Changeset 5382
- Timestamp:
- Mar 26, 2010, 3:16:54 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/themes.class.php
r5340 r5382 118 118 } 119 119 120 // you can't deactivate the last theme 121 if (count($this->db_themes_by_id) <= 1) 122 { 123 array_push( 124 $errors, 125 l10n('Impossible to deactivate this theme, you need at least one theme.') 126 ); 127 break; 128 } 129 120 130 if ($theme_id == get_default_theme()) 121 131 { … … 228 238 function set_default_theme($theme_id) 229 239 { 240 global $conf; 241 230 242 // first we need to know which users are using the current default theme 231 243 $default_theme = get_default_theme(); … … 237 249 WHERE theme = "'.$default_theme.'" 238 250 ;'; 239 $user_ids = array_from_query($query, 'user_id'); 251 $user_ids = array_unique( 252 array_merge( 253 array_from_query($query, 'user_id'), 254 array($conf['guest_id'], $conf['default_user_id']) 255 ) 256 ); 240 257 241 258 // $user_ids can't be empty, at least the default user has the default -
trunk/admin/themes/default/template/themes_installed.tpl
r5284 r5382 14 14 <div class="themeShot"><img src="{$theme.screenshot}"></div> 15 15 <div class="themeActions"> 16 17 {if $theme.deactivable} 16 18 <a href="{$deactivate_baseurl}{$theme.id}" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a> 19 {else} 20 <span title="{$theme.deactivate_tooltip}">{'Deactivate'|@translate}</span> 21 {/if} 22 17 23 {if not $theme.is_default} 18 24 | <a href="{$set_default_baseurl}{$theme.id}" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a> -
trunk/admin/themes_installed.php
r5259 r5382 78 78 if (in_array($theme_id, $db_theme_ids)) 79 79 { 80 $fs_theme['deactivable'] = true; 81 82 if (count($db_theme_ids) <= 1) 83 { 84 $fs_theme['deactivable'] = false; 85 $fs_theme['deactivate_tooltip'] = l10n('Impossible to deactivate this theme, you need at least one theme.'); 86 } 87 80 88 if ($theme_id == $default_theme) 81 89 { -
trunk/language/en_UK/admin.lang.php
r5381 r5382 759 759 $lang['None'] = 'None'; 760 760 $lang['Invert'] = 'Invert'; 761 $lang['Impossible to deactivate this theme, you need at least one theme.'] = 'Impossible to deactivate this theme, you need at least one theme.'; 761 762 ?> -
trunk/language/fr_FR/admin.lang.php
r5381 r5382 764 764 $lang['None'] = 'Rien'; 765 765 $lang['Invert'] = 'Inverser'; 766 $lang['Impossible to deactivate this theme, you need at least one theme.'] = 'Impossible de désactiver ce thème, il doit rester au moins un thème activé.'; 766 767 ?>
Note: See TracChangeset
for help on using the changeset viewer.