| 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/new-saint-martin/plugins/system/jtaldef/field/ |
Upload File : |
<?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
*/
defined('JPATH_PLATFORM') or die;
\JLoader::registerNamespace('Jtaldef', JPATH_PLUGINS . '/system/jtaldef/src', false, false, 'psr4');
use Joomla\CMS\HTML\HTMLHelper;
use Jtaldef\Helper\JtaldefHelper;
use Joomla\CMS\Language\Text;
/**
* List of supported frameworks
*
* @since 2.0.0
*/
class JFormFieldJtaldefClearCache extends JFormField
{
/**
* 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>';
HTMLHelper::_(
'script',
'plg_system_jtaldef/jtaldefClickAction.js',
array('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 '';
}
}