当前位置: 首页>>代码示例>>PHP>>正文


PHP navigation_node类代码示例

本文整理汇总了PHP中navigation_node的典型用法代码示例。如果您正苦于以下问题:PHP navigation_node类的具体用法?PHP navigation_node怎么用?PHP navigation_node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了navigation_node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: engagement_report_extend_navigation

/**
 * This function extends the navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $course The course to object for the report
 * @param stdClass $context The context of the course
 */
function engagement_report_extend_navigation($navigation, $course, $context)
{
    if (has_capability('report/engagement:view', $context)) {
        $url = new moodle_url('/course/report/engagement/index.php', array('id' => $course->id));
        $navigation->add(get_string('pluginname', 'coursereport_engagement'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
    }
}
开发者ID:netspotau,项目名称:moodle-coursereport_engagement,代码行数:14,代码来源:lib.php

示例2: report_loglive_extend_navigation_course

/**
 * This function extends the navigation with the report items
 *
 * @global stdClass $CFG
 * @global core_renderer $OUTPUT
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass        $course     The course to object for the report
 * @param context         $context    The context of the course
 */
function report_loglive_extend_navigation_course($navigation, $course, $context)
{
    if (has_capability('report/loglive:view', $context)) {
        $url = new moodle_url('/report/loglive/index.php', array('id' => $course->id));
        $navigation->add(get_string('pluginname', 'report_loglive'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
    }
}
开发者ID:evltuma,项目名称:moodle,代码行数:16,代码来源:lib.php

示例3: booktool_wordimport_extend_settings_navigation

/**
 * Adds module specific settings to the settings block
 *
 * @param settings_navigation $settings The settings navigation object
 * @param navigation_node $node The node to add module settings to
 */
function booktool_wordimport_extend_settings_navigation(settings_navigation $settings, navigation_node $node)
{
    global $PAGE;
    if ($PAGE->cm->modname !== 'book') {
        return;
    }
    $params = $PAGE->url->params();
    if (empty($params['id']) and empty($params['cmid'])) {
        return;
    }
    if (empty($PAGE->cm->context)) {
        $PAGE->cm->context = get_context_module::instance($PAGE->cm->instance);
    }
    if (!(has_capability('booktool/wordimport:import', $PAGE->cm->context) and has_capability('mod/book:edit', $PAGE->cm->context))) {
        return;
    }
    // Configure Import link, and pass in the current chapter in case the insert should happen here rather than at the end.
    $url1 = new moodle_url('/mod/book/tool/wordimport/index.php', array('id' => $PAGE->cm->id, 'chapterid' => $params['chapterid']));
    $node->add(get_string('importchapters', 'booktool_wordimport'), $url1, navigation_node::TYPE_SETTING, null, null, new pix_icon('f/document', '', 'moodle', array('class' => 'iconsmall', 'title' => '')));
    // Configure Export links for book and current chapter.
    $url2 = new moodle_url('/mod/book/tool/wordimport/index.php', array('id' => $PAGE->cm->id, 'action' => 'export'));
    $node->add(get_string('exportbook', 'booktool_wordimport'), $url2, navigation_node::TYPE_SETTING, null, null, new pix_icon('f/document', '', 'moodle', array('class' => 'iconsmall', 'title' => '')));
    $url3 = new moodle_url('/mod/book/tool/wordimport/index.php', array('id' => $PAGE->cm->id, 'chapterid' => $params['chapterid'], 'action' => 'export'));
    $node->add(get_string('exportchapter', 'booktool_wordimport'), $url3, navigation_node::TYPE_SETTING, null, null, new pix_icon('f/document', '', 'moodle', array('class' => 'iconsmall', 'title' => '')));
}
开发者ID:ecampbell,项目名称:moodle-booktool_wordimport,代码行数:31,代码来源:lib.php

示例4: booktool_importhtml_extend_settings_navigation

/**
 * Adds module specific settings to the settings block
 *
 * @param settings_navigation $settings The settings navigation object
 * @param navigation_node $node The node to add module settings to
 */
function booktool_importhtml_extend_settings_navigation(settings_navigation $settings, navigation_node $node)
{
    global $PAGE;
    if (has_capability('booktool/importhtml:import', $PAGE->cm->context)) {
        $url = new moodle_url('/mod/book/tool/importhtml/index.php', array('id' => $PAGE->cm->id));
        $node->add(get_string('import', 'booktool_importhtml'), $url, navigation_node::TYPE_SETTING, null, null, null);
    }
}
开发者ID:pzhu2004,项目名称:moodle,代码行数:14,代码来源:lib.php

示例5: report_configreports_extend_navigation_course

/**
 * This function extends the coursenavigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $course The course to object for the report
 * @param stdClass $context The context of the course
 */
function report_configreports_extend_navigation_course($navigation, $course, $context)
{
    if ($myreports = report_configreports_get_my_reports($course, $context)) {
        foreach ($myreports as $report) {
            $navigation->add($report['name'], $report['url'], navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
        }
    }
}
开发者ID:nickkoeppen,项目名称:moodle-report_configreports,代码行数:15,代码来源:lib.php

示例6: report_loglive_extend_navigation_course

/**
 * This function extends the navigation with the report items
 *
 * @global stdClass $CFG
 * @global core_renderer $OUTPUT
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass        $course     The course to object for the report
 * @param stdClass        $context    The context of the course
 */
function report_loglive_extend_navigation_course($navigation, $course, $context) {
    global $CFG, $OUTPUT;
    if (has_capability('report/loglive:view', $context)) {
        $url = new moodle_url('/report/loglive/index.php', array('id'=>$course->id, 'inpopup'=>1));
        $action = new action_link($url, get_string('pluginname', 'report_loglive'), new popup_action('click', $url));
        $navigation->add('', $action, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
    }
}
开发者ID:JP-Git,项目名称:moodle,代码行数:17,代码来源:lib.php

示例7: participation_report_extend_navigation

/**
 * This function extends the navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $course The course to object for the report
 * @param stdClass $context The context of the course
 */
function participation_report_extend_navigation($navigation, $course, $context)
{
    global $CFG, $OUTPUT;
    if (has_capability('coursereport/participation:view', $context)) {
        $url = new moodle_url('/course/report/participation/index.php', array('id' => $course->id));
        $navigation->add(get_string('participationreport'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
    }
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:15,代码来源:lib.php

示例8: tool_kent_extend_navigation_user_settings

/**
 * This function extends the navigation with the tool items for user settings node.
 *
 * @param navigation_node $navigation  The navigation node to extend
 * @param stdClass        $user        The user object
 * @param context         $usercontext The context of the user
 * @param stdClass        $course      The course to object for the tool
 * @param context         $coursecontext     The context of the course
 */
function tool_kent_extend_navigation_user_settings($navigation, $user, $usercontext, $course, $coursecontext)
{
    $url = new moodle_url('/local/kent/preferences.php');
    $subsnode = navigation_node::create('Kent Preferences', $url, navigation_node::TYPE_SETTING, null, 'kent');
    if (isset($subsnode) && !empty($navigation)) {
        $navigation->add_node($subsnode);
    }
}
开发者ID:unikent,项目名称:moodle-tool_kent,代码行数:17,代码来源:lib.php

示例9: report_configurablereports_extend_navigation_user

/**
 * This function extends the course navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $user
 * @param stdClass $course The course to object for the report
 */
function report_configurablereports_extend_navigation_user($navigation, $user, $course)
{
    return;
    //TODO: this plugin was not linked from navigation in 2.0, let's keep it that way for now --skodak
    if (report_configurablereports_can_access_user_report($user, $course)) {
        $url = new moodle_url('/report/configurablereports/index.php', array('userid' => $user->id, 'id' => $course->id));
        $navigation->add(get_string('pluginname', 'report_configurablereports'), $url);
    }
}
开发者ID:nadavkav,项目名称:moodle-block_configurablereports,代码行数:16,代码来源:lib.php

示例10: booktool_exportimscp_extend_settings_navigation

/**
 * Adds module specific settings to the settings block
 *
 * @param settings_navigation $settings The settings navigation object
 * @param navigation_node $node The node to add module settings to
 */
function booktool_exportimscp_extend_settings_navigation(settings_navigation $settings, navigation_node $node)
{
    global $PAGE;
    if (has_capability('booktool/exportimscp:export', $PAGE->cm->context)) {
        $url = new moodle_url('/mod/book/tool/exportimscp/index.php', array('id' => $PAGE->cm->id));
        $icon = new pix_icon('generate', '', 'booktool_exportimscp', array('class' => 'icon'));
        $node->add(get_string('generateimscp', 'booktool_exportimscp'), $url, navigation_node::TYPE_SETTING, null, null, $icon);
    }
}
开发者ID:evltuma,项目名称:moodle,代码行数:15,代码来源:lib.php

示例11: report_completion_extend_navigation_user

/**
 * This function extends the course navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $user
 * @param stdClass $course The course to object for the report
 */
function report_completion_extend_navigation_user($navigation, $user, $course)
{
    return;
    //TODO: this plugin was not linked from navigation in 2.0, let's keep it that way for now --skodak
    if (report_completion_can_access_user_report($user, $course)) {
        $url = new moodle_url('/report/completion/user.php', array('id' => $user->id, 'course' => $course->id));
        $navigation->add(get_string('coursecompletion'), $url);
    }
}
开发者ID:evltuma,项目名称:moodle,代码行数:16,代码来源:lib.php

示例12: report_outline_extend_navigation_user

/**
 * This function extends the course navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $user
 * @param stdClass $course The course to object for the report
 */
function report_outline_extend_navigation_user($navigation, $user, $course)
{
    if (report_outline_can_access_user_report($user, $course)) {
        $url = new moodle_url('/report/outline/user.php', array('id' => $user->id, 'course' => $course->id, 'mode' => 'outline'));
        $navigation->add(get_string('outlinereport'), $url);
        $url = new moodle_url('/report/outline/user.php', array('id' => $user->id, 'course' => $course->id, 'mode' => 'complete'));
        $navigation->add(get_string('completereport'), $url);
    }
}
开发者ID:Hirenvaghasiya,项目名称:moodle,代码行数:16,代码来源:lib.php

示例13: report_teacherreport_extend_navigation_user

/**
 * This function extends the navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $course The course to object for the report
 * @param stdClass $context The context of the course
 */
function report_teacherreport_extend_navigation_user($navigation, $user, $course)
{
    global $CFG, $DB, $PAGE, $USER;
    $context = context_user::instance($USER->id);
    if (has_capability('report/teacherreport:view', $context)) {
        $url = new moodle_url('/report/teacherreport/index.php', array('userid' => $USER->id));
        $navigation->add(get_string('pluginname', 'report_teacherreport'), $url, navigation_node::TYPE_SETTING, null, null, null);
    }
}
开发者ID:AmineBENCHEIKHBRAHIM,项目名称:Moodle-Reporting-Plugin,代码行数:16,代码来源:lib.php

示例14: extend_navigation

 /**
  * Extends the module navigation
  *
  * This function is called when the context for the page is an activity module with the
  * FEATURE_ADVANCED_GRADING and there is an area with the active grading method set to the given plugin.
  *
  * @param global_navigation $navigation {@link global_navigation}
  * @param navigation_node $node {@link navigation_node}
  */
 public function extend_navigation(global_navigation $navigation, navigation_node $node = null)
 {
     if (has_capability('moodle/grade:managegradingforms', $this->get_context())) {
         // no need for preview if user can manage forms, he will have link to manage.php in settings instead
         return;
     }
     if ($this->is_form_defined() && ($options = $this->get_options()) && !empty($options['alwaysshowdefinition'])) {
         $node->add(get_string('gradingof', 'gradingform_rubric', get_grading_manager($this->get_areaid())->get_area_title()), new moodle_url('/grade/grading/form/' . $this->get_method_name() . '/preview.php', array('areaid' => $this->get_areaid())), settings_navigation::TYPE_CUSTOM);
     }
 }
开发者ID:JP-Git,项目名称:moodle,代码行数:19,代码来源:lib.php

示例15: report_stats_extend_navigation_user

/**
 * This function extends the course navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $user
 * @param stdClass $course The course to object for the report
 */
function report_stats_extend_navigation_user($navigation, $user, $course) {
    global $CFG;
    if (!empty($CFG->enablestats)) {
        return;
    }
    if (report_stats_can_access_user_report($user, $course)) {
        $url = new moodle_url('/report/stats/user.php', array('id'=>$user->id, 'course'=>$course->id));
        $navigation->add(get_string('stats'), $url);
    }
}
开发者ID:nigeli,项目名称:moodle,代码行数:17,代码来源:lib.php


注:本文中的navigation_node类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。