Dotclear

Changeset 2128:42a5c4990b87


Ignore:
Timestamp:
09/22/13 02:31:51 (12 years ago)
Author:
Lepeltier kévin <kevin@…>
Branch:
Ticket #1548
Message:

Ticket #1548

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/js/filter-controls.js

    r0 r2128  
    11$(function() { 
    2      var c = $('#filter-control'); 
    3      c.css('display','inline'); 
    4      $('#filters-form').hide(); 
    5      c.click(function() { 
    6           $('#filters-form').show(); 
    7           $(this).hide(); 
     2      
     3     $filtersform = $('#filters-form'); 
     4     $filtersform.before('<p><a id="filter-control" class="form-control" href="?" style="display:inline">'+dotclear.msg.filter_posts_list+'</a></p>') 
     5      
     6     if( dotclear.msg.show_filters == 'false' ) { 
     7          $filtersform.hide(); 
     8     } else { 
     9          $('#filter-control') 
     10               .addClass('open') 
     11               .text(dotclear.msg.cancel_the_filter); 
     12     } 
     13      
     14     $('#filter-control').click(function() { 
     15          if( $(this).hasClass('open') ) { 
     16               if( dotclear.msg.show_filters == 'true' ) { 
     17                    return true; 
     18               } else { 
     19                    $filtersform.hide(); 
     20                    $(this).removeClass('open') 
     21                            .text(dotclear.msg.filter_posts_list); 
     22               } 
     23          } else { 
     24               $filtersform.show(); 
     25               $(this).addClass('open') 
     26                       .text(dotclear.msg.cancel_the_filter); 
     27          } 
    828          return false; 
    929     }); 
  • admin/posts.php

    r1912 r2128  
    235235/* DISPLAY 
    236236-------------------------------------------------------- */ 
    237 $starting_script = dcPage::jsLoad('js/_posts_list.js'); 
    238 if (!$show_filters) { 
    239      $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 
    240 } 
    241  
    242 dcPage::open(__('Entries'),$starting_script, 
     237 
     238dcPage::open(__('Entries'), 
     239     dcPage::jsLoad('js/_posts_list.js'). 
     240     dcPage::jsLoad('js/filter-controls.js'). 
     241     '<script type="text/javascript">'."\n". 
     242     "//<![CDATA["."\n". 
     243     dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true':'false')."\n". 
     244     dcPage::jsVar('dotclear.msg.filter_posts_list',__('Filter posts list'))."\n". 
     245     dcPage::jsVar('dotclear.msg.cancel_the_filter',__('Cancel the filter'))."\n". 
     246     "//]]>". 
     247     "</script>", 
    243248     dcPage::breadcrumb( 
    244249          array( 
     
    255260{ 
    256261     echo 
    257      '<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>'; 
    258       
    259      if (!$show_filters) { 
    260           echo '<p><a id="filter-control" class="form-control" href="#">'. 
    261           __('Filter posts list').'</a></p>'; 
    262      } 
    263       
    264      echo 
     262     '<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>'. 
    265263     '<form action="posts.php" method="get" id="filters-form">'. 
    266      '<h3 class="hidden">'.__('Filter posts list').'</h3>'. 
    267  
     264     '<h3 class="out-of-screen-if-js">'.__('Filters and display options').'</h3>'. 
     265      
    268266     '<div class="table">'. 
    269267     '<div class="cell">'. 
     
    326324     $core->formNonce(). 
    327325     '</div>'. 
    328      '</form>' 
     326     '</form>', 
     327     $show_filters 
    329328     ); 
    330329} 
  • admin/style/default.css

    r1979 r2128  
    578578     color: #000; 
    579579     } 
     580a.form-control.open { 
     581     background: url(../images/hide.png) no-repeat 4px center; 
     582     } 
    580583.form-note { 
    581584     font-style: italic; 
  • inc/admin/lib.pager.php

    r1932 r2128  
    145145class adminPostList extends adminGenericList 
    146146{ 
    147      public function display($page,$nb_per_page,$enclose_block='') 
     147     public function display($page,$nb_per_page,$enclose_block='',$filter=false) 
    148148     { 
    149149          if ($this->rs->isEmpty()) 
    150150          { 
    151                echo '<p><strong>'.__('No entry').'</strong></p>'; 
     151               if( $filter ) { 
     152                    echo '<p><strong>'.__('No entry matches the filter').'</strong></p>'; 
     153               } else { 
     154                    echo '<p><strong>'.__('No entry').'</strong></p>'; 
     155               } 
    152156          } 
    153157          else 
     
    160164                    } 
    161165               } 
    162                $html_block = 
    163                '<table class="clear"><caption class="hidden">'.__('Entries list').'</caption><tr>'. 
     166               $html_block  = '<table class="clear">'; 
     167                
     168               if( $filter ) { 
     169                    $html_block .= '<caption>'.sprintf(__('List of %s entries match the filter.'), $this->rs_count).'</caption>'; 
     170               } else { 
     171                    $html_block .= '<caption class="hidden">'.__('Entries list').'</caption>'; 
     172               } 
     173                          
     174               $html_block .= '<tr>'. 
    164175               '<th colspan="2" class="first">'.__('Title').'</th>'. 
    165176               '<th scope="col">'.__('Date').'</th>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map