Dotclear


Ignore:
Timestamp:
07/13/11 07:28:49 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
themes
Message:

Configuration du nb de billets par page pour les contextes home (toute page), catégorie, tag, recherche.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • themes/ductile/_config.php

    r572 r583  
    143143} 
    144144 
     145$ductile_counts_base = array( 
     146     'default' => null, 
     147     'category' => null, 
     148     'tag' => null, 
     149     'search' => null 
     150); 
     151 
     152$ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts'); 
     153$ductile_counts = @unserialize($ductile_counts); 
     154if (!is_array($ductile_counts)) { 
     155     $ductile_counts = $ductile_counts_base; 
     156} 
     157 
     158 
    145159$conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html'; 
    146160 
     
    182196               } 
    183197                
     198               for ($i = 0; $i < count($_POST['count_nb']); $i++) { 
     199                    $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i]; 
     200               } 
     201                
    184202          } 
    185203           
     
    216234          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers)); 
    217235          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists)); 
     236          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_counts',serialize($ductile_counts)); 
    218237 
    219238          // Blog refresh 
     
    283302echo '</fieldset>'; 
    284303 
    285 echo '<fieldset><legend>'.__('Entries list types').'</legend>'; 
     304echo '<fieldset><legend>'.__('Entries list types and limits').'</legend>'; 
    286305 
    287306echo '<table id="entrieslist">'.'<caption>'.__('Entries lists').'</caption>'. 
     
    290309'<th scope="col">'.__('Context').'</th>'. 
    291310'<th scope="col">'.__('Entries list type').'</th>'. 
     311'<th scope="col">'.__('Number of entries').'</th>'. 
    292312'</tr>'. 
    293313'</thead>'. 
     
    297317          '<tr>'. 
    298318          '<td scope="raw">'.$contexts[$k].'</td>'. 
    299           '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>'. 
     319          '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>'; 
     320     if (array_key_exists($k,$ductile_counts)) { 
     321          echo '<td>'.form::hidden(array('count_ctx[]'),$k).form::field(array('count_nb[]'),2,3,$ductile_counts[$k]).'</td>'; 
     322     } else { 
     323          echo '<td></td>'; 
     324     } 
     325     echo 
    300326          '</tr>'; 
    301327} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map