|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00032 function callback_topics_uses_sections() { 00033 return true; 00034 } 00035 00046 function callback_topics_load_content(&$navigation, $course, $coursenode) { 00047 return $navigation->load_generic_course_sections($course, $coursenode, 'topics'); 00048 } 00049 00056 function callback_topics_definition() { 00057 return get_string('topic'); 00058 } 00059 00066 function callback_topics_request_key() { 00067 return 'topic'; 00068 } 00069 00070 function callback_topics_get_section_name($course, $section) { 00071 // We can't add a node without any text 00072 if (!empty($section->name)) { 00073 return format_string($section->name, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))); 00074 } else if ($section->section == 0) { 00075 return get_string('section0name', 'format_topics'); 00076 } else { 00077 return get_string('topic').' '.$section->section; 00078 } 00079 } 00080 00087 function callback_topics_ajax_support() { 00088 $ajaxsupport = new stdClass(); 00089 $ajaxsupport->capable = true; 00090 $ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0); 00091 return $ajaxsupport; 00092 } 00093 00101 function callback_topics_get_section_url($courseid, $sectionnum) { 00102 return new moodle_url('/course/view.php', array('id' => $courseid, 'topic' => $sectionnum)); 00103 }