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


PHP grade_plugin_return::add_url_params方法代碼示例

本文整理匯總了PHP中grade_plugin_return::add_url_params方法的典型用法代碼示例。如果您正苦於以下問題:PHP grade_plugin_return::add_url_params方法的具體用法?PHP grade_plugin_return::add_url_params怎麽用?PHP grade_plugin_return::add_url_params使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在grade_plugin_return的用法示例。


在下文中一共展示了grade_plugin_return::add_url_params方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: grade_print_scale_link

/**
 * Local shortcut function for creating a link to a scale.
 * @param int $courseid The Course ID
 * @param grade_scale $scale The Scale to link to
 * @param grade_plugin_return $gpr An object used to identify the page we just came from
 * @return string html
 */
function grade_print_scale_link($courseid, $scale, $gpr)
{
    global $CFG, $OUTPUT;
    $url = new moodle_url('/grade/edit/scale/edit.php', array('courseid' => $courseid, 'id' => $scale->id));
    $url = $gpr->add_url_params($url);
    return html_writer::link($url, $scale->get_name());
}
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:14,代碼來源:index.php

示例2: array

navigation_node::override_active_url(new moodle_url('/grade/edit/tree/index.php', array('id' => $courseid)));
if (!($course = $DB->get_record('course', array('id' => $courseid)))) {
    print_error('nocourseid');
}
require_login($course);
$context = context_course::instance($course->id);
require_capability('moodle/grade:manage', $context);
// default return url
$gpr = new grade_plugin_return();
$returnurl = $gpr->get_return_url('index.php?id=' . $course->id);
$heading = get_string('itemsedit', 'grades');
if ($grade_item = grade_item::fetch(array('id' => $id, 'courseid' => $courseid))) {
    // redirect if outcomeid present
    if (!empty($grade_item->outcomeid) && !empty($CFG->enableoutcomes)) {
        $url = $CFG->wwwroot . '/grade/edit/tree/outcomeitem.php?id=' . $id . '&courseid=' . $courseid;
        redirect($gpr->add_url_params($url));
    }
    if ($grade_item->is_course_item() or $grade_item->is_category_item()) {
        $grade_category = $grade_item->get_item_category();
        $url = $CFG->wwwroot . '/grade/edit/tree/category.php?id=' . $grade_category->id . '&courseid=' . $courseid;
        redirect($gpr->add_url_params($url));
    }
    $item = $grade_item->get_record_data();
    $parent_category = $grade_item->get_parent_category();
    $item->parentcategory = $parent_category->id;
} else {
    $heading = get_string('newitem', 'grades');
    $grade_item = new grade_item(array('courseid' => $courseid, 'itemtype' => 'manual'), false);
    $item = $grade_item->get_record_data();
    $parent_category = grade_category::fetch_course_category($courseid);
    $item->parentcategory = $parent_category->id;
開發者ID:alanaipe2015,項目名稱:moodle,代碼行數:31,代碼來源:item.php


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