function local_dashboard_extend_navigation(global_navigation $navigation) { $dashboardurl = '/local/dashboard/index.php'; if (isloggedin()) { $nodeform = $navigation->add('KTree Dashboard', $dashboardurl); } }
function local_dashboard_extends_navigation(global_navigation $navigation) { $perfornamce_url = '/local/dashboard/index.php'; if (isloggedin()) { $nodeForm = $navigation->add('Dashboard', $perfornamce_url); } }
function report_ktreeuserdedicationreport_extends_navigation(global_navigation $navigation) { $url6 = '/report/ktreeuserdedicationreport/adminreport.php'; if (is_siteadmin()) { $nodeForm3 = $navigation->add('Ktree\'s User Dedication'); $nodeForm = $nodeForm3->add('Dedication Report', $url6); } }
/** * Returns the content of the navigation tree. * * @param global_navigation $navigation * @param int $expansionlimit * @param array $options * @return string $content */ public function navigation_tree(global_navigation $navigation, $expansionlimit, array $options = array()) { $navigation->add_class('navigation_node'); $content = $this->navigation_node(array($navigation), array('class' => 'block_tree list'), $expansionlimit, $options); if (isset($navigation->id) && !is_numeric($navigation->id) && !empty($content)) { $content = $this->output->box($content, 'block_tree_box', $navigation->id); } return $content; }
function local_mapleta_extend_navigation(global_navigation $navigation) { global $CFG, $PAGE; $navigation->add(get_string('menulink', 'local_mapleta'), $CFG->wwwroot . '/local/mapleta',navigation_node::TYPE_CUSTOM); //Add children to nodeAwesome. Pretend we have a list "$myList" of links to add. //$nodeAwesome->add(, new moodle_url('/path/to/file/' . $myList[$i]), null, null, $myList[$i]); //force the node open //$nodeAwesome->forceopen = true; }
/** * Navigation menu * @desc this function will add menu & links. * * @package local_note * @copyright 2015 MoodleOfIndia * @author shambhu kumar * @license MoodleOfIndia {@web http://www.moodleofindia.com} */ function local_note_extend_navigation(global_navigation $navigation) { global $CFG; if (isloggedin()) { $node = $navigation->add(get_string('pluginname', 'local_note')); $node->add(get_string('addnote', 'local_note'), $CFG->wwwroot . '/local/note/add_note.php'); $node->add(get_string('mynote', 'local_note'), $CFG->wwwroot . '/local/note/my_notes.php'); $node->add(get_string('viewnote', 'local_note'), $CFG->wwwroot . '/local/note/view_all_note.php'); } }
/** * Puts AMOS into the global navigation tree. * * @param global_navigation $navigation */ function amos_extends_navigation(global_navigation $navigation) { $amos = $navigation->add('AMOS', new moodle_url('/local/amos/')); if (has_capability('local/amos:stage', get_system_context())) { $amos->add(get_string('translatortool', 'local_amos'), new moodle_url('/local/amos/view.php')); $amos->add(get_string('stage', 'local_amos'), new moodle_url('/local/amos/stage.php')); } if (has_capability('local/amos:stash', get_system_context())) { $amos->add(get_string('stashes', 'local_amos'), new moodle_url('/local/amos/stash.php')); $amos->add(get_string('contributions', 'local_amos'), new moodle_url('/local/amos/contrib.php')); } $amos->add(get_string('log', 'local_amos'), new moodle_url('/local/amos/log.php')); if (has_capability('local/amos:manage', get_system_context())) { $admin = $amos->add(get_string('administration')); $admin->add(get_string('maintainers', 'local_amos'), new moodle_url('/local/amos/admin/translators.php')); $admin->add(get_string('newlanguage', 'local_amos'), new moodle_url('/local/amos/admin/newlanguage.php')); } }
/** * Puts AMOS into the global navigation tree. * * @param global_navigation $navigation the navigation tree instance * @category navigation */ function local_dev_extend_navigation(global_navigation $navigation) { global $CFG; if (!empty($CFG->hidelocaldevfromnavigation)) { return; } if (!defined('LOCAL_DEV_LOCALLIB_LOADED')) { return; } $devnode = $navigation->add(get_string('pluginname', 'local_dev'), null, navigation_node::TYPE_CUSTOM, null, 'local_dev-root'); $devnode->add(get_string('developers', 'local_dev'), new local_dev_url('/local/dev/index.php'), navigation_node::TYPE_CUSTOM, null, 'local_dev-developers'); $devnode->add(get_string('contributions', 'local_dev'), new local_dev_url('/local/dev/contributions.php'), navigation_node::TYPE_CUSTOM, null, 'local_dev-contributions'); if (has_capability('local/dev:manage', context_system::instance())) { $admin = $devnode->add(get_string('administration')); $admin->add(get_string('adminoverview', 'local_dev'), new local_dev_url('/local/dev/admin/index.php')); $admin->add(get_string('gitaliases', 'local_dev'), new local_dev_url('/local/dev/admin/git-aliases.php')); } }
function local_gas_extends_navigation(global_navigation $navigation) { global $DB, $USER, $COURSE, $SESSION; $prconfig = $DB->count_records('config_plugins', array('plugin' => 'local_gas')); if ($prconfig > 0 && G\isuservalid($USER->id)) { $node = $navigation->find('local_gas', navigation_node::TYPE_CONTAINER); if (!$node) { $node = $navigation->add(get_string('pluginname', 'local_gas'), null, navigation_node::TYPE_CONTAINER, get_string('pluginname', 'local_gas'), 'local_gas'); } $node->add(get_string('generalInfo', 'local_gas'), new moodle_url('/local/gas/index.php'), null, null, "generalInfo"); if (G\isstudent($USER->id)) { $node->add(get_string('assessment', 'local_gas'), new moodle_url('/local/gas/student.php'), null, null, "assessment"); } if (G\isteacher($USER->id)) { $node->add(get_string('courseAssessment', 'local_gas'), new moodle_url('/local/gas/teacherassessment.php'), null, null, "courseAssessment"); $node->add(get_string('courseAssessmentReport', 'local_gas'), new moodle_url('/local/gas/coursereport.php'), null, null, "courseAssessmentReport"); } if (has_capability('local/gas:administrator', context_course::instance($COURSE->id))) { $node->add(get_string('attributeManagement', 'local_gas'), new moodle_url('/local/gas/attributemanagement.php'), null, null, "attributeManagement"); } } }
/** * Loads all of the course sections into the navigation * * This method is called from {@link global_navigation::load_course_sections()} * * By default the method {@link global_navigation::load_generic_course_sections()} is called * * When overwriting please note that navigationlib relies on using the correct values for * arguments $type and $key in {@link navigation_node::add()} * * Example of code creating a section node: * $sectionnode = $node->add($sectionname, $url, navigation_node::TYPE_SECTION, null, $section->id); * $sectionnode->nodetype = navigation_node::NODETYPE_BRANCH; * * Example of code creating an activity node: * $activitynode = $sectionnode->add($activityname, $action, navigation_node::TYPE_ACTIVITY, null, $activity->id, $icon); * if (global_navigation::module_extends_navigation($activity->modname)) { * $activitynode->nodetype = navigation_node::NODETYPE_BRANCH; * } else { * $activitynode->nodetype = navigation_node::NODETYPE_LEAF; * } * * Also note that if $navigation->includesectionnum is not null, the section with this relative * number needs is expected to be loaded * * @param global_navigation $navigation * @param navigation_node $node The course node within the navigation */ public function extend_course_navigation($navigation, navigation_node $node) { if ($course = $this->get_course()) { $navigation->load_generic_course_sections($course, $node); } return array(); }
/** * Adds a course module to the navigation node * * @param navigation_node $node * @param cm_info $cm * @return null|navigation_node */ protected function navigation_add_activity(navigation_node $node, $cm) { if (!$cm->uservisible || !$cm->has_view()) { return null; } $activityname = $cm->get_formatted_name(); $action = $cm->url; if ($cm->icon) { $icon = new pix_icon($cm->icon, $cm->modfullname, $cm->iconcomponent); } else { $icon = new pix_icon('icon', $cm->modfullname, $cm->modname); } $activitynode = $node->add($activityname, $action, navigation_node::TYPE_ACTIVITY, null, $cm->id, $icon); if (global_navigation::module_extends_navigation($cm->modname)) { $activitynode->nodetype = navigation_node::NODETYPE_BRANCH; } else { $activitynode->nodetype = navigation_node::NODETYPE_LEAF; } return $activitynode; }
/** * Adds a course module to the navigation node * * This is basically copied from function global_navigation::load_section_activities() * because it is not accessible from outside. * * @param navigation_node $node * @param cm_info $cm * @return null|navigation_node */ protected function navigation_add_activity(navigation_node $node, $cm) { if (!$cm->uservisible) { return null; } $action = $cm->get_url(); if (!$action) { // Do not add to navigation activity without url (i.e. labels). return null; } $activityname = format_string($cm->name, true, array('context' => context_module::instance($cm->id))); if ($cm->icon) { $icon = new pix_icon($cm->icon, $cm->modfullname, $cm->iconcomponent); } else { $icon = new pix_icon('icon', $cm->modfullname, $cm->modname); } $activitynode = $node->add($activityname, $action, navigation_node::TYPE_ACTIVITY, null, $cm->id, $icon); if (global_navigation::module_extends_navigation($cm->modname)) { $activitynode->nodetype = navigation_node::NODETYPE_BRANCH; } else { $activitynode->nodetype = navigation_node::NODETYPE_LEAF; } return $activitynode; }
public function navigation_tree(global_navigation $navigation, $expansionlimit, array $options = array()) { $navigation->add_class('navigation_node'); $content = $this->navigation_node(array($navigation), array('class' => 'block_tree list nav nav-list'), $expansionlimit, $options); if (!isset($navigation->id) && !is_numeric($navigation->id) && !empty($content)) { $attributes = array('class' => 'block_tree_box', 'id' => $navigation->id); $content = html::li($attributes, $content); } return $content; }
public function __construct(moodle_page $page = null) { global $PAGE; if ($page === null) { $page = $PAGE; } parent::__construct($page); $this->cache = new navigation_cache('unittest_nav'); }
/** * Returns the content of the navigation tree. * * @param global_navigation $navigation * @param int $expansionlimit * @param array $options * @return string $content */ public function navigation_tree(global_navigation $navigation, $expansionlimit, array $options = array()) { $navigation->add_class('navigation_node'); $navigationattrs = array('class' => 'block_tree list', 'role' => 'tree', 'data-ajax-loader' => 'block_navigation/nav_loader'); $content = $this->active_family(array($navigation), $navigationattrs, $expansionlimit, $options); if (isset($navigation->id) && !is_numeric($navigation->id) && !empty($content)) { $content = $this->output->box($content, 'block_tree_box', $navigation->id); } return $content; }
public function test_module_extends_navigation() { $this->assertTrue($this->node->exposed_module_extends_navigation('data')); $this->assertFalse($this->node->exposed_module_extends_navigation('test1')); }
public function test_module_extends_navigation() { $this->cache->test1_extends_navigation = true; $this->cache->test2_extends_navigation = false; $this->assertTrue($this->node->exposed_module_extends_navigation('data')); $this->assertTrue($this->node->exposed_module_extends_navigation('test1')); $this->assertFalse($this->node->exposed_module_extends_navigation('test2')); $this->assertFalse($this->node->exposed_module_extends_navigation('test3')); }
protected function load_all_courses($categoryids = null) { if (!$this->expandtocourses) { return array(); } return parent::load_all_courses($categoryids); }
/** * This function extends the navigation with the report items. * * @param navigation_node $navigation The navigation node to extend * @param stdClass $course The course to object for the report * @param stdClass $context The context of the course */ function report_myfeedback_extend_navigation(global_navigation $navigation) { $url = new moodle_url('/report/myfeedback/index.php', array('course' => $course->id)); $navigation->add(get_string('pluginname', 'report_myfeedback'), $url, null, null, new pix_icon('i/report', '')); }
/** * Created by PhpStorm. * User: moni * Date: 15-6-30 * Time: 14:01 */ function local_simple_message_extends_navigation(global_navigation $nav) { $nav->add(get_string('title', 'local_simple_message'), new moodle_url('/local/simple_message/index.php'), navigation_node::TYPE_CONTAINER); }
/** * add the onlinejudge plugin into navigation */ function onlinejudge_extends_navigation(global_navigation $navigation) { $onlinejudge = $navigation->add(get_string('pluginname', 'local_onlinejudge'), new moodle_url('/local/onlinejudge/')); }
public function navigation_tree(global_navigation $navigation, $expansionlimit, array $options = array()) { $homenode = $navigation->find('home', navigation_node::TYPE_SETTING); //$myhomenode=$navigation->find('myhome', navigation_node::TYPE_SETTING); if ($homenode) { $homenode->remove(); $navigation = $homenode->parent; } //if($myhomenode){ // $myhomenode->remove(); // $navigation=$myhomenode->parent; // } return parent::navigation_tree($navigation, $expansionlimit, $options); }