From: stronk7 Date: Mon, 14 May 2007 16:57:33 +0000 (+0000) Subject: Add support for more tabs in module pages. Point 1. MDL-9736 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3b98c475cd44bbc47c95a0929440748d3dade3ec;p=moodle.git Add support for more tabs in module pages. Point 1. MDL-9736 Merged from MOODLE_18_STABLE --- diff --git a/admin/roles/tabs.php b/admin/roles/tabs.php index 1629572488..f6d02e08c2 100755 --- a/admin/roles/tabs.php +++ b/admin/roles/tabs.php @@ -162,6 +162,25 @@ if ($context->contextlevel != CONTEXT_SYSTEM) { // Print tabs for anything ex $activetwo = array(); } +/// Here other core tabs should go (always calling tabs.php files) +/// All the logic to decide what to show must be self-cointained in the tabs file +/// ej.: +/// include_once($CFG->dirroot . '/grades/tabs.php'); + +/// Finally, we support adding some 'on-the-fly' tabs here +/// All the logic to decide what to show must be self-cointained in the tabs file + if (isset($CFG->extratabs) && !empty($CFG->extratabs)) { + if ($extratabs = explode(',', $CFG->extratabs)) { + asort($extratabs); + foreach($extratabs as $extratab) { + /// Each extra tab mus be one $CFG->dirroot relative file + if (file_exists($CFG->dirroot . '/' . $extratab)) { + include_once($CFG->dirroot . '/' . $extratab); + } + } + } + } + if (!empty($secondrow)) { $tabs = array($toprow, $secondrow); } else {