Changeset 2128:42a5c4990b87
- Timestamp:
- 09/22/13 02:31:51 (12 years ago)
- Branch:
- Ticket #1548
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/filter-controls.js
r0 r2128 1 1 $(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 } 8 28 return false; 9 29 }); -
admin/posts.php
r1912 r2128 235 235 /* DISPLAY 236 236 -------------------------------------------------------- */ 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 238 dcPage::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>", 243 248 dcPage::breadcrumb( 244 249 array( … … 255 260 { 256 261 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>'. 265 263 '<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 268 266 '<div class="table">'. 269 267 '<div class="cell">'. … … 326 324 $core->formNonce(). 327 325 '</div>'. 328 '</form>' 326 '</form>', 327 $show_filters 329 328 ); 330 329 } -
admin/style/default.css
r1979 r2128 578 578 color: #000; 579 579 } 580 a.form-control.open { 581 background: url(../images/hide.png) no-repeat 4px center; 582 } 580 583 .form-note { 581 584 font-style: italic; -
inc/admin/lib.pager.php
r1932 r2128 145 145 class adminPostList extends adminGenericList 146 146 { 147 public function display($page,$nb_per_page,$enclose_block='' )147 public function display($page,$nb_per_page,$enclose_block='',$filter=false) 148 148 { 149 149 if ($this->rs->isEmpty()) 150 150 { 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 } 152 156 } 153 157 else … … 160 164 } 161 165 } 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>'. 164 175 '<th colspan="2" class="first">'.__('Title').'</th>'. 165 176 '<th scope="col">'.__('Date').'</th>'.
Note: See TracChangeset
for help on using the changeset viewer.