Skip to content

Commit

Permalink
Deleted Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Oni01110011 committed Jun 18, 2024
1 parent 3a0fa5b commit e6f3ec5
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions classes/newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ private function view_edit_issue_page(array $params) {
$draftitemid = file_get_submitted_draft_itemid('attachments');
$ctx = $options['context'];


if (!$this->check_issue_id($params[NEWSLETTER_PARAM_ISSUE])) {
throw new moodle_exception (
'Wrong ' . NEWSLETTER_PARAM_ISSUE . ' parameter value: ' . $params[NEWSLETTER_PARAM_ISSUE]
Expand Down Expand Up @@ -847,14 +846,14 @@ private function view_edit_issue_page(array $params) {
);

$fpoptions = array();
if ($options['maxfiles'] != 0 ) {
if($options['maxfiles'] != 0 ) {
$args = new stdClass();
// need these three to filter repositories list

$args->accepted_types = array('web_image');
$args->return_types = $options['return_types'];
$args->context = $ctx;
$args->env = 'filepicker';
// advimage plugin

$image_options = initialise_filepicker($args);
$image_options->context = $ctx;
$image_options->client_id = uniqid();
Expand All @@ -863,7 +862,6 @@ private function view_edit_issue_page(array $params) {
$image_options->env = 'editor';
$image_options->itemid = $draftitemid;

// moodlemedia plugin
$args->accepted_types = array('video', 'audio');
$media_options = initialise_filepicker($args);
$media_options->context = $ctx;
Expand All @@ -873,7 +871,6 @@ private function view_edit_issue_page(array $params) {
$media_options->env = 'editor';
$media_options->itemid = $draftitemid;

// advlink plugin
$args->accepted_types = '*';
$link_options = initialise_filepicker($args);
$link_options->context = $ctx;
Expand All @@ -892,34 +889,23 @@ private function view_edit_issue_page(array $params) {
$subtitle_options->env = 'editor';
$subtitle_options->itemid = $draftitemid;

if (has_capability('moodle/h5p:deploy', $ctx)) {
// Only set H5P Plugin settings if the user can deploy new H5P content.
// H5P plugin.
$args->accepted_types = array('.h5p');
$h5poptions = initialise_filepicker($args);
$h5poptions->context = $ctx;
$h5poptions->client_id = uniqid();
$h5poptions->maxbytes = $options['maxbytes'];
$h5poptions->areamaxbytes = $options['areamaxbytes'];
$h5poptions->env = 'editor';
$h5poptions->itemid = $draftitemid;
$fpoptions['h5p'] = $h5poptions;
}
$args->accepted_types = ['h5p'];
$h5poptions = initialise_filepicker($args);
$h5poptions->context = $this->context;
$h5poptions->client_id = uniqid();
$h5poptions->maxbytes = $options['maxbytes'];
$h5poptions->env = 'editor';
$h5poptions->itemid = $draftitemid;

$fpoptions['image'] = $image_options;
$fpoptions['media'] = $media_options;
$fpoptions['link'] = $link_options;
$fpoptions['subtitle'] = $subtitle_options;
$fpoptions['h5p'] = $h5poptions;
}

$editor = new newsletter_editor();

// TODO Remove this in MDL-77334 for Moodle 4.6.
// If editor is required and tinymce, then set required_tinymce option to initalize tinymce validation.
if (($editor instanceof tinymce_texteditor) && !is_null($this->getAttribute('onchange'))) {
$options['required'] = true;
}

$editor->use_editor($draftitemid, $options, $fpoptions, $issue, $files);
$editor->use_editor('id_htmlcontent', $options, $fpoptions, $issue, $files);
$mform = new issue_form(
null,
array('newsletter' => $this, 'issue' => $issue, 'context' => $context)
Expand Down

0 comments on commit e6f3ec5

Please sign in to comment.