. /** * prints the tabbed bar * * @author Andreas Grabs * @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @package apply */ defined('MOODLE_INTERNAL') OR die('not allowed'); $tabs = array(); $row = array(); $inactive = array(); $activated = array(); //some pages deliver the cmid instead the id if (isset($cmid) and intval($cmid) and $cmid>0) { $used_id = $cmid; } else { $used_id = $id; } if (!$courseid) $courseid = optional_param('courseid', false, PARAM_INT); // $context = context_module::instance($used_id); if (!isset($current_tab)) { $current_tab = ''; } // View my applications $viewurl = new moodle_url('/mod/apply/view.php', array('id'=>$used_id, 'do_show'=>'view', 'show_all'=>$show_all)); $row[] = new tabobject('view', $viewurl->out(), get_string('overview', 'apply')); // View all Report if (has_capability('mod/apply:viewreports', $context)) { $url_params = array('id'=>$used_id, 'do_show'=>'view_entries', 'sort'=>'time_modified', 'order'=>'DESC', 'show_all'=>$show_all); $reporturl = new moodle_url('/mod/apply/view_entries.php', $url_params); $row[] = new tabobject('view_entries', $reporturl->out(), get_string('view_entries', 'apply')); } // Edit Item and Template if (has_capability('mod/apply:edititems', $context)) { // $editurl = new moodle_url('/mod/apply/edit.php', array('id'=>$used_id, 'do_show'=>'edit', 'show_all'=>$show_all)); $row[] = new tabobject('edit', $editurl->out(), get_string('edit_items', 'apply')); // $exporturl = new moodle_url('/mod/apply/export.php', array('id'=>$used_id, 'do_show'=>'export', 'show_all'=>$show_all)); $row[] = new tabobject('export', $exporturl->out(), get_string('export', 'apply')); // // $templateurl = new moodle_url('/mod/apply/edit.php', array('id'=>$used_id, 'do_show'=>'templates', 'show_all'=>$show_all)); // $row[] = new tabobject('templates', $templateurl->out(), get_string('templates', 'apply')); } $row[] = new tabobject('', $CFG->wwwroot.'/course/view.php?id='.$courseid, get_string('returnto_course', 'apply')); if (count($row) > 1) { $tabs[] = $row; echo '
'; echo ''; print_tabs($tabs, $current_tab, $inactive, $activated); echo '
'; }