本文整理汇总了PHP中grade_helper::managesetting方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_helper::managesetting方法的具体用法?PHP grade_helper::managesetting怎么用?PHP grade_helper::managesetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_helper
的用法示例。
在下文中一共展示了grade_helper::managesetting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_info_manage_settings
/**
* Get grade_plugin_info object for managing settings if the user can
*
* @param int $courseid
* @return grade_plugin_info
*/
public static function get_info_manage_settings($courseid)
{
if (self::$managesetting !== null) {
return self::$managesetting;
}
$context = context_course::instance($courseid);
if (has_capability('moodle/grade:manage', $context)) {
self::$managesetting = new grade_plugin_info('coursesettings', new moodle_url('/grade/edit/settings/index.php', array('id' => $courseid)), get_string('course'));
} else {
self::$managesetting = false;
}
return self::$managesetting;
}
示例2: get_info_manage_settings
/**
* Get grade_plugin_info object for managing settings if the user can
*
* @param int $courseid
* @return grade_plugin_info[]
*/
public static function get_info_manage_settings($courseid)
{
if (self::$managesetting !== null) {
return self::$managesetting;
}
$context = context_course::instance($courseid);
self::$managesetting = array();
if ($courseid != SITEID && has_capability('moodle/grade:manage', $context)) {
self::$managesetting['categoriesanditems'] = new grade_plugin_info('setup', new moodle_url('/grade/edit/tree/index.php', array('id' => $courseid)), get_string('categoriesanditems', 'grades'));
self::$managesetting['coursesettings'] = new grade_plugin_info('coursesettings', new moodle_url('/grade/edit/settings/index.php', array('id' => $courseid)), get_string('coursegradesettings', 'grades'));
}
if (self::$gradereportpreferences === null) {
self::get_plugins_reports($courseid);
}
if (self::$gradereportpreferences) {
self::$managesetting = array_merge(self::$managesetting, self::$gradereportpreferences);
}
return self::$managesetting;
}