first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Filesystem\Folder;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerQuantumcodemirror
|
||||
*/
|
||||
class QuantummanagerControllerQuantumcodemirror extends QuantummanagerController
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Filesystem\Folder;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerQuantumcropperjs
|
||||
*/
|
||||
class QuantummanagerControllerQuantumcropperjs extends QuantummanagerController
|
||||
{
|
||||
|
||||
public function getImageForCrop()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if(!isset($data['path'], $data['scope'], $data['file']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::getImageForCrop($data['path'], $data['scope'], $data['file']);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
|
||||
public function save()
|
||||
{
|
||||
|
||||
$app = Factory::getApplication();
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::converterSave();
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerQuantummanager
|
||||
*/
|
||||
class QuantummanagerControllerQuantummanager extends QuantummanagerController
|
||||
{
|
||||
|
||||
|
||||
public function hideJedReview()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
JLoader::register('QuantummanagerHelper', JPATH_ROOT . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
|
||||
if((int)QuantummanagerHelper::getParamsComponentValue('reivew', 1))
|
||||
{
|
||||
QuantummanagerHelper::setComponentsParams('review', "0");
|
||||
}
|
||||
|
||||
$app->close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Http\Transport\CurlTransport;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Filesystem\File;
|
||||
use Joomla\Filesystem\Folder;
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerquantumpexels
|
||||
*/
|
||||
class QuantummanagerControllerquantumpexels extends QuantummanagerController
|
||||
{
|
||||
|
||||
|
||||
public function search()
|
||||
{
|
||||
|
||||
$app = Factory::getApplication();
|
||||
|
||||
try
|
||||
{
|
||||
$data = Factory::getApplication()->input->getArray();
|
||||
$dataForRequest = [
|
||||
'q' => '',
|
||||
'page' => '1',
|
||||
];
|
||||
|
||||
$fields = [
|
||||
'q',
|
||||
'page',
|
||||
'locale'
|
||||
];
|
||||
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
if(isset($data[$field]))
|
||||
{
|
||||
$dataForRequest[$field] = $data[$field];
|
||||
}
|
||||
}
|
||||
|
||||
$query = http_build_query([
|
||||
'option' => 'com_yoohikashop',
|
||||
'task' => 'pexels.search'
|
||||
]);
|
||||
|
||||
$curlTransport = new CurlTransport(new Registry());
|
||||
$uri = new Uri();
|
||||
$uri->setScheme('https');
|
||||
$uri->setHost('hika.su/');
|
||||
$uri->setPath('index.php');
|
||||
$uri->setQuery($query);
|
||||
$request = $curlTransport->request('POST', $uri, $dataForRequest);
|
||||
echo $request->body;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
|
||||
public function download()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = Factory::getApplication()->input->getArray();
|
||||
$file = $data['file'];
|
||||
|
||||
if(!isset($data['file'], $data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$file = $data['file'];
|
||||
$id = $data['id'];
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::downloadFilePexels($path, $scope, $file, $id);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Http\Transport\CurlTransport;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Filesystem\File;
|
||||
use Joomla\Filesystem\Folder;
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerquantumpixabay
|
||||
*/
|
||||
class QuantummanagerControllerquantumpixabay extends QuantummanagerController
|
||||
{
|
||||
|
||||
|
||||
public function search()
|
||||
{
|
||||
|
||||
$app = Factory::getApplication();
|
||||
|
||||
try
|
||||
{
|
||||
$data = Factory::getApplication()->input->getArray();
|
||||
$dataForRequest = [
|
||||
'q' => '',
|
||||
'page' => '1',
|
||||
];
|
||||
|
||||
$fields = [
|
||||
'q',
|
||||
'page',
|
||||
'colors',
|
||||
'orientation',
|
||||
'size',
|
||||
'image_type',
|
||||
];
|
||||
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
if(isset($data[$field]))
|
||||
{
|
||||
$dataForRequest[$field] = $data[$field];
|
||||
}
|
||||
}
|
||||
|
||||
$query = http_build_query([
|
||||
'option' => 'com_yoohikashop',
|
||||
'task' => 'pixabay.search'
|
||||
]);
|
||||
|
||||
$curlTransport = new CurlTransport(new Registry());
|
||||
$uri = new Uri();
|
||||
$uri->setScheme('https');
|
||||
$uri->setHost('hika.su/');
|
||||
$uri->setPath('index.php');
|
||||
$uri->setQuery($query);
|
||||
$request = $curlTransport->request('POST', $uri, $dataForRequest);
|
||||
echo $request->body;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
|
||||
public function download()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = Factory::getApplication()->input->getArray();
|
||||
$file = $data['file'];
|
||||
|
||||
if(!isset($data['file'], $data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$file = $data['file'];
|
||||
$id = $data['id'];
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::downloadFilePixabay($path, $scope, $file, $id);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Filesystem\Folder;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerQuantumtreecatalogs
|
||||
*/
|
||||
class QuantummanagerControllerQuantumtreecatalogs extends QuantummanagerController
|
||||
{
|
||||
|
||||
public function getDirectories()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if(!isset($data['path']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = isset($data['scope']) ? $data['scope'] : '';
|
||||
$rootSplit = explode('/', $data['root']);
|
||||
|
||||
if(isset($rootSplit[0]))
|
||||
{
|
||||
$root = $rootSplit[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$root = '';
|
||||
}
|
||||
|
||||
if(empty($scope))
|
||||
{
|
||||
$scope = 'all';
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::getScopesDirectories($path, $root, $scope);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Http\Transport\CurlTransport;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Filesystem\File;
|
||||
use Joomla\Filesystem\Folder;
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerquantumunsplash
|
||||
*/
|
||||
class QuantummanagerControllerquantumunsplash extends QuantummanagerController
|
||||
{
|
||||
|
||||
|
||||
public function search()
|
||||
{
|
||||
|
||||
$app = Factory::getApplication();
|
||||
|
||||
try
|
||||
{
|
||||
$data = Factory::getApplication()->input->getArray();
|
||||
$dataForRequest = [
|
||||
'q' => '',
|
||||
'page' => '1',
|
||||
];
|
||||
|
||||
if(isset($data['q']))
|
||||
{
|
||||
$dataForRequest['q'] = $data['q'];
|
||||
}
|
||||
|
||||
if(isset($data['page']))
|
||||
{
|
||||
$dataForRequest['page'] = $data['page'];
|
||||
}
|
||||
|
||||
$query = http_build_query([
|
||||
'option' => 'com_yoohikashop',
|
||||
'task' => 'unsplash.search'
|
||||
]);
|
||||
|
||||
$curlTransport = new CurlTransport(new Registry());
|
||||
$uri = new Uri();
|
||||
$uri->setScheme('https');
|
||||
$uri->setHost('hika.su/');
|
||||
$uri->setPath('index.php');
|
||||
$uri->setQuery($query);
|
||||
$request = $curlTransport->request('POST', $uri, $dataForRequest);
|
||||
echo $request->body;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
|
||||
public function download()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = Factory::getApplication()->input->getArray();
|
||||
$file = $data['file'];
|
||||
|
||||
if(!isset($data['file'], $data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$file = $data['file'];
|
||||
$id = $data['id'];
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::downloadFileUnsplash($path, $scope, $file, $id);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function downloadTrigger()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
$query = http_build_query([
|
||||
'option' => 'com_yoohikashop',
|
||||
'task' => 'unsplash.downloadTrigger',
|
||||
'uid' => $data['id']
|
||||
]);
|
||||
|
||||
$curlTransport = new CurlTransport(new Registry());
|
||||
$uri = new Uri();
|
||||
$uri->setScheme('https');
|
||||
$uri->setHost('hika.su/');
|
||||
$uri->setPath('index.php');
|
||||
$uri->setQuery($query);
|
||||
$request = $curlTransport->request('GET', $uri);
|
||||
$photo = json_decode($request->body, JSON_OBJECT_AS_ARRAY);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Filesystem\File;
|
||||
use Joomla\Filesystem\Folder;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerQuantumupload
|
||||
*/
|
||||
class QuantummanagerControllerQuantumupload extends QuantummanagerController
|
||||
{
|
||||
|
||||
|
||||
public function upload()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if(!isset($data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::upload();
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,360 @@
|
||||
<?php
|
||||
/**
|
||||
* @package quantummanager
|
||||
* @author Dmitry Tsymbal <cymbal@delo-design.ru>
|
||||
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see license.txt
|
||||
* @link https://www.norrnext.com
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
JLoader::register('QuantummanagerController', JPATH_ADMINISTRATOR . '/components/com_quantummanager/controller.php');
|
||||
|
||||
/**
|
||||
* Class QuantummanagerControllerquantumviewfiles
|
||||
*/
|
||||
class QuantummanagerControllerQuantumviewfiles extends QuantummanagerController
|
||||
{
|
||||
|
||||
public function createDirectory()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset($data['path'], $data['name'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::createDirectory($data['path'], $data['scope'], $data['name']);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
public function getFiles()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset($data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::getFiles($data['path'], $data['scope']);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
public function getMetaFile()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset($data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$name = '';
|
||||
|
||||
if (isset($data['name']))
|
||||
{
|
||||
$name = $data['name'];
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::getMetaFile($data['path'], $data['scope'], $name);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
public function watermark()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset($data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$list = '';
|
||||
|
||||
if (isset($data['list']))
|
||||
{
|
||||
$list = json_decode($data['list']);
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::setWatermark($data['path'], $data['scope'], $list);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
public function duplicate()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset(
|
||||
$data['path'],
|
||||
$data['scope'],
|
||||
$data['list'])
|
||||
)
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$list = json_decode($data['list'], JSON_OBJECT_AS_ARRAY);
|
||||
|
||||
if (count($list) === 0)
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::duplicate($path, $scope, $list);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
public function paste()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset(
|
||||
$data['pathFrom'],
|
||||
$data['scopeFrom'],
|
||||
$data['pathTo'],
|
||||
$data['scopeTo'],
|
||||
$data['cut'],
|
||||
$data['list'])
|
||||
)
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$pathFrom = $data['pathFrom'];
|
||||
$scopeFrom = $data['scopeFrom'];
|
||||
$pathTo = $data['pathTo'];
|
||||
$scopeTo = $data['scopeTo'];
|
||||
$cut = (int) $data['cut'];
|
||||
$list = json_decode($data['list'], JSON_OBJECT_AS_ARRAY);
|
||||
|
||||
if (count($list) === 0)
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::paste($pathFrom, $scopeFrom, $pathTo, $scopeTo, $cut, $list);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset($data['path'], $data['list'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$list = json_decode($data['list']);
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::delete($scope, $path, $list);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
|
||||
}
|
||||
|
||||
public function getParsePath()
|
||||
{
|
||||
try
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
|
||||
if (!isset($data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$host = '';
|
||||
|
||||
if (isset($data['host']))
|
||||
{
|
||||
$host = $data['host'];
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerHelper', JPATH_ROOT . '/administrator/components/com_quantummanager/helpers/quantummanager.php');
|
||||
echo json_encode([
|
||||
'path' => QuantummanagerHelper::preparePath($path, $host, $scope, true)
|
||||
]);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function renameFile()
|
||||
{
|
||||
try
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
$file = '';
|
||||
|
||||
if (!isset($data['path'], $data['scope'], $data['file'], $data['name']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
if (empty($data['path']) || empty($data['scope']) || empty($data['file']) || empty($data['name']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$file = $data['file'];
|
||||
$name = $data['name'];
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::renameFile($path, $scope, $file, $name);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function renameDirectory()
|
||||
{
|
||||
try
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
$file = '';
|
||||
|
||||
if (!isset($data['path'], $data['scope'], $data['oldName'], $data['name']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
if (empty($data['path']) || empty($data['scope']) || empty($data['oldName']) || empty($data['name']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$oldName = $data['oldName'];
|
||||
$name = $data['name'];
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::renameDirectory($path, $scope, $oldName, $name);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function generatePreviewImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
$file = '';
|
||||
|
||||
if (!isset($data['path'], $data['scope']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
|
||||
if (isset($data['file']))
|
||||
{
|
||||
$file = $data['file'];
|
||||
}
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
QuantummanagerFileSystemLocal::generatePreviewImage($path, $scope, $file);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function createPreview()
|
||||
{
|
||||
try
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->input->getArray();
|
||||
$file = '';
|
||||
|
||||
if (!isset($data['path'], $data['scope'], $data['list'], $data['preview']))
|
||||
{
|
||||
$app->close();
|
||||
}
|
||||
|
||||
$path = $data['path'];
|
||||
$scope = $data['scope'];
|
||||
$list = json_decode($data['list'], true);
|
||||
$preview = $data['preview'];
|
||||
|
||||
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
|
||||
echo QuantummanagerFileSystemLocal::createPreview($path, $scope, $list, $preview);
|
||||
|
||||
QuantummanagerHelper::setHeadersNoCache();
|
||||
$app->close();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user