[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 <?php 2 // This file is part of Moodle - http://moodle.org/ 3 // 4 // Moodle is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // Moodle is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16 17 /** 18 * prints the tabbed bar 19 * 20 * @author Andreas Grabs 21 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License 22 * @package mod_feedback 23 */ 24 defined('MOODLE_INTERNAL') OR die('not allowed'); 25 26 $tabs = array(); 27 $row = array(); 28 $inactive = array(); 29 $activated = array(); 30 31 //some pages deliver the cmid instead the id 32 if (isset($cmid) AND intval($cmid) AND $cmid > 0) { 33 $usedid = $cmid; 34 } else { 35 $usedid = $id; 36 } 37 38 $context = context_module::instance($usedid); 39 40 $courseid = optional_param('courseid', false, PARAM_INT); 41 // $current_tab = $SESSION->feedback->current_tab; 42 if (!isset($current_tab)) { 43 $current_tab = ''; 44 } 45 46 $viewurl = new moodle_url('/mod/feedback/view.php', array('id'=>$usedid, 'do_show'=>'view')); 47 $row[] = new tabobject('view', $viewurl->out(), get_string('overview', 'feedback')); 48 49 if (has_capability('mod/feedback:edititems', $context)) { 50 $editurl = new moodle_url('/mod/feedback/edit.php', array('id'=>$usedid, 'do_show'=>'edit')); 51 $row[] = new tabobject('edit', $editurl->out(), get_string('edit_items', 'feedback')); 52 53 $templateurl = new moodle_url('/mod/feedback/edit.php', array('id'=>$usedid, 'do_show'=>'templates')); 54 $row[] = new tabobject('templates', $templateurl->out(), get_string('templates', 'feedback')); 55 } 56 57 if (has_capability('mod/feedback:viewreports', $context)) { 58 if ($feedback->course == SITEID) { 59 $url_params = array('id'=>$usedid, 'courseid'=>$courseid, 'do_show'=>'analysis'); 60 $analysisurl = new moodle_url('/mod/feedback/analysis_course.php', $url_params); 61 $row[] = new tabobject('analysis', 62 $analysisurl->out(), 63 get_string('analysis', 'feedback')); 64 65 } else { 66 $url_params = array('id'=>$usedid, 'courseid'=>$courseid, 'do_show'=>'analysis'); 67 $analysisurl = new moodle_url('/mod/feedback/analysis.php', $url_params); 68 $row[] = new tabobject('analysis', 69 $analysisurl->out(), 70 get_string('analysis', 'feedback')); 71 } 72 73 $url_params = array('id'=>$usedid, 'do_show'=>'showentries'); 74 $reporturl = new moodle_url('/mod/feedback/show_entries.php', $url_params); 75 $row[] = new tabobject('showentries', 76 $reporturl->out(), 77 get_string('show_entries', 'feedback')); 78 79 if ($feedback->anonymous == FEEDBACK_ANONYMOUS_NO AND $feedback->course != SITEID) { 80 $nonrespondenturl = new moodle_url('/mod/feedback/show_nonrespondents.php', array('id'=>$usedid)); 81 $row[] = new tabobject('nonrespondents', 82 $nonrespondenturl->out(), 83 get_string('show_nonrespondents', 'feedback')); 84 } 85 } 86 87 if (count($row) > 1) { 88 $tabs[] = $row; 89 90 print_tabs($tabs, $current_tab, $inactive, $activated); 91 } 92
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |