Changeset 1719:b8c48f380463 for admin/post.php
- Timestamp:
- 09/04/13 14:57:03 (10 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/post.php
r1714 r1719 51 51 52 52 # Getting categories 53 $categories_combo = array(' ' => ''); 54 try { 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 65 foreach ($core->blog->getAllPostStatus() as $k => $v) { 66 $status_combo[$v] = (string) $k; 67 } 53 $categories_combo = dcAdminCombos::getCategoriesCombo( 54 $core->blog->getCategories(array('post_type'=>'post')) 55 ); 56 57 $status_combo = dcAdminCombos::getPostStatusesCombo(); 58 68 59 $img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />'; 69 60 70 61 # Formaters combo 71 foreach ($core->getFormaters() as $v) { 72 $formaters_combo[$v] = $v; 73 } 62 $formaters_combo = dcAdminCombos::getFormatersCombo(); 74 63 75 64 # Languages combo 76 65 $rs = $core->blog->getLangs(array('order'=>'asc')); 77 $all_langs = l10n::getISOcodes(0,1); 78 $lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1)); 79 while ($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 } 87 unset($all_langs); 88 unset($rs); 66 $lang_combo = dcAdminCombos::getLangsCombo($rs,true); 89 67 90 68 # Validation flag … … 305 283 306 284 # Getting categories 307 $categories_combo = array(__('(No cat)') => ''); 308 try { 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(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 314 $categories->cat_id 315 ); 316 } 317 } 318 } catch (Exception $e) { } 319 285 $categories_combo = dcAdminCombos::getCategoriesCombo( 286 $core->blog->getCategories(array('post_type'=>'post')) 287 ); 320 288 /* DISPLAY 321 289 -------------------------------------------------------- */
Note: See TracChangeset
for help on using the changeset viewer.