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


PHP enrol_plugin::can_hide_show_instance方法代码示例

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


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

示例1: col_edit

 /**
  * Generate the edit column.
  *
  * @param \stdClass $tool event data.
  * @return string
  */
 public function col_edit($tool)
 {
     global $OUTPUT;
     $buttons = array();
     $instance = new \stdClass();
     $instance->id = $tool->enrolid;
     $instance->courseid = $tool->courseid;
     $instance->enrol = 'lti';
     $instance->status = $tool->status;
     $strdelete = get_string('delete');
     $strenable = get_string('enable');
     $strdisable = get_string('disable');
     $url = new \moodle_url('/enrol/lti/index.php', array('sesskey' => sesskey(), 'courseid' => $this->courseid));
     if ($this->ltiplugin->can_delete_instance($instance)) {
         $aurl = new \moodle_url($url, array('action' => 'delete', 'instanceid' => $instance->id));
         $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/delete', $strdelete, 'core', array('class' => 'iconsmall')));
     }
     if ($this->ltienabled && $this->ltiplugin->can_hide_show_instance($instance)) {
         if ($instance->status == ENROL_INSTANCE_ENABLED) {
             $aurl = new \moodle_url($url, array('action' => 'disable', 'instanceid' => $instance->id));
             $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/hide', $strdisable, 'core', array('class' => 'iconsmall')));
         } else {
             if ($instance->status == ENROL_INSTANCE_DISABLED) {
                 $aurl = new \moodle_url($url, array('action' => 'enable', 'instanceid' => $instance->id));
                 $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/show', $strenable, 'core', array('class' => 'iconsmall')));
             }
         }
     }
     if ($this->ltienabled && $this->canconfig) {
         $linkparams = array('courseid' => $instance->courseid, 'id' => $instance->id, 'type' => $instance->enrol, 'returnurl' => new \moodle_url('/enrol/lti/index.php', array('courseid' => $this->courseid)));
         $editlink = new \moodle_url("/enrol/editinstance.php", $linkparams);
         $buttons[] = $OUTPUT->action_icon($editlink, new \pix_icon('t/edit', get_string('edit'), 'core', array('class' => 'iconsmall')));
     }
     return implode(' ', $buttons);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:41,代码来源:manage_table.php


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