view.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. @author Julio Montoya <gugli100@gmail.com> BeezNest 2011
  5. * @package chamilo.timeline
  6. */
  7. require_once '../inc/global.inc.php';
  8. require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';
  9. $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
  10. $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Listing'));
  11. $timeline = new Timeline();
  12. if (empty($_GET['id'])) {
  13. api_not_allowed();
  14. }
  15. $url = $timeline->get_url($_GET['id']);
  16. $item = $timeline->get($_GET['id']);
  17. $interbreadcrumb[]=array('url' => '#','name' => $item['headline']);
  18. $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timeline/timeline.css');
  19. $htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');
  20. $htmlHeadXtra[] = '
  21. <script>
  22. $(document).ready(function() {
  23. var timeline = new VMM.Timeline();
  24. timeline.init("'.$url.'");
  25. });
  26. </script>';
  27. $content = '<div class="timeline-example"><div id="timeline"></div></div>';
  28. $tpl = new Template($tool_name);
  29. $tpl->assign('actions', $actions);
  30. $tpl->assign('message', $message);
  31. $tpl->assign('content', $content);
  32. $tpl->display_one_col_template();