%PDF-
%PDF-
Mini Shell
Mini Shell
<?php
/**
* @package BaForms
* @author Balbooa http://www.balbooa.com/
* @copyright Copyright @ Balbooa
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
class BaformsControllerForms extends JControllerAdmin
{
/**
* Proxy for getModel.
*/
public function getModel($name = 'form', $prefix = 'baformsModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
public function duplicate()
{
$pks = $this->input->getVar('cid', array(), 'post', 'array');
$model = $this->getModel();
$model->duplicate($pks);
$this->setMessage(JText::plural('FORM_DUPLICATED', count($pks)));
$this->setRedirect('index.php?option=com_baforms&view=forms');
}
public function updateBaforms()
{
$target = $_POST['target'];
$config = JFactory::getConfig();
$path = $config->get('tmp_path') . '/pkg_BaForms.zip';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
$data = curl_exec($ch);
curl_close($ch);
$file = fopen($path, "w+");
fputs($file, $data);
fclose($file);
JArchive::extract($path, $config->get('tmp_path') . '/pkg_BaForms');
$installer = JInstaller::getInstance();
$result = $installer->update($config->get('tmp_path') . '/pkg_BaForms');
JFile::delete($path);
JFolder::delete( $config->get('tmp_path') . '/pkg_BaForms' );
$verion = baformsHelper::aboutUs();
if ($result) {
echo new JResponseJson($result, $verion->version);
} else {
echo new JResponseJson($result, '', true);
}
jexit();
}
}
Zerion Mini Shell 1.0