Changeset 1476:c45f3be639b6 for admin/posts_actions.php
- Timestamp:
- 08/19/13 16:38:02 (11 years ago)
- Branch:
- default
- Children:
- 1477:6ffbcd3cfb6f, 1480:9451796b02e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ?>
Note: See TracChangeset
for help on using the changeset viewer.