當前位置: 首頁>>代碼示例>>PHP>>正文


PHP grade_helper::get_plugin_strings方法代碼示例

本文整理匯總了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;
}
開發者ID:EmmanuelYupit,項目名稱:educursos,代碼行數:81,代碼來源:lib.php

示例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;
}
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:68,代碼來源:lib.php


注:本文中的grade_helper::get_plugin_strings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。