Changeset 1398:5a13d30c48ec
- Timestamp:
- 08/16/13 13:59:50 (11 years ago)
- Branch:
- default
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/post.php
r1396 r1398 384 384 exit; 385 385 } 386 387 386 /* Post form if we can edit post 388 387 -------------------------------------------------------- */ 389 388 if ($can_edit_post) 390 389 { 391 echo '<div class="multi-part" title="'.($post_id ? __('Edit entry') : __('New entry')).'" id="edit-entry">'; 392 echo '<form action="post.php" method="post" id="entry-form">'; 393 echo '<div id="entry-wrapper">'; 394 echo '<div id="entry-content"><div class="constrained">'; 395 396 echo '<h3 class="hidden">'.__('Edit post').'</h3>'; 397 398 echo 399 '<p class="col"><label class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 400 form::field('post_title',20,255,html::escapeHTML($post_title),'maximal'). 401 '</p>'. 402 403 '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'. 404 __('Add an introduction to the post.').'</span></label> '. 405 form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 406 '</p>'. 407 408 '<p class="area"><label class="required" '. 409 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 410 form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 411 '</p>'. 412 413 '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'</label><span class="form-note">'. 414 __('Add unpublished notes.').'</span>'. 415 form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 416 '</p>'; 417 418 # --BEHAVIOR-- adminPostForm 419 $core->callBehavior('adminPostForm',isset($post) ? $post : null); 420 421 echo 422 '<p class="border-top">'. 423 ($post_id ? form::hidden('id',$post_id) : ''). 424 '<input type="submit" value="'.__('Save').' (s)" '. 425 'accesskey="s" name="save" /> '; 426 if ($post_id) { 427 $preview_url = 428 $core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'. 429 http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')). 430 '/'.$post->post_url); 431 echo '<a id="post-preview" href="'.$preview_url.'" class="button" accesskey="p">'.__('Preview').' (p)'.'</a> '; 432 } else { 433 echo 434 '<a id="post-cancel" href="index.php" class="button" accesskey="c">'.__('Cancel').' (c)</a>'; 435 } 436 437 echo 438 ($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : ''). 439 $core->formNonce(). 440 '</p>'; 441 442 echo '</div></div>'; // End #entry-content 443 echo '</div>'; // End #entry-wrapper 444 445 echo '<div id="entry-sidebar">'; 446 447 $post_sidebar = new ArrayObject(array( 390 $sidebar_items = new ArrayObject(array( 448 391 'status-box' => array( 449 392 'title' => __('Status'), … … 516 459 '</p></div>' 517 460 )))); 518 $core->callBehavior('adminPostFormSidebarItems',$post_sidebar, isset($post) ? $post : null); 519 foreach ($post_sidebar as $id => $c) { 461 462 $main_items = new ArrayObject(array( 463 "post_title" => 464 '<p class="col">'. 465 '<label class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 466 form::field('post_title',20,255,html::escapeHTML($post_title),'maximal'). 467 '</p>', 468 469 "post_excerpt" => 470 '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'. 471 __('Add an introduction to the post.').'</span></label> '. 472 form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 473 '</p>', 474 475 "post_content" => 476 '<p class="area"><label class="required" '. 477 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 478 form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 479 '</p>', 480 481 "post_notes" => 482 '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'</label><span class="form-note">'. 483 __('Add unpublished notes.').'</span>'. 484 form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 485 '</p>' 486 ) 487 ); 488 489 # --BEHAVIOR-- adminPostFormItems 490 $core->callBehavior('adminPostFormItems',$main_items,$sidebar_items, isset($post) ? $post : null); 491 492 echo '<div class="multi-part" title="'.($post_id ? __('Edit entry') : __('New entry')).'" id="edit-entry">'; 493 echo '<form action="post.php" method="post" id="entry-form">'; 494 echo '<div id="entry-wrapper">'; 495 echo '<div id="entry-content"><div class="constrained">'; 496 497 echo '<h3 class="hidden">'.__('Edit post').'</h3>'; 498 499 foreach ($main_items as $id => $item) { 500 echo $item; 501 } 502 503 # --BEHAVIOR-- adminPostForm (may be deprecated) 504 $core->callBehavior('adminPostForm',isset($post) ? $post : null); 505 506 echo 507 '<p class="border-top">'. 508 ($post_id ? form::hidden('id',$post_id) : ''). 509 '<input type="submit" value="'.__('Save').' (s)" '. 510 'accesskey="s" name="save" /> '; 511 if ($post_id) { 512 $preview_url = 513 $core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'. 514 http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')). 515 '/'.$post->post_url); 516 echo '<a id="post-preview" href="'.$preview_url.'" class="button" accesskey="p">'.__('Preview').' (p)'.'</a> '; 517 } else { 518 echo 519 '<a id="post-cancel" href="index.php" class="button" accesskey="c">'.__('Cancel').' (c)</a>'; 520 } 521 522 echo 523 ($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : ''). 524 $core->formNonce(). 525 '</p>'; 526 527 echo '</div></div>'; // End #entry-content 528 echo '</div>'; // End #entry-wrapper 529 530 echo '<div id="entry-sidebar">'; 531 532 foreach ($sidebar_items as $id => $c) { 520 533 echo '<div id="'.$id.'" class="box">'. 521 534 '<h4>'.$c['title'].'</h4>'; … … 527 540 528 541 529 # --BEHAVIOR-- adminPostFormSidebar 542 # --BEHAVIOR-- adminPostFormSidebar (may be deprecated) 530 543 $core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null); 531 544 echo '</div>'; // End #entry-sidebar -
plugins/attachments/_admin.php
r1392 r1398 12 12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 13 13 14 $core->addBehavior ('adminPostForm SidebarItems',array('attachmentAdmin','adminPostFormSidebarItems'));14 $core->addBehavior ('adminPostFormItems',array('attachmentAdmin','adminPostFormItems')); 15 15 $core->addBehavior ('adminPostAfterForm',array('attachmentAdmin','adminPostAfterForm')); 16 16 $core->addBehavior('adminPostHeaders',array('attachmentAdmin','postHeaders')); … … 23 23 '<script type="text/javascript" src="index.php?pf=attachments/js/post.js"></script>'; 24 24 } 25 public static function adminPostForm SidebarItems($items,$post)25 public static function adminPostFormItems($main,$sidebar,$post) 26 26 { 27 27 if ($post !== null) … … 61 61 } 62 62 $item .= '<p class="s-attachments"><a class="button" href="media.php?post_id='.$post->post_id.'">'.__('Add files to this entry').'</a></p>'; 63 $ items['metas-box']['items']['attachments']= $item;63 $sidebar['metas-box']['items']['attachments']= $item; 64 64 } 65 65 } -
plugins/pings/_admin.php
r1392 r1398 33 33 34 34 $core->addBehavior('adminPostHeaders',array('pingsBehaviors','pingJS')); 35 $core->addBehavior('adminPostForm SidebarItems',array('pingsBehaviors','pingsFormItems'));35 $core->addBehavior('adminPostFormItems',array('pingsBehaviors','pingsFormItems')); 36 36 $core->addBehavior('adminAfterPostCreate',array('pingsBehaviors','doPings')); 37 37 $core->addBehavior('adminAfterPostUpdate',array('pingsBehaviors','doPings')); -
plugins/pings/lib.pings.php
r1396 r1398 41 41 } 42 42 43 public static function pingsFormItems($ items,$post)43 public static function pingsFormItems($main,$sidebar,$post) 44 44 { 45 45 $core =& $GLOBALS['core']; … … 69 69 $i++; 70 70 } 71 $ items['options-box']['items']['pings']=$item;71 $sidebar['options-box']['items']['pings']=$item; 72 72 73 73 } -
plugins/tags/_admin.php
r1396 r1398 18 18 require dirname(__FILE__).'/_widgets.php'; 19 19 20 $core->addBehavior('adminPostForm SidebarItems',array('tagsBehaviors','tagsField'));20 $core->addBehavior('adminPostFormItems',array('tagsBehaviors','tagsField')); 21 21 22 22 $core->addBehavior('adminAfterPostCreate',array('tagsBehaviors','setTags')); … … 71 71 } 72 72 73 public static function tagsField($ items,$post)73 public static function tagsField($main,$sidebar,$post) 74 74 { 75 75 $meta =& $GLOBALS['core']->meta; … … 80 80 $value = ($post) ? $meta->getMetaStr($post->post_meta,'tag') : ''; 81 81 } 82 $ items['metas-box']['items']['post_tags']=82 $sidebar['metas-box']['items']['post_tags']= 83 83 '<h5><label class="s-tags" for="post_tags">'.__('Tags').'</label></h5>'. 84 84 '<div class="p s-tags" id="tags-edit">'.form::textarea('post_tags',20,3,$value,'maximal').'</div>';
Note: See TracChangeset
for help on using the changeset viewer.