fix templatechooser to not apply theme in backend

Conflicts:
	docs/NEWS
	index.php
This commit is contained in:
Garvin Hicking 2015-04-01 11:53:58 +02:00
parent c786d457a7
commit 8112c39485
2 changed files with 8 additions and 2 deletions

View File

@ -61,6 +61,8 @@ Version 2.0.2 ()
* Fix Issue #321, negative offset for LIMIT SQL statements when
using stable archive sorting and plugins like history.
* Templatechooser will not apply theme in backend admin.
* Use "secure" flag for (session) cookies sent over SSL, thanks to
dayton967

View File

@ -14,7 +14,7 @@ class serendipity_event_templatechooser extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_TEMPLATECHOOSER_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Evan Nemerson');
$propbag->add('version', '1.5');
$propbag->add('version', '1.6');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -41,7 +41,11 @@ class serendipity_event_templatechooser extends serendipity_event
if (isset($hooks[$event])) {
switch($event) {
case 'frontend_configure':
if (defined('IN_serendipity_admin') && IN_serendipity_admin) {
// Admin shall not have switchable themes.
return true;
}
if (isset($serendipity['COOKIE']['user_template']) && !isset($_REQUEST['user_template'])) {
$_REQUEST['user_template'] = $serendipity['COOKIE']['user_template'];
}