本文整理汇总了PHP中print_tabs函数的典型用法代码示例。如果您正苦于以下问题:PHP print_tabs函数的具体用法?PHP print_tabs怎么用?PHP print_tabs使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_tabs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activequiz_view_tabs
/**
* 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);
}
示例2: print_tabs
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)));
}
示例3: print_tabs
/**
* 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);
}
示例4: show_tabs
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);
}
示例5: bookmarks_print_tabs
/**
*
*
*
*
*/
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);
}
示例6: build_tabs_template
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);
}
示例7: forumng_feature_deleted_print_tabs
/**
*
* @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">';
}
示例8: build_tabs_local
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);
}
示例9: draw_settings_tab_menu
/**
* 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"]);
}
}
示例10: bookmarks_print_tabs
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);
}
示例11: print_html_body_begin
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
示例12: print_tabs
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)));
}
示例13: draw_tool_tab_menu
/**
* 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);
}
示例14: print_tabs
} 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
示例15: grade_print_tabs
/**
* 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;
}
}