You are here

function recipe_admin_settings in Recipe 5

Same name and namespace in other branches
  1. 6 recipe.admin.inc \recipe_admin_settings()
  2. 7.2 recipe.admin.inc \recipe_admin_settings()
  3. 7 recipe.admin.inc \recipe_admin_settings()

Settings form for menu callback

1 string reference to 'recipe_admin_settings'
recipe_menu in ./recipe.module
Implementation of hook_menu().

File

./recipe.module, line 343
recipe.module - share recipes for drupal 5.x

Code

function recipe_admin_settings() {
  $form['recipe_index_depth'] = array(
    '#type' => 'select',
    '#title' => t('Index Depth'),
    '#default_value' => variable_get('recipe_index_depth', 0),
    '#options' => array(
      0 => t('All Terms'),
      1 => "1",
      2 => "2",
      3 => "3",
      4 => "4",
      5 => "5",
      6 => "6",
    ),
    '#description' => t("Defines how many levels of terms should be displayed on any given recipe index page. For example, if you select 1 then only one level of the Recipe index tree will be displayed at a time."),
  );
  $form['recipe_recent_box_enable'] = array(
    '#type' => 'radios',
    '#title' => t('Recent Recipes Box'),
    '#default_value' => variable_get('recipe_recent_box_enable', 1),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#description' => t('Enables or Disables the recent recipes box on the recipes index page.'),
    '#required' => false,
  );
  $form['recipe_recent_box_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Box Title'),
    '#default_value' => variable_get('recipe_recent_box_title', t('Latest Recipes')),
    '#size' => 35,
    '#maxlength' => 255,
    '#description' => t('Title of the Recent Recipes Box on the Recipes index page.'),
  );
  $form['recipe_recent_display'] = array(
    '#type' => 'select',
    '#title' => t('Recipes to Display'),
    '#default_value' => variable_get('recipe_recent_display', '5'),
    '#options' => array(
      5 => "5",
      10 => "10",
      15 => "15",
    ),
    '#description' => t("Sets the number of recent recipes that will be displayed in the Recent Recipes box. (0 = not displayed)."),
  );
  $form['recipe_help'] = array(
    '#type' => 'textarea',
    '#title' => t('Explanation or submission guidelines'),
    '#default_value' => variable_get('recipe_help', ''),
    '#cols' => 55,
    '#rows' => 4,
    '#description' => t('This text will be displayed at the top of the recipe submission form.  Useful for helping or instructing your users.'),
  );
  $options = array(
    'simple' => t('Simple'),
    'complex' => t('Complex'),
  );
  $form['recipe_ingredient_system'] = array(
    '#type' => 'radios',
    '#title' => t('Ingredient entering system'),
    '#default_value' => variable_get('recipe_ingredient_system', 'complex'),
    '#options' => $options,
    '#description' => t('The simple ingredient system allows all ingredients to be entered on one line.  The complex system forces the user to seperate the quanity and units from the ingredient'),
  );
  $form['recipe_fraction_display'] = array(
    '#type' => 'textfield',
    '#title' => t('Fractions Display String'),
    '#default_value' => variable_get('recipe_fraction_display', t('{%d }%d⁄%d')),
    '#size' => 35,
    '#maxlength' => 255,
    '#description' => t('How fractions should be displayed.  Leave blank to display as decimals.  Each incidence of %d will be replaced by the whole number, the numerator, and the denominator in that order.  Anything between curly braces will not be displayed when the whole number is equal to 0.  Recommended settings are "{%d }%d⁄%d" or "{%d }<sup>%d</sup>/<sub>%d</sub>"'),
  );
  $form['recipe_export_html_enable'] = array(
    '#type' => 'radios',
    '#title' => t('Export HTML'),
    '#default_value' => variable_get('recipe_export_html_enable', 1),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#description' => t('Enables or Disables the Export as HTML link.'),
    '#required' => false,
  );
  $form['recipe_export_recipeml_enable'] = array(
    '#type' => 'radios',
    '#title' => t('Export RecipeML'),
    '#default_value' => variable_get('recipe_export_recipeml_enable', 1),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#description' => t('Enables or Disables the Export as RecipeML link.'),
    '#required' => false,
  );
  return system_settings_form($form);
}