Dotclear


Ignore:
Timestamp:
08/16/13 10:39:47 (11 years ago)
Author:
Dsls
Branch:
default
Message:
  • Added foldable sidebar entries,
  • Added new behavior : adminPostFormSidebarItems
  • Sidebar entries are now manageable from plugins

see #1533

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r1365 r1392  
    445445     echo '<div id="entry-sidebar">'; 
    446446      
    447      echo 
    448      '<div id="status-box" class="box">'. 
    449      '<h4>Statut</h4>'. 
    450  
    451      '<p><label for="post_status">'.__('Entry status:'). 
    452      form::combo('post_status',$status_combo,$post_status,'maximal','',!$can_publish). 
    453      '</label></p>'. 
    454       
    455      '<p><label for="post_dt">'.__('Published on:'). 
    456      form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')). 
    457      '</label></p>'. 
    458       
    459      '<p><label for="post_format">'.__('Text formating:'). 
    460      form::combo('post_format',$formaters_combo,$post_format,'maximal'). 
    461      '</label>'. 
    462      '</p>'. 
    463  
    464      '<p>'.($post_id && $post_format != 'xhtml' ? '<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'.__('Convert to XHTML').'</a>' : '').'</p>'. 
    465  
    466      '<p><label for="post_lang">'.__('Entry lang:'). 
    467      form::combo('post_lang',$lang_combo,$post_lang). 
    468      '</label></p>'. 
    469       
    470      '</div>'. // End status box 
    471       
    472      '<div id="metas-box" class="box">'. 
    473      '<h4>Classement</h4>'. 
    474  
    475      '<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '. 
    476      __('Selected entry').'</label></p>'. 
    477  
    478      '<p><label for="cat_id">'.__('Category:'). 
    479      form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 
    480      '</label></p>'. 
    481  
    482      '</div>'. // End metas box 
    483       
    484      '<div id="options-box" class="box">'. 
    485      '<h4>Options</h4>'. 
    486      '<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '. 
    487      __('Accept comments').'</label></p>'. 
    488      ($core->blog->settings->system->allow_comments ?  
    489           (isContributionAllowed($post_id,strtotime($post_dt),true) ?  
    490                '' : 
    491                '<p class="form-note warn">'.__('Warning: Comments are not more accepted for this entry.').'</p>') :  
    492           '<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>'). 
    493  
    494      '<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '. 
    495      __('Accept trackbacks').'</label></p>'. 
    496      ($core->blog->settings->system->allow_trackbacks ?  
    497           (isContributionAllowed($post_id,strtotime($post_dt),false) ?  
    498                '' : 
    499                '<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this entry.').'</p>') :  
    500           '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'). 
    501  
    502      '<p><label for="post_password">'.__('Password:'). 
    503      form::field('post_password',10,32,html::escapeHTML($post_password),'maximal'). 
    504      '</label></p>'. 
    505       
    506      '<div class="lockable">'. 
    507      '<p><label for="post_url">'.__('Edit basename:'). 
    508      form::field('post_url',10,255,html::escapeHTML($post_url),'maximal'). 
    509      '</label></p>'. 
    510      '<p class="form-note warn">'. 
    511      __('Warning: If you set the URL manually, it may conflict with another entry.'). 
    512      '</p>'. 
    513      '</div>'; 
     447     $post_sidebar = new ArrayObject(array( 
     448          'status-box' => array( 
     449               'title' => __('Status'), 
     450               'items' => array( 
     451                    'post_status' =>  
     452                         '<p><label for="post_status">'.__('Entry status:'). 
     453                         form::combo('post_status',$status_combo,$post_status,'maximal','',!$can_publish). 
     454                         '</label></p>', 
     455                    'post_dt' =>  
     456                         '<p><label for="post_dt">'.__('Published on:'). 
     457                         form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')). 
     458                         '</label></p>', 
     459                    'post_lang' => 
     460                         '<p><label for="post_lang">'.__('Entry lang:'). 
     461                         form::combo('post_lang',$lang_combo,$post_lang). 
     462                         '</label></p>', 
     463                    'post_format' => 
     464                         '<p><label for="post_format">'.__('Text formating:'). 
     465                         form::combo('post_format',$formaters_combo,$post_format,'maximal'). 
     466                         '</label></p>'. 
     467                         '<p>'.($post_id && $post_format != 'xhtml' ?  
     468                         '<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'. 
     469                         __('Convert to XHTML').'</a>' : '').'</p>')), 
     470          'metas-box' => array( 
     471               'title' => __('Ordering'), 
     472               'items' => array( 
     473                    'post_selected' =>  
     474                         '<p><label for="post_selected" class="classic">'. 
     475                         form::checkbox('post_selected',1,$post_selected).' '. 
     476                         __('Selected entry').'</label></p>', 
     477                    'cat_id' => 
     478                         '<p><label for="cat_id">'.__('Category:'). 
     479                         form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 
     480                         '</label></p>')), 
     481          'options-box' => array( 
     482               'title' => __('Options'), 
     483               'items' => array( 
     484                    'post_open_comment' => 
     485                         '<p><label for="post_open_comment" class="classic">'. 
     486                         form::checkbox('post_open_comment',1,$post_open_comment).' '. 
     487                         __('Accept comments').'</label></p>'. 
     488                         ($core->blog->settings->system->allow_comments ?  
     489                              (isContributionAllowed($post_id,strtotime($post_dt),true) ?  
     490                                   '' : 
     491                                   '<p class="form-note warn">'. 
     492                                   __('Warning: Comments are not more accepted for this entry.').'</p>') :  
     493                              '<p class="form-note warn">'. 
     494                              __('Warning: Comments are not accepted on this blog.').'</p>'), 
     495                    'post_open_tb' => 
     496                         '<p><label for="post_open_tb" class="classic">'. 
     497                         form::checkbox('post_open_tb',1,$post_open_tb).' '. 
     498                         __('Accept trackbacks').'</label></p>'. 
     499                         ($core->blog->settings->system->allow_trackbacks ?  
     500                              (isContributionAllowed($post_id,strtotime($post_dt),false) ?  
     501                                   '' : 
     502                                   '<p class="form-note warn">'. 
     503                                   __('Warning: Trackbacks are not more accepted for this entry.').'</p>') :  
     504                              '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'), 
     505                    'post_password' => 
     506                         '<p><label for="post_password">'.__('Password:'). 
     507                         form::field('post_password',10,32,html::escapeHTML($post_password),'maximal'). 
     508                         '</label></p>', 
     509                    'post_url' => 
     510                         '<div class="lockable">'. 
     511                         '<p><label for="post_url">'.__('Edit basename:'). 
     512                         form::field('post_url',10,255,html::escapeHTML($post_url),'maximal'). 
     513                         '</label></p>'. 
     514                         '<p class="form-note warn">'. 
     515                         __('Warning: If you set the URL manually, it may conflict with another entry.'). 
     516                         '</p></div>' 
     517     )))); 
     518     $core->callBehavior('adminPostFormSidebarItems',$post_sidebar, isset($post) ? $post : null); 
     519     foreach ($post_sidebar as $id => $c) { 
     520          echo '<div id="'.$id.'" class="box">'. 
     521               '<h4>'.$c['title'].'</h4>'; 
     522          foreach ($c['items'] as $e_name=>$e_content) { 
     523               echo $e_content; 
     524          } 
     525          echo '</div>'; 
     526     } 
     527      
    514528      
    515529     # --BEHAVIOR-- adminPostFormSidebar 
    516530     $core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null); 
    517  
    518      echo '</div>'; // End options box 
    519       
    520531     echo '</div>';      // End #entry-sidebar 
    521532 
Note: See TracChangeset for help on using the changeset viewer.

Sites map