Dotclear

Changeset 2192:511c654d4adb for admin


Ignore:
Timestamp:
10/01/13 21:54:38 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
dcRepo
Message:

Next step for themes manager, to be continued

Location:
admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/blog_theme.php

    r2182 r2192  
    116116# -- Page header -- 
    117117dcPage::open(__('Themes management'), 
    118 //   (!$conf_file ? dcPage::jsLoad('js/_blog_theme.js') : ''). 
     118     dcPage::jsLoad('js/_blog_theme.js'). 
    119119     dcPage::jsPageTabs(). 
    120120     dcPage::jsColorPicker(), 
     
    181181          ->displayModulesList( 
    182182               /* 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(); 
     188if (!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') 
    184201          ); 
    185202} 
     
    205222          ->displayNavMenu() 
    206223          ->displayModulesList( 
    207                /* cols */          array('expander', 'sshot', 'name', 'config', 'desc', 'author', 'version', 'parent'), 
     224               /* cols */          array('expander', 'sshot', 'name', 'config', 'desc', 'author', 'version', 'parent', 'distrib'), 
    208225               /* actions */  array('install'), 
    209226               /* nav limit */     true 
  • admin/js/_blog_theme.js

    r2101 r2192  
    11$(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 
    2613          }); 
    2714     }); 
    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('&nbsp;&nbsp;'); 
    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*/ 
    7116}); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map