|
|
|
@ -1177,6 +1177,38 @@ class rcmail extends rcube
|
|
|
|
|
self::write_log('userlogins', $message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Check if specified asset file exists
|
|
|
|
|
*
|
|
|
|
|
* @param string $path Asset path
|
|
|
|
|
* @param bool $minified Fallback to minified version of the file
|
|
|
|
|
*
|
|
|
|
|
* @return string Asset path if found (modified if minified file found)
|
|
|
|
|
*/
|
|
|
|
|
public function find_asset($path, $minified = true)
|
|
|
|
|
{
|
|
|
|
|
if (empty($path)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$assets_dir = $this->config->get('assets_dir');
|
|
|
|
|
$root_path = unslashify($assets_dir ?: INSTALL_PATH) . '/';
|
|
|
|
|
$full_path = $root_path . trim($path, '/');
|
|
|
|
|
|
|
|
|
|
if (file_exists($full_path)) {
|
|
|
|
|
return $path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($minified && preg_match('/(?<!\.min)\.(js|css)$/', $path)) {
|
|
|
|
|
$path = preg_replace('/\.(js|css)$/', '.min.\\1', $path);
|
|
|
|
|
$full_path = $root_path . trim($path, '/');
|
|
|
|
|
|
|
|
|
|
if (file_exists($full_path)) {
|
|
|
|
|
return $path;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a HTML table based on the given data
|
|
|
|
|
*
|
|
|
|
@ -2061,14 +2093,16 @@ class rcmail extends rcube
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ($path = $this->config->get('editor_css_location')) {
|
|
|
|
|
$config['content_css'] = $skin_path . $path;
|
|
|
|
|
if ($path = $this->find_asset($skin_path . $path)) {
|
|
|
|
|
$config['content_css'] = $path;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->output->add_label('selectimage', 'addimage', 'selectmedia', 'addmedia');
|
|
|
|
|
$this->output->set_env('editor_config', $config);
|
|
|
|
|
|
|
|
|
|
if ($path = $this->config->get('media_browser_css_location', 'program/resources/tinymce/browser.css')) {
|
|
|
|
|
if ($path != 'none') {
|
|
|
|
|
if ($path != 'none' && ($path = $this->find_asset($path))) {
|
|
|
|
|
$this->output->include_css($path);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|