当前位置: 首页>>代码示例>>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;未经允许,请勿转载。