1
0

rely on smarty-init-css also in the backend

This commit is contained in:
onli
2013-06-15 15:40:42 +02:00
parent 0044e210ae
commit 347311e78d
4 changed files with 8 additions and 23 deletions

View File

@ -958,7 +958,11 @@ function serendipity_smarty_init($vars = array()) {
}
if (!isset($serendipity['smarty_vars']['head_link_stylesheet'])) {
$serendipity['smarty_vars']['head_link_stylesheet'] = serendipity_rewriteURL('serendipity.css');
if (IN_serendipity_admin === true) {
$serendipity['smarty_vars']['head_link_stylesheet'] = serendipity_rewriteURL('serendipity_admin.css');
} else {
$serendipity['smarty_vars']['head_link_stylesheet'] = serendipity_rewriteURL('serendipity.css');
}
// When templates are switched, append a specific version string to make sure the browser does not cache the CSS
if (strstr($serendipity['smarty_vars']['head_link_stylesheet'], '?')) {

View File

@ -14,24 +14,7 @@ if (IS_installed === false) {
require(S9Y_INCLUDE_PATH . 'include/functions_permalinks.inc.php');
require(S9Y_INCLUDE_PATH . 'include/functions_installer.inc.php');
require(S9Y_INCLUDE_PATH . 'include/functions_config.inc.php');
$css_file = 'serendipity.css.php?serendipity[css_mode]=serendipity_admin.css&v=' . time();
} else {
$css_file = serendipity_rewriteURL('serendipity_admin.css');
// This is a bit of an ugly hack, but when switching templates, the HTML head is already emitted,
// so we need a way to actually enforce switching/updating the CSS. So we need to do it at
// this place.
if ($serendipity['GET']['adminAction'] == 'install' && $serendipity['GET']['adminModule'] == 'templates') {
$serendipity['last_template_change'] = time();
}
// When templates are switched, append a specific version string to make sure the browser does not cache the CSS
if (strstr($css_file, '?')) {
$css_file .= '&v=' . $serendipity['last_template_change'];
} else {
$css_file .= '?v=' . $serendipity['last_template_change'];
}
if (defined('IS_up2date') && IS_up2date === true) {
serendipity_plugin_api::hook_event('backend_configure', $serendipity);
}
@ -63,8 +46,6 @@ if (isset($serendipity['GET']['no_smarty']) || isset($serendipity['no_smarty']))
$_SESSION['no_smarty'] = true;
}
$admin_css_file = serendipity_getTemplateFile('admin/pluginmanager.css');
if (defined('IS_up2date') && IS_up2date === true && IS_installed === true) {
$admin_installed = true;
} else {
@ -271,7 +252,7 @@ if (!$use_installer && $is_logged_in) {
}
if (!$use_installer) {
$poll_admin_vars = array('css_file', 'admin_css_file', 'main_content', 'no_banner', 'no_sidebar', 'no_footer', 'post_action', 'is_logged_in', 'admin_installed', 'self_info', 'use_installer', 'title');
$poll_admin_vars = array('main_content', 'no_banner', 'no_sidebar', 'no_footer', 'post_action', 'is_logged_in', 'admin_installed', 'self_info', 'use_installer', 'title');
$admin_vars = array();
foreach($poll_admin_vars AS $poll_admin_var) {
$admin_vars[$poll_admin_var] =& $$poll_admin_var;

View File

@ -5,7 +5,7 @@
<meta charset="{$CONST.LANG_CHARSET}">
<title>{if $admin_vars.title}{$admin_vars.title} | {/if}{$CONST.SERENDIPITY_ADMIN_SUITE}</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="{$admin_vars.css_file}">
<link rel="stylesheet" href="{$head_link_stylesheet}">
<script src="{serendipity_getFile file='admin/js/modernizr-2.6.2.min.js'}"></script>
{if $admin_vars.admin_installed}{serendipity_hookPlugin hook="backend_header" hookAll="true"}{/if}
</head>

View File

@ -5,7 +5,7 @@
<meta charset="{$CONST.LANG_CHARSET}">
<title>{$CONST.SERENDIPITY_ADMIN_SUITE}</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="{serendipity_getFile file='admin/style.css'}">
<link rel="stylesheet" href="{$head_link_stylesheet}">
<script src="{serendipity_getFile file='admin/js/modernizr-2.6.2.min.js'}"></script>
{serendipity_hookPlugin hook="backend_header" hookAll="true"}
</head>