Changeset 23259 for trunk/admin
- Timestamp:
- Jun 16, 2013, 6:23:45 PM (11 years ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/template/themes_installed.tpl
r14192 r23259 1 1 {include file='include/colorbox.inc.tpl'} 2 2 3 {footer_script}{literal} 3 4 jQuery(document).ready(function() { 4 $("a.preview-box").colorbox(); 5 }); 5 $("a.preview-box").colorbox(); 6 7 jQuery('.showInfo').tipTip({ 8 'delay' : 0, 9 'fadeIn' : 200, 10 'fadeOut' : 200, 11 'maxWidth':'300px', 12 'keepAlive':true, 13 'activation':'click' 14 }); 15 }); 6 16 {/literal}{/footer_script} 7 17 … … 12 22 <div id="themesContent"> 13 23 14 <fieldset> 15 <legend>{'Active Themes'|@translate}</legend> 16 {if isset($active_themes)} 17 <div class="themeBoxes"> 18 {foreach from=$active_themes item=theme} 19 <div class="themeBox{if $theme.is_default} themeDefault{/if}"> 20 <div class="themeName">{$theme.name}{if $theme.is_default} <em>({'default'|@translate})</em>{/if} {if $theme.mobile} <em>({'Mobile'|@translate})</em>{/if}</div> 21 <div class="themeShot"><a href="{$theme.screenshot}" class="preview-box" title="{$theme.name}"><img src="{$theme.screenshot}" alt=""></a></div> 24 {assign var='field_name' value='null'} {* <!-- 'counter' for fieldset management --> *} 25 {foreach from=$tpl_themes item=theme} 26 27 {if $field_name != $theme.STATE} 28 {if $field_name != 'null'} 29 </div> 30 </fieldset> 31 {/if} 32 33 <fieldset> 34 <legend> 35 {if $theme.STATE == 'active'} 36 {'Active Themes'|@translate} 37 {else} 38 {'Inactive Themes'|@translate} 39 {/if} 40 </legend> 41 <div class="themeBoxes"> 42 {assign var='field_name' value=$theme.STATE} 43 {/if} 44 45 {if not empty($theme.AUTHOR)} 46 {if not empty($theme.AUTHOR_URL)} 47 {assign var='author' value="<a href='%s'>%s</a>"|@sprintf:$theme.AUTHOR_URL:$theme.AUTHOR} 48 {else} 49 {assign var='author' value='<u>'|cat:$theme.AUTHOR|cat:'</u>'} 50 {/if} 51 {/if} 52 {if not empty($theme.VISIT_URL)} 53 {assign var='version' value="<a class='externalLink' href='"|cat:$theme.VISIT_URL|cat:"'>"|cat:$theme.VERSION|cat:"</a>"} 54 {else} 55 {assign var='version' value=$theme.VERSION} 56 {/if} 57 58 <div class="themeBox{if $theme.IS_DEFAULT} themeDefault{/if}"> 59 <div class="themeName"> 60 {$theme.NAME} {if $theme.IS_DEFAULT}<em>({'default'|@translate})</em>{/if} {if $theme.IS_MOBILE}<em>({'Mobile'|@translate})</em>{/if} 61 <a class="showInfo" title="{if !empty($author)}{'By %s'|@translate|@sprintf:$author} | {/if}{'Version'|@translate} {$version}<br/>{$theme.DESC|@escape:'html'}">i</a> 62 </div> 63 <div class="themeShot"><a href="{$theme.SCREENSHOT}" class="preview-box" title="{$theme.NAME}"><img src="{$theme.SCREENSHOT}" alt=""></a></div> 22 64 <div class="themeActions"> 23 65 <div> 24 {if $theme.deactivable} 25 <a href="{$deactivate_baseurl}{$theme.id}" class="tiptip" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a> 66 {if $theme.STATE == 'active'} 67 {if $theme.DEACTIVABLE} 68 <a href="{$deactivate_baseurl}{$theme.ID}" class="tiptip" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a> 69 {else} 70 <span title="{$theme.DEACTIVATE_TOOLTIP}" class="tiptip">{'Deactivate'|@translate}</span> 71 {/if} 72 73 {if not $theme.IS_DEFAULT} 74 | <a href="{$set_default_baseurl}{$theme.ID}" class="tiptip" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a> 75 {/if} 76 {if $theme.ADMIN_URI} 77 <br><a href="{$theme.ADMIN_URI}" class="tiptip" title="{'Configuration'|@translate}">{'Configuration'|@translate}</a> 78 {/if} 26 79 {else} 27 <span title="{$theme.deactivate_tooltip}" class="tiptip">{'Deactivate'|@translate}</span> 28 {/if} 29 30 {if not $theme.is_default} 31 | <a href="{$set_default_baseurl}{$theme.id}" class="tiptip" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a> 32 {/if} 33 {if isset($theme.admin_uri)} 34 <br><a href="{$theme.admin_uri}" class="tiptip" title="{'Configuration'|@translate}">{'Configuration'|@translate}</a> 80 {if $theme.ACTIVABLE} 81 <a href="{$activate_baseurl}{$theme.ID}" title="{'Make this theme available to users'|@translate}" class="tiptip">{'Activate'|@translate}</a> 82 {else} 83 <span title="{$theme.ACTIVATE_TOOLTIP}" class="tiptip">{'Activate'|@translate}</span> 84 {/if} 85 | 86 {if $theme.DELETABLE} 87 <a href="{$delete_baseurl}{$theme.ID}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a> 88 {else} 89 <span title="{$theme.DELETE_TOOLTIP}" class="tiptip">{'Delete'|@translate}</span> 90 {/if} 35 91 {/if} 36 92 </div> 37 93 </div> <!-- themeActions --> 38 94 </div> 39 {/foreach} 40 </div> <!-- themeBoxes --> 41 {/if} 42 </fieldset> 43 44 {if isset($inactive_themes)} 45 <fieldset> 46 <legend>{'Inactive Themes'|@translate}</legend> 47 <div class="themeBoxes"> 48 {foreach from=$inactive_themes item=theme} 49 <div class="themeBox"> 50 <div class="themeName">{$theme.name}{if $theme.mobile} <em>({'Mobile'|@translate})</em>{/if}</div> 51 <div class="themeShot"><a href="{$theme.screenshot}" class="preview-box" title="{$theme.name}"><img src="{$theme.screenshot}" alt=""></a></div> 52 <div class="themeActions"> 53 <div> 54 {if $theme.activable} 55 <a href="{$activate_baseurl}{$theme.id}" title="{'Make this theme available to users'|@translate}" class="tiptip">{'Activate'|@translate}</a> 56 {else} 57 <span title="{$theme.activate_tooltip}" class="tiptip">{'Activate'|@translate}</span> 58 {/if} 59 60 | 61 62 {if $theme.deletable} 63 <a href="{$delete_baseurl}{$theme.id}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a> 64 {else} 65 <span title="{$theme.delete_tooltip}" class="tiptip">{'Delete'|@translate}</span> 66 {/if} 67 </div> 68 </div> 69 70 </div> 95 71 96 {/foreach} 72 97 </div> <!-- themeBoxes --> 73 98 </fieldset> 74 {/if}75 99 76 100 </div> <!-- themesContent --> -
trunk/admin/themes/default/theme.css
r23121 r23259 759 759 #thePopuphelpPage #footer {display:none} 760 760 761 .themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; -moz-border-radius:5px; overflow:hidden; }761 .themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; border-radius:5px; overflow:hidden; } 762 762 763 763 .themeBox IMG {border:1px solid white; margin:0 15px;} 764 .themeName {font-size:1 .1em; margin:5px 0;}764 .themeName {font-size:1em; margin:5px 0; position:relative; } 765 765 .themeActions {display: table-row; font-size:12px; height: 43px; } 766 766 .themeActions DIV {display: table-cell; vertical-align: middle; line-height:18px; } … … 865 865 .languageActions DIV {display: table-cell; vertical-align: middle; line-height:18px; } 866 866 867 #ui-datepicker-div {-moz-border-radius:5px; }867 #ui-datepicker-div {-moz-border-radius:5px; border-radius:5px;} 868 868 #ui-datepicker-div .ui-icon-circle-triangle-w, #ui-datepicker-div .ui-icon-circle-triangle-e {color:transparent;} 869 869 #ui-datepicker-div A.ui-datepicker-prev, #ui-datepicker-div A.ui-datepicker-next {background-color:transparent;} … … 1101 1101 -moz-border-radius:10px; 1102 1102 -webkit-border-radius:10px; 1103 -border-radius:10px;1104 1103 margin-left:5px; 1105 1104 } -
trunk/admin/themes_installed.php
r19703 r23259 66 66 } 67 67 68 $active_themes = array(); 69 $inactive_themes = array(); 68 $tpl_themes = array(); 70 69 71 70 foreach ($themes->fs_themes as $theme_id => $fs_theme) … … 75 74 continue; 76 75 } 76 77 $tpl_theme = array( 78 'ID' => $theme_id, 79 'NAME' => $fs_theme['name'], 80 'VISIT_URL' => $fs_theme['uri'], 81 'VERSION' => $fs_theme['version'], 82 'DESC' => $fs_theme['description'], 83 'AUTHOR' => $fs_theme['author'], 84 'AUTHOR_URL' => @$fs_theme['author uri'], 85 'PARENT' => @$fs_theme['parent'], 86 'SCREENSHOT' => $fs_theme['screenshot'], 87 'IS_MOBILE' => $fs_theme['mobile'], 88 'ADMIN_URI' => @$fs_theme['admin_uri'], 89 ); 77 90 78 91 if (in_array($theme_id, $db_theme_ids)) 79 92 { 80 $fs_theme['deactivable'] = true; 93 $tpl_theme['STATE'] = 'active'; 94 $tpl_theme['DEACTIVABLE'] = true; 81 95 82 96 if (count($db_theme_ids) <= 1) 83 97 { 84 $ fs_theme['deactivable'] = false;85 $ fs_theme['deactivate_tooltip'] = l10n('Impossible to deactivate this theme, you need at least one theme.');98 $tpl_theme['DEACTIVABLE'] = false; 99 $tpl_theme['DEACTIVATE_TOOLTIP'] = l10n('Impossible to deactivate this theme, you need at least one theme.'); 86 100 } 87 88 if ($theme_id == $default_theme) 101 102 $tpl_theme['IS_DEFAULT'] = ($theme_id == $default_theme); 103 } 104 else 105 { 106 $tpl_theme['STATE'] = 'inactive'; 107 108 // is the theme "activable" ? 109 if (isset($fs_theme['activable']) and !$fs_theme['activable']) 89 110 { 90 $ fs_theme['is_default'] = true;91 array_unshift($active_themes, $fs_theme);111 $tpl_theme['ACTIVABLE'] = false; 112 $tpl_theme['ACTIVABLE_TOOLTIP'] = l10n('This theme was not designed to be directly activated'); 92 113 } 93 114 else 94 115 { 95 $fs_theme['is_default'] = false; 96 array_push($active_themes, $fs_theme); 97 } 98 } 99 else 100 { 101 // is the theme "activable" ? 102 if (isset($fs_theme['activable']) and !$fs_theme['activable']) 103 { 104 $fs_theme['activate_tooltip'] = l10n('This theme was not designed to be directly activated'); 105 } 106 else 107 { 108 $fs_theme['activable'] = true; 116 $tpl_theme['ACTIVABLE'] = true; 109 117 } 110 118 … … 112 120 if (isset($missing_parent)) 113 121 { 114 $ fs_theme['activable'] = false;122 $tpl_theme['ACTIVABLE'] = false; 115 123 116 $ fs_theme['activate_tooltip'] = sprintf(124 $tpl_theme['ACTIVABLE_TOOLTIP'] = sprintf( 117 125 l10n('Impossible to activate this theme, the parent theme is missing: %s'), 118 126 $missing_parent … … 123 131 $children = $themes->get_children_themes($theme_id); 124 132 125 $ fs_theme['deletable'] = true;133 $tpl_theme['DELETABLE'] = true; 126 134 127 135 if (count($children) > 0) 128 136 { 129 $ fs_theme['deletable'] = false;137 $tpl_theme['DELETABLE'] = false; 130 138 131 $ fs_theme['delete_tooltip'] = sprintf(139 $tpl_theme['DELETE_TOOLTIP'] = sprintf( 132 140 l10n('Impossible to delete this theme. Other themes depends on it: %s'), 133 141 implode(', ', $children) 134 142 ); 135 143 } 144 } 145 146 array_push($tpl_themes, $tpl_theme); 147 } 136 148 137 array_push($inactive_themes, $fs_theme); 138 } 149 // sort themes by state then by name 150 function cmp($a, $b) 151 { 152 $s = array('active' => 0, 'inactive' => 1); 153 154 if (@$a['IS_DEFAULT']) return -1; 155 if (@$b['IS_DEFAULT']) return 1; 156 157 if($a['STATE'] == $b['STATE']) 158 return strcasecmp($a['NAME'], $b['NAME']); 159 else 160 return $s[$a['STATE']] >= $s[$b['STATE']]; 139 161 } 162 usort($tpl_themes, 'cmp'); 140 163 141 164 $template->assign( … … 146 169 'delete_baseurl' => $base_url.'&action=delete&theme=', 147 170 148 'active_themes' => $active_themes, 149 'inactive_themes' => $inactive_themes, 171 'tpl_themes' => $tpl_themes, 150 172 ) 151 173 );
Note: See TracChangeset
for help on using the changeset viewer.