AnonSec Shell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.144
Web Server : Apache
System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : maitricfuz ( 93378)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maitricfuz/www/saint-martin-lg/plugins/system/jtaldef/field/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/saint-martin-lg/plugins/system/jtaldef/field/jtaldefclearcache.php
<?php

/**
 * Automatic local download external files
 *
 * @package     Joomla.Plugin
 * @subpackage  System.Jtaldef
 *
 * @author      Guido De Gobbis <support@joomtools.de>
 * @copyright   JoomTools.de - All rights reserved.
 * @license     GNU General Public License version 3 or later
 */

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

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\WebAsset\WebAssetManager;
use JoomTools\Plugin\System\Jtaldef\Helper\JtaldefHelper;

/**
 * List of supported frameworks
 *
 * @since  2.0.0
 */
class JFormFieldJtaldefClearCache extends FormField
{
    /**
     * The form field type.
     *
     * @var    string
     * @since  2.0.0
     */
    protected $type = 'JtaldefClearCache';

    /**
     * Summary of indexed items
     *
     * @var    integer
     * @since  2.0.0
     */
    protected $indexedItems;

    /**
     * Generate the field output
     *
     * @return  string
     *
     * @since   2.0.0
     */
    public function getInput()
    {
        $indexedItems = $this->countIndexedItems();
        $disabled     = $indexedItems < 1 ? 'class="btn btn-secondary" disabled' : 'class="btn btn-primary"';
        $clickAction  = 'index.php?option=com_ajax&group=system&plugin=JtaldefClearCache&format=json';

        $content = '<p>' . Text::sprintf('PLG_SYSTEM_JTALDEF_CLEAR_CACHE_INFO', $indexedItems);
        $content .= '<button id="jtaldefClearCache" data-action="' . $clickAction . '" ' . $disabled . '>';
        $content .= Text::_('PLG_SYSTEM_JTALDEF_CLEAR_CACHE_LABEL') . '</button></p>';

        /** @var CMSApplication $app */
        $app = Factory::getApplication();

        /** @var WebAssetManager $wa */
        $wa = $app->getDocument()->getWebAssetManager();

        $wa->registerAndUseScript(
            'jtaldefClickAction',
            'plg_system_jtaldef/jtaldefClickAction.js',
            ['version' => 'auto', 'relative' => true],
            [],
            []
        );

        return $content;
    }

    /**
     * Count indexed items
     *
     * @return  integer
     *
     * @since   2.0.0
     */
    private function countIndexedItems()
    {
        if (null !== $this->indexedItems) {
            return $this->indexedItems;
        }

        if (file_exists(JPATH_ROOT . '/' . JtaldefHelper::JTALDEF_UPLOAD . '/fileindex')) {
            $this->indexedItems = \count(
                json_decode(
                    file_get_contents(JPATH_ROOT . '/' . JtaldefHelper::JTALDEF_UPLOAD . '/fileindex'),
                    true
                )
            );
        }

        return (int) $this->indexedItems;
    }

    /**
     * Generate the label for the field
     *
     * @return  string
     *
     * @since   2.0.0
     */
    public function getLabel()
    {
        return '';
    }
}

Anon7 - 2022
AnonSec Team