-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b4b7b8
commit ab3c508
Showing
40 changed files
with
309 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,11 @@ | |
/** | ||
* Modal form to create single option dates which are not part of the date series. | ||
* | ||
* @package mod_booking | ||
* @package local_musi | ||
* @copyright 2022 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class botags_modal_form extends \core_form\dynamic_form { | ||
|
||
protected function get_context_for_dynamic_submission(): \context { | ||
return \context_system::instance(); | ||
} | ||
|
@@ -42,13 +41,18 @@ public function definition() { | |
|
||
$existingbotagsarray = self::get_existing_botags_array(); | ||
|
||
$mform->addElement('autocomplete', 'botags', get_string('editbotags', 'local_musi'), | ||
$existingbotagsarray, [ | ||
$mform->addElement( | ||
'autocomplete', | ||
'botags', | ||
get_string('editbotags', 'local_musi'), | ||
$existingbotagsarray, | ||
[ | ||
'tags' => true, | ||
'multiple' => true, | ||
'placeholder' => get_string('createbotag', 'local_musi'), | ||
'showsuggestions' => false | ||
]); | ||
'showsuggestions' => false, | ||
] | ||
); | ||
|
||
$mform->addElement('html', get_string('createbotag:helptext', 'local_musi')); | ||
} | ||
|
@@ -86,7 +90,7 @@ public function process_dynamic_submission() { | |
|
||
foreach ($data->botags as $key => $value) { | ||
if (!$DB->get_record('local_musi_botags', ['botag' => $value])) { | ||
$newbotagrecord = new stdClass; | ||
$newbotagrecord = new stdClass(); | ||
$newbotagrecord->botag = $value; | ||
$DB->insert_record('local_musi_botags', $newbotagrecord); | ||
} | ||
|
@@ -109,7 +113,7 @@ protected function get_page_url_for_dynamic_submission(): \moodle_url { | |
* | ||
* @return array array of existing botags | ||
*/ | ||
private static function get_existing_botags_array (): array { | ||
private static function get_existing_botags_array(): array { | ||
global $DB; | ||
$existingbotagrecords = $DB->get_records('local_musi_botags'); | ||
$existingbotagsarray = []; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,9 +33,9 @@ | |
* @copyright Wunderbyte GmbH <[email protected]> | ||
* @author Bernhard Fischer | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @package local_musi | ||
*/ | ||
class sports_form extends dynamic_form { | ||
|
||
/** | ||
* {@inheritdoc} | ||
* @see moodleform::definition() | ||
|
@@ -145,7 +145,7 @@ protected function get_page_url_for_dynamic_submission(): moodle_url { | |
if (!$cmid) { | ||
$cmid = $this->optional_param('cmid', '', PARAM_RAW); | ||
} | ||
return new moodle_url('/local/musi/editoptions', array('id' => $cmid)); | ||
return new moodle_url('/local/musi/editoptions', ['id' => $cmid]); | ||
} | ||
|
||
/** | ||
|
@@ -156,7 +156,7 @@ protected function get_page_url_for_dynamic_submission(): moodle_url { | |
*/ | ||
public function validation($data, $files) { | ||
|
||
$errors = array(); | ||
$errors = []; | ||
|
||
return $errors; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.