本文整理汇总了PHP中grade_helper::get_plugins_report_preferences方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_helper::get_plugins_report_preferences方法的具体用法?PHP grade_helper::get_plugins_report_preferences怎么用?PHP grade_helper::get_plugins_report_preferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_helper
的用法示例。
在下文中一共展示了grade_helper::get_plugins_report_preferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: grade_extend_settings
/**
* This method adds settings to the settings block for the grade system and its
* plugins
*
* @global moodle_page $PAGE
*/
function grade_extend_settings($plugininfo, $courseid)
{
global $PAGE;
$gradenode = $PAGE->settingsnav->prepend(get_string('gradeadministration', 'grades'), null, navigation_node::TYPE_CONTAINER);
$strings = array_shift($plugininfo);
if ($reports = grade_helper::get_plugins_reports($courseid)) {
foreach ($reports as $report) {
$gradenode->add($report->string, $report->link, navigation_node::TYPE_SETTING, null, $report->id, new pix_icon('i/report', ''));
}
}
if ($imports = grade_helper::get_plugins_import($courseid)) {
$importnode = $gradenode->add($strings['import'], null, navigation_node::TYPE_CONTAINER);
foreach ($imports as $import) {
$importnode->add($import->string, $import->link, navigation_node::TYPE_SETTING, null, $import->id, new pix_icon('i/import', ''));
}
}
if ($exports = grade_helper::get_plugins_export($courseid)) {
$exportnode = $gradenode->add($strings['export'], null, navigation_node::TYPE_CONTAINER);
foreach ($exports as $export) {
$exportnode->add($export->string, $export->link, navigation_node::TYPE_SETTING, null, $export->id, new pix_icon('i/export', ''));
}
}
if ($setting = grade_helper::get_info_manage_settings($courseid)) {
$gradenode->add(get_string('coursegradesettings', 'grades'), $setting->link, navigation_node::TYPE_SETTING, null, $setting->id, new pix_icon('i/settings', ''));
}
if ($preferences = grade_helper::get_plugins_report_preferences($courseid)) {
$preferencesnode = $gradenode->add(get_string('myreportpreferences', 'grades'), null, navigation_node::TYPE_CONTAINER);
foreach ($preferences as $preference) {
$preferencesnode->add($preference->string, $preference->link, navigation_node::TYPE_SETTING, null, $preference->id, new pix_icon('i/settings', ''));
}
}
if ($letters = grade_helper::get_info_letters($courseid)) {
$letters = array_shift($letters);
$gradenode->add($strings['letter'], $letters->link, navigation_node::TYPE_SETTING, null, $letters->id, new pix_icon('i/settings', ''));
}
if ($outcomes = grade_helper::get_info_outcomes($courseid)) {
$outcomes = array_shift($outcomes);
$gradenode->add($strings['outcome'], $outcomes->link, navigation_node::TYPE_SETTING, null, $outcomes->id, new pix_icon('i/outcomes', ''));
}
if ($scales = grade_helper::get_info_scales($courseid)) {
$gradenode->add($strings['scale'], $scales->link, navigation_node::TYPE_SETTING, null, $scales->id, new pix_icon('i/scales', ''));
}
if ($categories = grade_helper::get_info_edit_structure($courseid)) {
$categoriesnode = $gradenode->add(get_string('categoriesanditems', 'grades'), null, navigation_node::TYPE_CONTAINER);
foreach ($categories as $category) {
$categoriesnode->add($category->string, $category->link, navigation_node::TYPE_SETTING, null, $category->id, new pix_icon('i/report', ''));
}
}
if ($gradenode->contains_active_node()) {
// If the gradenode is active include the settings base node (gradeadministration) in
// the navbar, typcially this is ignored.
$PAGE->navbar->includesettingsbase = true;
// If we can get the course admin node make sure it is closed by default
// as in this case the gradenode will be opened
if ($coursenode = $PAGE->settingsnav->get('courseadmin', navigation_node::TYPE_COURSE)) {
$coursenode->make_inactive();
$coursenode->forceopen = false;
}
}
}