本文整理汇总了PHP中grade_helper::get_plugin_strings方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_helper::get_plugin_strings方法的具体用法?PHP grade_helper::get_plugin_strings怎么用?PHP grade_helper::get_plugin_strings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_helper
的用法示例。
在下文中一共展示了grade_helper::get_plugin_strings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: grade_get_plugin_info
/**
* grade_get_plugin_info
*
* @param int $courseid The course id
* @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, ...
*
* @return array
*/
function grade_get_plugin_info($courseid, $active_type, $active_plugin)
{
global $CFG, $SITE;
$context = context_course::instance($courseid);
$plugin_info = array();
$count = 0;
$active = '';
$url_prefix = $CFG->wwwroot . '/grade/';
// Language strings
$plugin_info['strings'] = grade_helper::get_plugin_strings();
if ($reports = grade_helper::get_plugins_reports($courseid)) {
$plugin_info['report'] = $reports;
}
//showing grade categories and items make no sense if we're not within a course
if ($courseid != $SITE->id) {
if ($edittree = grade_helper::get_info_edit_structure($courseid)) {
$plugin_info['edittree'] = $edittree;
}
}
if ($scale = grade_helper::get_info_scales($courseid)) {
$plugin_info['scale'] = array('view' => $scale);
}
if ($outcomes = grade_helper::get_info_outcomes($courseid)) {
$plugin_info['outcome'] = $outcomes;
}
if ($letters = grade_helper::get_info_letters($courseid)) {
$plugin_info['letter'] = $letters;
}
if ($imports = grade_helper::get_plugins_import($courseid)) {
$plugin_info['import'] = $imports;
}
if ($exports = grade_helper::get_plugins_export($courseid)) {
$plugin_info['export'] = $exports;
}
foreach ($plugin_info as $plugin_type => $plugins) {
if (!empty($plugins->id) && $active_plugin == $plugins->id) {
$plugin_info['strings']['active_plugin_str'] = $plugins->string;
break;
}
foreach ($plugins as $plugin) {
if (is_a($plugin, 'grade_plugin_info')) {
if ($active_plugin == $plugin->id) {
$plugin_info['strings']['active_plugin_str'] = $plugin->string;
}
}
}
}
//hide course settings if we're not in a course
if ($courseid != $SITE->id) {
if ($setting = grade_helper::get_info_manage_settings($courseid)) {
$plugin_info['settings'] = array('course' => $setting);
}
}
// Put preferences last
if ($preferences = grade_helper::get_plugins_report_preferences($courseid)) {
$plugin_info['preferences'] = $preferences;
}
foreach ($plugin_info as $plugin_type => $plugins) {
if (!empty($plugins->id) && $active_plugin == $plugins->id) {
$plugin_info['strings']['active_plugin_str'] = $plugins->string;
break;
}
foreach ($plugins as $plugin) {
if (is_a($plugin, 'grade_plugin_info')) {
if ($active_plugin == $plugin->id) {
$plugin_info['strings']['active_plugin_str'] = $plugin->string;
}
}
}
}
return $plugin_info;
}
示例2: grade_get_plugin_info
/**
* grade_get_plugin_info
*
* @param int $courseid The course id
* @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, ...
*
* @return array
*/
function grade_get_plugin_info($courseid, $active_type, $active_plugin)
{
global $CFG, $SITE;
$context = context_course::instance($courseid);
$plugin_info = array();
$count = 0;
$active = '';
$url_prefix = $CFG->wwwroot . '/grade/';
// Language strings
$plugin_info['strings'] = grade_helper::get_plugin_strings();
if ($reports = grade_helper::get_plugins_reports($courseid)) {
$plugin_info['report'] = $reports;
}
if ($settings = grade_helper::get_info_manage_settings($courseid)) {
$plugin_info['settings'] = $settings;
}
if ($scale = grade_helper::get_info_scales($courseid)) {
$plugin_info['scale'] = array('view' => $scale);
}
if ($outcomes = grade_helper::get_info_outcomes($courseid)) {
$plugin_info['outcome'] = $outcomes;
}
if ($letters = grade_helper::get_info_letters($courseid)) {
$plugin_info['letter'] = $letters;
}
if ($imports = grade_helper::get_plugins_import($courseid)) {
$plugin_info['import'] = $imports;
}
if ($exports = grade_helper::get_plugins_export($courseid)) {
$plugin_info['export'] = $exports;
}
foreach ($plugin_info as $plugin_type => $plugins) {
if (!empty($plugins->id) && $active_plugin == $plugins->id) {
$plugin_info['strings']['active_plugin_str'] = $plugins->string;
break;
}
foreach ($plugins as $plugin) {
if (is_a($plugin, 'grade_plugin_info')) {
if ($active_plugin == $plugin->id) {
$plugin_info['strings']['active_plugin_str'] = $plugin->string;
}
}
}
}
foreach ($plugin_info as $plugin_type => $plugins) {
if (!empty($plugins->id) && $active_plugin == $plugins->id) {
$plugin_info['strings']['active_plugin_str'] = $plugins->string;
break;
}
foreach ($plugins as $plugin) {
if (is_a($plugin, 'grade_plugin_info')) {
if ($active_plugin == $plugin->id) {
$plugin_info['strings']['active_plugin_str'] = $plugin->string;
}
}
}
}
return $plugin_info;
}