Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/fck_helper.php
Show First 20 Lines • Show All 524 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Returns url to CSS and JS style configuration. | * Returns url to CSS and JS style configuration. | ||||
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
protected function getStyles() | protected function getStyles() | ||||
{ | { | ||||
static $cache = array(); | |||||
/** @var ThemeItem $theme */ | /** @var ThemeItem $theme */ | ||||
$theme = $this->Application->recallObject('theme.current'); | $theme = $this->Application->recallObject('theme.current'); | ||||
$stylesheet_file = $theme->getStylesheetFile(true); | $stylesheet_file = $theme->getStylesheetFile(true); | ||||
if ( !isset($cache[$stylesheet_file]) ) { | |||||
if ( $stylesheet_file ) { | if ( $stylesheet_file ) { | ||||
$stylesheet_folder_url = dirname($stylesheet_file) . '/'; | $stylesheet_folder_url = dirname($stylesheet_file) . '/'; | ||||
$url_params = Array ('events[fck]' => 'OnGetsEditorStyles', 'no_pass_through' => 1, 'pass' => 'm'); | $url_params = array('events[fck]' => 'OnGetsEditorStyles', 'no_pass_through' => 1, 'pass' => 'm'); | ||||
$prefix = $this->Application->isAdmin ? '_FRONT_END_' : ''; | $prefix = $this->Application->isAdmin ? '_FRONT_END_' : ''; | ||||
$styles_css = $this->Application->HREF('index', $prefix, $url_params, 'index.php'); | $styles_css = $this->Application->HREF('index', $prefix, $url_params, 'index.php'); | ||||
/** @var kCurlHelper $curl_helper */ | /** @var kCurlHelper $curl_helper */ | ||||
$curl_helper = $this->Application->recallObject('CurlHelper'); | $curl_helper = $this->Application->recallObject('CurlHelper'); | ||||
$curl_helper->Send($styles_css, false); | $curl_helper->Send($styles_css, false); | ||||
$styles_css = $curl_helper->getInfo(CURLINFO_REDIRECT_URL); | $styles_css = $curl_helper->getInfo(CURLINFO_REDIRECT_URL); | ||||
$curl_helper->CloseConnection(); | $curl_helper->CloseConnection(); | ||||
} | } | ||||
else { | else { | ||||
$stylesheet_folder_url = $this->Application->BaseURL(rtrim(EDITOR_PATH, '/')); | $stylesheet_folder_url = $this->Application->BaseURL(rtrim(EDITOR_PATH, '/')); | ||||
$styles_css = $stylesheet_folder_url . 'style.css'; | $styles_css = $stylesheet_folder_url . 'style.css'; | ||||
} | } | ||||
$styles_js = $stylesheet_folder_url . 'styles.js'; | $styles_js = $stylesheet_folder_url . 'styles.js'; | ||||
return array($styles_css, $styles_js); | $cache[$stylesheet_file] = array($styles_css, $styles_js); | ||||
} | |||||
return $cache[$stylesheet_file]; | |||||
} | } | ||||
/** | /** | ||||
* Returns url to JavaScript configuration file. | * Returns url to JavaScript configuration file. | ||||
* | * | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
protected function getJavaScriptConfig() | protected function getJavaScriptConfig() | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |