You are here

function block_refresh_settings in Block Refresh 5

Same name and namespace in other branches
  1. 6 block_refresh.module \block_refresh_settings()

callback for admin/settings/block_refresh

5 string references to 'block_refresh_settings'
block_refresh_block_content in ./block_refresh.module
page callback for /block_refresh/[module]/[delta] displays the block content, without any other page information
block_refresh_footer in ./block_refresh.module
implements hook_footer calls the jquery to refresh blocks automatically, but only if the blocks exist on the current page and are enabled
block_refresh_form_alter in ./block_refresh.module
Add a 'Block Refresh' settings fieldset to the block admin form
block_refresh_menu in ./block_refresh.module
implements hook_menu
block_refresh_submit in ./block_refresh.module
handle submission of block refresh form on block settings page

File

./block_refresh.module, line 96

Code

function block_refresh_settings() {
  $form = array();
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Settings help'),
    '#collapsible' => TRUE,
  );
  $form['settings']['configure'] = array(
    '#type' => 'item',
    '#value' => t("Ensure that you have !configured for user roles. Adding a permission to %access will allow a block, when configured, to be refreshed automatically and/or manually.", array(
      '%access' => 'access block refresh content',
      '!configured' => l(t('configured permissions'), 'admin/user/access', array(), NULL, 'module-block_refresh'),
    )),
  );
  $form['settings']['settings'] = array(
    '#type' => 'item',
    '#value' => t("You will also need to set the appropriate settings for each block that you wish to automatically and/or manually refresh by clicking on the appropriate %configure link(s) on the !admin.", array(
      '%configure' => t('configure'),
      '!admin' => l(t('blocks administration page'), 'admin/build/block'),
    )),
  );
  $form['global'] = array(
    '#type' => 'fieldset',
    '#title' => t('Global settings'),
    '#collapsible' => TRUE,
  );
  $form['global']['block_refresh_group_auto'] = array(
    '#type' => 'checkbox',
    '#title' => t('Group block refreshes'),
    '#description' => t('If checked, then all grouped block refresh enabled blocks will be refreshed together, whether manually or using the timer settings below. To group blocks together, check the appropriate block on that block\'s configuration settings page.'),
    '#default_value' => variable_get('block_refresh_group_auto', TRUE),
  );
  $form['global']['block_refresh_group_auto_timer'] = array(
    '#type' => 'textfield',
    '#title' => t('Group block refresh timer'),
    '#description' => t('Enter the time, in seconds, that grouped blocks will refresh, when grouped and set to automatic.'),
    '#default_value' => variable_get('block_refresh_group_auto_timer', BLOCK_REFRESH_AUTOREFRESH_DEFAULT_TIMER),
  );
  return system_settings_form($form);
}