Skip to content

Commit

Permalink
respect the default value
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Apr 2, 2017
1 parent af9b542 commit eb79dbf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plugins/editors/tinymce/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,17 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons
// Get specific path
$tempPath = $levelParams->get('path', '');

if (!empty($tempPath) && $tempPath !== '-1')
if ($dragdrop && !empty($tempPath) && $tempPath !== '-1')
{
// Remove the root images path
$tempPath = str_replace(JComponentHelper::getParams('com_media')->get('image_path') . '/', '', $tempPath);
}

if (isset($tempPath) && $tempPath === '-1')
{
$tempPath = '';
}

JText::script('PLG_TINY_ERR_UNSUPPORTEDBROWSER');

$scriptOptions['setCustomDir'] = $isSubDir;
Expand Down Expand Up @@ -1870,12 +1875,17 @@ private function onDisplayLegacy($name, $content, $width, $height, $col, $row, $
// Get specific path
$tempPath = $this->params->get('path', '');

if (!empty($tempPath) && $tempPath !== '-1')
if ($dragdrop && !empty($tempPath) && $tempPath === '-1')
{
// Remove the root images path
$tempPath = str_replace(JComponentHelper::getParams('com_media')->get('image_path') . '/', '', $tempPath);
}

if (isset($tempPath) && $tempPath !== '-1')
{
$tempPath = '';
}

JText::script('PLG_TINY_ERR_UNSUPPORTEDBROWSER');

$scriptOptions['setCustomDir'] = $isSubDir;
Expand Down

0 comments on commit eb79dbf

Please sign in to comment.