view.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. // name of the language file that needs to be included
  8. $language_file = array ('registration','admin');
  9. require_once '../inc/global.inc.php';
  10. require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';
  11. $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
  12. $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Listing'));
  13. $timeline = new Timeline();
  14. if (empty($_GET['id'])) {
  15. api_not_allowed();
  16. }
  17. $url = $timeline->get_url($_GET['id']);
  18. $item = $timeline->get($_GET['id']);
  19. $interbreadcrumb[]=array('url' => '#','name' => $item['headline']);
  20. $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timeline/timeline.css');
  21. $htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');
  22. $htmlHeadXtra[] = '
  23. <script>
  24. $(document).ready(function() {
  25. var timeline = new VMM.Timeline();
  26. timeline.init("'.$url.'");
  27. });
  28. </script>';
  29. $content = '<div class="timeline-example"><div id="timeline"></div></div>';
  30. $tpl = new Template($tool_name);
  31. $tpl->assign('actions', $actions);
  32. $tpl->assign('message', $message);
  33. $tpl->assign('content', $content);
  34. $tpl->display_one_col_template();