-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80d5b88
commit 68c09b1
Showing
32 changed files
with
1,389 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
administrator/components/com_quantummanager/controllers/quantumcodemirror.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{ | ||
|
||
} |
108 changes: 108 additions & 0 deletions
108
administrator/components/com_quantummanager/controllers/quantumpixabay.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
administrator/components/com_quantummanager/fields/quantumpixabay.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.