Additional fixes for #601

This commit is contained in:
Kijin Sung 2016-10-01 23:32:59 +09:00
parent f8fb61ec6c
commit e9df310364
3 changed files with 13 additions and 4 deletions

View file

@ -156,6 +156,7 @@ class FrontEndFileHandler extends Handler
}
$pathInfo = pathinfo($fileName);
$file = new stdClass();
$file->fileName = $pathInfo['basename'];
$file->filePath = $this->_getAbsFileUrl($pathInfo['dirname']);
@ -173,6 +174,10 @@ class FrontEndFileHandler extends Handler
$file->isMinified = false;
}
$file->isExternalURL = preg_match('@^(https?:)?//@i', $file->filePath) ? true : false;
if ($file->isExternalURL && !$file->fileExtension)
{
$file->fileExtension = preg_match('/[\.\/](css|js)\b/', $fileName, $matches) ? $matches[1] : null;
}
$file->isCachedScript = !$file->isExternalURL && strpos($file->filePath, 'files/cache/') !== false;
$file->isCommon = $isCommon;
$file->keyName = $file->fileNameNoExt . '.' . $file->fileExtension;

View file

@ -133,6 +133,11 @@ class editorAdminView extends editor
Context::set('component_count', $component_count);
Context::set('editor_config_default', $editor_config_default);
foreach ($config->additional_css as $additional_css_url)
{
Context::loadFile(array($additional_css_url));
}
$security = new Security();
$security->encodeHTML('component_list....');

View file

@ -116,7 +116,6 @@
<div class="x_control-group">
<label class="x_control-label">{$lang->guide_additional_css}</label>
<div class="x_controls">
{@ var_dump($editor_config)}
<textarea id="additional_css" name="additional_css" style="width:90%" rows="4" cols="42">{escape(implode("\n", $editor_config->additional_css ?: array()))}</textarea>
<p class="x_help-block">{$lang->about_additional_css}</p>
</div>