Changeset 2494:b168f47c7f9c
- Timestamp:
- 10/26/13 18:32:22 (10 years ago)
- Branch:
- 2.6
- Children:
- 2496:e33dcbc18e36, 2497:2d9e6d2d0d65
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/actions/class.dcactionposts.php
r2309 r2494 28 28 29 29 } 30 30 31 31 public function beginPage($breadcrumb='',$head='') { 32 32 if ($this->in_plugin) { … … 46 46 echo '<p><a class="back" href="'.$this->getRedirection(true).'">'.__('Back to entries list').'</a></p>'; 47 47 } 48 48 49 49 public function endPage() { 50 50 if ($this->in_plugin) { … … 54 54 } 55 55 } 56 56 57 57 public function error(Exception $e) { 58 58 $this->core->error->add($e->getMessage()); … … 66 66 $this->endPage(); 67 67 } 68 68 69 69 protected function fetchEntries($from) { 70 70 if (!empty($from['entries'])) 71 71 { 72 72 $entries = $from['entries']; 73 73 74 74 foreach ($entries as $k => $v) { 75 75 $entries[$k] = (integer) $v; 76 76 } 77 77 78 78 $params['sql'] = 'AND P.post_id IN('.implode(',',$entries).') '; 79 79 80 80 if (!isset($from['full_content']) || empty($from['full_content'])) { 81 81 $params['no_content'] = true; 82 82 } 83 83 84 84 if (isset($from['post_type'])) { 85 85 $params['post_type'] = $from['post_type']; 86 86 } 87 87 88 88 $posts = $this->core->blog->getPosts($params); 89 89 while ($posts->fetch()) { 90 90 $this->entries[$posts->post_id] = $posts->post_title; 91 91 } 92 $this->rs = $posts; 92 $this->rs = $posts; 93 93 } else { 94 94 $this->rs = $this->core->con->select("SELECT blog_id FROM ".$this->core->prefix."blog WHERE false");; … … 97 97 } 98 98 99 class dcDefaultPostActions 99 class dcDefaultPostActions 100 100 { 101 101 public static function adminPostsActionsPage($core, $ap) { … … 170 170 $ap->redirect(true); 171 171 } 172 172 173 173 public static function doUpdateSelectedPost($core, dcPostsActionsPage $ap, $post) { 174 174 $posts_ids = $ap->getIDs(); … … 199 199 $ap->redirect(true); 200 200 } 201 201 202 202 public static function doDeletePost($core, dcPostsActionsPage $ap, $post) { 203 203 … … 212 212 $core->callBehavior('adminBeforePostDelete',(integer) $post_id); 213 213 } 214 214 215 215 # --BEHAVIOR-- adminBeforePostsDelete 216 216 $core->callBehavior('adminBeforePostsDelete',$posts_ids); 217 217 218 218 $core->blog->delPosts($posts_ids); 219 219 dcPage::addSuccessNotice(sprintf( … … 225 225 count($posts_ids)) 226 226 ); 227 227 228 228 $ap->redirect(false); 229 229 } … … 242 242 $cur_cat->cat_url = ''; 243 243 $title = $cur_cat->cat_title; 244 244 245 245 $parent_cat = !empty($post['new_cat_parent']) ? $post['new_cat_parent'] : ''; 246 246 247 247 # --BEHAVIOR-- adminBeforeCategoryCreate 248 248 $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 249 249 250 250 $new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 251 251 252 252 # --BEHAVIOR-- adminAfterCategoryCreate 253 253 $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id); 254 254 } 255 255 256 256 $core->blog->updPostsCategory($posts_ids, $new_cat_id); 257 257 $title = $core->blog->getCategory($new_cat_id); … … 280 280 $categories_combo = dcAdminCombos::getCategoriesCombo( 281 281 $core->blog->getCategories() 282 ); 282 ); 283 283 echo 284 284 '<form action="'.$ap->getURI().'" method="post">'. … … 286 286 '<p><label for="new_cat_id" class="classic">'.__('Category:').'</label> '. 287 287 form::combo(array('new_cat_id'),$categories_combo,''); 288 288 289 289 if ($core->auth->check('categories', $core->blog->id)) { 290 echo 290 echo 291 291 '<div>'. 292 292 '<p id="new_cat">'.__('Create a new category for the post(s)').'</p>'. … … 298 298 '</div>'; 299 299 } 300 300 301 301 echo 302 302 $core->formNonce(). … … 308 308 309 309 } 310 310 311 311 } 312 312 public static function doChangePostAuthor($core, dcPostsActionsPage $ap, $post) { … … 320 320 throw new Exception(__('This user does not exist')); 321 321 } 322 322 323 323 $cur = $core->con->openCursor($core->prefix.'post'); 324 324 $cur->user_id = $new_user_id; … … 368 368 '<p><label for="new_auth_id" class="classic">'.__('New author (author ID):').'</label> '. 369 369 form::field('new_auth_id',20,255); 370 370 371 371 echo 372 372 $core->formNonce().$ap->getHiddenFields(). … … 403 403 html::escapeHTML($core->blog->name) => '', 404 404 $ap->getCallerTitle() => $ap->getRedirection(true), 405 _ ('Change language for this selection') => ''405 __('Change language for this selection') => '' 406 406 ))); 407 407 # lang list … … 420 420 unset($all_langs); 421 421 unset($rs); 422 422 423 423 echo 424 424 '<form action="'.$ap->getURI().'" method="post">'. 425 425 $ap->getCheckboxes(). 426 426 427 427 '<p><label for="new_lang" class="classic">'.__('Entry language:').'</label> '. 428 428 form::combo('new_lang',$lang_combo,''); 429 429 430 430 echo 431 431 $core->formNonce().$ap->getHiddenFields().
Note: See TracChangeset
for help on using the changeset viewer.