Dotclear

Changeset 1617:47b43ca4c6a7


Ignore:
Timestamp:
08/29/13 22:06:09 (11 years ago)
Author:
Dsls
Branch:
default
Message:

Updated pages plugin the same way as post.php, see #1533

Location:
plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/attachments/_admin.php

    r1501 r1617  
    1515$core->addBehavior ('adminPostAfterForm',array('attachmentAdmin','adminPostAfterForm')); 
    1616$core->addBehavior('adminPostHeaders',array('attachmentAdmin','postHeaders')); 
     17$core->addBehavior ('adminPageFormItems',array('attachmentAdmin','adminPostFormItems')); 
     18$core->addBehavior ('adminPageAfterForm',array('attachmentAdmin','adminPostAfterForm')); 
     19$core->addBehavior('adminPageHeaders',array('attachmentAdmin','postHeaders')); 
    1720 
    1821class attachmentAdmin 
  • plugins/pages/page.php

    r1553 r1617  
    396396if ($can_edit_page) 
    397397{ 
     398     $sidebar_items = new ArrayObject(array( 
     399          'status-box' => array( 
     400               'title' => __('Status'), 
     401               'items' => array( 
     402                    'post_status' =>  
     403                         '<p><label for="post_status" class="ib">'.__('Page status:').'</label> '. 
     404                         form::combo('post_status',$status_combo,$post_status,'','',!$can_publish). 
     405                         '</p>', 
     406                    'post_dt' =>  
     407                         '<p><label for="post_dt" class="ib">'.__('Publication date and hour').'</label>'. 
     408                         form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')). 
     409                         '</p>', 
     410                    'post_lang' => 
     411                         '<p><label for="post_lang" class="ib">'.__('Page lang:').'</label>'. 
     412                         form::combo('post_lang',$lang_combo,$post_lang). 
     413                         '</p>', 
     414                    'post_format' => 
     415                         '<p><label for="post_format" class="ib">'.__('Text formating').'</label>'. 
     416                         form::combo('post_format',$formaters_combo,$post_format,'maximal'). 
     417                         '</p>'. 
     418                         '<p>'.($post_id && $post_format != 'xhtml' ?  
     419                         '<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'. 
     420                         __('Convert to XHTML').'</a>' : '').'</p>')), 
     421          'metas-box' => array( 
     422               'title' => __('Ordering'), 
     423               'items' => array( 
     424                    'post_position' =>  
     425                         '<p><label for="post_position" class="classic">'.__('Page position:').'</label> '. 
     426                         form::field('post_position',3,3,(string) $post_position). 
     427                         '</p>')), 
     428          'options-box' => array( 
     429               'title' => __('Options'), 
     430               'items' => array( 
     431                    'post_open_comment' => 
     432                         '<p><label for="post_open_comment" class="classic">'. 
     433                         form::checkbox('post_open_comment',1,$post_open_comment).' '. 
     434                         __('Accept comments').'</label></p>'. 
     435                         ($core->blog->settings->system->allow_comments ?  
     436                              (isContributionAllowed($post_id,strtotime($post_dt),true) ?  
     437                                   '' : 
     438                                   '<p class="form-note warn">'. 
     439                                   __('Warning: Comments are not more accepted for this entry.').'</p>') :  
     440                              '<p class="form-note warn">'. 
     441                              __('Warning: Comments are not accepted on this blog.').'</p>'), 
     442                    'post_open_tb' => 
     443                         '<p><label for="post_open_tb" class="classic">'. 
     444                         form::checkbox('post_open_tb',1,$post_open_tb).' '. 
     445                         __('Accept trackbacks').'</label></p>'. 
     446                         ($core->blog->settings->system->allow_trackbacks ?  
     447                              (isContributionAllowed($post_id,strtotime($post_dt),false) ?  
     448                                   '' : 
     449                                   '<p class="form-note warn">'. 
     450                                   __('Warning: Trackbacks are not more accepted for this entry.').'</p>') :  
     451                              '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'), 
     452                    'post_password' => 
     453                         '<p><label for="post_password" class="ib">'.__('Password').'</label>'. 
     454                         form::field('post_password',10,32,html::escapeHTML($post_password),'maximal'). 
     455                         '</p>', 
     456                    'post_url' => 
     457                         '<div class="lockable">'. 
     458                         '<p><label for="post_url" class="ib">'.__('Edit basename').'</label>'. 
     459                         form::field('post_url',10,255,html::escapeHTML($post_url),'maximal'). 
     460                         '</p>'. 
     461                         '<p class="form-note warn">'. 
     462                         __('Warning: If you set the URL manually, it may conflict with another entry.'). 
     463                         '</p></div>' 
     464     )))); 
     465     $main_items = new ArrayObject(array( 
     466          "post_title" => 
     467               '<p class="col">'. 
     468               '<label class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 
     469               form::field('post_title',20,255,html::escapeHTML($post_title),'maximal'). 
     470               '</p>', 
     471           
     472          "post_excerpt" => 
     473               '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'. 
     474               __('Add an introduction to the post.').'</span></label> '. 
     475               form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 
     476               '</p>', 
     477           
     478          "post_content" => 
     479               '<p class="area"><label class="required" '. 
     480               'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 
     481               form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 
     482               '</p>', 
     483           
     484          "post_notes" => 
     485               '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'. 
     486               __('Add unpublished notes.').'</span></label>'. 
     487               form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 
     488               '</p>' 
     489          ) 
     490     ); 
     491 
     492     # --BEHAVIOR-- adminPostFormItems 
     493     $core->callBehavior('adminPageFormItems',$main_items,$sidebar_items, isset($post) ? $post : null); 
     494 
    398495     echo '<div class="multi-part" title="'.__('Edit page').'" id="edit-entry">'; 
    399496     echo '<form action="'.html::escapeURL($redir_url).'" method="post" id="entry-form">'; 
     
    402499     echo '<div id="entry-content"><div class="constrained">'; 
    403500      
    404      echo 
    405      '<p class="col"><label for="post_title" class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'. 
    406      form::field('post_title',20,255,html::escapeHTML($post_title),'maximal'). 
    407      '</p>'. 
    408       
    409      '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:'). 
    410      '<span class="form-note">'.__('Add an introduction to the page.').'</span></label> '. 
    411      form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 
    412      '</p>'. 
    413       
    414      '<p class="area"><label class="required" '. 
    415      'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 
    416      form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 
    417      '</p>'; 
    418       
    419      echo 
    420      '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:'). 
    421      '<span class="form-note">'.__('Add unpublished notes.').'</span></label>'. 
    422      form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 
    423      '</p>'; 
     501      
     502     foreach ($main_items as $id => $item) { 
     503          echo $item; 
     504     } 
    424505 
    425506     # --BEHAVIOR-- adminPageForm 
     
    454535     echo '<div id="entry-sidebar">'; 
    455536      
    456      echo 
    457      '<p><label for="post_status" class="ib">'.__('Page status:').'</label> '. 
    458      form::combo('post_status',$status_combo,$post_status,'','',!$can_publish). 
    459      '</p>'. 
    460       
    461      '<p><label for="post_dt" class="ib">'.__('Published on:').'</label>'. 
    462      form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')).'</p>'. 
    463       
    464      '<p><label for="post_format" class="ib">'.__('Text formating:').'</label>'. 
    465      form::combo('post_format',$formaters_combo,$post_format). 
    466      ($post_id && $post_format != 'xhtml' ? '<a class="button" href="'.html::escapeURL($redir_url).'&amp;id='.$post_id.'&amp;xconv=1">'.__('Convert to XHTML').'</a>' : ''). 
    467      '</p>'. 
    468       
    469      '<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '. 
    470      __('Accept comments').'</label></p>'. 
    471      ($core->blog->settings->system->allow_comments ?  
    472           (isContributionAllowed($post_id,strtotime($post_dt),true) ?  
    473                '' : 
    474                '<p class="form-note warn">'.__('Warning: Comments are not more accepted for this page.').'</p>') :  
    475           '<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>'). 
    476  
    477      '<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '. 
    478      __('Accept trackbacks').'</label></p>'. 
    479      ($core->blog->settings->system->allow_trackbacks ?  
    480           (isContributionAllowed($post_id,strtotime($post_dt),false) ?  
    481                '' : 
    482                '<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this page.').'</p>') :  
    483           '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'). 
    484       
    485      '<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '. 
    486      __('Hide').'</label></p>'. 
    487      '<p class="form-note">'. 
    488      __('If checked this page will be active but not listed in widget Pages.'). 
    489      '</p>'. 
    490  
    491      '<p><label for="post_position" class="classic">'.__('Page position:').'</label> '. 
    492      form::field('post_position',3,3,(string) $post_position). 
    493      '</p>'. 
    494       
    495      '<p><label for="post_lang" class="ib">'.__('Page lang:').'</label>'. 
    496      form::combo('post_lang',$lang_combo,$post_lang).'</p>'. 
    497       
    498      '<p><label for="post_password" class="ib">'.__('Page password:').'</label>'. 
    499      form::field('post_password',10,32,html::escapeHTML($post_password),'maximal'). 
    500      '</p>'. 
    501       
    502      '<div class="lockable ib">'. 
    503      '<p><label for="post_url" class="ib">'.__('Basename:').'</label>'. 
    504      form::field('post_url',10,255,html::escapeHTML($post_url),'maximal'). 
    505      '</p>'. 
    506      '<p class="form-note warn">'. 
    507      __('Warning: If you set the URL manually, it may conflict with another page.'). 
    508      '</p>'. 
    509      '</div>'; 
    510       
    511      if ($post_id) 
    512      { 
    513           echo 
    514           '<h4 class="clear">'.__('Attachments').'</h4>'; 
    515           foreach ($post_media as $f) 
    516           { 
    517                $ftitle = $f->media_title; 
    518                if (strlen($ftitle) > 18) { 
    519                     $ftitle = substr($ftitle,0,16).'...'; 
    520                } 
    521                echo 
    522                '<div class="media-item">'. 
    523                '<a class="media-icon" href="media_item.php?id='.$f->media_id.'">'. 
    524                '<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'. 
    525                '<ul>'. 
    526                '<li><a class="media-link" href="media_item.php?id='.$f->media_id.'"'. 
    527                'title="'.$f->basename.'">'.$ftitle.'</a></li>'. 
    528                '<li>'.$f->media_dtstr.'</li>'. 
    529                '<li>'.files::size($f->size).' - '. 
    530                '<a href="'.$f->file_url.'">'.__('open').'</a>'.'</li>'. 
    531                 
    532                '<li class="media-action"><a class="attachment-remove" id="attachment-'.$f->media_id.'" '. 
    533                'href="post_media.php?post_id='.$post_id.'&amp;media_id='.$f->media_id.'&amp;remove=1">'. 
    534                '<img src="images/check-off.png" alt="'.__('Remove').'" /></a>'. 
    535                '</li>'. 
    536                 
    537                '</ul>'. 
    538                '</div>'; 
    539           } 
    540           unset($f); 
    541            
    542           if (empty($post_media)) { 
    543                echo '<p class="form-note">'.__('No attachment.').'</p>'; 
    544           } 
    545           echo '<p><a class="button" href="media.php?post_id='.$post_id.'">'.__('Add files to this page').'</a></p>'; 
     537     foreach ($sidebar_items as $id => $c) { 
     538          echo '<div id="'.$id.'" class="box">'. 
     539               '<h4>'.$c['title'].'</h4>'; 
     540          foreach ($c['items'] as $e_name=>$e_content) { 
     541               echo $e_content; 
     542          } 
     543          echo '</div>'; 
    546544     } 
    547545      
Note: See TracChangeset for help on using the changeset viewer.

Sites map