• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP navigation_node类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: completion_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 completion_report_extend_navigation($navigation, $course, $context)
{
    global $CFG, $OUTPUT;
    if (has_capability('coursereport/completion:view', $context)) {
        $completion = new completion_info($course);
        if ($completion->is_enabled() && $completion->has_criteria()) {
            $url = new moodle_url('/course/report/completion/index.php', array('course' => $course->id));
            $navigation->add(get_string('pluginname', 'coursereport_completion'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
        }
    }
}
开发者ID:vuchannguyen,项目名称:web,代码行数:18,代码来源:lib.php


示例17: report_competency_extend_navigation_course

/**
 * 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_competency_extend_navigation_course($navigation, $course, $context)
{
    if (!get_config('core_competency', 'enabled')) {
        return;
    }
    if (has_capability('moodle/competency:coursecompetencyview', $context)) {
        $url = new moodle_url('/report/competency/index.php', array('id' => $course->id));
        $name = get_string('pluginname', 'report_competency');
        $navigation->add($name, $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
    }
}
开发者ID:evltuma,项目名称:moodle,代码行数:18,代码来源:lib.php


示例18: tool_monitor_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_monitor_extend_navigation_user_settings($navigation, $user, $usercontext, $course, $coursecontext)
{
    global $USER;
    if ($USER->id == $user->id && has_capability('tool/monitor:subscribe', $coursecontext)) {
        $url = new moodle_url('/admin/tool/monitor/index.php', array('courseid' => $course->id));
        $subsnode = navigation_node::create(get_string('managesubscriptions', 'tool_monitor'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/settings', ''));
        if (isset($subsnode) && !empty($navigation)) {
            $navigation->add_node($subsnode);
        }
    }
}
开发者ID:HuiChangZhai,项目名称:moodle,代码行数:20,代码来源:lib.php


示例19: report_comments_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_comments_extend_navigation_user($navigation, $user, $course)
{
    global $CFG;
    $context = context_course::instance($course->id);
    if (has_capability('report/comments:view', $context)) {
        if ($CFG->usecomments) {
            $url = new moodle_url('/report/comments/index.php', array('course' => $course->id, 'id' => $user->id));
            $navigation->add(get_string('comments'), $url);
        }
    }
}
开发者ID:ewallah,项目名称:moodle-report_comments,代码行数:18,代码来源:lib.php


示例20: add_course_navigation

 /**
  * Returns enrolment instance manage link.
  *
  * By defaults looks for manage.php file and tests for manage capability.
  *
  * @param navigation_node $instancesnode
  * @param stdClass $instance
  * @return moodle_url;
  */
 public function add_course_navigation($instancesnode, stdClass $instance)
 {
     if ($instance->enrol !== 'manual') {
         throw new coding_exception('Invalid enrol instance type!');
     }
     $context = context_course::instance($instance->courseid);
     if (has_capability('enrol/manual:config', $context)) {
         $managelink = new moodle_url('/enrol/manual/edit.php', array('courseid' => $instance->courseid));
         $instancesnode->add($this->get_instance_name($instance), $managelink, navigation_node::TYPE_SETTING);
     }
 }
开发者ID:netspotau,项目名称:moodle-mod_assign,代码行数:20,代码来源:lib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nc_Core类代码示例发布时间:2022-05-23
下一篇:
PHP navigation_cache类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap