当前位置: 首页>>代码示例>>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;未经允许,请勿转载。