Skip to content

Commit

Permalink
3.0.5 (#67)
Browse files Browse the repository at this point in the history
* поправлена скачка файлов

* ver. 3.0.5

* ver. 3.0.5

* ver. 3.0.5

Co-authored-by: Dmitrii Cymbal <[email protected]>
  • Loading branch information
progreccor and dmitriitux authored Sep 24, 2021
1 parent 0b58d63 commit 28c18af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
39 changes: 12 additions & 27 deletions radicalform.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);

$cache = Factory::getCache('_system', 'callback');
$cache->clean();

JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');
$this->maxDirSize = $this->params->get('maxfile',20)*1048576;
Expand Down Expand Up @@ -525,29 +522,23 @@ private function processUploadedFiles($files, $uniq)
*/
public function onAfterInitialise()
{
$uri = Uri::getInstance();
$path = $uri->getPath();
$root = Uri::root(true);
$entry = $root . "/".$this->params->get('downloadpath') ;
$folder = basename(dirname($path));
$uniq = basename(dirname(dirname($path)));
$uri = Uri::getInstance();
$path = $uri->getPath();
$root = Uri::root(true);
$entry = $root . "/".$this->params->get('downloadpath') ;

if (preg_match('#' . $entry . '#', $path))
{
$folder = basename(dirname($path));
$uniq = basename(dirname(dirname($path)));
$filename = basename($path);

if (preg_match('#' . $entry . '#', $path))
{
$filename=basename($path);
$uri->setPath($root);
$uri->setVar('option', 'com_ajax');
$uri->setVar('plugin', 'radicalform');
$uri->setVar('group', 'system');
$uri->setVar('format', 'raw');
$uri->setVar('img', $filename);
$uri->setVar('uniq', $uniq);
$uri->setVar('folder', $folder);
}
$this->showImage($uniq, $folder, $filename);
}

}


/**
* Check file mime type and return it
* @param $filepath
Expand Down Expand Up @@ -672,12 +663,6 @@ public function onAjaxRadicalform()
}
}

$name = $uri->getVar('img');
if(!empty($name))
{
return $this->showImage($uri->getVar('uniq'), $uri->getVar('folder'), $name);
}

if (isset($get['deletefile']) )
{
return $this->deleteUploadedFile($get['catalog'], $get['deletefile'], $get['uniq']);;
Expand Down
4 changes: 2 additions & 2 deletions radicalform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorUrl>https://hika.su</authorUrl>
<copyright>Copyright (C) 2021 Progreccor. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later;</license>
<version>3.0.4</version>
<creationDate>2021-07-24</creationDate>
<version>3.0.5</version>
<creationDate>2021-09-24</creationDate>
<description>PLG_RADICALFORM_DESC</description>
<scriptfile>script.php</scriptfile>
<files>
Expand Down

0 comments on commit 28c18af

Please sign in to comment.