Dotclear


Ignore:
Timestamp:
07/10/11 21:58:19 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
themes
Message:

Mise en place gestion paramétrée des types de liste de billets (home, catégorie, search, tag, archive-month)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • themes/ductile/_config.php

    r515 r563  
    1313 
    1414l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); 
     15 
     16$list_types = array( 
     17     __('Title') => 'title', 
     18     __('Short') => 'short', 
     19     __('Full') => 'full' 
     20); 
     21 
     22$contexts = array( 
     23     'default' => __('Home (first page)'), 
     24     'default-page' => __('Home (other pages)'), 
     25     'category' => __('Entries for a category'), 
     26     'tag' => __('Entries for a tag'), 
     27     'search' => __('Search result entries'), 
     28     'archive-month' => __('Month archive entries') 
     29); 
    1530 
    1631$sticker_images = array( 
     
    111126if (!is_array($ductile_stickers)) { 
    112127     $ductile_stickers = $ductile_stickers_base; 
     128} 
     129 
     130$ductile_lists_base = array( 
     131     'default' => null, 
     132     'default-page' => null, 
     133     'category' => null, 
     134     'tag' => null, 
     135     'search' => null, 
     136     'archive-month' => null 
     137); 
     138 
     139$ductile_lists = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_lists'); 
     140$ductile_lists = @unserialize($ductile_lists); 
     141if (!is_array($ductile_lists)) { 
     142     $ductile_lists = $ductile_lists_base; 
    113143} 
    114144 
     
    147177                    $ductile_stickers[$i]['image'] = null; 
    148178               } 
     179 
     180               for ($i = 0; $i < count($_POST['list_type']); $i++) { 
     181                    $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i]; 
     182               } 
     183                
    149184          } 
    150185           
     
    180215          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user)); 
    181216          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers)); 
     217          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists)); 
    182218          $core->blog->triggerBlog(); 
    183219 
     
    242278echo '</fieldset>'; 
    243279 
     280echo '<fieldset><legend>'.__('Entries list types').'</legend>'; 
     281 
     282echo '<table id="entrieslist">'.'<caption>'.__('Entries lists').'</caption>'. 
     283'<thead>'. 
     284'<tr>'. 
     285'<th scope="col">'.__('Context').'</th>'. 
     286'<th scope="col">'.__('Entries list type').'</th>'. 
     287'</tr>'. 
     288'</thead>'. 
     289'<tbody>'; 
     290foreach ($ductile_lists as $k => $v) { 
     291     echo  
     292          '<tr>'. 
     293          '<td scope="raw">'.$contexts[$k].'</td>'. 
     294          '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>'. 
     295          '</tr>'; 
     296} 
     297echo 
     298'</tbody>'. 
     299'</table>'; 
     300 
     301echo '</fieldset>'; 
     302 
    244303echo '<input type="hidden" name="conf_tab" value="html">'; 
    245304echo '<p class="clear"><input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map