| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.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 : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/a/w/e/awebpaca/minedecapgaronne/administrator/components/com_ovacomposer/controllers/ |
Upload File : |
<?php
/**
* @version $Id$
* @author OvaTheme
* @package Joomla.Site
* @subpackage com_ovacomposer
* @copyright Copyright (C) 2013 OvaTheme. All rights reserved.
* @license License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.controlleradmin');
class OvaComposerControllerItem extends JControllerAdmin{
public function getModel($name = 'item', $prefix = 'OvaComposerModel', $config = array('ignore_request' => true)){
$model = parent::getModel($name, $prefix, $config);
return $model;
}
public function getEditor(){
$editor =& JFactory::getEditor();
$pa = array( 'smilies'=> '0' ,
'style' => '1' ,
'layer' => '0' ,
'table' => '0' ,
'clear_entities'=>'0'
);
echo $editor->display( 'pbEditor', '', '100%', '300', '20', '20', false, $pa );
}
public function Save(){
$arr = json_decode(JRequest::getVar('data'));
for($i=0;$i<count($arr);$i++){
$arr[$i]=urldecode($arr[$i]);
}
$id = JRequest::getVar('id');
$name= htmlspecialchars(JRequest::getVar('name'));
$config = rawurldecode(JRequest::getVar('config'));
$keyword= htmlspecialchars(JRequest::getVar('keyword'));
$description= htmlspecialchars(JRequest::getVar('description'));
$robots=htmlspecialchars(JRequest::getVar('robots'));
$author=htmlspecialchars(JRequest::getVar('author'));
$model = $this->getModel();
echo $model->save($arr,$id,$name,$config,$keyword,$description,$robots,$author);
exit();
}
public function duplicate(){
$ids = JRequest::getVar('cid');
$model = $this->getModel();
foreach ($ids as $key => $id) {
$model->duplicate($id);
}
$this->setRedirect('index.php?option=com_ovacomposer');
return true;
}
public function add(){
$this->setRedirect('index.php?option=com_ovacomposer&view=item');
return true;
}
public function edit(){
$model = $this->getModel();
$id = $model->addNewPage(htmlspecialchars(JRequest::getVar('pagename')));
$this->setRedirect('index.php?option=com_ovacomposer&view=item&layout=edit&id='.$id);
return true;
}
public function getImageFolder(){
$folder = JRequest::getVar('folder');
$fol = JPATH_SITE.'/'.$folder;
if(!$dir = @opendir($fol)){
$arr = array("check"=>"0","data"=>"null");
echo json_encode($arr);
die();
};
while (false !== ($file = readdir($dir)))
{
if (preg_match('/.+\.(jpg|jpeg|gif|png)$/i', $file)) {
// check with getimagesize() which attempts to return the image mime-type
if(getimagesize($fol.'/'.$file)!==FALSE){
$files[]=array("admin"=>JURI::root(true).'/'.$folder.'/'.$file,"site"=>$folder.'/'.$file,"name"=>$file);
}
}
}
closedir($dir);
$arr = array("check"=>"1","data"=>$files);
echo json_encode($arr);
die();
}
public function delete(){
$model = $this->getModel();
$model->delete();
$this->setRedirect('index.php?option=com_ovacomposer', JText::_('COM_OVACOMPOSER_DELETE_SUSSESS'));
return true;
}
}