Changeset 2192:511c654d4adb for admin
- Timestamp:
- 10/01/13 21:54:38 (12 years ago)
- Branch:
- dcRepo
- Location:
- admin
- Files:
-
- 2 edited
-
blog_theme.php (modified) (3 diffs)
-
js/_blog_theme.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin/blog_theme.php
r2182 r2192 116 116 # -- Page header -- 117 117 dcPage::open(__('Themes management'), 118 // (!$conf_file ? dcPage::jsLoad('js/_blog_theme.js') : '').118 dcPage::jsLoad('js/_blog_theme.js'). 119 119 dcPage::jsPageTabs(). 120 120 dcPage::jsColorPicker(), … … 181 181 ->displayModulesList( 182 182 /* cols */ array('sshot', 'name', 'config', 'desc', 'author', 'version', 'parent'), 183 /* actions */ array('deactivate', 'delete') 183 /* actions */ array('select', 'deactivate', 'delete') 184 ); 185 } 186 187 $modules = $core->themes->getDisabledModules(); 188 if (!empty($modules)) { 189 190 echo 191 '<h3>'.__('Deactivated themes').'</h3>'. 192 '<p>'.__('Deactivated themes are installed but not usable. You can activate them from here.').'</p>'; 193 194 $list 195 ->newList('theme-deactivate') 196 ->setModules($modules) 197 ->setPageTab('themes') 198 ->displayModulesList( 199 /* cols */ array('name', 'distrib'), 200 /* actions */ array('activate', 'delete') 184 201 ); 185 202 } … … 205 222 ->displayNavMenu() 206 223 ->displayModulesList( 207 /* cols */ array('expander', 'sshot', 'name', 'config', 'desc', 'author', 'version', 'parent' ),224 /* cols */ array('expander', 'sshot', 'name', 'config', 'desc', 'author', 'version', 'parent', 'distrib'), 208 225 /* actions */ array('install'), 209 226 /* nav limit */ true -
admin/js/_blog_theme.js
r2101 r2192 1 1 $(function() { 2 $('#themes-actions').hide(); 3 var submit_s = $('#themes-actions input[name=select]'); 4 var submit_r = $('#themes-actions input[name=remove]'); 5 6 var details = $('#themes div.theme-details'); 7 $('div.theme-actions',details).hide(); 8 $('input:radio',details).hide(); 9 $('div.theme-info span, div.theme-info a',details).hide(); 10 details.removeClass('theme-details').addClass('theme-details-js'); 11 12 var themes_wrapper = $('<div id="themes-wrapper"></div>'); 13 var theme_box = $('<div id="theme-box"><div</div>'); 14 $('#themes').wrap(themes_wrapper).before(theme_box); 15 16 details.each(function() { 17 var box = this; 18 var a = $(document.createElement('a')); 19 a.attr('href','#'); 20 a.attr('title',$('>div h3>label',this).text()); 21 $(box).wrap(a); 22 $(box).parent().click(function(event) { 23 update_box(box); 24 event.preventDefault(); 25 return false; 2 $('.module-name').not('.current-theme .module-name').each(function(){ 3 $(this).toggleWithLegend($(this).parent().children('.module-infos'),{legend_click: true}); 4 }); 5 /* Exemple for toggle on screenshot 6 $('.module-sshot').not('.current-theme .module-name').each(function(){ 7 $(this).toggleWithLegend($(this).parent().children('.module-infos'),{ 8 img_on_src: '', 9 img_on_alt: '', 10 img_off_src: '', 11 img_off_alt: '', 12 legend_click: true 26 13 }); 27 14 }); 28 29 function update_box(e) { 30 theme_box.empty(); 31 var img = $('div.theme-shot',e).clone(); 32 var info = $('div.theme-info',e).clone(); 33 34 if ($(e).hasClass('current-theme')) { 35 var actions = $('div.theme-actions',e).clone(); 36 actions.show(); 37 } else { 38 var actions = $('<div class="theme-actions"></div>'); 39 if (submit_s.length > 0 && !$('input:radio',info).attr('disabled')) { 40 var select = $('<a href="#" class="button">' + dotclear.msg.use_this_theme + '</a>'); 41 select.addClass('select-button').click(function(){ 42 submit_s.click(); 43 return false; 44 }); 45 actions.append(select).append(' '); 46 } 47 if (submit_r.length > 0 && $('input:radio',info).attr('id') != 'theme_default') { 48 var remove = $('<a href="#" class="button delete">' + dotclear.msg.remove_this_theme + '</a>'); 49 remove.click(function() { 50 var t_name = $(this).parents('#theme-box').find('div.theme-info h3:first').text(); 51 t_name = $.trim(t_name); 52 if (window.confirm(dotclear.msg.confirm_delete_theme.replace('%s',t_name))) { 53 submit_r.click(); 54 } 55 return false; 56 }); 57 actions.append(remove); 58 } 59 } 60 61 $('input:radio',info).remove(); 62 $('span, a',info).show(); 63 64 theme_box.append(img).append(info).append(actions); 65 details.removeClass('theme-selected'); 66 $(e).addClass('theme-selected'); 67 $('input:radio',e).prop('checked',true); 68 } 69 70 update_box(details[0]); 15 */ 71 16 });
Note: See TracChangeset
for help on using the changeset viewer.
