Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r1741 r1714  
    5151 
    5252# Getting categories 
    53 $categories_combo = dcAdminCombos::getCategoriesCombo( 
    54      $core->blog->getCategories(array('post_type'=>'post')) 
    55 ); 
    56  
    57 $status_combo = dcAdminCombos::getPostStatusesCombo(); 
    58  
     53$categories_combo = array(' ' => ''); 
     54try { 
     55     $categories = $core->blog->getCategories(array('post_type'=>'post')); 
     56     while ($categories->fetch()) { 
     57          $categories_combo[] = new formSelectOption( 
     58               str_repeat('  ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 
     59               $categories->cat_id 
     60     ); 
     61     } 
     62} catch (Exception $e) { } 
     63 
     64# Status combo 
     65foreach ($core->blog->getAllPostStatus() as $k => $v) { 
     66     $status_combo[$v] = (string) $k; 
     67} 
    5968$img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    6069 
    6170# Formaters combo 
    62 $formaters_combo = dcAdminCombos::getFormatersCombo(); 
     71foreach ($core->getFormaters() as $v) { 
     72     $formaters_combo[$v] = $v; 
     73} 
    6374 
    6475# Languages combo 
    6576$rs = $core->blog->getLangs(array('order'=>'asc')); 
    66 $lang_combo = dcAdminCombos::getLangsCombo($rs,true); 
     77$all_langs = l10n::getISOcodes(0,1); 
     78$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1)); 
     79while ($rs->fetch()) { 
     80     if (isset($all_langs[$rs->post_lang])) { 
     81          $lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang; 
     82          unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]); 
     83     } else { 
     84          $lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang; 
     85     } 
     86} 
     87unset($all_langs); 
     88unset($rs); 
    6789 
    6890# Validation flag 
     
    283305 
    284306# Getting categories 
    285 $categories_combo = dcAdminCombos::getCategoriesCombo( 
    286      $core->blog->getCategories(array('post_type'=>'post')) 
    287 ); 
     307$categories_combo = array(__('(No cat)') => ''); 
     308try { 
     309     $categories = $core->blog->getCategories(array('post_type'=>'post')); 
     310     if (!$categories->isEmpty()) { 
     311          while ($categories->fetch()) { 
     312               $catparents_combo[] = $categories_combo[] = new formSelectOption( 
     313                    str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
     314                    $categories->cat_id 
     315               ); 
     316          } 
     317     } 
     318} catch (Exception $e) { } 
     319 
    288320/* DISPLAY 
    289321-------------------------------------------------------- */ 
     
    414446                         '</p>'. 
    415447                         '<p>'.($post_id && $post_format != 'xhtml' ?  
    416                          '<a id="convert-xhtml" class="button" href="post.php?id='.$post_id.'&amp;xconv=1">'. 
     448                         '<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'. 
    417449                         __('Convert to XHTML').'</a>' : '').'</p></div>')), 
    418450          'metas-box' => array( 
     
    485517           
    486518          "post_excerpt" => 
    487                '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').' <span class="form-note">'. 
     519               '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'. 
    488520               __('Introduction to the post.').'</span></label> '. 
    489521               form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 
     
    497529           
    498530          "post_notes" => 
    499                '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').' <span class="form-note">'. 
     531               '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'. 
    500532               __('Unpublished notes.').'</span></label>'. 
    501533               form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 
     
    548580      
    549581     foreach ($sidebar_items as $id => $c) { 
    550           echo '<div id="'.$id.'" class="sb-box">'. 
     582          echo '<div id="'.$id.'" class="box">'. 
    551583               '<h4>'.$c['title'].'</h4>'; 
    552584          foreach ($c['items'] as $e_name=>$e_content) { 
     
    601633      
    602634     echo 
    603      '<div id="comments" class="clear multi-part" title="'.__('Comments').'">'; 
     635     '<div id="comments" class="multi-part" title="'.__('Comments').'">'; 
    604636           
    605637     # --BEHAVIOR-- adminCommentsActionsCombo 
     
    608640     $has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty()); 
    609641     echo  
    610      '<p class="top-add"><a class="button add" href="#comment-form">'.__('Add a comment').'</a></p>'; 
     642     '<p class="top-add"><a class="button add onblog_link" href="#comment-form">'.__('Add a comment').'</a></p>'; 
    611643      
    612644     if ($has_action) { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map