view.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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 __DIR__.'/../inc/global.inc.php';
  8. $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('Timeline')];
  9. $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('Listing')];
  10. $timeline = new Timeline();
  11. if (empty($_GET['id'])) {
  12. api_not_allowed();
  13. }
  14. $url = $timeline->get_url($_GET['id']);
  15. $item = $timeline->get($_GET['id']);
  16. $interbreadcrumb[] = ['url' => '#', 'name' => $item['headline']];
  17. $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timeline/timeline.css');
  18. $htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');
  19. $htmlHeadXtra[] = '
  20. <script>
  21. $(function() {
  22. var timeline = new VMM.Timeline();
  23. timeline.init("'.$url.'");
  24. });
  25. </script>';
  26. $content = '<div class="timeline-example"><div id="timeline"></div></div>';
  27. $tpl = new Template($tool_name);
  28. $tpl->assign('message', $message);
  29. $tpl->assign('content', $content);
  30. $tpl->display_one_col_template();