You are here

function dynamic_banner_settings in Dynamic Banner 7

Same name and namespace in other branches
  1. 6 includes/callbacks.inc \dynamic_banner_settings()
  2. 7.2 dynamic_banner.module \dynamic_banner_settings()
  3. 8.x dynamic_banner.module \dynamic_banner_settings()

A page that will display a form for changing how dynamic banner will function

1 string reference to 'dynamic_banner_settings'
dynamic_banner_menu in ./dynamic_banner.module
Implements hook_menu(). it is key to note here access arguments is referring to permissions

File

includes/callbacks.inc, line 780
Dynamic Banner Admin Pages and various other functions to make them work Most of the code in this file was derived from path module

Code

function dynamic_banner_settings($form, $form_state) {

  // todo need to find a better way of doing this
  $errors_current_setting = 1;
  if (variable_get('dynamic_banner_display_errors', BANNER_DEFAULT_ERROR)) {
    $errors_current_setting = 0;
  }
  $form['display_setting'] = array(
    '#type' => 'radios',
    '#title' => t('Display Setting'),
    '#options' => drupal_map_assoc(array(
      t('url'),
      t('text'),
      t('urltext'),
      t('urllink'),
    )),
    '#default_value' => variable_get('dynamic_banner_display_setting', BANNER_DEFAULT_OUTPUT),
    '#description' => t('What display pattern do you want the module to follow in the template file'),
    '#required' => TRUE,
  );
  $form['display_errors'] = array(
    '#type' => 'radios',
    '#title' => t('Display Errors?'),
    '#options' => array(
      t('yes'),
      t('no'),
    ),
    '#default_value' => $errors_current_setting,
    '#description' => t('If dynamic banner can not find a banner for the current page do you want it to display an error?'),
    '#required' => TRUE,
  );

  // does this still work when there is a default banner
  $form['image_save_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Image save path'),
    '#default_value' => variable_get('dynamic_banner_file_save_path', BANNER_DEFAULT_SAVE_LOCATION),
    '#description' => t('This will be the path all banners get saved to when using the upload utility. \'public://\' is your sites files folder. '),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}