--- article.module 2005-04-02 20:01:13.000000000 +0000 +++ article.module.new 2006-03-08 15:44:09.000000000 +0000 @@ -40,8 +40,22 @@ return $blocks; } elseif ($op == "configure" && $delta == 0) { - $form = form_textfield("Block Title", "article_block_title", variable_get("article_block_title", t("Latest Articles")), 35, 255, t("Title of the Articles block.")); - $form .= form_select(t('Recent Articles to Display'), 'article_recent_block', variable_get('article_recent_block', '5'), drupal_map_assoc(array(5, 10, 15, 20)), t("Sets the number of recent articles that will be displayed in the Recent Articles block.")); + $form['article_block_title'] = array( + '#type' => 'textfield', + '#title' => "Block Title", + '#default_value' => variable_get("article_block_title", t("Latest Articles")), + '#size' => 35, + '#maxlength' => 255, + '#desription' => t("Title of the Articles block.") +); + $form['article_recent_block'] = array( + '#type' => 'select', + '#title' => t('Recent Articles to Display'), + '#options' => drupal_map_assoc(array(5, 10, 15, 20)), + '#default_value' => variable_get('article_recent_block', 5), + '#desription' => t("Sets the number of recent articles that will be displayed in the Recent Articles block."), + '#ultiple' => false +); return $form; } elseif ($op == "save" && $delta == 0) { @@ -116,16 +130,61 @@ $select[$vocabulary->vid] = $vocabulary->name; } } - $output = form_select(t('Article Vocabularies'), 'article_vocab', variable_get('article_vocab', array()), $select, t('Select the vocabularies which contain the Article categories. All the vocabularies you select here will show up on the Article index.'), '', 1); - $output .= form_textfield('Overview Title', 'article_title', variable_get('article_title', t('Articles')), 35, 255, t('Title of the Articles box.')); - $output .= form_select(t('Index Depth'), 'article_index_depth', variable_get('article_index_depth', 0), array(0 => "All Terms", 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5", 6 => "6"), t("Defines how many levels of terms should be displayed on any given article index page. For example, if you select 1 then only one level of the Article index tree will be displayed at a time.")); - - $recent_group = form_radios(t('Recent Articles Box'), 'article_recent_box_enable', variable_get('article_recent_box_enable', 1), array(t('Disabled'), t('Enabled')), t('Enables or Disables the recent articles box on the article index page.'), false); - $recent_group .= form_textfield('Box Title', 'article_recent_box_title', variable_get('article_recent_box_title', t('Latest Articles')), 35, 255, t('Title of the Recent Articles Box on the Article index page.')); - $recent_group .= form_select(t('Articles to Display'), 'article_recent_display', variable_get('article_recent_display', '5'), array(5 => "5", 10 => "10", 15 => "15"), t("Sets the number of recent articles that will be displayed in the Recent Articles box. (0 = not displayed).")); - $output .= form_group(t('Recent Box Settings'), $recent_group); + if (!$select) + $select = array(); + $form['article_vocab'] = array( + '#type' => 'select', + '#title' => t('Article Vocabularies'), + '#options' => $select, + '#multiple' => TRUE, + '#default_value' => variable_get('article_vocab', ''), + '#desription' => t('Select the vocabularies which contain the Article categories. All the vocabularies you select here will show up on the Article index.'), + '#ultiple' => true +); + $form['article_title'] = array( + '#type' => 'textfield', + '#title' => t('Overview Title'), + '#default_value' => variable_get('article_title', t('Articles')), + '#size' => 35, + '#maxlength' => 255, + '#desription' => t('Title of the Articles box.') +); + $form['article_index_depth'] = array( + '#type' => 'select', + '#title' => t('Index Depth'), + '#options' => array(0 => "All Terms", 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5", 6 => "6"), + '#default_value' => variable_get('article_index_depth', 0), + '#desription' => t("Defines how many levels of terms should be displayed on any given article index page. For example, if you select 1 then only one level of the Article index tree will be displayed at a time."), + '#ultiple' => false +); + $form['recent_group'] = array('#type' => 'fieldset', '#title' => t('Recent Box Settings')); + $form['recent_group']['article_recent_box_enable'] = array( + '#type' => 'radios', + '#title' => t('Recent Articles Box'), + '#options' => array(t('Disabled'), t('Enabled')), + '#default_value' => variable_get('article_recent_box_enable', 1), + '#description' => t('Enables or Disables the recent articles box on the article index page.'), +'#required' => false +); + $form['recent_group']['article_recent_box_title'] = array( + '#type' => 'textfield', + '#title' => 'Box Title', + '#default_value' => variable_get('article_recent_box_title', t('Latest Articles')), + '#size' => 35, + '#maxlength' => 255, + '#description' => t('Title of the Recent Articles Box on the Article index page.') +); + + $form['recent_group']['article_recent_display'] = array( + '#type' => 'select', + '#options' => array(5 => "5", 10 => "10", 15 => "15"), + '#default_value' => variable_get('article_recent_display', '5'), + '#title' => t('Articles to Display'), + '#description' => t("Sets the number of recent articles that will be displayed in the Recent Articles box. (0 = not displayed)."), + '#multiple' => false + ); - return $output; + return $form; } /**