本文整理汇总了PHP中grade_extend_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP grade_extend_settings函数的具体用法?PHP grade_extend_settings怎么用?PHP grade_extend_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了grade_extend_settings函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: print_grade_page_head
/**
* Prints the page headers, breadcrumb trail, page heading, (optional) dropdown navigation menu and
* (optional) navigation tabs for any gradebook page. All gradebook pages MUST use these functions
* in favour of the usual print_header(), print_header_simple(), print_heading() etc.
* !IMPORTANT! Use of tabs.php file in gradebook pages is forbidden unless tabs are switched off at
* the site level for the gradebook ($CFG->grade_navmethod = GRADE_NAVMETHOD_DROPDOWN).
*
* @param int $courseid Course id
* @param string $active_type The type of the current page (report, settings,
* import, export, scales, outcomes, letters)
* @param string $active_plugin The plugin of the current page (grader, fullview etc...)
* @param string $heading The heading of the page. Tries to guess if none is given
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
* @param boolean $shownavigation should the gradebook navigation drop down (or tabs) be shown?
* @param string $headerhelpidentifier The help string identifier if required.
* @param string $headerhelpcomponent The component for the help string.
*
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head($courseid, $active_type, $active_plugin = null, $heading = false, $return = false, $buttons = false, $shownavigation = true, $headerhelpidentifier = null, $headerhelpcomponent = null)
{
global $CFG, $OUTPUT, $PAGE;
if ($active_type === 'preferences') {
// In Moodle 2.8 report preferences were moved under 'settings'. Allow backward compatibility for 3rd party grade reports.
$active_type = 'settings';
}
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
// Determine the string of the active plugin
$stractive_plugin = $active_plugin ? $plugin_info['strings']['active_plugin_str'] : $heading;
$stractive_type = $plugin_info['strings'][$active_type];
if (empty($plugin_info[$active_type]->id) || !empty($plugin_info[$active_type]->parent)) {
$title = $PAGE->course->fullname . ': ' . $stractive_type . ': ' . $stractive_plugin;
} else {
$title = $PAGE->course->fullname . ': ' . $stractive_plugin;
}
if ($active_type == 'report') {
$PAGE->set_pagelayout('report');
} else {
$PAGE->set_pagelayout('admin');
}
$PAGE->set_title(get_string('grades') . ': ' . $stractive_type);
$PAGE->set_heading($title);
if ($buttons instanceof single_button) {
$buttons = $OUTPUT->render($buttons);
}
$PAGE->set_button($buttons);
if ($courseid != SITEID) {
grade_extend_settings($plugin_info, $courseid);
}
$returnval = $OUTPUT->header();
if (!$return) {
echo $returnval;
}
// Guess heading if not given explicitly
if (!$heading) {
$heading = $stractive_plugin;
}
if ($shownavigation) {
if ($courseid != SITEID && ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN)) {
$returnval .= print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return);
}
$output = '';
// Add a help dialogue box if provided.
if (isset($headerhelpidentifier)) {
$output = $OUTPUT->heading_with_help($heading, $headerhelpidentifier, $headerhelpcomponent);
} else {
$output = $OUTPUT->heading($heading);
}
if ($return) {
$returnval .= $output;
} else {
echo $output;
}
if ($courseid != SITEID && ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS)) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
}
}
$returnval .= print_natural_aggregation_upgrade_notice($courseid, context_course::instance($courseid), $PAGE->url, $return);
if ($return) {
return $returnval;
}
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:84,代码来源:lib.php
示例2: print_grade_page_head
/**
* Prints the page headers, breadcrumb trail, page heading, (optional) dropdown navigation menu and
* (optional) navigation tabs for any gradebook page. All gradebook pages MUST use these functions
* in favour of the usual print_header(), print_header_simple(), print_heading() etc.
* !IMPORTANT! Use of tabs.php file in gradebook pages is forbidden unless tabs are switched off at
* the site level for the gradebook ($CFG->grade_navmethod = GRADE_NAVMETHOD_DROPDOWN).
*
* @param int $courseid Course id
* @param string $active_type The type of the current page (report, settings,
* import, export, scales, outcomes, letters)
* @param string $active_plugin The plugin of the current page (grader, fullview etc...)
* @param string $heading The heading of the page. Tries to guess if none is given
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
* @param boolean $shownavigation should the gradebook navigation drop down (or tabs) be shown?
*
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head($courseid, $active_type, $active_plugin = null, $heading = false, $return = false, $buttons = false, $shownavigation = true)
{
global $CFG, $OUTPUT, $PAGE;
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
// Determine the string of the active plugin
$stractive_plugin = $active_plugin ? $plugin_info['strings']['active_plugin_str'] : $heading;
$stractive_type = $plugin_info['strings'][$active_type];
if (empty($plugin_info[$active_type]->id) || !empty($plugin_info[$active_type]->parent)) {
$title = $PAGE->course->fullname . ': ' . $stractive_type . ': ' . $stractive_plugin;
} else {
$title = $PAGE->course->fullname . ': ' . $stractive_plugin;
}
if ($active_type == 'report') {
$PAGE->set_pagelayout('report');
} else {
$PAGE->set_pagelayout('admin');
}
$PAGE->set_title(get_string('grades') . ': ' . $stractive_type);
$PAGE->set_heading($title);
if ($buttons instanceof single_button) {
$buttons = $OUTPUT->render($buttons);
}
$PAGE->set_button($buttons);
grade_extend_settings($plugin_info, $courseid);
$returnval = $OUTPUT->header();
if (!$return) {
echo $returnval;
}
// Guess heading if not given explicitly
if (!$heading) {
$heading = $stractive_plugin;
}
if ($shownavigation) {
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
$returnval .= print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return);
}
if ($return) {
$returnval .= $OUTPUT->heading($heading);
} else {
echo $OUTPUT->heading($heading);
}
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
}
}
if ($return) {
return $returnval;
}
}
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:68,代码来源:lib.php
示例3: print_grade_page_head
/**
* Prints the page headers, breadcrumb trail, page heading, (optional) dropdown navigation menu and
* (optional) navigation tabs for any gradebook page. All gradebook pages MUST use these functions
* in favour of the usual print_header(), print_header_simple(), print_heading() etc.
* !IMPORTANT! Use of tabs.php file in gradebook pages is forbidden unless tabs are switched off at
* the site level for the gradebook ($CFG->grade_navmethod = GRADE_NAVMETHOD_DROPDOWN).
*
* @param int $courseid Course id
* @param string $active_type The type of the current page (report, settings,
* import, export, scales, outcomes, letters)
* @param string $active_plugin The plugin of the current page (grader, fullview etc...)
* @param string $heading The heading of the page. Tries to guess if none is given
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
* @param boolean $shownavigation should the gradebook navigation drop down (or tabs) be shown?
* @param string $headerhelpidentifier The help string identifier if required.
* @param string $headerhelpcomponent The component for the help string.
* @param stdClass $user The user object for use with the user context header.
*
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head($courseid, $active_type, $active_plugin=null,
$heading = false, $return=false,
$buttons=false, $shownavigation=true, $headerhelpidentifier = null, $headerhelpcomponent = null,
$user = null) {
global $CFG, $OUTPUT, $PAGE;
// Put a warning on all gradebook pages if the course has modules currently scheduled for background deletion.
require_once($CFG->dirroot . '/course/lib.php');
if (course_modules_pending_deletion($courseid)) {
\core\notification::add(get_string('gradesmoduledeletionpendingwarning', 'grades'),
\core\output\notification::NOTIFY_WARNING);
}
if ($active_type === 'preferences') {
// In Moodle 2.8 report preferences were moved under 'settings'. Allow backward compatibility for 3rd party grade reports.
$active_type = 'settings';
}
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
// Determine the string of the active plugin
$stractive_plugin = ($active_plugin) ? $plugin_info['strings']['active_plugin_str'] : $heading;
$stractive_type = $plugin_info['strings'][$active_type];
if (empty($plugin_info[$active_type]->id) || !empty($plugin_info[$active_type]->parent)) {
$title = $PAGE->course->fullname.': ' . $stractive_type . ': ' . $stractive_plugin;
} else {
$title = $PAGE->course->fullname.': ' . $stractive_plugin;
}
if ($active_type == 'report') {
$PAGE->set_pagelayout('report');
} else {
$PAGE->set_pagelayout('admin');
}
$PAGE->set_title(get_string('grades') . ': ' . $stractive_type);
$PAGE->set_heading($title);
if ($buttons instanceof single_button) {
$buttons = $OUTPUT->render($buttons);
}
$PAGE->set_button($buttons);
if ($courseid != SITEID) {
grade_extend_settings($plugin_info, $courseid);
}
// Set the current report as active in the breadcrumbs.
if ($active_plugin !== null && $reportnav = $PAGE->settingsnav->find($active_plugin, navigation_node::TYPE_SETTING)) {
$reportnav->make_active();
}
$returnval = $OUTPUT->header();
if (!$return) {
echo $returnval;
}
// Guess heading if not given explicitly
if (!$heading) {
$heading = $stractive_plugin;
}
if ($shownavigation) {
$navselector = null;
if ($courseid != SITEID &&
($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN)) {
// It's absolutely essential that this grade plugin selector is shown after the user header. Just ask Fred.
$navselector = print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, true);
if ($return) {
$returnval .= $navselector;
} else if (!isset($user)) {
echo $navselector;
}
}
$output = '';
// Add a help dialogue box if provided.
if (isset($headerhelpidentifier)) {
$output = $OUTPUT->heading_with_help($heading, $headerhelpidentifier, $headerhelpcomponent);
//.........这里部分代码省略.........
开发者ID:EsdrasCaleb,项目名称:moodle,代码行数:101,代码来源:lib.php
注:本文中的grade_extend_settings函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论