[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[1179] | 6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
[0] | 7 | # Licensed under the GPL version 2.0 license. |
---|
| 8 | # See LICENSE file or |
---|
| 9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
| 10 | # |
---|
| 11 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
| 12 | |
---|
| 13 | require dirname(__FILE__).'/../inc/admin/prepend.php'; |
---|
| 14 | |
---|
| 15 | dcPage::check('usage,contentadmin'); |
---|
| 16 | |
---|
| 17 | $params = array(); |
---|
[1399] | 18 | |
---|
[1472] | 19 | /** |
---|
| 20 | * FieldsList - Compatibility class for hidden fields & entries[] fields |
---|
| 21 | * |
---|
| 22 | */ |
---|
[1471] | 23 | class FieldsList { |
---|
[1472] | 24 | /** @var array list of hidden fields */ |
---|
[1471] | 25 | protected $hidden; |
---|
[1472] | 26 | /** @var array list of selected entries */ |
---|
[1471] | 27 | protected $entries; |
---|
[1472] | 28 | |
---|
| 29 | |
---|
| 30 | /** |
---|
| 31 | * Class constructor |
---|
| 32 | */ |
---|
[1471] | 33 | public function __construct() { |
---|
| 34 | $this->hidden=array(); |
---|
| 35 | $this->entries =array(); |
---|
| 36 | } |
---|
[1472] | 37 | |
---|
| 38 | /** |
---|
| 39 | * addHidden - adds a hidden field |
---|
| 40 | * |
---|
| 41 | * @param string $name the field name. |
---|
| 42 | * @param mixed $value the field value. |
---|
| 43 | * |
---|
| 44 | * @access public |
---|
| 45 | * @return the FieldsList instance, enabling to chain requests |
---|
| 46 | */ |
---|
| 47 | public function addHidden($name,$value) { |
---|
[1471] | 48 | $this->hidden[] = form::hidden($name,$value); |
---|
| 49 | return $this; |
---|
| 50 | } |
---|
[1472] | 51 | |
---|
| 52 | /** |
---|
| 53 | * addEntry - adds a antry field |
---|
| 54 | * |
---|
| 55 | * @param string $id the entry id. |
---|
| 56 | * @param mixed $title the entry title. |
---|
| 57 | * |
---|
| 58 | * @access public |
---|
| 59 | * @return the FieldsList instance, enabling to chain requests |
---|
| 60 | */ |
---|
| 61 | public function addEntry($id,$title) { |
---|
[1471] | 62 | $this->entries[$id]=$title; |
---|
| 63 | return $this; |
---|
| 64 | } |
---|
| 65 | |
---|
[1472] | 66 | /** |
---|
| 67 | * getHidden - returns the list of hidden fields, html encoded |
---|
| 68 | * |
---|
| 69 | * @access public |
---|
| 70 | * @return the list of hidden fields, html encoded |
---|
| 71 | */ |
---|
| 72 | public function getHidden() { |
---|
[1471] | 73 | return join('',$this->hidden); |
---|
| 74 | } |
---|
| 75 | |
---|
[1472] | 76 | /** |
---|
| 77 | * getEntries - returns the list of entry fields, html encoded |
---|
| 78 | * |
---|
| 79 | * @param boolean $hidden if set to true, returns entries as a list of hidden field |
---|
| 80 | * if set to false, returns html code displaying the list of entries |
---|
| 81 | * with a list of checkboxes to enable to select/deselect entries |
---|
| 82 | * @access public |
---|
| 83 | * @return the list of entry fields, html encoded |
---|
| 84 | */ |
---|
[1471] | 85 | public function getEntries ($hidden=false) { |
---|
| 86 | $ret = ''; |
---|
| 87 | if ($hidden) { |
---|
| 88 | foreach ($this->entries as $id=> $e) { |
---|
| 89 | $ret .= form::hidden('entries[]',$id); |
---|
| 90 | } |
---|
| 91 | } else { |
---|
| 92 | $ret = |
---|
| 93 | '<table class="posts-list"><tr>'. |
---|
| 94 | '<th colspan="2">'.__('Title').'</th>'. |
---|
| 95 | '</tr>'; |
---|
| 96 | foreach ($this->entries as $id=>$title) { |
---|
| 97 | $ret .= |
---|
| 98 | '<tr><td>'. |
---|
| 99 | form::checkbox(array('entries[]'),$id,true,'','').'</td>'. |
---|
| 100 | '<td>'. $title.'</td></tr>'; |
---|
| 101 | } |
---|
| 102 | $ret .= '</table>'; |
---|
| 103 | } |
---|
| 104 | return $ret; |
---|
| 105 | } |
---|
| 106 | |
---|
[1472] | 107 | /** |
---|
| 108 | * __toString - magic method. -- DEPRECATED here |
---|
| 109 | * This method is only used to preserve compatibility with plugins |
---|
| 110 | * relying on previous versions of adminPostsActionsContent behavior, |
---|
| 111 | * |
---|
| 112 | * @access public |
---|
| 113 | * @return the list of hidden fields and entries (as hidden fields too), html encoded |
---|
| 114 | */ |
---|
[1471] | 115 | public function __toString() { |
---|
| 116 | return join('',$this->hidden).$this->getEntries(true); |
---|
| 117 | } |
---|
| 118 | } |
---|
| 119 | |
---|
| 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 | } |
---|
[0] | 135 | |
---|
| 136 | /* Actions |
---|
| 137 | -------------------------------------------------------- */ |
---|
| 138 | if (!empty($_POST['action']) && !empty($_POST['entries'])) |
---|
| 139 | { |
---|
| 140 | $entries = $_POST['entries']; |
---|
| 141 | $action = $_POST['action']; |
---|
| 142 | |
---|
| 143 | if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false) |
---|
| 144 | { |
---|
| 145 | $redir = $_POST['redir']; |
---|
| 146 | } |
---|
| 147 | else |
---|
| 148 | { |
---|
| 149 | $redir = |
---|
| 150 | 'posts.php?user_id='.$_POST['user_id']. |
---|
| 151 | '&cat_id='.$_POST['cat_id']. |
---|
| 152 | '&status='.$_POST['status']. |
---|
| 153 | '&selected='.$_POST['selected']. |
---|
| 154 | '&month='.$_POST['month']. |
---|
| 155 | '&lang='.$_POST['lang']. |
---|
| 156 | '&sortby='.$_POST['sortby']. |
---|
| 157 | '&order='.$_POST['order']. |
---|
| 158 | '&page='.$_POST['page']. |
---|
| 159 | '&nb='.$_POST['nb']; |
---|
| 160 | } |
---|
| 161 | |
---|
| 162 | foreach ($entries as $k => $v) { |
---|
| 163 | $entries[$k] = (integer) $v; |
---|
| 164 | } |
---|
| 165 | |
---|
| 166 | $params['sql'] = 'AND P.post_id IN('.implode(',',$entries).') '; |
---|
| 167 | |
---|
| 168 | if (!isset($_POST['full_content']) || empty($_POST['full_content'])) { |
---|
| 169 | $params['no_content'] = true; |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | if (isset($_POST['post_type'])) { |
---|
| 173 | $params['post_type'] = $_POST['post_type']; |
---|
| 174 | } |
---|
| 175 | |
---|
| 176 | $posts = $core->blog->getPosts($params); |
---|
| 177 | |
---|
[1030] | 178 | $posts_ids = array(); |
---|
| 179 | while ($posts->fetch()) { |
---|
| 180 | $posts_ids[] = $posts->post_id; |
---|
| 181 | } |
---|
| 182 | |
---|
[0] | 183 | # --BEHAVIOR-- adminPostsActions |
---|
| 184 | $core->callBehavior('adminPostsActions',$core,$posts,$action,$redir); |
---|
| 185 | |
---|
| 186 | if (preg_match('/^(publish|unpublish|schedule|pending)$/',$action)) |
---|
| 187 | { |
---|
| 188 | switch ($action) { |
---|
| 189 | case 'unpublish' : $status = 0; break; |
---|
| 190 | case 'schedule' : $status = -1; break; |
---|
| 191 | case 'pending' : $status = -2; break; |
---|
| 192 | default : $status = 1; break; |
---|
| 193 | } |
---|
| 194 | |
---|
| 195 | try |
---|
| 196 | { |
---|
[1030] | 197 | $core->blog->updPostsStatus($posts_ids,$status); |
---|
[0] | 198 | |
---|
| 199 | http::redirect($redir); |
---|
| 200 | } |
---|
| 201 | catch (Exception $e) |
---|
| 202 | { |
---|
| 203 | $core->error->add($e->getMessage()); |
---|
| 204 | } |
---|
| 205 | } |
---|
| 206 | elseif ($action == 'selected' || $action == 'unselected') |
---|
| 207 | { |
---|
| 208 | try |
---|
| 209 | { |
---|
[1030] | 210 | $core->blog->updPostsSelected($posts_ids,$action == 'selected'); |
---|
[0] | 211 | |
---|
| 212 | http::redirect($redir); |
---|
| 213 | } |
---|
| 214 | catch (Exception $e) |
---|
| 215 | { |
---|
| 216 | $core->error->add($e->getMessage()); |
---|
| 217 | } |
---|
| 218 | } |
---|
| 219 | elseif ($action == 'delete') |
---|
| 220 | { |
---|
| 221 | try |
---|
| 222 | { |
---|
[1030] | 223 | // Backward compatibility |
---|
| 224 | foreach($posts_ids as $post_id) |
---|
| 225 | { |
---|
[0] | 226 | # --BEHAVIOR-- adminBeforePostDelete |
---|
[1030] | 227 | $core->callBehavior('adminBeforePostDelete',(integer) $post_id); |
---|
[0] | 228 | } |
---|
| 229 | |
---|
[1030] | 230 | # --BEHAVIOR-- adminBeforePostsDelete |
---|
| 231 | $core->callBehavior('adminBeforePostsDelete',$posts_ids); |
---|
| 232 | |
---|
| 233 | $core->blog->delPosts($posts_ids); |
---|
| 234 | |
---|
[0] | 235 | http::redirect($redir); |
---|
| 236 | } |
---|
| 237 | catch (Exception $e) |
---|
| 238 | { |
---|
| 239 | $core->error->add($e->getMessage()); |
---|
| 240 | } |
---|
| 241 | |
---|
| 242 | } |
---|
| 243 | elseif ($action == 'category' && isset($_POST['new_cat_id'])) |
---|
| 244 | { |
---|
[1419] | 245 | $new_cat_id = $_POST['new_cat_id']; |
---|
| 246 | |
---|
[0] | 247 | try |
---|
| 248 | { |
---|
[1419] | 249 | if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) |
---|
| 250 | { |
---|
| 251 | $cur_cat = $core->con->openCursor($core->prefix.'category'); |
---|
| 252 | $cur_cat->cat_title = $_POST['new_cat_title']; |
---|
| 253 | $cur_cat->cat_url = ''; |
---|
| 254 | |
---|
| 255 | $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; |
---|
| 256 | |
---|
| 257 | # --BEHAVIOR-- adminBeforeCategoryCreate |
---|
| 258 | $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); |
---|
| 259 | |
---|
| 260 | $new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); |
---|
| 261 | |
---|
| 262 | # --BEHAVIOR-- adminAfterCategoryCreate |
---|
| 263 | $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id); |
---|
| 264 | } |
---|
| 265 | |
---|
| 266 | $core->blog->updPostsCategory($posts_ids, $new_cat_id); |
---|
[1030] | 267 | |
---|
[0] | 268 | http::redirect($redir); |
---|
| 269 | } |
---|
| 270 | catch (Exception $e) |
---|
| 271 | { |
---|
| 272 | $core->error->add($e->getMessage()); |
---|
| 273 | } |
---|
| 274 | } |
---|
| 275 | elseif ($action == 'author' && isset($_POST['new_auth_id']) |
---|
| 276 | && $core->auth->check('admin',$core->blog->id)) |
---|
| 277 | { |
---|
| 278 | $new_user_id = $_POST['new_auth_id']; |
---|
| 279 | |
---|
| 280 | try |
---|
| 281 | { |
---|
| 282 | if ($core->getUser($new_user_id)->isEmpty()) { |
---|
| 283 | throw new Exception(__('This user does not exist')); |
---|
| 284 | } |
---|
| 285 | |
---|
[1030] | 286 | $cur = $core->con->openCursor($core->prefix.'post'); |
---|
| 287 | $cur->user_id = $new_user_id; |
---|
| 288 | $cur->update('WHERE post_id '.$core->con->in($posts_ids)); |
---|
[0] | 289 | |
---|
| 290 | http::redirect($redir); |
---|
| 291 | } |
---|
| 292 | catch (Exception $e) |
---|
| 293 | { |
---|
| 294 | $core->error->add($e->getMessage()); |
---|
| 295 | } |
---|
| 296 | } |
---|
[1102] | 297 | elseif ($action == 'lang' && isset($_POST['new_lang'])) |
---|
| 298 | { |
---|
| 299 | $new_lang = $_POST['new_lang']; |
---|
| 300 | try |
---|
| 301 | { |
---|
| 302 | $cur = $core->con->openCursor($core->prefix.'post'); |
---|
| 303 | $cur->post_lang = $new_lang; |
---|
| 304 | $cur->update('WHERE post_id '.$core->con->in($posts_ids)); |
---|
| 305 | |
---|
| 306 | http::redirect($redir); |
---|
| 307 | } |
---|
| 308 | catch (Exception $e) |
---|
| 309 | { |
---|
| 310 | $core->error->add($e->getMessages()); |
---|
| 311 | } |
---|
| 312 | } |
---|
[1471] | 313 | } else { |
---|
| 314 | if (empty($_POST['entries'])) { |
---|
| 315 | $core->error->add(__('At least one entry should be selected')); |
---|
| 316 | } else { |
---|
| 317 | $core->error->add(__('No action specified.')); |
---|
| 318 | } |
---|
| 319 | dcPage::open( |
---|
| 320 | __('Entries'),'',dcPage::breadcrumb( |
---|
| 321 | array( |
---|
| 322 | html::escapeHTML($core->blog->name) => '', |
---|
| 323 | __('Entries') => 'posts.php', |
---|
| 324 | '<span class="page-title">'.__('Entries actions').'</span>' => '' |
---|
| 325 | )) |
---|
| 326 | ); |
---|
| 327 | |
---|
| 328 | dcPage::close(); |
---|
| 329 | exit; |
---|
[0] | 330 | } |
---|
| 331 | /* DISPLAY |
---|
| 332 | -------------------------------------------------------- */ |
---|
[1035] | 333 | // Get current users list |
---|
| 334 | $usersList = ''; |
---|
| 335 | if ($action == 'author' && $core->auth->check('admin',$core->blog->id)) { |
---|
| 336 | $params = array( |
---|
| 337 | 'limit' => 100, |
---|
| 338 | 'order' => 'nb_post DESC' |
---|
| 339 | ); |
---|
| 340 | $rs = $core->getUsers($params); |
---|
| 341 | while ($rs->fetch()) |
---|
| 342 | { |
---|
| 343 | $usersList .= ($usersList != '' ? ',' : '').'"'.$rs->user_id.'"'; |
---|
| 344 | } |
---|
| 345 | } |
---|
[0] | 346 | dcPage::open( |
---|
| 347 | __('Entries'), |
---|
[1035] | 348 | '<script type="text/javascript">'."\n". |
---|
| 349 | "//<![CDATA[\n". |
---|
| 350 | 'usersList = ['.$usersList.']'."\n". |
---|
| 351 | "\n//]]>\n". |
---|
| 352 | "</script>\n". |
---|
| 353 | dcPage::jsLoad('js/jquery/jquery.autocomplete.js'). |
---|
| 354 | dcPage::jsLoad('js/_posts_actions.js'). |
---|
[0] | 355 | dcPage::jsMetaEditor(). |
---|
| 356 | # --BEHAVIOR-- adminBeforePostDelete |
---|
| 357 | $core->callBehavior('adminPostsActionsHeaders') |
---|
| 358 | ); |
---|
| 359 | |
---|
| 360 | if (!isset($action)) { |
---|
| 361 | dcPage::close(); |
---|
| 362 | exit; |
---|
| 363 | } |
---|
| 364 | |
---|
[1471] | 365 | $fields = new FieldsList(); |
---|
[0] | 366 | while ($posts->fetch()) { |
---|
[1471] | 367 | $fields->addEntry($posts->post_id,$posts->post_title); |
---|
[0] | 368 | } |
---|
| 369 | |
---|
| 370 | if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false) |
---|
| 371 | { |
---|
[1471] | 372 | $fields->addHidden(array('redir'),html::escapeURL($_POST['redir'])); |
---|
[0] | 373 | } |
---|
| 374 | else |
---|
| 375 | { |
---|
[1471] | 376 | $fields |
---|
| 377 | ->addHidden(array('user_id'),$_POST['user_id']) |
---|
| 378 | ->addHidden(array('cat_id'),$_POST['cat_id']) |
---|
| 379 | ->addHidden(array('status'),$_POST['status']) |
---|
| 380 | ->addHidden(array('selected'),$_POST['selected']) |
---|
| 381 | ->addHidden(array('month'),$_POST['month']) |
---|
| 382 | ->addHidden(array('lang'),$_POST['lang']) |
---|
| 383 | ->addHidden(array('sortby'),$_POST['sortby']) |
---|
| 384 | ->addHidden(array('order'),$_POST['order']) |
---|
| 385 | ->addHidden(array('page'),$_POST['page']) |
---|
| 386 | ->addHidden(array('nb'),$_POST['nb']) |
---|
| 387 | ; |
---|
[0] | 388 | } |
---|
| 389 | |
---|
| 390 | if (isset($_POST['post_type'])) { |
---|
[1471] | 391 | $fields->addHidden(array('post_type'),$_POST['post_type']); |
---|
[0] | 392 | } |
---|
| 393 | |
---|
| 394 | # --BEHAVIOR-- adminPostsActionsContent |
---|
[1471] | 395 | $core->callBehavior('adminPostsActionsContent',$core,$action,$fields); |
---|
[0] | 396 | |
---|
| 397 | if ($action == 'category') |
---|
| 398 | { |
---|
[1471] | 399 | echo dcPage::breadcrumb( |
---|
| 400 | array( |
---|
| 401 | html::escapeHTML($core->blog->name) => '', |
---|
| 402 | __('Entries') => 'posts.php', |
---|
| 403 | __('Change category for entries') => '' |
---|
| 404 | )); |
---|
| 405 | |
---|
[1399] | 406 | # categories list |
---|
[0] | 407 | # Getting categories |
---|
[1389] | 408 | $categories_combo = array(__('(No cat)') => ''); |
---|
[0] | 409 | try { |
---|
| 410 | $categories = $core->blog->getCategories(array('post_type'=>'post')); |
---|
[1389] | 411 | if (!$categories->isEmpty()) { |
---|
[1399] | 412 | while ($categories->fetch()) { |
---|
[1421] | 413 | $catparents_combo[] = $categories_combo[] = new formSelectOption( |
---|
| 414 | str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), |
---|
[1399] | 415 | $categories->cat_id |
---|
| 416 | ); |
---|
| 417 | } |
---|
[0] | 418 | } |
---|
| 419 | } catch (Exception $e) { } |
---|
| 420 | |
---|
| 421 | echo |
---|
| 422 | '<form action="posts_actions.php" method="post">'. |
---|
[1471] | 423 | $fields->getEntries(). |
---|
[1399] | 424 | '<p><label for="new_cat_id" class="classic">'.__('Category:').'</label> '. |
---|
| 425 | form::combo('new_cat_id',$categories_combo,''); |
---|
[0] | 426 | |
---|
[1419] | 427 | if ($core->auth->check('categories', $core->blog->id)) { |
---|
| 428 | echo |
---|
| 429 | '<div>'. |
---|
| 430 | '<p id="new_cat">'.__('Add a new category').'</p>'. |
---|
| 431 | '<p><label for="new_cat_title">'.__('Title:').' '. |
---|
| 432 | form::field('new_cat_title',30,255,'','maximal').'</label></p>'. |
---|
| 433 | '<p><label for="new_cat_parent">'.__('Parent:').' '. |
---|
| 434 | form::combo('new_cat_parent',$categories_combo,'','maximal'). |
---|
| 435 | '</label></p>'. |
---|
| 436 | '</div>'; |
---|
| 437 | } |
---|
| 438 | |
---|
[0] | 439 | echo |
---|
[1471] | 440 | $fields->getHidden(). |
---|
[0] | 441 | $core->formNonce(). |
---|
| 442 | form::hidden(array('action'),'category'). |
---|
[217] | 443 | '<input type="submit" value="'.__('Save').'" /></p>'. |
---|
[0] | 444 | '</form>'; |
---|
| 445 | } |
---|
[1102] | 446 | elseif ($action == 'lang') |
---|
| 447 | { |
---|
[1471] | 448 | echo dcPage::breadcrumb( |
---|
| 449 | array( |
---|
| 450 | html::escapeHTML($core->blog->name) => '', |
---|
| 451 | __('Entries') => 'posts.php', |
---|
| 452 | '<span class="page-title">'.__('Change language for entries').'</span>' => '' |
---|
| 453 | )); |
---|
[1102] | 454 | |
---|
| 455 | # lang list |
---|
| 456 | # Languages combo |
---|
| 457 | $rs = $core->blog->getLangs(array('order'=>'asc')); |
---|
| 458 | $all_langs = l10n::getISOcodes(0,1); |
---|
| 459 | $lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1)); |
---|
| 460 | while ($rs->fetch()) { |
---|
| 461 | if (isset($all_langs[$rs->post_lang])) { |
---|
| 462 | $lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang; |
---|
| 463 | unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]); |
---|
| 464 | } else { |
---|
| 465 | $lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang; |
---|
| 466 | } |
---|
| 467 | } |
---|
| 468 | unset($all_langs); |
---|
| 469 | unset($rs); |
---|
| 470 | |
---|
| 471 | echo |
---|
| 472 | '<form action="posts_actions.php" method="post">'. |
---|
[1473] | 473 | $fields->getEntries(). |
---|
| 474 | |
---|
[1399] | 475 | '<p><label for="new_lang" class="classic">'.__('Entry lang:').'</label> '. |
---|
| 476 | form::combo('new_lang',$lang_combo,''); |
---|
[1102] | 477 | |
---|
| 478 | echo |
---|
[1471] | 479 | $fields->getHidden(). |
---|
[1102] | 480 | $core->formNonce(). |
---|
| 481 | form::hidden(array('action'),'lang'). |
---|
| 482 | '<input type="submit" value="'.__('Save').'" /></p>'. |
---|
| 483 | '</form>'; |
---|
| 484 | |
---|
| 485 | } |
---|
[0] | 486 | elseif ($action == 'author' && $core->auth->check('admin',$core->blog->id)) |
---|
| 487 | { |
---|
[1471] | 488 | echo dcPage::breadcrumb( |
---|
| 489 | array( |
---|
| 490 | html::escapeHTML($core->blog->name) => '', |
---|
| 491 | __('Entries') => 'posts.php', |
---|
| 492 | '<span class="page-title">'.__('Change author for entries').'</span>' => '' |
---|
| 493 | )); |
---|
[0] | 494 | |
---|
| 495 | echo |
---|
| 496 | '<form action="posts_actions.php" method="post">'. |
---|
[1471] | 497 | $fields->getEntries(). |
---|
[1399] | 498 | '<p><label for="new_auth_id" class="classic">'.__('Author ID:').'</label> '. |
---|
| 499 | form::field('new_auth_id',20,255); |
---|
[0] | 500 | |
---|
| 501 | echo |
---|
[1471] | 502 | $fields->getHidden(). |
---|
[0] | 503 | $core->formNonce(). |
---|
| 504 | form::hidden(array('action'),'author'). |
---|
[217] | 505 | '<input type="submit" value="'.__('Save').'" /></p>'. |
---|
[0] | 506 | '</form>'; |
---|
| 507 | } |
---|
| 508 | |
---|
| 509 | echo '<p><a class="back" href="'.html::escapeURL($redir).'">'.__('back').'</a></p>'; |
---|
| 510 | |
---|
| 511 | dcPage::close(); |
---|
| 512 | ?> |
---|