Skip to content

Commit 68c09b1

Browse files
committed
Версия 1.3.1
1 parent 80d5b88 commit 68c09b1

32 files changed

+1389
-73
lines changed

administrator/components/com_quantummanager/config.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,17 @@
172172
<option value="0">JNO</option>
173173
</field>
174174

175+
<field name="pixabay"
176+
type="radio"
177+
label="COM_QUANTUMMANAGER_CONFIG_IMAGE_PIXABAY_LABEL"
178+
description="COM_QUANTUMMANAGER_CONFIG_IMAGE_PIXABAY_DESC"
179+
required="true"
180+
class="btn-group"
181+
default="1">
182+
<option value="1">JYES</option>
183+
<option value="0">JNO</option>
184+
</field>
185+
175186
<field name="original"
176187
type="radio"
177188
label="COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_LABEL"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* @package quantummanager
4+
* @author Dmitry Tsymbal <[email protected]>
5+
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
6+
* @license GNU General Public License version 3 or later; see license.txt
7+
* @link https://www.norrnext.com
8+
*/
9+
10+
defined('_JEXEC') or die;
11+
12+
use Joomla\CMS\Factory;
13+
use Joomla\CMS\MVC\Controller\AdminController;
14+
use Joomla\Filesystem\Folder;
15+
16+
/**
17+
* Class QuantummanagerControllerQuantumcodemirror
18+
*/
19+
class QuantummanagerControllerQuantumcodemirror extends AdminController
20+
{
21+
22+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?php
2+
/**
3+
* @package quantummanager
4+
* @author Dmitry Tsymbal <[email protected]>
5+
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
6+
* @license GNU General Public License version 3 or later; see license.txt
7+
* @link https://www.norrnext.com
8+
*/
9+
10+
defined('_JEXEC') or die;
11+
12+
use Joomla\CMS\Factory;
13+
use Joomla\CMS\Http\Transport\CurlTransport;
14+
use Joomla\CMS\Language\Text;
15+
use Joomla\CMS\MVC\Controller\AdminController;
16+
use Joomla\CMS\Uri\Uri;
17+
use Joomla\Filesystem\File;
18+
use Joomla\Filesystem\Folder;
19+
use Joomla\Registry\Registry;
20+
21+
/**
22+
* QuantummanagerControllerquantumpixabay Controller.
23+
*
24+
* @package quantummanager
25+
* @since 1.0
26+
*/
27+
class QuantummanagerControllerquantumpixabay extends AdminController
28+
{
29+
30+
31+
public function search()
32+
{
33+
34+
$app = Factory::getApplication();
35+
36+
try
37+
{
38+
$data = Factory::getApplication()->input->getArray();
39+
$dataForRequest = [
40+
'q' => '',
41+
'page' => '1',
42+
];
43+
44+
$fields = [
45+
'q',
46+
'page',
47+
'colors',
48+
'orientation',
49+
'size',
50+
'image_type',
51+
];
52+
53+
foreach ($fields as $field)
54+
{
55+
if(isset($data[$field]))
56+
{
57+
$dataForRequest[$field] = $data[$field];
58+
}
59+
}
60+
61+
$query = http_build_query([
62+
'option' => 'com_yoohikashop',
63+
'task' => 'pixabay.search'
64+
]);
65+
66+
$curlTransport = new CurlTransport(new Registry());
67+
$uri = new Uri();
68+
$uri->setScheme('https');
69+
$uri->setHost('hika.su/');
70+
$uri->setPath('index.php');
71+
$uri->setQuery($query);
72+
$request = $curlTransport->request('POST', $uri, $dataForRequest);
73+
echo $request->body;
74+
}
75+
catch (Exception $e)
76+
{
77+
echo $e->getMessage();
78+
}
79+
80+
81+
$app->close();
82+
}
83+
84+
85+
public function download()
86+
{
87+
$app = Factory::getApplication();
88+
$data = Factory::getApplication()->input->getArray();
89+
$file = $data['file'];
90+
91+
if(!isset($data['file'], $data['path'], $data['scope']))
92+
{
93+
$app->close();
94+
}
95+
96+
$path = $data['path'];
97+
$scope = $data['scope'];
98+
$file = $data['file'];
99+
$id = $data['id'];
100+
101+
JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php');
102+
echo QuantummanagerFileSystemLocal::downloadFilePixabay($path, $scope, $file, $id);
103+
104+
$app->close();
105+
106+
}
107+
108+
}

administrator/components/com_quantummanager/fields/quantumcombine.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
class JFormFieldQuantumCombine extends JFormField
2424
{
2525

26+
/**
27+
* @var array
28+
* @since version
29+
*/
30+
private $addLayouts = [];
31+
2632
/**
2733
* @var string
2834
*/
@@ -64,13 +70,18 @@ protected function getLayoutData()
6470
*/
6571
protected function getLayoutPaths()
6672
{
67-
return [
73+
return array_merge($this->addLayouts, [
6874
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
6975
JPATH_ROOT . '/layouts/joomla/form',
70-
];
76+
]);
7177
}
7278

7379

80+
public function addCustomLayoutsPath($layouts)
81+
{
82+
$this->addLayouts = array_merge($this->addLayouts, $layouts);
83+
}
84+
7485
public function getInput()
7586
{
7687
try {
@@ -106,6 +117,11 @@ public function getInput()
106117
'relative' => true
107118
]);
108119

120+
HTMLHelper::_('script', 'com_quantummanager/split.min.js', [
121+
'version' => filemtime(__FILE__),
122+
'relative' => true
123+
]);
124+
109125
HTMLHelper::_('script', 'com_quantummanager/combine.js', [
110126
'version' => filemtime(__FILE__),
111127
'relative' => true
@@ -161,6 +177,8 @@ public function getInput()
161177
QuantummanagerHelper::loadLang();
162178

163179
$filemanager = new FileLayout($this->layout, JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
180+
$filemanager->addIncludePaths($this->getLayoutPaths());
181+
164182
return $filemanager->render(array_merge($this->getLayoutData(), $htmlFields));
165183

166184
}

administrator/components/com_quantummanager/fields/quantumconfigpath.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Joomla\CMS\Layout\FileLayout;
1717
use Joomla\CMS\Uri\Uri;
1818

19+
JFormHelper::loadFieldClass('text');
20+
1921
/**
2022
* Class JFormFieldQuantumtoolbar
2123
*/

administrator/components/com_quantummanager/fields/quantumconfigscopetitle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Joomla\CMS\Layout\FileLayout;
1717
use Joomla\CMS\Uri\Uri;
1818

19+
JFormHelper::loadFieldClass('text');
20+
1921
/**
2022
* Class JFormFieldQuantumtoolbar
2123
*/
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<?php
2+
/**
3+
* @package quantummanager
4+
* @author Dmitry Tsymbal <[email protected]>
5+
* @copyright Copyright © 2019 Delo Design & NorrNext. All rights reserved.
6+
* @license GNU General Public License version 3 or later; see license.txt
7+
* @link https://www.norrnext.com
8+
*/
9+
10+
defined('_JEXEC') or die;
11+
12+
use Joomla\CMS\Filter\OutputFilter;
13+
use Joomla\CMS\HTML\HTMLHelper;
14+
use Joomla\CMS\Language\Text;
15+
use Joomla\CMS\Factory;
16+
use Joomla\CMS\Layout\FileLayout;
17+
18+
/**
19+
* Class JFormFieldQuantumtreecatalogs
20+
*/
21+
class JFormFieldQuantumpixabay extends JFormField
22+
{
23+
24+
/**
25+
* @var string
26+
*/
27+
public $type = 'QuantumPixabay';
28+
29+
/**
30+
* @var string
31+
*/
32+
protected $layout = 'quantumpixabay';
33+
34+
35+
/**
36+
* Allow to override renderer include paths in child fields
37+
*
38+
* @return array
39+
*
40+
* @since 3.5
41+
*/
42+
protected function getLayoutPaths()
43+
{
44+
return [
45+
JPATH_ROOT . '/administrator/components/com_quantummanager/layouts/fields',
46+
];
47+
}
48+
49+
/**
50+
* @return array
51+
*/
52+
protected function getLayoutData()
53+
{
54+
return array_merge(parent::getLayoutData(),
55+
[
56+
'cssClass' => $this->cssClass,
57+
]
58+
);
59+
}
60+
61+
62+
public function getInput()
63+
{
64+
try {
65+
66+
$this->__set('standalone', $this->getAttribute('standalone', true));
67+
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
68+
69+
HTMLHelper::_('stylesheet', 'com_quantummanager/main.css', [
70+
'version' => filemtime(__FILE__),
71+
'relative' => true
72+
]);
73+
74+
HTMLHelper::_('stylesheet', 'com_quantummanager/quantumpixabay.css', [
75+
'version' => filemtime(__FILE__),
76+
'relative' => true
77+
]);
78+
79+
HTMLHelper::_('script', 'com_quantummanager/main.js', [
80+
'version' => filemtime(__FILE__),
81+
'relative' => true
82+
]);
83+
84+
HTMLHelper::_('script', 'com_quantummanager/utils.js', [
85+
'version' => filemtime(__FILE__),
86+
'relative' => true
87+
]);
88+
89+
HTMLHelper::_('script', 'com_quantummanager/quantumpixabay.js', [
90+
'version' => filemtime(__FILE__),
91+
'relative' => true
92+
]);
93+
94+
HTMLHelper::_('script', 'com_quantummanager/masonry.min.js', [
95+
'version' => filemtime(__FILE__),
96+
'relative' => true
97+
]);
98+
99+
$field = parent::getInput();
100+
101+
if($this->standalone)
102+
{
103+
$filemanager = new FileLayout( 'fieldstandalone', JPATH_ROOT . '/administrator/components/com_quantummanager/layouts');
104+
return $filemanager->render(['field' => $field]);
105+
}
106+
107+
return $field;
108+
}
109+
catch (Exception $e) {
110+
echo $e->getMessage();
111+
}
112+
}
113+
114+
}

administrator/components/com_quantummanager/fields/quantumupload.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function getLayoutData()
5151
{
5252
return array_merge(parent::getLayoutData(),
5353
[
54+
'scope' => $this->scope,
5455
'directory' => $this->directory,
5556
'dropAreaHidden' => $this->dropAreaHidden,
5657
'maxsize' => $this->maxsize,
@@ -67,6 +68,7 @@ public function getInput()
6768
$this->__set('cssClass', $this->getAttribute('cssClass', ''));
6869
$this->__set('maxsize', $this->getAttribute('maxsize', '2'));
6970
$this->directory = $this->getAttribute('directory', 'images');
71+
$this->scope = $this->getAttribute('scope', '');
7072
$this->dropAreaHidden = $this->getAttribute('dropAreaHidden', '0');
7173

7274
HTMLHelper::_('stylesheet', 'com_quantummanager/main.css', [

0 commit comments

Comments
 (0)