Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/index.php

    r1535 r1536  
    326326     if ($core->auth->check('usage,contentadmin',$core->blog->id)) 
    327327     { 
    328           $categories_combo = array(' ' => ''); 
     328          # Getting categories 
     329          $categories_combo = array(__('(No cat)') => ''); 
    329330          try { 
    330331               $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    331                while ($categories->fetch()) { 
    332                     $categories_combo[] = new formSelectOption( 
    333                          str_repeat('  ',$categories->level-1). 
    334                          ($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 
    335                          $categories->cat_id 
    336                     ); 
     332               if (!$categories->isEmpty()) { 
     333                    while ($categories->fetch()) { 
     334                         $catparents_combo[] = $categories_combo[] = new formSelectOption( 
     335                              str_repeat('  ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 
     336                              $categories->cat_id 
     337                         ); 
     338                    } 
    337339               } 
    338340          } catch (Exception $e) { } 
    339       
     341           
    340342          echo 
    341343          '<div id="quick">'. 
     
    352354          '<p><label for="cat_id" class="classic">'.__('Category:').' '. 
    353355          form::combo('cat_id',$categories_combo).'</label></p>'. 
     356          ($core->auth->check('categories', $core->blog->id) 
     357               ? '<div>'. 
     358               '<p id="new_cat">'.__('Add a new category').'</p>'. 
     359               '<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'. 
     360               '<p><label for="new_cat_title">'.__('Title:').' '. 
     361               form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
     362               '<p><label for="new_cat_parent">'.__('Parent:').' '. 
     363               form::combo('new_cat_parent',$categories_combo,'','maximal'). 
     364               '</label></p>'. 
     365               '</div>' 
     366               : ''). 
    354367          '<p><input type="submit" value="'.__('Save').'" name="save" /> '. 
    355368          ($core->auth->check('publish',$core->blog->id) 
Note: See TracChangeset for help on using the changeset viewer.

Sites map