本文整理匯總了PHP中grade_helper::letterinfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP grade_helper::letterinfo方法的具體用法?PHP grade_helper::letterinfo怎麽用?PHP grade_helper::letterinfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類grade_helper
的用法示例。
在下文中一共展示了grade_helper::letterinfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_info_letters
/**
* Get information on letters
* @param int $courseid
* @return array
*/
public static function get_info_letters($courseid)
{
global $SITE;
if (self::$letterinfo !== null) {
return self::$letterinfo;
}
$context = context_course::instance($courseid);
$canmanage = has_capability('moodle/grade:manage', $context);
$canmanageletters = has_capability('moodle/grade:manageletters', $context);
if ($canmanage || $canmanageletters) {
// Redirect to system context when report is accessed from admin settings MDL-31633
if ($context->instanceid == $SITE->id) {
$param = array('edit' => 1);
} else {
$param = array('edit' => 1, 'id' => $context->id);
}
self::$letterinfo = array('view' => new grade_plugin_info('view', new moodle_url('/grade/edit/letter/index.php', array('id' => $context->id)), get_string('view')), 'edit' => new grade_plugin_info('edit', new moodle_url('/grade/edit/letter/index.php', $param), get_string('edit')));
} else {
self::$letterinfo = false;
}
return self::$letterinfo;
}
示例2: get_info_letters
/**
* Get information on letters
* @param int $courseid
* @return array
*/
public static function get_info_letters($courseid)
{
if (self::$letterinfo !== null) {
return self::$letterinfo;
}
$context = get_context_instance(CONTEXT_COURSE, $courseid);
$canmanage = has_capability('moodle/grade:manage', $context);
$canmanageletters = has_capability('moodle/grade:manageletters', $context);
if ($canmanage || $canmanageletters) {
self::$letterinfo = array('view' => new grade_plugin_info('view', new moodle_url('/grade/edit/letter/index.php', array('id' => $context->id)), get_string('view')), 'edit' => new grade_plugin_info('edit', new moodle_url('/grade/edit/letter/index.php', array('edit' => 1, 'id' => $context->id)), get_string('edit')));
} else {
self::$letterinfo = false;
}
return self::$letterinfo;
}