Index: admin/post.php
===================================================================
--- admin/post.php	(revision 1816)
+++ admin/post.php	(revision 1822)
@@ -51,40 +51,18 @@
 
 # Getting categories
-$categories_combo = array('&nbsp;' => '');
-try {
-	$categories = $core->blog->getCategories(array('post_type'=>'post'));
-	while ($categories->fetch()) {
-		$categories_combo[] = new formSelectOption(
-			str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
-			$categories->cat_id
-	);
-	}
-} catch (Exception $e) { }
-
-# Status combo
-foreach ($core->blog->getAllPostStatus() as $k => $v) {
-	$status_combo[$v] = (string) $k;
-}
+$categories_combo = dcAdminCombos::getCategoriesCombo(
+	$core->blog->getCategories(array('post_type'=>'post'))
+);
+
+$status_combo = dcAdminCombos::getPostStatusesCombo();
+
 $img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
 
 # Formaters combo
-foreach ($core->getFormaters() as $v) {
-	$formaters_combo[$v] = $v;
-}
+$formaters_combo = dcAdminCombos::getFormatersCombo();
 
 # Languages combo
 $rs = $core->blog->getLangs(array('order'=>'asc'));
-$all_langs = l10n::getISOcodes(0,1);
-$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1));
-while ($rs->fetch()) {
-	if (isset($all_langs[$rs->post_lang])) {
-		$lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
-		unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
-	} else {
-		$lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
-	}
-}
-unset($all_langs);
-unset($rs);
+$lang_combo = dcAdminCombos::getLangsCombo($rs,true);
 
 # Validation flag
@@ -305,17 +283,7 @@
 
 # Getting categories
-$categories_combo = array(__('(No cat)') => '');
-try {
-	$categories = $core->blog->getCategories(array('post_type'=>'post'));
-	if (!$categories->isEmpty()) {
-		while ($categories->fetch()) {
-			$catparents_combo[] = $categories_combo[] = new formSelectOption(
-				str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
-				$categories->cat_id
-			);
-		}
-	}
-} catch (Exception $e) { }
-
+$categories_combo = dcAdminCombos::getCategoriesCombo(
+	$core->blog->getCategories(array('post_type'=>'post'))
+);
 /* DISPLAY
 -------------------------------------------------------- */
@@ -446,5 +414,5 @@
 					'</p>'.
 					'<p class="format_control control_wiki">'.
-					'<a id="convert-xhtml" class="button maximal '.($post_id && $post_format != 'wiki' ? 'hide' : '').'" href="post.php?id='.$post_id.'&amp;xconv=1">'.
+					'<a id="convert-xhtml" class="button'.($post_id && $post_format != 'wiki' ? 'hide' : '').'" href="post.php?id='.$post_id.'&amp;xconv=1">'.
 					__('Convert to XHTML').'</a></p></div>')),
 		'metas-box' => array(
@@ -517,5 +485,5 @@
 		
 		"post_excerpt" =>
-			'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'.
+			'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').' <span class="form-note">'.
 			__('Introduction to the post.').'</span></label> '.
 			form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)).
@@ -529,5 +497,5 @@
 		
 		"post_notes" =>
-			'<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'.
+			'<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').' <span class="form-note">'.
 			__('Unpublished notes.').'</span></label>'.
 			form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
@@ -580,5 +548,5 @@
 	
 	foreach ($sidebar_items as $id => $c) {
-		echo '<div id="'.$id.'" class="box">'.
+		echo '<div id="'.$id.'" class="sb-box">'.
 			'<h4>'.$c['title'].'</h4>';
 		foreach ($c['items'] as $e_name=>$e_content) {
@@ -633,5 +601,5 @@
 	
 	echo
-	'<div id="comments" class="multi-part" title="'.__('Comments').'">';
+	'<div id="comments" class="clear multi-part" title="'.__('Comments').'">';
 		
 	# --BEHAVIOR-- adminCommentsActionsCombo
@@ -640,5 +608,5 @@
 	$has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty());
 	echo 
-	'<p class="top-add"><a class="button add onblog_link" href="#comment-form">'.__('Add a comment').'</a></p>';
+	'<p class="top-add"><a class="button add" href="#comment-form">'.__('Add a comment').'</a></p>';
 	
 	if ($has_action) {
