Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/monara/public_html/test.athavaneng.com/themes.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230

Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
. /** * Provides the {@see core_webservice\token_filter} class. * * @package core_webservice * @copyright 2020 David Mudrák * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_webservice; use moodleform; /** * Form allowing to filter displayed tokens. * * @copyright 2020 David Mudrák * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class token_filter extends moodleform { /** * Defines the form fields. */ public function definition() { global $DB; $mform = $this->_form; $presetdata = $this->_customdata; $mform->addElement('header', 'tokenfilter', get_string('tokenfilter', 'webservice')); if (empty($presetdata->token) && empty($presetdata->users) && empty($presetdata->services)) { $mform->setExpanded('tokenfilter', false); } else { $mform->setExpanded('tokenfilter', true); } // Token. $mform->addElement('text', 'token', get_string('token', 'core_webservice'), ['size' => 32]); $mform->setType('token', PARAM_ALPHANUM); // User selector. $attributes = [ 'multiple' => true, 'ajax' => 'core_user/form_user_selector', 'valuehtmlcallback' => function($userid) { global $DB, $OUTPUT; $context = \context_system::instance(); $fields = \core_user\fields::for_name()->with_identity($context, false); $record = \core_user::get_user($userid, 'id' . $fields->get_sql()->selects, MUST_EXIST); $user = (object)[ 'id' => $record->id, 'fullname' => fullname($record, has_capability('moodle/site:viewfullnames', $context)), 'extrafields' => [], ]; foreach ($fields->get_required_fields([\core_user\fields::PURPOSE_IDENTITY]) as $extrafield) { $user->extrafields[] = (object)[ 'name' => $extrafield, 'value' => s($record->$extrafield) ]; } return $OUTPUT->render_from_template('core_user/form_user_selector_suggestion', $user); }, ]; $mform->addElement('autocomplete', 'users', get_string('user'), [], $attributes); // Service selector. $options = $DB->get_records_menu('external_services', null, '', 'id, name'); $attributes = [ 'multiple' => true, ]; $mform->addElement('autocomplete', 'services', get_string('service', 'webservice'), $options, $attributes); // Action buttons. $mform->addGroup([ $mform->createElement('submit', 'submitbutton', get_string('tokenfiltersubmit', 'core_webservice')), $mform->createElement('submit', 'resetbutton', get_string('tokenfilterreset', 'core_webservice'), [], false), ], 'actionbuttons', '', ' ', false); } }