Changeset 3874:ab8368569446 for plugins/pages/page.php
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/page.php
r3771 r3874 34 34 $post_selected = false; 35 35 36 $post_media = array();36 $post_media = []; 37 37 38 38 $page_title = __('New page'); … … 60 60 # Formaters combo 61 61 $core_formaters = $core->getFormaters(); 62 $available_formats = array('' => '');62 $available_formats = ['' => '']; 63 63 foreach ($core_formaters as $editor => $formats) { 64 64 foreach ($formats as $format) { … … 68 68 69 69 # Languages combo 70 $rs = $core->blog->getLangs( array('order' => 'asc'));70 $rs = $core->blog->getLangs(['order' => 'asc']); 71 71 $lang_combo = dcAdminCombos::getLangsCombo($rs, true); 72 72 … … 279 279 if ($p_edit == $c_edit) { 280 280 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 281 $p_edit, 'page', array('#post_excerpt', '#post_content', '#comment_content'), $post_format);281 $p_edit, 'page', ['#post_excerpt', '#post_content', '#comment_content'], $post_format); 282 282 } else { 283 283 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 284 $p_edit, 'page', array('#post_excerpt', '#post_content'), $post_format);284 $p_edit, 'page', ['#post_excerpt', '#post_content'], $post_format); 285 285 $admin_post_behavior .= $core->callBehavior('adminPostEditor', 286 $c_edit, 'comment', array('#comment_content'), 'xhtml');286 $c_edit, 'comment', ['#comment_content'], 'xhtml'); 287 287 } 288 288 } … … 334 334 } 335 335 echo dcPage::breadcrumb( 336 array(336 [ 337 337 html::escapeHTML($core->blog->name) => '', 338 338 __('Pages') => $p_url, 339 339 $edit_entry_title => '' 340 ));340 ]); 341 341 342 342 if (!empty($_GET['upd'])) { … … 386 386 -------------------------------------------------------- */ 387 387 if ($can_edit_page) { 388 $sidebar_items = new ArrayObject( array(389 'status-box' => array(388 $sidebar_items = new ArrayObject([ 389 'status-box' => [ 390 390 'title' => __('Status'), 391 'items' => array(391 'items' => [ 392 392 'post_status' => 393 393 '<p><label for="post_status">' . __('Page status') . '</label> ' . 394 394 form::combo('post_status', $status_combo, 395 array('default' => $post_status, 'disabled' => !$can_publish)) .395 ['default' => $post_status, 'disabled' => !$can_publish]) . 396 396 '</p>', 397 397 'post_dt' => … … 402 402 Dont forget to remove call to datepicker in post.js 403 403 404 form::datetime('post_dt', array(404 form::datetime('post_dt', [ 405 405 'default' => html::escapeHTML(dt::str('%Y-%m-%dT%H:%M', strtotime($post_dt))), 406 406 'class' => ($bad_dt ? 'invalid' : '') 407 )) .407 ]) . 408 408 */ 409 409 '</p>', … … 419 419 '<a id="convert-xhtml" class="button' . ($post_id && $post_format != 'wiki' ? ' hide' : '') . 420 420 '" href="' . html::escapeURL($redir_url) . '&id=' . $post_id . '&xconv=1">' . 421 __('Convert to XHTML') . '</a></p></div>' )),422 'metas-box' => array(421 __('Convert to XHTML') . '</a></p></div>']], 422 'metas-box' => [ 423 423 'title' => __('Filing'), 424 'items' => array(424 'items' => [ 425 425 'post_position' => 426 426 '<p><label for="post_position" class="classic">' . __('Page position') . '</label> ' . 427 form::number('post_position', array(427 form::number('post_position', [ 428 428 'default' => $post_position 429 )) .430 '</p>' )),431 'options-box' => array(429 ]) . 430 '</p>']], 431 'options-box' => [ 432 432 'title' => __('Options'), 433 'items' => array(433 'items' => [ 434 434 'post_open_comment_tb' => 435 435 '<div>' . … … 471 471 __('Warning: If you set the URL manually, it may conflict with another page.') . 472 472 '</p></div>' 473 ))));474 $main_items = new ArrayObject( array(473 ]]]); 474 $main_items = new ArrayObject([ 475 475 "post_title" => 476 476 '<p class="col">' . 477 477 '<label class="required no-margin bold" for="post_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . 478 form::field('post_title', 20, 255, array(478 form::field('post_title', 20, 255, [ 479 479 'default' => html::escapeHTML($post_title), 480 480 'class' => 'maximal', 481 481 'extra_html' => 'required placeholder="' . __('Title') . '"' 482 )) .482 ]) . 483 483 '</p>', 484 484 … … 493 493 'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . 494 494 form::textarea('post_content', 50, $core->auth->getOption('edit_size'), 495 array(495 [ 496 496 'default' => html::escapeHTML($post_content), 497 497 'extra_html' => 'required placeholder="' . __('Content') . '"' 498 )) .498 ]) . 499 499 '</p>', 500 500 … … 504 504 form::textarea('post_notes', 50, 5, html::escapeHTML($post_notes)) . 505 505 '</p>' 506 )506 ] 507 507 ); 508 508 … … 577 577 echo 578 578 '<form action="' . $core->adminurl->get('admin.post.media') . '" id="attachment-remove-hide" method="post">' . 579 '<div>' . form::hidden( array('post_id'), $post_id) .580 form::hidden( array('media_id'), '') .581 form::hidden( array('remove'), 1) .579 '<div>' . form::hidden(['post_id'], $post_id) . 580 form::hidden(['media_id'], '') . 581 form::hidden(['remove'], 1) . 582 582 $core->formNonce() . '</div></form>'; 583 583 } … … 587 587 -------------------------------------------------------- */ 588 588 if ($post_id) { 589 $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC');590 591 $comments = $core->blog->getComments(array_merge($params, array('comment_trackback' => 0)));592 $trackbacks = $core->blog->getComments(array_merge($params, array('comment_trackback' => 1)));589 $params = ['post_id' => $post_id, 'order' => 'comment_dt ASC']; 590 591 $comments = $core->blog->getComments(array_merge($params, ['comment_trackback' => 0])); 592 $trackbacks = $core->blog->getComments(array_merge($params, ['comment_trackback' => 1])); 593 593 594 594 # Actions combo box 595 $combo_action = array();595 $combo_action = []; 596 596 if ($can_edit_page && $core->auth->check('publish,contentadmin', $core->blog->id)) { 597 597 $combo_action[__('Publish')] = 'publish'; … … 655 655 '<div class="constrained">' . 656 656 '<p><label for="comment_author" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Name:') . '</label>' . 657 form::field('comment_author', 30, 255, array(657 form::field('comment_author', 30, 255, [ 658 658 'default' => html::escapeHTML($core->auth->getInfo('user_cn')), 659 659 'extra_html' => 'required placeholder="' . __('Author') . '"' 660 )) .660 ]) . 661 661 '</p>' . 662 662 663 663 '<p><label for="comment_email">' . __('Email:') . '</label>' . 664 form::email('comment_email', array(664 form::email('comment_email', [ 665 665 'size' => 30, 666 666 'default' => html::escapeHTML($core->auth->getInfo('user_email')), 667 667 'autocomplete' => 'email' 668 )) .668 ]) . 669 669 '</p>' . 670 670 671 671 '<p><label for="comment_site">' . __('Web site:') . '</label>' . 672 form::url('comment_site', array(672 form::url('comment_site', [ 673 673 'size' => 30, 674 674 'default' => html::escapeHTML($core->auth->getInfo('user_url')), 675 675 'autocomplete' => 'url' 676 )) .676 ]) . 677 677 '</p>' . 678 678 679 679 '<p class="area"><label for="comment_content" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . 680 680 __('Comment:') . '</label> ' . 681 form::textarea('comment_content', 50, 8, array('extra_html' => 'required placeholder="' . __('Comment') . '"')) .681 form::textarea('comment_content', 50, 8, ['extra_html' => 'required placeholder="' . __('Comment') . '"']) . 682 682 '</p>' . 683 683 … … 729 729 730 730 while ($rs->fetch()) { 731 $comment_url = $core->adminurl->get('admin.comment', array('id' => $rs->comment_id));731 $comment_url = $core->adminurl->get('admin.comment', ['id' => $rs->comment_id]); 732 732 733 733 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; … … 752 752 753 753 '<td class="nowrap">' . 754 ($has_action ? form::checkbox( array('comments[]'), $rs->comment_id,755 array(754 ($has_action ? form::checkbox(['comments[]'], $rs->comment_id, 755 [ 756 756 'extra_html' => 'title="' . __('Select this comment') . '"' 757 )757 ] 758 758 ) : '') . '</td>' . 759 759 '<td class="maximal">' . $rs->comment_author . '</td>' . 760 760 '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . 761 '<td class="nowrap"><a href="' . $core->adminurl->get('admin.comment', array('ip' => $rs->comment_ip)) . '">' . $rs->comment_ip . '</a></td>' .761 '<td class="nowrap"><a href="' . $core->adminurl->get('admin.comment', ['ip' => $rs->comment_ip]) . '">' . $rs->comment_ip . '</a></td>' . 762 762 '<td class="nowrap status">' . $img_status . '</td>' . 763 763 '<td class="nowrap status"><a href="' . $comment_url . '">' .
Note: See TracChangeset
for help on using the changeset viewer.