本文整理汇总了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);
}
示例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);
}
示例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);
}