當前位置: 首頁>>代碼示例>>PHP>>正文


PHP portfolio_add_button::reset_formats方法代碼示例

本文整理匯總了PHP中portfolio_add_button::reset_formats方法的典型用法代碼示例。如果您正苦於以下問題:PHP portfolio_add_button::reset_formats方法的具體用法?PHP portfolio_add_button::reset_formats怎麽用?PHP portfolio_add_button::reset_formats使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在portfolio_add_button的用法示例。


在下文中一共展示了portfolio_add_button::reset_formats方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * The constructor
  *
  * @param context $context
  * @param int $sid
  * @param string $filearea
  * @param string $component
  */
 public function __construct(context $context, $sid, $filearea, $component)
 {
     global $CFG;
     $this->context = $context;
     list($context, $course, $cm) = get_context_info_array($context->id);
     $this->cm = $cm;
     $this->course = $course;
     $fs = get_file_storage();
     $this->dir = $fs->get_area_tree($this->context->id, $component, $filearea, $sid);
     $files = $fs->get_area_files($this->context->id, $component, $filearea, $sid, "timemodified", false);
     if (!empty($CFG->enableportfolios)) {
         require_once $CFG->libdir . '/portfoliolib.php';
         if (count($files) >= 1 && has_capability('mod/assign:exportownsubmission', $this->context)) {
             $button = new portfolio_add_button();
             $button->set_callback_options('assign_portfolio_caller', array('cmid' => $this->cm->id, 'sid' => $sid, 'area' => $filearea, 'component' => $component), '/mod/assign/portfolio_callback.php');
             $button->reset_formats();
             $this->portfolioform = $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
         }
     }
     // plagiarism check if it is enabled
     $output = '';
     if (!empty($CFG->enableplagiarism)) {
         require_once $CFG->libdir . '/plagiarismlib.php';
         // for plagiarism_get_links
         $assignment = new assign($this->context, null, null);
         foreach ($files as $file) {
             $output .= plagiarism_get_links(array('userid' => $sid, 'file' => $file, 'cmid' => $this->cm->id, 'course' => $this->course, 'assignment' => $assignment->get_instance()));
             $output .= '<br />';
         }
     }
     $this->preprocess($this->dir, $filearea, $component);
 }
開發者ID:saurabh947,項目名稱:MoodleLearning,代碼行數:40,代碼來源:renderable.php

示例2: __construct

 public function __construct($context, $itemid, $filearea='submission') {
     global $USER, $CFG;
     $this->context = $context;
     list($context, $course, $cm) = get_context_info_array($context->id);
     $this->cm = $cm;
     $this->course = $course;
     $fs = get_file_storage();
     $this->dir = $fs->get_area_tree($this->context->id, 'mod_assignment', $filearea, $itemid);
     if (!empty($CFG->enableportfolios)) {
         require_once($CFG->libdir . '/portfoliolib.php');
         $files = $fs->get_area_files($this->context->id, 'mod_assignment', $filearea, $itemid, "timemodified", false);
         if (count($files) >= 1 && has_capability('mod/assignment:exportownsubmission', $this->context)) {
             $button = new portfolio_add_button();
             $button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'submissionid' => $itemid), '/mod/assignment/locallib.php');
             $button->reset_formats();
             $this->portfolioform = $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
         }
     }
     $this->preprocess($this->dir, $filearea);
 }
開發者ID:JP-Git,項目名稱:moodle,代碼行數:20,代碼來源:renderer.php

示例3: __construct

 /**
  * The constructor
  *
  * @param context $context
  * @param int $sid
  * @param string $filearea
  * @param string $component
  */
 public function __construct(context $context, $sid, $filearea, $component)
 {
     global $CFG;
     $this->context = $context;
     list($context, $course, $cm) = get_context_info_array($context->id);
     $this->cm = $cm;
     $this->course = $course;
     $fs = get_file_storage();
     $this->dir = $fs->get_area_tree($this->context->id, $component, $filearea, $sid);
     $files = $fs->get_area_files($this->context->id, $component, $filearea, $sid, 'timemodified', false);
     if (!empty($CFG->enableportfolios)) {
         require_once $CFG->libdir . '/portfoliolib.php';
         if (count($files) >= 1 && has_capability('mod/assign:exportownsubmission', $this->context)) {
             $button = new portfolio_add_button();
             $callbackparams = array('cmid' => $this->cm->id, 'sid' => $sid, 'area' => $filearea, 'component' => $component);
             $button->set_callback_options('assign_portfolio_caller', $callbackparams, 'mod_assign');
             $button->reset_formats();
             $this->portfolioform = $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
         }
     }
     $this->preprocess($this->dir, $filearea, $component);
 }
開發者ID:MoodleMetaData,項目名稱:MoodleMetaData,代碼行數:30,代碼來源:renderable.php


注:本文中的portfolio_add_button::reset_formats方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。