當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。