Changes in [2127:0bdb7068c050:2139:abcd1153037c]
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/blogs.php
r2107 r2137 31 31 $order = !empty($_GET['order']) ? $_GET['order'] : 'desc'; 32 32 33 $show_filters = false; 34 33 35 $page = !empty($_GET['page']) ? max(1,(integer) $_GET['page']) : 1; 34 36 $nb_per_page = 30; 35 37 36 38 if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { 39 if ($nb_per_page != $_GET['nb']) { 40 $show_filters = true; 41 } 37 42 $nb_per_page = (integer) $_GET['nb']; 38 43 } 39 40 $show_filters = false;41 44 42 45 # - Search filter … … 69 72 /* DISPLAY 70 73 -------------------------------------------------------- */ 71 $starting_script = ''; 72 if (!$show_filters) { 73 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 74 } 74 75 $form_filter_title = __('Filter blogs list and display options'); 76 $starting_script = dcPage::jsLoad('js/filter-controls.js'); 77 $starting_script .= 78 '<script type="text/javascript">'."\n". 79 "//<![CDATA["."\n". 80 dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true':'false')."\n". 81 dcPage::jsVar('dotclear.msg.filter_posts_list',$form_filter_title)."\n". 82 dcPage::jsVar('dotclear.msg.cancel_the_filter',__('Cancel the filter'))."\n". 83 "//]]>". 84 "</script>"; 85 75 86 dcPage::open(__('List of blogs'),$starting_script, 76 87 dcPage::breadcrumb( … … 89 100 if ($core->auth->isSuperAdmin()) { 90 101 echo '<p class="top-add"><a class="button add" href="blog.php">'.__('Create a new blog').'</a></p>'; 91 }92 93 if (!$show_filters) {94 echo '<p><a id="filter-control" class="form-control" href="#">'.__('Filter blogs list').'</a></p>';95 102 } 96 103 … … 124 131 if ($nb_blog == 0) 125 132 { 126 echo '<p><strong>'.__('No blog').'</strong></p>'; 133 if( $show_filters ) { 134 echo '<p><strong>'.__('No blog matches the filter').'</strong></p>'; 135 } else { 136 echo '<p><strong>'.__('No blog').'</strong></p>'; 137 } 127 138 } 128 139 else … … 134 145 echo 135 146 '<div class="table-outer">'. 136 '<table class="clear"><caption class="hidden">'.__('Blogs list').'</caption><tr>'. 147 '<table class="clear">'; 148 149 if( $show_filters ) { 150 echo '<caption>'.sprintf(__('List of %s blogs match the filter.'), $nb_blog).'</caption>'; 151 } else { 152 echo '<caption class="hidden">'.__('Blogs list').'</caption>'; 153 } 154 155 echo 156 '<tr>'. 137 157 '<th scope="col" class="nowrap">'.__('Blog id').'</th>'. 138 158 '<th scope="col">'.__('Blog name').'</th>'. -
admin/comments.php
r1999 r2136 152 152 /* DISPLAY 153 153 -------------------------------------------------------- */ 154 $starting_script = dcPage::jsLoad('js/_comments.js'); 155 if (!$show_filters) { 156 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 157 } 154 155 $form_filter_title = __('Filter comments, trackbacks list and display options'); 156 $starting_script = dcPage::jsLoad('js/_comments.js'); 157 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 158 $starting_script .= 159 '<script type="text/javascript">'."\n". 160 "//<![CDATA["."\n". 161 dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true':'false')."\n". 162 dcPage::jsVar('dotclear.msg.filter_posts_list',$form_filter_title)."\n". 163 dcPage::jsVar('dotclear.msg.cancel_the_filter',__('Cancel the filter'))."\n". 164 "//]]>". 165 "</script>"; 158 166 159 167 dcPage::open(__('Comments and trackbacks'),$starting_script, … … 203 211 echo '</form>'; 204 212 } 205 206 # Filters207 if (!$show_filters) {208 echo '<p><a id="filter-control" class="form-control" href="#">'.209 __('Filter comments and trackbacks list').'</a></p>';210 }211 213 212 214 echo … … 269 271 '</div>'. 270 272 271 '</form>' 273 '</form>', 274 $show_filters 272 275 ); 273 276 } -
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
r2072 r2136 212 212 /* DISPLAY 213 213 -------------------------------------------------------- */ 214 $starting_script = dcPage::jsLoad('js/_posts_list.js'); 215 if (!$show_filters) { 216 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 217 } 214 215 $form_filter_title = __('Filter users list and display options'); 216 $starting_script = dcPage::jsLoad('js/_posts_list.js'); 217 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 218 $starting_script .= 219 '<script type="text/javascript">'."\n". 220 "//<![CDATA["."\n". 221 dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true':'false')."\n". 222 dcPage::jsVar('dotclear.msg.filter_posts_list',$form_filter_title)."\n". 223 dcPage::jsVar('dotclear.msg.cancel_the_filter',__('Cancel the filter'))."\n". 224 "//]]>". 225 "</script>"; 218 226 219 227 dcPage::open(__('Entries'),$starting_script, … … 232 240 { 233 241 echo 234 '<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>'; 235 236 if (!$show_filters) { 237 echo '<p><a id="filter-control" class="form-control" href="#">'. 238 __('Filter posts list').'</a></p>'; 239 } 240 241 echo 242 '<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>'. 242 243 '<form action="posts.php" method="get" id="filters-form">'. 243 '<h3 class=" hidden">'.__('Filter posts list').'</h3>'.244 '<h3 class="out-of-screen-if-js">'.$form_filter_title.'</h3>'. 244 245 245 246 '<div class="table">'. … … 303 304 $core->formNonce(). 304 305 '</div>'. 305 '</form>' 306 '</form>', 307 $show_filters 306 308 ); 307 309 } -
admin/style/default.css
r2126 r2138 1299 1299 color: #000; 1300 1300 } 1301 a.form-control.open { 1302 background: url(../images/hide.png) no-repeat 4px center; 1303 } 1301 1304 #filters-form { 1302 1305 border: 1px dashed #999; -
admin/users.php
r1912 r2137 38 38 $core->callBehavior('adminUsersActionsCombo',array(&$combo_action)); 39 39 40 $show_filters = false; 40 41 41 42 #?Get users … … 44 45 45 46 if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { 47 if ($nb_per_page != $_GET['nb']) { 48 $show_filters = true; 49 } 46 50 $nb_per_page = $_GET['nb']; 47 51 } … … 53 57 $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); 54 58 55 $show_filters = false;56 59 57 60 # - Search filter … … 89 92 /* DISPLAY 90 93 -------------------------------------------------------- */ 91 $starting_script = dcPage::jsLoad('js/_users.js'); 92 if (!$show_filters) { 93 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 94 } 94 95 $form_filter_title = __('Filter users list and display options'); 96 $starting_script = dcPage::jsLoad('js/_users.js'); 97 $starting_script .= dcPage::jsLoad('js/filter-controls.js'); 98 $starting_script .= 99 '<script type="text/javascript">'."\n". 100 "//<![CDATA["."\n". 101 dcPage::jsVar('dotclear.msg.show_filters', $show_filters ? 'true':'false')."\n". 102 dcPage::jsVar('dotclear.msg.filter_posts_list',$form_filter_title)."\n". 103 dcPage::jsVar('dotclear.msg.cancel_the_filter',__('Cancel the filter'))."\n". 104 "//]]>". 105 "</script>"; 95 106 96 107 dcPage::open(__('Users'),$starting_script, … … 112 123 113 124 echo 114 '<p class="top-add"><strong><a class="button add" href="user.php">'.__('New user').'</a></strong></p>'; 115 116 if (!$show_filters) { 117 echo '<p><a id="filter-control" class="form-control" href="#">'.__('Filter users list').'</a></p>'; 118 } 119 120 echo 125 '<p class="top-add"><strong><a class="button add" href="user.php">'.__('New user').'</a></strong></p>'. 121 126 '<form action="users.php" method="get" id="filters-form">'. 122 '<h3 class=" hidden">'.__('Filter users list').'</h3>'.127 '<h3 class="out-of-screen-if-js">'.$form_filter_title.'</h3>'. 123 128 124 129 '<div class="table">'. … … 166 171 '</p>'. 167 172 '</div>'. 168 '</form>' 173 '</form>', 174 $show_filters 169 175 ); 170 176 } -
inc/admin/lib.pager.php
r2127 r2138 151 151 class adminPostList extends adminGenericList 152 152 { 153 public function display($page,$nb_per_page,$enclose_block='' )153 public function display($page,$nb_per_page,$enclose_block='',$filter=false) 154 154 { 155 155 if ($this->rs->isEmpty()) 156 156 { 157 echo '<p><strong>'.__('No entry').'</strong></p>'; 157 if( $filter ) { 158 echo '<p><strong>'.__('No entry matches the filter').'</strong></p>'; 159 } else { 160 echo '<p><strong>'.__('No entry').'</strong></p>'; 161 } 158 162 } 159 163 else … … 168 172 $html_block = 169 173 '<div class="table-outer">'. 170 '<table><caption class="hidden">'.__('Entries list').'</caption><tr>'. 174 '<table>'; 175 176 if( $filter ) { 177 $html_block .= '<caption>'.sprintf(__('List of %s entries match the filter.'), $this->rs_count).'</caption>'; 178 } else { 179 $html_block .= '<caption class="hidden">'.__('Entries list').'</caption>'; 180 } 181 182 $html_block .= '<tr>'. 171 183 '<th colspan="2" class="first">'.__('Title').'</th>'. 172 184 '<th scope="col">'.__('Date').'</th>'. … … 362 374 class adminCommentList extends adminGenericList 363 375 { 364 public function display($page,$nb_per_page,$enclose_block='' )376 public function display($page,$nb_per_page,$enclose_block='',$filter=false) 365 377 { 366 378 if ($this->rs->isEmpty()) 367 379 { 368 echo '<p><strong>'.__('No comment').'</strong></p>'; 380 if( $filter ) { 381 echo '<p><strong>'.__('No comments or trackbacks matches the filter').'</strong></p>'; 382 } else { 383 echo '<p><strong>'.__('No comment').'</strong></p>'; 384 } 369 385 } 370 386 else … … 380 396 $html_block = 381 397 '<div class="table-outer">'. 382 '<table><caption class="hidden">'.__('Comments and trackbacks list').'</caption><tr>'. 398 '<table>'; 399 400 if( $filter ) { 401 $html_block .= '<caption>'.sprintf(__('List of %s Comments or trackbacks match the filter.'), $this->rs_count).'</caption>'; 402 } else { 403 $html_block .= '<caption class="hidden">'.__('Comments and trackbacks list').'</caption>'; 404 } 405 406 $html_block .= '<tr>'. 383 407 '<th colspan="2" scope="col" abbr="comm" class="first">'.__('Type').'</th>'. 384 408 '<th scope="col">'.__('Author').'</th>'. … … 477 501 class adminUserList extends adminGenericList 478 502 { 479 public function display($page,$nb_per_page,$enclose_block='' )503 public function display($page,$nb_per_page,$enclose_block='',$filter=false) 480 504 { 481 505 if ($this->rs->isEmpty()) 482 506 { 483 echo '<p><strong>'.__('No user').'</strong></p>'; 507 if( $filter ) { 508 echo '<p><strong>'.__('No user matches the filter').'</strong></p>'; 509 } else { 510 echo '<p><strong>'.__('No user').'</strong></p>'; 511 } 484 512 } 485 513 else … … 489 517 $html_block = 490 518 '<div class="table-outer clear">'. 491 '<table><caption class="hidden">'.__('Users list').'</caption><tr>'. 519 '<table>'; 520 521 if( $filter ) { 522 $html_block .= '<caption>'.sprintf(__('List of %s users match the filter.'), $this->rs_count).'</caption>'; 523 } else { 524 $html_block .= '<caption class="hidden">'.__('Users list').'</caption>'; 525 } 526 527 $html_block .= '<tr>'. 492 528 '<th colspan="2" scope="col" class="first">'.__('Username').'</th>'. 493 529 '<th scope="col">'.__('First Name').'</th>'.
Note: See TracChangeset
for help on using the changeset viewer.