Skip to content

Commit

Permalink
Merge commit 'bb166d2700d641c163dc78ad52d0ba40433d7622' into mdl403-f…
Browse files Browse the repository at this point in the history
…eature-dragdrop
  • Loading branch information
grabs committed Jan 28, 2024
2 parents 566b1ce + bb166d2 commit 4bad5b8
Showing 1 changed file with 24 additions and 38 deletions.
62 changes: 24 additions & 38 deletions type/imageboard/classes/output/edit_element.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,22 @@ public function get_elements_name() {
/**
* Get the form elements as array in the order they should be printed out.
*
* @return array
* @return \HTML_QuickForm_element[]
*/
public function get_elements() {
$elements = [];

$inputidbase = 'id_' . $this->prefix . 'url_';
$pickerbutton = new \mod_unilabel\output\component\activity_picker_button($this->formid, $inputidbase);

$elements[] = $this->render_element(
$this->get_textfield(
'title',
['size' => 50]
)
$elements[] = $this->get_textfield(
'title',
['size' => 50]
);
$elements[] = $this->render_element(
$this->get_filemanager(
'image',
[],
$this->manager_options()
)
$elements[] = $this->get_filemanager(
'image',
[],
$this->manager_options()
);

// The position and the target are grouped elements built by:
Expand All @@ -80,9 +76,7 @@ public function get_elements() {
'yposition',
['size' => 4, 'placeholder' => get_string('placeholder_yposition', $this->component)]
);
$elements[] = $this->render_element(
$this->get_group('position', [$xposition, $yposition], null, false, 'position')
);
$elements[] = $this->get_group('position', [$xposition, $yposition], null, false, 'position');

$targetwidth = $this->get_textfield(
'targetwidth',
Expand All @@ -92,9 +86,7 @@ public function get_elements() {
'targetheight',
['size' => 4, 'placeholder' => get_string('placeholder_targetheight', $this->component)]
);
$elements[] = $this->render_element(
$this->get_group('targetsize', [$targetwidth, $targetheight], null, false, 'targetsize')
);
$elements[] = $this->get_group('targetsize', [$targetwidth, $targetheight], null, false, 'targetsize');

$urlelement = $this->get_textfield(
'url',
Expand All @@ -106,32 +98,26 @@ public function get_elements() {
'',
get_string('newwindow')
);
$elements[] = $this->render_element(
$this->get_group(
'urlgroup',
[$urlelement, $newwindowelement],
null,
false,
'url',
get_string('url', $this->component) . '-' . ($this->repeatindex + 1)
)
$elements[] = $this->get_group(
'urlgroup',
[$urlelement, $newwindowelement],
null,
false,
'url',
get_string('url', $this->component) . '-' . ($this->repeatindex + 1)
);

$elements[] = $this->render_element(
$this->get_static(
'picker',
$this->output->render(
$pickerbutton
)
$elements[] = $this->get_static(
'picker',
$this->output->render(
$pickerbutton
)
);

$numbers = array_combine(range(0, 10, 1), range(0, 10, 1));
$elements[] = $this->render_element(
$this->get_select(
'border',
$numbers
)
$elements[] = $this->get_select(
'border',
$numbers
);

return $elements;
Expand Down

0 comments on commit 4bad5b8

Please sign in to comment.