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


PHP coursecat::can_review_permissions方法代码示例

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


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

示例1: get_category_listitem_actions

 /**
  * Returns an array of actions that can be performed upon a category being shown in a list.
  *
  * @param \coursecat $category
  * @return array
  */
 public static function get_category_listitem_actions(\coursecat $category)
 {
     global $PAGE;
     $baseurl = new \moodle_url('/course/management.php', array('categoryid' => $category->id, 'sesskey' => \sesskey()));
     $actions = array();
     // Edit.
     if ($category->can_edit()) {
         $actions['edit'] = array('url' => new \moodle_url('/course/editcategory.php', array('id' => $category->id)), 'icon' => new \pix_icon('t/edit', new \lang_string('edit')), 'string' => new \lang_string('edit'));
     }
     // Show/Hide.
     if ($category->can_change_visibility()) {
         // We always show both icons and then just toggle the display of the invalid option with CSS.
         $actions['hide'] = array('url' => new \moodle_url($baseurl, array('action' => 'hidecategory')), 'icon' => new \pix_icon('t/hide', new \lang_string('hide')), 'string' => new \lang_string('hide'));
         $actions['show'] = array('url' => new \moodle_url($baseurl, array('action' => 'showcategory')), 'icon' => new \pix_icon('t/show', new \lang_string('show')), 'string' => new \lang_string('show'));
     }
     // Move up/down.
     if ($category->can_change_sortorder()) {
         $actions['moveup'] = array('url' => new \moodle_url($baseurl, array('action' => 'movecategoryup')), 'icon' => new \pix_icon('t/up', new \lang_string('up')), 'string' => new \lang_string('up'));
         $actions['movedown'] = array('url' => new \moodle_url($baseurl, array('action' => 'movecategorydown')), 'icon' => new \pix_icon('t/down', new \lang_string('down')), 'string' => new \lang_string('down'));
     }
     if ($category->can_create_subcategory()) {
         $actions['createnewsubcategory'] = array('url' => new \moodle_url('/course/editcategory.php', array('parent' => $category->id)), 'icon' => new \pix_icon('i/withsubcat', new \lang_string('createnewsubcategory')), 'string' => new \lang_string('createnewsubcategory'));
     }
     // Resort.
     if ($category->can_resort_subcategories() && $category->has_children()) {
         $actions['resortbyname'] = array('url' => new \moodle_url($baseurl, array('action' => 'resortcategories', 'resort' => 'name')), 'icon' => new \pix_icon('t/sort', new \lang_string('sort')), 'string' => new \lang_string('resortsubcategoriesby', 'moodle', get_string('categoryname')));
         $actions['resortbynamedesc'] = array('url' => new \moodle_url($baseurl, array('action' => 'resortcategories', 'resort' => 'namedesc')), 'icon' => new \pix_icon('t/sort', new \lang_string('sort')), 'string' => new \lang_string('resortsubcategoriesbyreverse', 'moodle', get_string('categoryname')));
         $actions['resortbyidnumber'] = array('url' => new \moodle_url($baseurl, array('action' => 'resortcategories', 'resort' => 'idnumber')), 'icon' => new \pix_icon('t/sort', new \lang_string('sort')), 'string' => new \lang_string('resortsubcategoriesby', 'moodle', get_string('idnumbercoursecategory')));
         $actions['resortbyidnumberdesc'] = array('url' => new \moodle_url($baseurl, array('action' => 'resortcategories', 'resort' => 'idnumberdesc')), 'icon' => new \pix_icon('t/sort', new \lang_string('sort')), 'string' => new \lang_string('resortsubcategoriesbyreverse', 'moodle', get_string('idnumbercoursecategory')));
     }
     // Delete.
     if ($category->can_delete_full()) {
         $actions['delete'] = array('url' => new \moodle_url($baseurl, array('action' => 'deletecategory')), 'icon' => new \pix_icon('t/delete', new \lang_string('delete')), 'string' => new \lang_string('delete'));
     }
     // Assign roles.
     if ($category->can_review_roles()) {
         $actions['assignroles'] = array('url' => new \moodle_url('/admin/roles/assign.php', array('contextid' => $category->get_context()->id, 'returnurl' => $PAGE->url->out_as_local_url(false))), 'icon' => new \pix_icon('t/assignroles', new \lang_string('assignroles', 'role')), 'string' => new \lang_string('assignroles', 'role'));
     }
     // Permissions.
     if ($category->can_review_permissions()) {
         $actions['permissions'] = array('url' => new \moodle_url('/admin/roles/permissions.php', array('contextid' => $category->get_context()->id, 'returnurl' => $PAGE->url->out_as_local_url(false))), 'icon' => new \pix_icon('i/permissions', new \lang_string('permissions', 'role')), 'string' => new \lang_string('permissions', 'role'));
     }
     // Check permissions.
     if ($category->can_review_permissions()) {
         $actions['checkroles'] = array('url' => new \moodle_url('/admin/roles/check.php', array('contextid' => $category->get_context()->id, 'returnurl' => $PAGE->url->out_as_local_url(false))), 'icon' => new \pix_icon('i/checkpermissions', new \lang_string('checkpermissions', 'role')), 'string' => new \lang_string('checkpermissions', 'role'));
     }
     // Cohorts.
     if ($category->can_review_cohorts()) {
         $actions['cohorts'] = array('url' => new \moodle_url('/cohort/index.php', array('contextid' => $category->get_context()->id)), 'icon' => new \pix_icon('t/cohort', new \lang_string('cohorts', 'cohort')), 'string' => new \lang_string('cohorts', 'cohort'));
     }
     // Filters.
     if ($category->can_review_filters()) {
         $actions['filters'] = array('url' => new \moodle_url('/filter/manage.php', array('contextid' => $category->get_context()->id, 'return' => 'management')), 'icon' => new \pix_icon('i/filter', new \lang_string('filters', 'admin')), 'string' => new \lang_string('filters', 'admin'));
     }
     if ($category->can_restore_courses_into()) {
         $actions['restore'] = array('url' => new \moodle_url('/backup/restorefile.php', array('contextid' => $category->get_context()->id)), 'icon' => new \pix_icon('i/restore', new \lang_string('restorecourse', 'admin')), 'string' => new \lang_string('restorecourse', 'admin'));
     }
     return $actions;
 }
开发者ID:EsdrasCaleb,项目名称:moodle,代码行数:65,代码来源:helper.php


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