Skip to content

Commit

Permalink
Версия 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Dec 3, 2019
1 parent 80d5b88 commit 68c09b1
Show file tree
Hide file tree
Showing 32 changed files with 1,389 additions and 73 deletions.
11 changes: 11 additions & 0 deletions administrator/components/com_quantummanager/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@
<option value="0">JNO</option>
</field>

<field name="pixabay"
type="radio"
label="COM_QUANTUMMANAGER_CONFIG_IMAGE_PIXABAY_LABEL"
description="COM_QUANTUMMANAGER_CONFIG_IMAGE_PIXABAY_DESC"
required="true"
class="btn-group"
default="1">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field name="original"
type="radio"
label="COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_LABEL"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* @package quantummanager
* @author Dmitry Tsymbal <[email protected]>
* @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;

/**
* Class QuantummanagerControllerQuantumcodemirror
*/
class QuantummanagerControllerQuantumcodemirror extends AdminController
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?php
/**
* @package quantummanager
* @author Dmitry Tsymbal <[email protected]>
* @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;

/**
* QuantummanagerControllerquantumpixabay Controller.
*
* @package quantummanager
* @since 1.0
*/
class QuantummanagerControllerquantumpixabay extends AdminController
{


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();
}


$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);

$app->close();

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
class JFormFieldQuantumCombine extends JFormField
{

/**
* @var array
* @since version
*/
private $addLayouts = [];

/**
* @var string
*/
Expand Down Expand Up @@ -64,13 +70,18 @@ protected function getLayoutData()
*/
protected function getLayoutPaths()
{
return [
return array_merge($this->addLayouts, [
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
JPATH_ROOT . '/layouts/joomla/form',
];
]);
}


public function addCustomLayoutsPath($layouts)
{
$this->addLayouts = array_merge($this->addLayouts, $layouts);
}

public function getInput()
{
try {
Expand Down Expand Up @@ -106,6 +117,11 @@ public function getInput()
'relative' => true
]);

HTMLHelper::_('script', 'com_quantummanager/split.min.js', [
'version' => filemtime(__FILE__),
'relative' => true
]);

HTMLHelper::_('script', 'com_quantummanager/combine.js', [
'version' => filemtime(__FILE__),
'relative' => true
Expand Down Expand Up @@ -161,6 +177,8 @@ public function getInput()
QuantummanagerHelper::loadLang();

$filemanager = new FileLayout($this->layout, JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
$filemanager->addIncludePaths($this->getLayoutPaths());

return $filemanager->render(array_merge($this->getLayoutData(), $htmlFields));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Uri\Uri;

JFormHelper::loadFieldClass('text');

/**
* Class JFormFieldQuantumtoolbar
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Uri\Uri;

JFormHelper::loadFieldClass('text');

/**
* Class JFormFieldQuantumtoolbar
*/
Expand Down
114 changes: 114 additions & 0 deletions administrator/components/com_quantummanager/fields/quantumpixabay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php
/**
* @package quantummanager
* @author Dmitry Tsymbal <[email protected]>
* @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\Filter\OutputFilter;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
use Joomla\CMS\Layout\FileLayout;

/**
* Class JFormFieldQuantumtreecatalogs
*/
class JFormFieldQuantumpixabay extends JFormField
{

/**
* @var string
*/
public $type = 'QuantumPixabay';

/**
* @var string
*/
protected $layout = 'quantumpixabay';


/**
* Allow to override renderer include paths in child fields
*
* @return array
*
* @since 3.5
*/
protected function getLayoutPaths()
{
return [
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
];
}

/**
* @return array
*/
protected function getLayoutData()
{
return array_merge(parent::getLayoutData(),
[
'cssClass' => $this->cssClass,
]
);
}


public function getInput()
{
try {

$this->__set('standalone', $this->getAttribute('standalone', true));
$this->__set('cssClass', $this->getAttribute('cssClass', ''));

HTMLHelper::_('stylesheet', 'com_quantummanager/main.css', [
'version' => filemtime(__FILE__),
'relative' => true
]);

HTMLHelper::_('stylesheet', 'com_quantummanager/quantumpixabay.css', [
'version' => filemtime(__FILE__),
'relative' => true
]);

HTMLHelper::_('script', 'com_quantummanager/main.js', [
'version' => filemtime(__FILE__),
'relative' => true
]);

HTMLHelper::_('script', 'com_quantummanager/utils.js', [
'version' => filemtime(__FILE__),
'relative' => true
]);

HTMLHelper::_('script', 'com_quantummanager/quantumpixabay.js', [
'version' => filemtime(__FILE__),
'relative' => true
]);

HTMLHelper::_('script', 'com_quantummanager/masonry.min.js', [
'version' => filemtime(__FILE__),
'relative' => true
]);

$field = parent::getInput();

if($this->standalone)
{
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
return $filemanager->render(['field' => $field]);
}

return $field;
}
catch (Exception $e) {
echo $e->getMessage();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function getLayoutData()
{
return array_merge(parent::getLayoutData(),
[
'scope' => $this->scope,
'directory' => $this->directory,
'dropAreaHidden' => $this->dropAreaHidden,
'maxsize' => $this->maxsize,
Expand All @@ -67,6 +68,7 @@ public function getInput()
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
$this->__set('maxsize', $this->getAttribute('maxsize', '2'));
$this->directory = $this->getAttribute('directory', 'images');
$this->scope = $this->getAttribute('scope', '');
$this->dropAreaHidden = $this->getAttribute('dropAreaHidden', '0');

HTMLHelper::_('stylesheet', 'com_quantummanager/main.css', [
Expand Down
Loading

0 comments on commit 68c09b1

Please sign in to comment.