| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.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 : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nice/components/com_jce/editor/plugins/imgmanager/ |
Upload File : |
<?php
/**
* @package JCE
* @subpackage Editor
*
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
class WFImgManagerPlugin extends WFMediaManager
{
public $_filetypes = 'jpg,jpeg,png,apng,gif,webp,avif';
protected $name = 'imgmanager';
public function __construct($config = array())
{
$config['colorpicker'] = true;
parent::__construct($config);
$this->addFileBrowserEvent('onUpload', array($this, 'onUpload'));
}
/**
* Display the plugin.
*/
public function display()
{
parent::display();
$document = WFDocument::getInstance();
// create new tabs instance
$tabs = WFTabs::getInstance(array(
'base_path' => WF_EDITOR_PLUGINS . '/imgmanager',
));
// Add tabs
$tabs->addTab('image', 1, array('plugin' => $this));
if ($this->allowEvents()) {
$tabs->addTab('rollover', $this->getParam('tabs_rollover', 1));
}
$tabs->addTab('advanced', $this->getParam('tabs_advanced', 1));
$document->addScript(array('imgmanager'), 'plugins');
$document->addStyleSheet(array('imgmanager'), 'plugins');
$document->addScriptDeclaration('ImageManagerDialog.settings=' . json_encode($this->getSettings()) . ';');
}
public function getDefaultAttributes()
{
return parent::getDefaultAttributes();
}
public function onUpload($file, $relative = '')
{
parent::onUpload($file, $relative);
$app = Factory::getApplication();
// inline upload
if ($app->input->getInt('inline', 0) === 1) {
$result = array(
'file' => $relative,
'name' => WFUtility::mb_basename($relative),
);
if ($this->getParam('always_include_dimensions', 1)) {
$dim = @getimagesize($file);
if ($dim) {
$result['width'] = $dim[0];
$result['height'] = $dim[1];
}
}
$result = array_merge($result, array('attributes' => $this->getDefaultAttributes()));
return $result;
}
return array();
}
public function getSettings($settings = array())
{
$settings = array(
'always_include_dimensions' => (bool) $this->getParam('always_include_dimensions', 1),
);
return parent::getSettings($settings);
}
}