Changeset 5258
- Timestamp:
- Mar 22, 2010, 3:11:10 PM (14 years ago)
- Location:
- trunk/admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/themes.class.php
r5196 r5258 141 141 break; 142 142 } 143 144 $children = $this->get_children_themes($theme_id); 145 if (count($children) > 0) 146 { 147 array_push( 148 $errors, 149 sprintf( 150 l10n('Impossible to delete this theme. Other themes depends on it: %s'), 151 implode(', ', $children) 152 ) 153 ); 154 break; 155 } 143 156 144 157 if (!$this->deltree(PHPWG_THEMES_PATH.$theme_id)) … … 155 168 return $errors; 156 169 } 170 171 function get_children_themes($theme_id) 172 { 173 $children = array(); 174 175 foreach ($this->fs_themes as $test_child) 176 { 177 if (isset($test_child['parent']) and $test_child['parent'] == $theme_id) 178 { 179 array_push($children, $test_child['name']); 180 } 181 } 182 183 return $children; 184 } 157 185 158 186 function set_default_theme($theme_id) … … 267 295 list( , $extension) = explode('extension_view.php?eid=', $theme['uri']); 268 296 if (is_numeric($extension)) $theme['extension'] = $extension; 297 } 298 if (preg_match('/["\']parent["\'][^"\']+["\']([^"\']+)["\']/', $theme_data, $val)) 299 { 300 $theme['parent'] = $val[1]; 269 301 } 270 302 -
trunk/admin/themes/default/template/footer.tpl
r5246 r5258 46 46 <script type='text/javascript'> 47 47 $(function() { 48 $('#pwgHead A, #footer A, .themeActions A ').tipTip({48 $('#pwgHead A, #footer A, .themeActions A, .themeActions SPAN').tipTip({ 49 49 'delay' : 0, 50 50 'fadeIn' : 200, -
trunk/admin/themes/default/template/themes_installed.tpl
r5200 r5258 5 5 <div id="themesContent"> 6 6 7 <h3>Active Themes</h3> 7 <fieldset> 8 <legend>Active Themes</legend> 8 9 {if isset($active_themes)} 9 10 <div class="themeBoxes"> … … 22 23 </div> <!-- themeBoxes --> 23 24 {/if} 25 </fieldset> 24 26 25 27 {if isset($inactive_themes)} 26 <h3>Inactive Themes</h3> 28 <fieldset> 29 <legend>Inactive Themes</legend> 27 30 <div class="themeBoxes"> 28 31 {foreach from=$inactive_themes item=theme} … … 32 35 <div class="themeActions"> 33 36 <a href="{$activate_baseurl}{$theme.id}" title="{'Make this theme available to users'|@translate}">{'Activate'|@translate}</a> 34 | <a href="{$delete_baseurl}{$theme.id}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a> 37 | 38 {if $theme.deletable} 39 <a href="{$delete_baseurl}{$theme.id}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a> 40 {else} 41 <span title="{$theme.delete_tooltip}">{'Delete'|@translate}</span> 42 {/if} 35 43 </div> 36 44 … … 38 46 {/foreach} 39 47 </div> <!-- themeBoxes --> 48 </fieldset> 40 49 {/if} 41 50 -
trunk/admin/themes_installed.php
r5196 r5258 69 69 $inactive_themes = array(); 70 70 71 foreach ($themes->fs_themes as $theme_id => $fs_theme)71 foreach ($themes->fs_themes as $theme_id => $fs_theme) 72 72 { 73 73 if ($theme_id == 'default') … … 90 90 else 91 91 { 92 $children = $themes->get_children_themes($theme_id); 93 94 if (count($children) > 0) 95 { 96 $fs_theme['deletable'] = false; 97 98 $fs_theme['delete_tooltip'] = sprintf( 99 l10n('Impossible to delete this theme. Other themes depends on it: %s'), 100 implode(', ', $children) 101 ); 102 } 103 else 104 { 105 $fs_theme['deletable'] = true; 106 } 107 92 108 array_push($inactive_themes, $fs_theme); 93 109 }
Note: See TracChangeset
for help on using the changeset viewer.