Changeset 3874:ab8368569446 for admin/post.php
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/post.php
r3771 r3874 38 38 $can_delete = false; 39 39 40 $post_headlink = '<link rel="%s" title="%s" href="' . $core->adminurl->get('admin.post', array('id' => "%s"), '&', true) . '" />';41 $post_link = '<a href="' . $core->adminurl->get('admin.post', array('id' => "%s"), '&', true) . '" title="%s">%s</a>';40 $post_headlink = '<link rel="%s" title="%s" href="' . $core->adminurl->get('admin.post', ['id' => "%s"], '&', true) . '" />'; 41 $post_link = '<a href="' . $core->adminurl->get('admin.post', ['id' => "%s"], '&', true) . '" title="%s">%s</a>'; 42 42 $next_link = $prev_link = $next_headlink = $prev_headlink = null; 43 43 … … 58 58 # Formats combo 59 59 $core_formaters = $core->getFormaters(); 60 $available_formats = array('' => '');60 $available_formats = ['' => '']; 61 61 foreach ($core_formaters as $editor => $formats) { 62 62 foreach ($formats as $format) { … … 66 66 67 67 # Languages combo 68 $rs = $core->blog->getLangs( array('order' => 'asc'));68 $rs = $core->blog->getLangs(['order' => 'asc']); 69 69 $lang_combo = dcAdminCombos::getLangsCombo($rs, true); 70 70 … … 147 147 } 148 148 149 $comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get('admin.post'), array('id' => $post_id, '_ANCHOR' => $anchor, 'section' => $anchor));149 $comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get('admin.post'), ['id' => $post_id, '_ANCHOR' => $anchor, 'section' => $anchor]); 150 150 151 151 if ($comments_actions_page->process()) { … … 176 176 $core->adminurl->redirect( 177 177 'admin.post', 178 array('id' => $post_id, 'tb' => '1')178 ['id' => $post_id, 'tb' => '1'] 179 179 ); 180 180 } … … 298 298 $core->adminurl->redirect( 299 299 'admin.post', 300 array('id' => $post_id)300 ['id' => $post_id] 301 301 ); 302 302 } catch (Exception $e) { … … 318 318 $core->adminurl->redirect( 319 319 'admin.post', 320 array('id' => $return_id)320 ['id' => $return_id] 321 321 ); 322 322 } catch (Exception $e) { … … 376 376 if ($p_edit == $c_edit) { 377 377 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 378 $p_edit, 'post', array('#post_excerpt', '#post_content', '#comment_content'), $post_format);378 $p_edit, 'post', ['#post_excerpt', '#post_content', '#comment_content'], $post_format); 379 379 } else { 380 380 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 381 $p_edit, 'post', array('#post_excerpt', '#post_content'), $post_format);381 $p_edit, 'post', ['#post_excerpt', '#post_content'], $post_format); 382 382 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 383 $c_edit, 'comment', array('#comment_content'), 'xhtml');383 $c_edit, 'comment', ['#comment_content'], 'xhtml'); 384 384 } 385 385 } … … 397 397 $next_headlink . "\n" . $prev_headlink, 398 398 dcPage::breadcrumb( 399 array(399 [ 400 400 html::escapeHTML($core->blog->name) => '', 401 401 __('Entries') => $core->adminurl->get("admin.posts"), 402 402 ($post_id ? $page_title_edit : $page_title) => '' 403 ))404 , array(403 ]) 404 , [ 405 405 'x-frame-allow' => $core->blog->url 406 )406 ] 407 407 ); 408 408 … … 488 488 '<th>' . __('Edit') . '</th>' . 489 489 '</tr>'; 490 $comments = array();490 $comments = []; 491 491 if (isset($_REQUEST['comments'])) { 492 492 foreach ($_REQUEST['comments'] as $v) { … … 496 496 497 497 while ($rs->fetch()) { 498 $comment_url = $core->adminurl->get("admin.comment", array('id' => $rs->comment_id));498 $comment_url = $core->adminurl->get("admin.comment", ['id' => $rs->comment_id]); 499 499 500 500 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; … … 519 519 520 520 '<td class="nowrap">' . 521 ($has_action ? form::checkbox( array('comments[]'), $rs->comment_id,522 array(521 ($has_action ? form::checkbox(['comments[]'], $rs->comment_id, 522 [ 523 523 'checked' => isset($comments[$rs->comment_id]), 524 524 'extra_html' => 'title="' . ($tb ? __('select this trackback') : __('select this comment') . '"') 525 )525 ] 526 526 ) : '') . '</td>' . 527 527 '<td class="maximal">' . html::escapeHTML($rs->comment_author) . '</td>' . 528 528 '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . 529 '<td class="nowrap"><a href="' . $core->adminurl->get("admin.comments", array('ip' => $rs->comment_ip)) . '">' . $rs->comment_ip . '</a></td>' .529 '<td class="nowrap"><a href="' . $core->adminurl->get("admin.comments", ['ip' => $rs->comment_ip]) . '">' . $rs->comment_ip . '</a></td>' . 530 530 '<td class="nowrap status">' . $img_status . '</td>' . 531 531 '<td class="nowrap status"><a href="' . $comment_url . '">' . … … 541 541 -------------------------------------------------------- */ 542 542 if ($can_edit_post) { 543 $sidebar_items = new ArrayObject( array(544 'status-box' => array(543 $sidebar_items = new ArrayObject([ 544 'status-box' => [ 545 545 'title' => __('Status'), 546 'items' => array(546 'items' => [ 547 547 'post_status' => 548 548 '<p class="entry-status"><label for="post_status">' . __('Entry status') . ' ' . $img_status . '</label>' . 549 549 form::combo('post_status', $status_combo, 550 array('default' => $post_status, 'class' => 'maximal', 'disabled' => !$can_publish)) .550 ['default' => $post_status, 'class' => 'maximal', 'disabled' => !$can_publish]) . 551 551 '</p>', 552 552 'post_dt' => … … 557 557 Dont forget to remove call to datepicker in post.js 558 558 559 form::datetime('post_dt', array(559 form::datetime('post_dt', [ 560 560 'default' => html::escapeHTML(dt::str('%Y-%m-%dT%H:%M', strtotime($post_dt))), 561 561 'class' => ($bad_dt ? 'invalid' : '') 562 )) .562 ]) . 563 563 */ 564 564 '</p>', … … 573 573 '<p class="format_control control_no_xhtml">' . 574 574 '<a id="convert-xhtml" class="button' . ($post_id && $post_format != 'wiki' ? ' hide' : '') . '" href="' . 575 $core->adminurl->get('admin.post', array('id' => $post_id, 'xconv' => '1')) .575 $core->adminurl->get('admin.post', ['id' => $post_id, 'xconv' => '1']) . 576 576 '">' . 577 __('Convert to XHTML') . '</a></p></div>' )),578 'metas-box' => array(577 __('Convert to XHTML') . '</a></p></div>']], 578 'metas-box' => [ 579 579 'title' => __('Filing'), 580 'items' => array(580 'items' => [ 581 581 'post_selected' => 582 582 '<p><label for="post_selected" class="classic">' . … … 593 593 '<h5 id="create_cat">' . __('Add a new category') . '</h5>' . 594 594 '<p><label for="new_cat_title">' . __('Title:') . ' ' . 595 form::field('new_cat_title', 30, 255, array('class' => 'maximal')) . '</label></p>' .595 form::field('new_cat_title', 30, 255, ['class' => 'maximal']) . '</label></p>' . 596 596 '<p><label for="new_cat_parent">' . __('Parent:') . ' ' . 597 597 form::combo('new_cat_parent', $categories_combo, '', 'maximal') . … … 599 599 '</div>' 600 600 : '') . 601 '</div>' )),602 'options-box' => array(601 '</div>']], 602 'options-box' => [ 603 603 'title' => __('Options'), 604 'items' => array(604 'items' => [ 605 605 'post_open_comment_tb' => 606 606 '<div>' . … … 638 638 __('Warning: If you set the URL manually, it may conflict with another entry.') . 639 639 '</p></div>' 640 ))));641 642 $main_items = new ArrayObject( array(640 ]]]); 641 642 $main_items = new ArrayObject([ 643 643 "post_title" => 644 644 '<p class="col">' . 645 645 '<label class="required no-margin bold" for="post_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . 646 form::field('post_title', 20, 255, array(646 form::field('post_title', 20, 255, [ 647 647 'default' => html::escapeHTML($post_title), 648 648 'class' => 'maximal', 649 649 'extra_html' => 'required placeholder="' . __('Title') . '"' 650 )) .650 ]) . 651 651 '</p>', 652 652 … … 661 661 'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . 662 662 form::textarea('post_content', 50, $core->auth->getOption('edit_size'), 663 array(663 [ 664 664 'default' => html::escapeHTML($post_content), 665 665 'extra_html' => 'required placeholder="' . __('Content') . '"' 666 )) .666 ]) . 667 667 '</p>', 668 668 … … 672 672 form::textarea('post_notes', 50, 5, html::escapeHTML($post_notes)) . 673 673 '</p>' 674 )674 ] 675 675 ); 676 676 … … 744 744 -------------------------------------------------------- */ 745 745 746 $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC');747 748 $comments = $core->blog->getComments(array_merge($params, array('comment_trackback' => 0)));746 $params = ['post_id' => $post_id, 'order' => 'comment_dt ASC']; 747 748 $comments = $core->blog->getComments(array_merge($params, ['comment_trackback' => 0])); 749 749 750 750 echo … … 773 773 '<p class="col right"><label for="action" class="classic">' . __('Selected comments action:') . '</label> ' . 774 774 form::combo('action', $combo_action) . 775 form::hidden( array('section'), 'comments') .776 form::hidden( array('id'), $post_id) .775 form::hidden(['section'], 'comments') . 776 form::hidden(['id'], $post_id) . 777 777 $core->formNonce() . 778 778 '<input type="submit" value="' . __('ok') . '" /></p>' . … … 790 790 '<div class="constrained">' . 791 791 '<p><label for="comment_author" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Name:') . '</label>' . 792 form::field('comment_author', 30, 255, array(792 form::field('comment_author', 30, 255, [ 793 793 'default' => html::escapeHTML($core->auth->getInfo('user_cn')), 794 794 'extra_html' => 'required placeholder="' . __('Author') . '"' 795 )) .795 ]) . 796 796 '</p>' . 797 797 … … 806 806 '<p class="area"><label for="comment_content" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . 807 807 __('Comment:') . '</label> ' . 808 form::textarea('comment_content', 50, 8, array('extra_html' => 'required placeholder="' . __('Comment') . '"')) .808 form::textarea('comment_content', 50, 8, ['extra_html' => 'required placeholder="' . __('Comment') . '"']) . 809 809 '</p>' . 810 810 … … 824 824 -------------------------------------------------------- */ 825 825 826 $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC');827 $trackbacks = $core->blog->getComments(array_merge($params, array('comment_trackback' => 1)));826 $params = ['post_id' => $post_id, 'order' => 'comment_dt ASC']; 827 $trackbacks = $core->blog->getComments(array_merge($params, ['comment_trackback' => 1])); 828 828 829 829 # Actions combo box … … 860 860 form::combo('action', $combo_action) . 861 861 form::hidden('id', $post_id) . 862 form::hidden( array('section'), 'trackbacks') .862 form::hidden(['section'], 'trackbacks') . 863 863 $core->formNonce() . 864 864 '<input type="submit" value="' . __('ok') . '" /></p>' . … … 875 875 echo 876 876 '<h3>' . __('Ping blogs') . '</h3>' . 877 '<form action="' . $core->adminurl->get("admin.post", array('id' => $post_id)) . '" id="trackback-form" method="post">' .877 '<form action="' . $core->adminurl->get("admin.post", ['id' => $post_id]) . '" id="trackback-form" method="post">' . 878 878 '<p><label for="tb_urls" class="area">' . __('URLs to ping:') . '</label>' . 879 879 form::textarea('tb_urls', 60, 5, $tb_urls) . … … 888 888 (empty($_GET['tb_auto']) ? 889 889 ' <a class="button" href="' . 890 $core->adminurl->get("admin.post", array('id' => $post_id, 'tb_auto' => 1, 'tb' => 1)) .890 $core->adminurl->get("admin.post", ['id' => $post_id, 'tb_auto' => 1, 'tb' => 1]) . 891 891 '">' . __('Auto discover ping URLs') . '</a>' 892 892 : '') .
Note: See TracChangeset
for help on using the changeset viewer.