Skip to content

Instantly share code, notes, and snippets.

@bitumin
Created January 31, 2019 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitumin/01a1059128fc0cf08f2ef481ce0a70ae to your computer and use it in GitHub Desktop.
Save bitumin/01a1059128fc0cf08f2ef481ce0a70ae to your computer and use it in GitHub Desktop.
// Ejemplo de construcción de custom breadcrumbds.
global $PAGE;
$PAGE->navbar->ignore_active();
$b7string = get_string('B7', 'local_webbook');
$firstnode = $PAGE->navbar->add($b7string, $this->assignmentsurl, navigation_node::TYPE_SECTION);
if (($this->isteamview || $this->studentid > 0) && $this->canmanageactivity) {
$secondnode = $firstnode->add($this->activity->name, $this->parentactivityurl, navigation_node::NODETYPE_LEAF);
if ($this->modulename === 'forum') {
$thirdnode = $secondnode->add($this->currentteam['name'], null, navigation_node::NODETYPE_LEAF);
} else {
$thirdnode = $secondnode->add($this->userfullname, null, navigation_node::NODETYPE_LEAF);
}
$thirdnode->make_active();
} else {
$secondnode = $firstnode->add($this->activity->name, null, navigation_node::NODETYPE_LEAF);
$secondnode->make_active();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment