/** * Prints local lib tabs * * @param \mod_activequiz\activequiz $RTQ Realtime quiz class * @param $currenttab * * @return string HTML string of the tabs */ function activequiz_view_tabs($RTQ, $currenttab) { $tabs = array(); $row = array(); $inactive = array(); $activated = array(); if ($RTQ->has_capability('mod/activequiz:attempt')) { $row[] = new tabobject('view', new moodle_url('/mod/activequiz/view.php', array('id' => $RTQ->getCM()->id)), get_string('view', 'activequiz')); } if ($RTQ->has_capability('mod/activequiz:editquestions')) { $row[] = new tabobject('edit', new moodle_url('/mod/activequiz/edit.php', array('cmid' => $RTQ->getCM()->id)), get_string('edit', 'activequiz')); } if ($RTQ->has_capability('mod/activequiz:seeresponses')) { $row[] = new tabobject('responses', new moodle_url('/mod/activequiz/responses.php', array('id' => $RTQ->getCM()->id)), get_string('responses', 'activequiz')); } if ($currenttab == 'view' && count($row) == 1) { // No tabs for students echo '<br />'; } else { $tabs[] = $row; } if ($currenttab == 'responses') { $activated[] = 'responses'; } if ($currenttab == 'edit') { $activated[] = 'edit'; } if ($currenttab == 'view') { $activated[] = 'view'; } return print_tabs($tabs, $currenttab, $inactive, $activated, true); }
function print_tabs() { $id = $this->required_param('id', PARAM_INT); $page = $this->get_tab_page(); $params = array('id' => $id); $rows = array(); $row = array(); // main row of tabs foreach ($page->tabs as $tab) { $tab = $page->add_defaults_to_tab($tab); if ($tab['showtab'] === true) { $target = new $tab['page'](array_merge($tab['params'], $params)); $row[] = new tabobject($tab['tab_id'], $target->get_url(), $tab['name']); } } $rows[] = $row; // assigned/unassigned tabs $assignedpage = clone $this->get_basepage(); unset($assignedpage->params['_assign']); $unassignedpage = clone $assignedpage; $unassignedpage->params['_assign'] = 'assign'; list($assigned_string, $unassigned_string) = $this->get_assigned_strings(); $row = array(new tabobject('assigned', $assignedpage->get_url(), $assigned_string), new tabobject('unassigned', $unassignedpage->get_url(), $unassigned_string)); if ($unassignedpage->can_do()) { $rows[] = $row; } print_tabs($rows, isset($rows[1]) ? $this->is_assigning() ? 'unassigned' : 'assigned' : get_class($this), array(), array(get_class($this))); }
/** * Prints the tabs for the learning path type * * @param string $currenttab Tab to highlight * @return void **/ function print_tabs($currenttab = 'layout') { global $COURSE; $context = get_context_instance(CONTEXT_COURSE, $COURSE->id); $tabs = $row = $inactive = $active = array(); $row[] = new tabobject('view', $this->url_get_full(), get_string('editpage', 'format_page')); if (has_capability('format/page:addpages', $context)) { $row[] = new tabobject('addpage', $this->url_build('action', 'editpage'), get_string('addpage', 'format_page')); } if (has_capability('format/page:managepages', $context)) { $row[] = new tabobject('manage', $this->url_build('action', 'manage'), get_string('manage', 'format_page')); } if (has_capability('moodle/local:managepageactivities', $context)) { $row[] = new tabobject('activities', $this->url_build('action', 'activities'), get_string('managemods', 'format_page')); } if (has_capability('moodle/local:classifylearningpath', $context)) { $row[] = new tabobject('classify', $this->url_build('action', 'classify'), get_string('classification', 'local')); } if (has_capability('moodle/local:savelearningpathtemplate', $context)) { $row[] = new tabobject('backup', $this->url_build('action', 'backup'), get_string('makebackup', 'local')); } $tabs[] = $row; if (in_array($currenttab, array('layout', 'settings', 'view'))) { $active[] = 'view'; $row = array(); $row[] = new tabobject('layout', $this->url_get_full(), get_string('layout', 'format_page')); $row[] = new tabobject('settings', $this->url_get_full(array('action' => 'editpage')), get_string('settings', 'format_page')); $tabs[] = $row; } print_tabs($tabs, $currenttab, $inactive, $active); }
function show_tabs($cm, $context, $currenttab = 'sessions') { $toprow = array(); if (has_capability('mod/attforblock:manageattendances', $context) or has_capability('mod/attforblock:takeattendances', $context) or has_capability('mod/attforblock:changeattendances', $context)) { $toprow[] = new tabobject('sessions', 'manage.php?id=' . $cm->id, get_string('sessions', 'attforblock')); } if (has_capability('mod/attforblock:manageattendances', $context)) { $toprow[] = new tabobject('add', "sessions.php?id={$cm->id}&action=add", get_string('add', 'attforblock')); } if (has_capability('mod/attforblock:viewreports', $context)) { $toprow[] = new tabobject('report', 'report.php?id=' . $cm->id, get_string('report', 'attforblock')); $toprow[] = new tabobject('advancedreport', 'adv_report.php?id=' . $cm->id, get_string('advancedreport', 'attforblock')); } if (has_capability('mod/attforblock:export', $context)) { $toprow[] = new tabobject('export', 'export.php?id=' . $cm->id, get_string('export', 'quiz')); } if (has_capability('mod/attforblock:changepreferences', $context)) { $toprow[] = new tabobject('settings', 'attsettings.php?id=' . $cm->id, get_string('settings', 'attforblock')); } if (has_capability('mod/attforblock:manageattendances', $context) or has_capability('mod/attforblock:takeattendances', $context) or has_capability('mod/attforblock:changeattendances', $context)) { $toprow[] = new tabobject('teachers', 'addteachers.php?id=' . $cm->id, get_string('teachers', 'attforblock')); $toprow[] = new tabobject('subjects', 'addsubjects.php?id=' . $cm->id, get_string('subjects', 'attforblock')); $toprow[] = new tabobject('sessiontitles', 'addtitles.php?id=' . $cm->id, get_string('sessiontitles', 'attforblock')); $toprow[] = new tabobject('scan', 'scan.php?id=' . $cm->id, get_string('scan', 'attforblock')); } $tabs = array($toprow); print_tabs($tabs, $currenttab); }
/** * * * * */ function bookmarks_print_tabs($cmid, $action) { $baseurl = 'view.php?id=' . $cmid . '&action='; $tabs = array(); $rows = array(); $rows[] = new tabobject('viewmy', $baseurl . 'viewmy', get_string('mybookmarks', 'bookmarks'), 'viewmy', false); $rows[] = new tabobject('viewall', $baseurl . 'viewall', get_string('allbookmarks', 'bookmarks'), 'viewall', false); $rows[] = new tabobject('search', $baseurl . 'search', get_string('search', 'bookmarks'), 'search', false); $tabs[] = $rows; print_tabs($tabs, $action); }
function build_tabs_template($active) { global $CFG; $options = array(); $inactive = array(); $activetwo = array(); $currenttab = $active; $options[] = new tabobject('add', $CFG->wwwroot . '/mod/diplome/add.php', get_string('add', 'diplome'), get_string('rolladd', 'diplome'), true); $options[] = new tabobject('edit', $CFG->wwwroot . '/mod/diplome/edit.php?view=all', get_string('edit', 'diplome'), get_string('rolledit', 'diplome'), true); $tabs = array($options); print_tabs($tabs, $currenttab, $inactive, $activetwo); }
/** * * @param string $selected is the selected tab * @param array $params url parameters to be encoded */ function forumng_feature_deleted_print_tabs($selected, $params) { global $CFG; $tabrow = array(); $listurl = new moodle_url('/mod/forumng/feature/deletedposts/list.php', $params); $deletedpostslisturl = new moodle_url('/mod/forumng/feature/deletedposts/deletedpostslist.php', $params); $tabrow[] = new tabobject('list', $listurl->out(), get_string('deleteddiscussions', 'forumngfeature_deletedposts')); $tabrow[] = new tabobject('deletedpostslist', $deletedpostslisturl->out(), get_string('deletedposts', 'forumngfeature_deletedposts')); $tabs = array(); $tabs[] = $tabrow; print_tabs($tabs, $selected, array(''), array('')); print '<div id="forumng_belowtabs">'; }
function build_tabs_local($active, $number) { global $CFG; $options = array(); $inactive = array(); $activetwo = array(); $currenttab = $active; for ($i = 1; $i <= $number; $i++) { $options[] = new tabobject('dash_' . $i, $CFG->wwwroot . '/mod/feedbackccna/dashboard.php?type=' . $i, get_string('name_' . $i, 'feedbackccna'), get_string('desc_' . $i, 'feedbackccna'), true); } $tabs = array($options); print_tabs($tabs, $currenttab, $inactive, $activetwo); }
/** * Prints the tab menu for the plugin settings * * @param string $currenttab The currect tab to be styled as selected */ public function draw_settings_tab_menu($currenttab, $notice = null) { global $OUTPUT; $tabs = array(); $tabs[] = new tabobject('turnitinsettings', 'settings.php', get_string('config', 'plagiarism_turnitin'), get_string('config', 'plagiarism_turnitin'), false); $tabs[] = new tabobject('turnitindefaults', 'settings.php?do=defaults', get_string('defaults', 'plagiarism_turnitin'), get_string('defaults', 'plagiarism_turnitin'), false); $tabs[] = new tabobject('turnitinshowusage', 'settings.php?do=viewreport', get_string('showusage', 'plagiarism_turnitin'), get_string('showusage', 'plagiarism_turnitin'), false); $tabs[] = new tabobject('turnitinsaveusage', 'settings.php?do=savereport', get_string('saveusage', 'plagiarism_turnitin'), get_string('saveusage', 'plagiarism_turnitin'), false); $tabs[] = new tabobject('turnitinerrors', 'settings.php?do=errors', get_string('errors', 'plagiarism_turnitin'), get_string('errors', 'plagiarism_turnitin'), false); print_tabs(array($tabs), $currenttab); if (!is_null($notice)) { echo $OUTPUT->box($notice["message"], 'generalbox boxaligncenter', $notice["type"]); } }
function bookmarks_print_tabs($cmid, $action) { $baseurl = 'view.php?id=' . $cmid . '&action='; $tabs = array(); $rows = array(); $rows[] = new tabobject('viewall', $baseurl . 'viewall', get_string('allbookmarks', 'bookmarks'), 'viewall', false); $rows[] = new tabobject('viewmy', $baseurl . 'viewmy', get_string('mybookmarks', 'bookmarks'), 'viewmy', false); $context = get_context_instance(CONTEXT_MODULE, $cmid); if (has_capability('mod/bookmarks:additem', $context)) { $rows[] = new tabobject('additem', 'edit.php?id=' . $cmid, get_string('additem', 'bookmarks'), 'additem', false); } $rows[] = new tabobject('search', $baseurl . 'search', get_string('search', 'bookmarks'), 'search', false); $tabs[] = $rows; print_tabs($tabs, $action); }
function print_html_body_begin($parameters=null){ global $config, $sess, $auth, $errors, $message; if (!$parameters) $parameters=null; // call user defined function at html body begin if (isset($parameters['run_at_html_body_begin']) and function_exists($parameters['run_at_html_body_begin'])) $parameters['run_at_html_body_begin']($parameters); //virtual(multidomain_get_file($config->html_prolog)); if (isset($parameters['title']) and $parameters['title']) echo $parameters['title']; //virtual(multidomain_get_file($config->html_separator)); ?> <?if (isset($parameters['tab_collection']) and $parameters['tab_collection']) { print_tabs($parameters['tab_collection'], isset($parameters['path_to_pages'])?$parameters['path_to_pages']:null, isset($parameters['selected_tab'])?$parameters['selected_tab']:null); //count tabs $num_of_tabs=0; foreach($parameters['tab_collection'] as $tab) if ($tab->enabled) $num_of_tabs++; ?> <div id="swContent"> <!-- contenet of div must be sufficient wide in order to tabs displays in one line --> <div style="height:1px; width:<?echo ($num_of_tabs*100)- 50;?>px;"> </div> <?}?> <? print_errors($errors); // Display error print_message($message); if ($errors or $message) echo "<br />"; } //end function print_html_body_begin
function print_tabs() { $id = $this->required_param('id', PARAM_INT); $page = $this->get_tab_page(); $params = array('id' => $id); $rows = $row; $row = array(); // main row of tabs foreach ($page->tabs as $tab) { $tab = $page->add_defaults_to_tab($tab); if ($tab['showtab'] === true) { $target = new $tab['page'](array_merge($tab['params'], $params)); $row[] = new tabobject($tab['tab_id'], $target->get_url(), $tab['name']); } } $rows[] = $row; // assigned/unassigned tabs $assignedpage = $this->get_basepage(); $unassignedpage = clone $assignedpage; $unassignedpage->params['mode'] = 'unassign'; $row = array(new tabobject('assigned', $assignedpage->get_url(), get_string('assigned', 'block_curr_admin')), new tabobject('unassigned', $unassignedpage->get_url(), get_string('unassigned', 'block_curr_admin'))); $rows[] = $row; print_tabs($rows, $this->optional_param('mode', 'unassign', PARAM_ACTION) == 'assign' ? 'assigned' : 'unassigned', array(), array(get_class($this))); }
/** * Prints the tab link menu across the top of the activity module * * @param object $cm The moodle course module object for this instance * @param object $selected The query string parameter to determine the page we are on * @param array $notice */ public function draw_tool_tab_menu($cm, $selected) { global $CFG; $tabs = array(); if (has_capability('mod/turnitintooltwo:grade', context_module::instance($cm->id))) { $tabs[] = new tabobject('submissions', $CFG->wwwroot . '/mod/turnitintooltwo/view.php?id=' . $cm->id . '&do=submissions', get_string('allsubmissions', 'turnitintooltwo'), get_string('allsubmissions', 'turnitintooltwo'), false); $tabs[] = new tabobject('tutors', $CFG->wwwroot . '/mod/turnitintooltwo/view.php?id=' . $cm->id . '&do=tutors', get_string('turnitintutors', 'turnitintooltwo'), get_string('turnitintutors', 'turnitintooltwo'), false); $tabs[] = new tabobject('students', $CFG->wwwroot . '/mod/turnitintooltwo/view.php?id=' . $cm->id . '&do=students', get_string('turnitinstudents', 'turnitintooltwo'), get_string('turnitinstudents', 'turnitintooltwo'), false); } else { $tabs[] = new tabobject('submissions', $CFG->wwwroot . '/mod/turnitintooltwo/view.php?id=' . $cm->id . '&do=submissions', get_string('mysubmissions', 'turnitintooltwo'), get_string('mysubmissions', 'turnitintooltwo'), false); } print_tabs(array($tabs), $selected); }
} else { ########### tabs print_tabs(array("object_type" => $typename)); edit_permissions(array("type" => 'OBJ')); } ?> </table> <?php } elseif ($site->fdat['tab'] == 'seo') { ################# BODY START ?> <body> <table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:100%"> <?php ########### tabs print_tabs(array("object_type" => $typename)); include_once 'edit_object_metadata.php'; if ($site->fdat['op'] == 'edit') { if ($site->fdat['op2'] == 'save') { salvesta_objekt_metadata(); } edit_objekt_metadata(); } ?> </table> <?php } # / 2. tab SEO ###################### } else { # browseri kontroll, agent=Netscape
/** * Print grading plugin selection tab-based navigation. * * @param string $active_type type of plugin on current page - import, export, report or edit * @param string $active_plugin active plugin type - grader, user, cvs, ... * @param array $plugin_info Array of plugins * @param boolean $return return as string * * @return nothing or string if $return true */ function grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false) { global $CFG, $COURSE; if (!isset($currenttab)) { //TODO: this is weird $currenttab = ''; } $tabs = array(); $top_row = array(); $bottom_row = array(); $inactive = array($active_plugin); $activated = array($active_type); $count = 0; $active = ''; foreach ($plugin_info as $plugin_type => $plugins) { if ($plugin_type == 'strings') { continue; } // If $plugins is actually the definition of a child-less parent link: if (!empty($plugins->id)) { $string = $plugins->string; if (!empty($plugin_info[$active_type]->parent)) { $string = $plugin_info[$active_type]->parent->string; } $top_row[] = new tabobject($plugin_type, $plugins->link, $string); continue; } $first_plugin = reset($plugins); $url = $first_plugin->link; if ($plugin_type == 'report') { $url = $CFG->wwwroot.'/grade/report/index.php?id='.$COURSE->id; } $top_row[] = new tabobject($plugin_type, $url, $plugin_info['strings'][$plugin_type]); if ($active_type == $plugin_type) { foreach ($plugins as $plugin) { $bottom_row[] = new tabobject($plugin->id, $plugin->link, $plugin->string); if ($plugin->id == $active_plugin) { $inactive = array($plugin->id); } } } } // Do not display rows that contain only one item, they are not helpful. if (count($top_row) > 1) { $tabs[] = $top_row; } if (count($bottom_row) > 1) { $tabs[] = $bottom_row; } if (empty($tabs)) { return; } $rv = html_writer::div(print_tabs($tabs, $active_plugin, $inactive, $activated, true), 'grade-navigation'); if ($return) { return $rv; } else { echo $rv; } }
$numberoflisteners = max(quiz_number_of_pages($quiz->questions), 1); for ($pageiter = 1; $pageiter <= $numberoflisteners; $pageiter++) { $quizeditconfig->dialoglisteners[] = 'addrandomdialoglaunch_' . $pageiter; } $PAGE->requires->data_for_js('quiz_edit_config', $quizeditconfig); $PAGE->requires->js('/question/qengine.js'); $PAGE->requires->js('/mod/quiz/edit.js'); $PAGE->requires->js_init_call('quiz_edit_init'); // Print the tabs to switch mode. if ($quiz_reordertool) { $currenttab = 'reorder'; } else { $currenttab = 'edit'; } $tabs = array(array(new tabobject('edit', new moodle_url($thispageurl, array('reordertool' => 0)), get_string('editingquiz', 'quiz')), new tabobject('reorder', new moodle_url($thispageurl, array('reordertool' => 1)), get_string('orderingquiz', 'quiz')))); print_tabs($tabs, $currenttab); if ($quiz_qbanktool) { $bankclass = ''; $quizcontentsclass = ''; } else { $bankclass = 'collapsed '; $quizcontentsclass = 'quizwhenbankcollapsed'; } echo '<div class="questionbankwindow ' . $bankclass . 'block">'; echo '<div class="header"><div class="title"><h2>'; echo get_string('questionbankcontents', 'quiz') . ' <a href="' . $thispageurl->out(true, array('qbanktool' => '1')) . '" id="showbankcmd">[' . get_string('show') . ']</a> <a href="' . $thispageurl->out(true, array('qbanktool' => '0')) . '" id="hidebankcmd">[' . get_string('hide') . ']</a>'; echo '</h2></div></div><div class="content">'; echo '<span id="questionbank"></span>'; echo '<div class="container">'; echo '<div id="module" class="module">';
/** * Print grading plugin selection tab-based navigation. * * @param string $active_type type of plugin on current page - import, export, report or edit * @param string $active_plugin active plugin type - grader, user, cvs, ... * @param array $plugin_info Array of plugins * @param boolean $return return as string * * @return nothing or string if $return true */ function grade_print_tabs($active_type, $active_plugin, $plugin_info, $return = false) { global $CFG, $COURSE; if (!isset($currenttab)) { //TODO: this is weird $currenttab = ''; } $tabs = array(); $top_row = array(); $bottom_row = array(); $inactive = array($active_plugin); $activated = array(); $count = 0; $active = ''; foreach ($plugin_info as $plugin_type => $plugins) { if ($plugin_type == 'strings') { continue; } // If $plugins is actually the definition of a child-less parent link: if (!empty($plugins->id)) { $string = $plugins->string; if (!empty($plugin_info[$active_type]->parent)) { $string = $plugin_info[$active_type]->parent->string; } $top_row[] = new tabobject($plugin_type, $plugins->link, $string); continue; } $first_plugin = reset($plugins); $url = $first_plugin->link; if ($plugin_type == 'report') { $url = $CFG->wwwroot . '/grade/report/index.php?id=' . $COURSE->id; } $top_row[] = new tabobject($plugin_type, $url, $plugin_info['strings'][$plugin_type]); if ($active_type == $plugin_type) { foreach ($plugins as $plugin) { $bottom_row[] = new tabobject($plugin->id, $plugin->link, $plugin->string); if ($plugin->id == $active_plugin) { $inactive = array($plugin->id); } } } } $tabs[] = $top_row; $tabs[] = $bottom_row; if ($return) { return print_tabs($tabs, $active_type, $inactive, $activated, true); } else { print_tabs($tabs, $active_type, $inactive, $activated); } }
$defaultemplate = 'addtemplate'; } else { $defaultemplate = 'singletemplate'; } } $row[] = new tabobject('templates', $CFG->wwwroot . '/mod/data/templates.php?d=' . $data->id . '&mode=' . $defaultemplate, get_string('templates', 'data')); $row[] = new tabobject('fields', $CFG->wwwroot . '/mod/data/field.php?d=' . $data->id, get_string('fields', 'data')); $row[] = new tabobject('presets', $CFG->wwwroot . '/mod/data/preset.php?d=' . $data->id, get_string('presets', 'data')); } } $tabs[] = $row; if ($currenttab == 'templates' and isset($mode)) { $inactive[] = 'templates'; $templatelist = array('listtemplate', 'singletemplate', 'addtemplate', 'rsstemplate', 'csstemplate', 'jstemplate'); $row = array(); $currenttab = ''; foreach ($templatelist as $template) { $row[] = new tabobject($template, "templates.php?d={$data->id}&mode={$template}", get_string($template, 'data')); if ($template == $mode) { $currenttab = $template; } } if ($currenttab == '') { $currenttab = $mode = 'singletemplate'; } $tabs[] = $row; $activetwo = array('templates'); } /// Print out the tabs and continue! print_tabs($tabs, $currenttab, $inactive, $activetwo);
$browserow[] = new tabobject('edit', '#', get_string('edit')); } /// Put all this info together $tabrows = array(); $tabrows[] = $browserow; // Always put these at the top if ($toolsrow) { $tabrows[] = $toolsrow; } ?> <div class="glossarydisplay"> <?php if ($showcommonelements && count($tabrows[0]) > 1) { print_tabs($tabrows, $tab, $inactive, $activated); } ?> <div class="entrybox"> <?php if (!isset($category)) { $category = ""; } switch ($tab) { case GLOSSARY_CATEGORY_VIEW: glossary_print_categories_menu($cm, $glossary, $hook, $category); break; case GLOSSARY_APPROVAL_VIEW: glossary_print_approval_menu($cm, $glossary, $mode, $hook, $sortkey, $sortorder);
/** * Prints the tab link menu across the top of the activity module * * @param object $cm The moodle course module object for this instance * @param object $do The query string parameter to determine the page we are on */ function turnitintool_draw_menu($cm, $do) { global $CFG, $USER; $tabs[] = new tabobject('intro', $CFG->wwwroot . '/mod/turnitintool/view.php' . '?id=' . $cm->id . '&do=intro', get_string('turnitintoolintro', 'turnitintool'), get_string('turnitintoolintro', 'turnitintool'), false); if (has_capability('mod/turnitintool:grade', turnitintool_get_context('MODULE', $cm->id))) { $tabs[] = new tabobject('submissions', $CFG->wwwroot . '/mod/turnitintool/view.php' . '?id=' . $cm->id . '&do=submissions', get_string('submitpaper', 'turnitintool'), get_string('submitpaper', 'turnitintool'), false); $tabs[] = new tabobject('allsubmissions', $CFG->wwwroot . '/mod/turnitintool/view.php' . '?id=' . $cm->id . '&do=allsubmissions', get_string('allsubmissions', 'turnitintool'), get_string('allsubmissions', 'turnitintool'), false); $tabs[] = new tabobject('options', $CFG->wwwroot . '/mod/turnitintool/view.php' . '?id=' . $cm->id . '&do=options', get_string('options', 'turnitintool'), get_string('options', 'turnitintool'), false); } else { $tabs[] = new tabobject('submissions', $CFG->wwwroot . '/mod/turnitintool/view.php' . '?id=' . $cm->id . '&do=submissions', get_string('mysubmissions', 'turnitintool'), get_string('mysubmissions', 'turnitintool'), false); } echo '<div class="clearfix"></div>'; if ($do == 'notes') { $tabs[] = new tabobject('notes', '', get_string('notes', 'turnitintool'), get_string('notes', 'turnitintool'), false); $inactive = array('notes'); $selected = 'notes'; } else { if ($do == 'tutors') { $tabs[] = new tabobject('tutors', '', get_string('turnitintutors', 'turnitintool'), get_string('turnitintutors', 'turnitintool'), false); $inactive = array('tutors'); $selected = 'tutors'; } else { $inactive = array(); $selected = $do; } } print_tabs(array($tabs), $selected, $inactive); }
} // Don't allow to be called bypassing dispatcher if (isset($_GET['all'])) { $option = 2; // Show all subs } elseif (!$current_user->user_id || isset($_GET['active'])) { $option = 1; // Show active } else { $option = 0; // Show suscribed } $char_selected = $chars = false; // User for index by first letter do_header(_("subs menéame"), 'm/'); print_tabs($option); /*** SIDEBAR ****/ echo '<div id="sidebar">'; do_banner_right(); do_banner_promotions(); echo '</div>'; /*** END SIDEBAR ***/ echo '<div id="newswrap">'; switch ($option) { case 0: $subs = SitesMgr::get_subscriptions($current_user->user_id); $template = 'subs_simple.html'; $all = false; break; case 1: $all = false;
<?php // $Id: config_instance_tabs.php,v 1.15 2009/05/07 08:55:11 tjhunt Exp $ /// This file to be included so we can assume config.php has already been included. /// We also assume that $inactive, $activetab and $currentaction have been set global $USER; $tabs = $row = array(); // TODO - temporary hack to get the block context only if it already exists. global $DB; if ($DB->record_exists('context', array('contextlevel' => CONTEXT_BLOCK, 'instanceid' => $this->instance->id))) { $context = get_context_instance(CONTEXT_BLOCK, $this->instance->id); } else { $context = get_context_instance(CONTEXT_SYSTEM); // pinned blocks do not have own context } if (has_capability('moodle/site:manageblocks', $context)) { $script = $page->url->out(array('instanceid' => $this->instance->id, 'sesskey' => sesskey(), 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss')); $row[] = new tabobject('configblock', $script, get_string('configblock', 'block_rss_client')); } $script = $page->url->out(array('instanceid' => $this->instance->id, 'sesskey' => sesskey(), 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id, 'section' => 'rss')); $row[] = new tabobject('managefeeds', $script, get_string('managefeeds', 'block_rss_client')); $tabs[] = $row; /// Print out the tabs and continue! print "\n" . '<div class="tabs">' . "\n"; print_tabs($tabs, $currentaction); print '</div>' . print_location_comment(__FILE__, __LINE__, true);
<?php include_once $class_path . "permissions.inc.php"; ## action "Copy permissions to subtree" if ($site->fdat['copypermissions']) { copy_permissions(array("type" => 'ACL', "source_id" => $site->fdat['id'], "crud" => $site->fdat['copypermissions'], "user_id" => $site->fdat['perm_user_id'], "group_id" => $site->fdat['perm_group_id'], "role_id" => $site->fdat['perm_role_id'])); } else { ########### tabs print_tabs(); edit_permissions(array("type" => 'ACL', "permissions" => 'C,R,U,D,S')); } } else { ?> <table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:100%"> <?php ########### tabs print_tabs(); ?> <?php ###################### # 1. CONTENT: tab GROUP # op = new/copy/edit/print if ($site->fdat['tab'] == 'group') { ###################### # FIND parent ID # OP = new/copy/edit: new group will be created as CHILD of selected group if ($site->fdat['op'] == 'new') { $parent_group_id = $group->group_id; } else { $parent_group_id = $group->parent_group_id; }
/** * Prints out tabs and highlights the appropiate current tab. * * @param string $active_tab Either 'invite' or 'history' */ function print_page_tabs($active_tab) { global $CFG, $COURSE; $tabs[] = new tabobject('history', new moodle_url('/enrol/invitation/history.php', array('courseid' => $COURSE->id)), get_string('invitehistory', 'enrol_invitation')); $tabs[] = new tabobject('invite', new moodle_url('/enrol/invitation/invitation.php', array('courseid' => $COURSE->id)), get_string('inviteusers', 'enrol_invitation')); // Display tabs here. print_tabs(array($tabs), $active_tab); }
/** * Prints the tabs for the module * * @return void **/ function pagemenu_print_tabs($cm, $currenttab) { global $CFG; if (has_capability('mod/pagemenu:manage', get_context_instance(CONTEXT_MODULE, $cm->id))) { $tabs = $row = $inactive = array(); $row[] = new tabobject('view', "{$CFG->wwwroot}/mod/pagemenu/view.php?id={$cm->id}", get_string('view', 'pagemenu')); $row[] = new tabobject('edit', "{$CFG->wwwroot}/mod/pagemenu/edit.php?id={$cm->id}", get_string('edit', 'pagemenu')); $tabs[] = $row; print_tabs($tabs, $currenttab, $inactive); } }
$table->data[] = array('<strong>' . $section->fullname . '</section>'); $table->data[] = array(netpublish_print_move_here($cm->id, $articleid, $cnt, $section->id)); if ($articles = netpublish_get_articles($section->id, $netpublish->id)) { foreach ($articles as $article) { if ($article->id == $articleid) { continue; } $cnt++; $table->data[] = array(" " . stripslashes($article->title)); $table->data[] = array(netpublish_print_move_here($cm->id, $articleid, $cnt, $section->id)); } } } // all of the printing print_heading_with_help(get_string('movingarticle', 'netpublish') . ": {$movingarticle->title}", 'movingarticle', 'netpublish'); print_tabs($tabs, $cm->id); echo '<p>'; print_table($table); echo '</p>'; print_footer($course); //////////////////////////////// HELP FUNCTIONS //////////////////////////////// function netpublish_array_search($needle, $haystack) { $needle = intval($needle); foreach ($haystack as $key => $value) { if ($needle === intval($value)) { return (int) $key; exit; } } return false;
* * @package mod-skillsoft * @author Martin Holden * @copyright 2009-2011 Martin Holden * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ if (empty($skillsoft)) { error('You cannot call this script in that way'); } if (!isset($currenttab)) { $currenttab = ''; } if (!isset($cm)) { $cm = get_coursemodule_from_instance('skillsoft', $skillsoft->id); } $contextmodule = get_context_instance(CONTEXT_MODULE, $cm->id); $row = array(); $tabs = array(); $inactive = array(); $activated = array(); $infourl = new moodle_url('/mod/skillsoft/view.php', array('id' => $cm->id)); $row[] = new tabobject('info', $infourl, get_string('skillsoft_info', 'skillsoft')); $reporturl = new moodle_url('/mod/skillsoft/report.php', array('id' => $skillsoft->id, 'user' => 'true', 'attempt' => $attempt)); $row[] = new tabobject('reports', $reporturl, get_string('skillsoft_results', 'skillsoft')); if (has_capability('mod/skillsoft:viewreport', $contextmodule)) { $reportallurl = new moodle_url('/mod/skillsoft/report.php', array('id' => $skillsoft->id, 'attempt' => $attempt)); $row[] = new tabobject('allreports', $reportallurl, get_string('skillsoft_allresults', 'skillsoft')); } $tabs[] = $row; print_tabs($tabs, $currenttab, $inactive, $activated);
public function tabs($page, $tabitems, $options) { global $CFG; $tabs = array(); $baseurl = $CFG->wwwroot . '/mod/wiki/'; $context = get_context_instance(CONTEXT_MODULE, $this->page->cm->id); $pageid = null; if (!empty($page)) { $pageid = $page->id; } $selected = $options['activetab']; // make specific tab linked even it is active if (!empty($options['linkedwhenactive'])) { $linked = $options['linkedwhenactive']; } else { $linked = ''; } if (!empty($options['inactivetabs'])) { $inactive = $options['inactivetabs']; } else { $inactive = array(); } foreach ($tabitems as $tab) { if ($tab == 'edit' && !has_capability('mod/wiki:editpage', $context)) { continue; } if ($tab == 'comments' && !has_capability('mod/wiki:viewcomment', $context)) { continue; } if ($tab == 'files' && !has_capability('mod/wiki:viewpage', $context)) { continue; } if (($tab == 'view' || $tab == 'map' || $tab == 'history') && !has_capability('mod/wiki:viewpage', $context)) { continue; } if ($tab == 'admin' && !has_capability('mod/wiki:managewiki', $context)) { continue; } $link = $baseurl . $tab . '.php?pageid=' . $pageid; if ($linked == $tab) { $tabs[] = new tabobject($tab, $link, get_string($tab, 'wiki'), '', true); } else { $tabs[] = new tabobject($tab, $link, get_string($tab, 'wiki')); } } return print_tabs(array($tabs), $selected, $inactive, null, true); }
/** * Render the view of the Presenter. */ function render() { global $CFG; // Setup our list of tabs // We will always have a view option $presenterTabs = array(); // Top level is rows of tabs $presenterTabs[0] = array(); // Second level is individual tabs in a row $presenterTabs[0][] = new tabobject(SLOODLE_PRESENTER_TAB_VIEW, SLOODLE_WWWROOT . "/view.php?id={$this->cm->id}&mode=view", get_string('view', 'sloodle'), get_string('presenter:viewpresentation', 'sloodle'), true); // Does the user have authority to edit this module? if ($this->canedit) { // Add the 'Edit' tab, for editing the presentation as a whole $presenterTabs[0][] = new tabobject(SLOODLE_PRESENTER_TAB_EDIT, SLOODLE_WWWROOT . "/view.php?id={$this->cm->id}&mode=edit", get_string('edit', 'sloodle'), get_string('presenter:edit', 'sloodle'), true); // Add the 'Add Slide' tab $presenterTabs[0][] = new tabobject(SLOODLE_PRESENTER_TAB_ADD_SLIDE, SLOODLE_WWWROOT . "/view.php?id={$this->cm->id}&mode=addslide", get_string('presenter:add', 'sloodle'), get_string('presenter:add', 'sloodle'), true); // Add the 'Bulk Upload' tab $presenterTabs[0][] = new tabobject(SLOODLE_PRESENTER_TAB_ADD_FILES, SLOODLE_WWWROOT . "/view.php?id={$this->cm->id}&mode=addfiles", get_string('presenter:bulkupload', 'sloodle'), get_string('presenter:bulkupload', 'sloodle'), true); // Add the 'Import Slides' tab $presenterTabs[0][] = new tabobject(SLOODLE_PRESENTER_TAB_IMPORT_SLIDES, SLOODLE_WWWROOT . "/view.php?id={$this->cm->id}&mode=importslides", get_string('presenter:importslides', 'sloodle'), get_string('presenter:importslides', 'sloodle'), true); // If we are editing a slide, then add the 'Edit Slide' tab if ($this->presenter_mode == 'editslide') { $presenterTabs[0][] = new tabobject(SLOODLE_PRESENTER_TAB_EDIT_SLIDE, '', get_string('editslide', 'sloodle'), '', false); } } // Determine which tab should be active $selectedtab = SLOODLE_PRESENTER_TAB_VIEW; switch ($this->presenter_mode) { case 'edit': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT; break; case 'addslide': $selectedtab = SLOODLE_PRESENTER_TAB_ADD_SLIDE; break; case 'addfiles': $selectedtab = SLOODLE_PRESENTER_TAB_ADD_FILES; break; case 'editslide': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT_SLIDE; break; case 'moveslide': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT; break; case 'deleteslide': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT; break; case 'confirmdeleteslide': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT; break; case 'deletemultiple': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT; break; case 'confirmdeletemultiple': $selectedtab = SLOODLE_PRESENTER_TAB_EDIT; break; case 'importslides': $selectedtab = SLOODLE_PRESENTER_TAB_IMPORT_SLIDES; break; case 'compatibility': $selectedtab = SLOODLE_PRESENTER_TAB_IMPORT_SLIDES; break; } // Display the tabs print_tabs($presenterTabs, $selectedtab); echo "<div style=\"text-align:center;\">\n"; // Call the appropriate render function, based on our mode switch ($this->presenter_mode) { case 'edit': $this->render_edit(); break; case 'addslide': $this->render_slide_edit(); break; case 'addfiles': $this->render_upload_many(); break; case 'editslide': $this->render_slide_edit(); break; case 'moveslide': $this->render_edit(); break; case 'deleteslide': $this->render_edit(); break; case 'confirmdeleteslide': $this->render_edit(); break; case 'deletemultiple': $this->render_edit(); break; case 'confirmdeletemultiple': $this->render_edit(); break; case 'importslides': $this->render_import_slides(); break; case 'compatibility': $this->render_compatibility_test(); break; default: $this->render_view(); break; } echo "</div>\n"; }
$fs = get_file_storage(); if (!($storedfile = $fs->get_file($context->id, 'mod_lightboxgallery', 'gallery_images', '0', '/', $image))) { print_error(get_string('errornofile', 'lightboxgallery', $image)); } if ($editinstance->processing() && confirm_sesskey()) { $params = array('context' => $context, 'other' => array('imagename' => $image, 'tab' => $tab)); $event = \mod_lightboxgallery\event\image_updated::create($params); $event->add_record_snapshot('course_modules', $cm); $event->add_record_snapshot('course', $course); $event->add_record_snapshot('lightboxgallery', $gallery); $event->trigger(); $editinstance->process_form(); redirect($CFG->wwwroot . '/mod/lightboxgallery/imageedit.php?id=' . $cm->id . '&image=' . $editinstance->image . '&tab=' . $tab); } $image = new lightboxgallery_image($storedfile, $gallery, $cm); $table = new html_table(); $table->width = '*'; if ($editinstance->showthumb) { $table->attributes = array('style' => 'margin-left:auto;margin-right:auto;'); $table->align = array('center', 'center'); $table->size = array('*', '*'); $table->data[] = array('<img src="' . $image->get_thumbnail_url() . '" alt="" /><br /><span title="' . $image->get_image_caption() . '">' . $image->get_image_caption() . '</span>', $editinstance->output($image->get_image_caption())); } else { $table->align = array('center'); $table->size = array('*'); $table->data[] = array($editinstance->output($image->get_image_caption())); } echo $OUTPUT->header(); print_tabs(array($tabs), $tab); echo html_writer::table($table); echo $OUTPUT->footer();