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

[email protected]: ~ $
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Toolbar\Button;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Toolbar\ToolbarButton;
use Joomla\CMS\Uri\Uri;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Renders a modal window button
 *
 * @method self    url(string $value)
 * @method self    icon(string $value)
 * @method self    iframeWidth(int $value)
 * @method self    iframeHeight(int $value)
 * @method self    bodyHeight(int $value)
 * @method self    modalWidth(string $value)
 * @method self    modalHeight(string $value)
 * @method self    onclose(string $value)
 * @method self    title(string $value)
 * @method self    footer(string $value)
 * @method self    selector(string $value)
 * @method self    listCheck(bool $value)
 * @method self    popupType(string $value)
 * @method self    textHeader(string $value)
 * @method string  getUrl()
 * @method int     getIframeWidth()
 * @method int     getIframeHeight()
 * @method int     getBodyHeight()
 * @method string  getModalWidth()
 * @method string  getModalHeight()
 * @method string  getOnclose()
 * @method string  getTitle()
 * @method string  getFooter()
 * @method string  getSelector()
 * @method bool    getListCheck()
 * @method string  getPopupType()
 * @method string  getTextHeader()
 *
 * @since  3.0
 */
class PopupButton extends ToolbarButton
{
    /**
     * Property layout.
     *
     * @var  string
     *
     * @since  4.0.0
     */
    protected $layout = 'joomla.toolbar.popup';

    /**
     * Prepare options for this button.
     *
     * @param   array  $options  The options about this button.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    protected function prepareOptions(array &$options)
    {
        $options['icon'] = $options['icon'] ?? 'icon-square';

        parent::prepareOptions($options);

        $options['doTask'] = $this->_getCommand($this->getUrl());

        $options['selector'] = $options['selector'] ?? 'modal-' . $this->getName();
    }

    /**
     * Fetch the HTML for the button
     *
     * @param   string   $type          Unused string, formerly button type.
     * @param   string   $name          Modal name, used to generate element ID
     * @param   string   $text          The link text
     * @param   string   $url           URL for popup
     * @param   integer  $iframeWidth   Width of popup
     * @param   integer  $iframeHeight  Height of popup
     * @param   integer  $bodyHeight    Optional height of the modal body in viewport units (vh)
     * @param   integer  $modalWidth    Optional width of the modal in viewport units (vh)
     * @param   string   $onClose       JavaScript for the onClose event.
     * @param   string   $title         The title text
     * @param   string   $footer        The footer html
     *
     * @return  string  HTML string for the button
     *
     * @since   3.0
     */
    public function fetchButton(
        $type = 'Modal',
        $name = '',
        $text = '',
        $url = '',
        $iframeWidth = 640,
        $iframeHeight = 480,
        $bodyHeight = null,
        $modalWidth = null,
        $onClose = '',
        $title = '',
        $footer = null
    ) {
        $this->name($name)
            ->text($text)
            ->task($this->_getCommand($url))
            ->url($url)
            ->icon('icon-' . $name)
            ->iframeWidth($iframeWidth)
            ->iframeHeight($iframeHeight)
            ->bodyHeight($bodyHeight)
            ->modalWidth($modalWidth)
            ->onclose($onClose)
            ->title($title)
            ->footer($footer);

        return $this->renderButton($this->options);
    }

    /**
     * Render button HTML.
     *
     * @param   array  $options  The button options.
     *
     * @return  string  The button HTML.
     *
     * @since   4.0.0
     */
    protected function renderButton(array &$options): string
    {
        $html = [];

        $html[] = parent::renderButton($options);

        if ($this->getPopupType()) {
            return $html[0];
        }

        @trigger_error(
            'Use of BS Modal is deprecated in Joomla\CMS\Toolbar\Button\PopupButton, and will be removed in 6.0',
            E_USER_DEPRECATED
        );

        if ((string) $this->getUrl() !== '') {
            // Build the options array for the modal
            $params               = [];
            $params['title']      = $options['title'] ?? $options['text'];
            $params['url']        = $this->getUrl();
            $params['height']     = $options['iframeHeight'] ?? 480;
            $params['width']      = $options['iframeWidth'] ?? 640;
            $params['bodyHeight'] = $options['bodyHeight'] ?? null;
            $params['modalWidth'] = $options['modalWidth'] ?? null;

            // Place modal div and scripts in a new div
            $html[] = '<div class="btn-group" style="width: 0; margin: 0; padding: 0;">';

            $selector = $options['selector'];

            $footer = $this->getFooter();

            if ($footer !== null) {
                $params['footer'] = $footer;
            }

            $html[] = HTMLHelper::_('bootstrap.renderModal', $selector, $params);

            $html[] = '</div>';

            // We have to move the modal, otherwise we get problems with the backdrop
            // @todo: There should be a better workaround than this
            Factory::getDocument()->addScriptDeclaration(
                <<<JS
document.addEventListener('DOMContentLoaded', function() {
  var modal =document.getElementById('{$options['selector']}');
  document.body.appendChild(modal);
  if (Joomla && Joomla.Bootstrap && Joomla.Bootstrap.Methods && Joomla.Bootstrap.Methods.Modal) {
    Joomla.Bootstrap.Methods.Initialise.Modal(modal);
  }
});
JS
            );
        }

        // If an $onClose event is passed, add it to the modal JS object
        if ((string) $this->getOnclose() !== '') {
            Factory::getDocument()->addScriptDeclaration(
                <<<JS
document.addEventListener('DOMContentLoaded', function() {
	document.querySelector('#{$options['selector']}').addEventListener('hide.bs.modal', function() {
	    {$options['onclose']}
	});
});
JS
            );
        }

        return implode("\n", $html);
    }

    /**
     * Get the JavaScript command for the button
     *
     * @param   string  $url  URL for popup
     *
     * @return  string  JavaScript command string
     *
     * @since   3.0
     */
    private function _getCommand($url)
    {
        $url = $url ?? '';

        if (strpos($url, 'http') !== 0) {
            $url = Uri::base() . $url;
        }

        return $url;
    }

    /**
     * Method to configure available option accessors.
     *
     * @return  array
     *
     * @since   4.0.0
     */
    protected static function getAccessors(): array
    {
        return array_merge(
            parent::getAccessors(),
            [
                'url',
                'iframeWidth',
                'iframeHeight',
                'bodyHeight',
                'modalWidth',
                'modalHeight',
                'onclose',
                'title',
                'footer',
                'selector',
                'listCheck',
                'popupType',
                'textHeader',
            ]
        );
    }
}

Filemanager

Name Type Size Permission Actions
AbstractGroupButton.php File 1.55 KB 0664
BasicButton.php File 1.06 KB 0664
ConfirmButton.php File 3.02 KB 0664
CustomButton.php File 1.67 KB 0664
DropdownButton.php File 3.14 KB 0664
HelpButton.php File 3.27 KB 0664
InlinehelpButton.php File 2.71 KB 0664
LinkButton.php File 2.08 KB 0664
PopupButton.php File 7.43 KB 0664
SeparatorButton.php File 915 B 0664
StandardButton.php File 3.65 KB 0664
Filemanager