view.php 710 B

1234567891011121314151617181920212223242526
  1. <?php
  2. $language_file = array('exercice', 'work', 'document', 'admin');
  3. require_once '../inc/global.inc.php';
  4. require_once 'work.lib.php';
  5. $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null;
  6. $work = get_work_data_by_id($id);
  7. if (empty($id) || empty($work)) {
  8. api_not_allowed();
  9. }
  10. $interbreadcrumb[] = array ('url' => 'work.php', 'name' => get_lang('StudentPublications'));
  11. if (api_is_allowed_to_edit() || $work['user_id'] == api_get_user_id()) {
  12. $tpl = new Template();
  13. $tpl->assign('work', $work);
  14. $template = $tpl->get_template('work/view.tpl');
  15. $content = $tpl->fetch($template);
  16. $tpl->assign('content', $content);
  17. $tpl->display_one_col_template();
  18. } else {
  19. api_not_allowed();
  20. }