Changeset 1476:c45f3be639b6
- Timestamp:
- 08/19/13 16:38:02 (12 years ago)
- Branch:
- default
- Children:
- 1477:6ffbcd3cfb6f, 1480:9451796b02e2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/posts.php
r1474 r1476 252 252 )) 253 253 ); 254 254 if (!empty($_GET['upd'])) { 255 dcPage::message(__('Selected entries have been successfully updated.')); 256 } elseif (!empty($_GET['del'])) { 257 dcPage::message(__('Selected entries have been successfully deleted.')); 258 } 255 259 if (!$core->error->flag()) 256 260 { -
admin/posts_actions.php
r1473 r1476 106 106 107 107 /** 108 * getEntriesQS - returns the list of entry fields as query string 109 * 110 * @access public 111 * @return the list of entry fields, html encoded 112 */ 113 public function getEntriesQS() { 114 $ret=array(); 115 foreach ($this->entries as $id=>$title) { 116 $ret[] = 'entries[]='.$id; 117 } 118 return join('&',$ret); 119 } 120 121 /** 108 122 * __toString - magic method. -- DEPRECATED here 109 123 * This method is only used to preserve compatibility with plugins … … 118 132 } 119 133 120 121 function listEntries($titles) { 122 $ret = 123 '<table class="posts-list"><tr>'. 124 '<th colspan="2">'.__('Title').'</th>'. 125 '</tr>'; 126 foreach ($titles as $id=>$title) { 127 $ret .= 128 '<tr><td>'. 129 form::checkbox(array('entries[]'),$id,true,'','').'</td>'. 130 '<td>'. $title.'</td></tr>'; 131 } 132 $ret .= '</table>'; 133 return $ret; 134 } 134 $fields = new FieldsList(); 135 135 136 136 /* Actions … … 179 179 while ($posts->fetch()) { 180 180 $posts_ids[] = $posts->post_id; 181 } 181 $fields->addEntry($posts->post_id,$posts->post_title); 182 } 183 // Redirection including selected entries 184 $redir_sel = $redir.'&'.$fields->getEntriesQS(); 182 185 183 186 # --BEHAVIOR-- adminPostsActions … … 197 200 $core->blog->updPostsStatus($posts_ids,$status); 198 201 199 http::redirect($redir );202 http::redirect($redir_sel.'&upd=1'); 200 203 } 201 204 catch (Exception $e) … … 210 213 $core->blog->updPostsSelected($posts_ids,$action == 'selected'); 211 214 212 http::redirect($redir );215 http::redirect($redir_sel."&upd=1"); 213 216 } 214 217 catch (Exception $e) … … 233 236 $core->blog->delPosts($posts_ids); 234 237 235 http::redirect($redir );238 http::redirect($redir."&del=1"); 236 239 } 237 240 catch (Exception $e) … … 266 269 $core->blog->updPostsCategory($posts_ids, $new_cat_id); 267 270 268 http::redirect($redir );271 http::redirect($redir_sel."&upd=1"); 269 272 } 270 273 catch (Exception $e) … … 288 291 $cur->update('WHERE post_id '.$core->con->in($posts_ids)); 289 292 290 http::redirect($redir );293 http::redirect($redir_sel."&upd=1"); 291 294 } 292 295 catch (Exception $e) … … 304 307 $cur->update('WHERE post_id '.$core->con->in($posts_ids)); 305 308 306 http::redirect($redir );309 http::redirect($redir_sel."&upd=1"); 307 310 } 308 311 catch (Exception $e) … … 325 328 )) 326 329 ); 330 331 echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>'; 327 332 328 333 dcPage::close(); … … 361 366 dcPage::close(); 362 367 exit; 363 }364 365 $fields = new FieldsList();366 while ($posts->fetch()) {367 $fields->addEntry($posts->post_id,$posts->post_title);368 368 } 369 369 … … 403 403 __('Change category for entries') => '' 404 404 )); 405 406 echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>'; 405 407 406 408 # categories list … … 452 454 '<span class="page-title">'.__('Change language for entries').'</span>' => '' 453 455 )); 454 456 echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>'; 457 455 458 # lang list 456 459 # Languages combo … … 492 495 '<span class="page-title">'.__('Change author for entries').'</span>' => '' 493 496 )); 494 497 echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>'; 498 495 499 echo 496 500 '<form action="posts_actions.php" method="post">'. … … 507 511 } 508 512 509 echo '<p><a class="back" href="'.html::escapeURL($redir).'">'.__('back').'</a></p>';510 511 513 dcPage::close(); 512 514 ?> -
inc/admin/lib.pager.php
r1468 r1476 42 42 $pager->html_next = $this->html_next; 43 43 $pager->var_page = 'page'; 44 44 $entries = array(); 45 if (isset($_REQUEST['entries'])) { 46 foreach ($_REQUEST['entries'] as $v) { 47 $entries[(integer)$v]=true; 48 } 49 } 45 50 $html_block = 46 51 '<table class="clear"><tr>'. … … 66 71 while ($this->rs->fetch()) 67 72 { 68 echo $this->postLine( );73 echo $this->postLine(isset($entries[$this->rs->post_id])); 69 74 } 70 75 … … 75 80 } 76 81 77 private function postLine( )82 private function postLine($checked) 78 83 { 79 84 if ($this->core->auth->check('categories',$this->core->blog->id)) { … … 128 133 $res .= 129 134 '<td class="nowrap">'. 130 form::checkbox(array('entries[]'),$this->rs->post_id, '','','',!$this->rs->isEditable()).'</td>'.135 form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable()).'</td>'. 131 136 '<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 132 137 html::escapeHTML($this->rs->post_title).'</a></td>'.
Note: See TracChangeset
for help on using the changeset viewer.