From: pdontthink Date: Mon, 2 Oct 2006 11:02:27 +0000 (+0000) Subject: Cleanup and abstraction of how default template set is retrieved X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0f7d6a844c6f29b95466de850e9e36c94eaf2eb2;p=squirrelmail.git Cleanup and abstraction of how default template set is retrieved git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11797 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/include/load_prefs.php b/include/load_prefs.php index d86cf6ca..5b5124fa 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -29,11 +29,11 @@ if( ! sqgetGlobalVar('username', $username, SQ_SESSION) ) { // TODO Get rid of "none" strings when NULL or false should be used, i hate them i hate them i hate them!!!. $custom_css = getPref($data_dir, $username, 'custom_css', 'none' ); -$aTemplateSet = (!isset($aTemplateSet) || !is_array($aTemplateSet) - ? array() : $aTemplateSet); -$templateset_default = ( !isset($templateset_default) ? 0 : $templateset_default ); -$sTemplateID = getPref($data_dir, $username, 'sTemplateID', 'default'); +// template set setup +// +$sDefaultTemplateID = Template::get_default_template_set(); +$sTemplateID = getPref($data_dir, $username, 'sTemplateID', $sDefaultTemplateID); // check user prefs template selection against templates actually available // @@ -48,21 +48,19 @@ for ($i = 0; $i < count($aTemplateSet); ++$i){ // FIXME: do we need/want to check here for actual presence of template sets? // selected template not available, fall back to default template // -if (!$found_templateset) { - $sTemplateID = ( !isset($aTemplateSet[$templateset_default]['ID']) ? - 'default' : $aTemplateSet[$templateset_default]['ID'] ); -} +if (!$found_templateset) $sTemplateID = $sDefaultTemplateID; $chosen_theme = getPref($data_dir, $username, 'chosen_theme'); -/* +/* Steve, is this commented out because it is part of the old system being removed? + Let's just remove it then... no? $theme = ( !isset($theme) ? array() : $theme ); $color = ( !isset($color) ? array() : $color ); $chosen_theme = getPref($data_dir, $username, 'chosen_theme'); $found_theme = false; -// need to adjust $chosen_theme path with SM_PATH +// need to adjust $chosen_theme path with SM_PATH */ $chosen_theme = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme); for ($i = 0; $i < count($theme); ++$i){