You are here

function delta_blocks_block_configure in Delta 7.3

Implements hook_block_configure().

File

delta_blocks/delta_blocks.module, line 117
Exposes a number of core Drupal elements as blocks.

Code

function delta_blocks_block_configure($delta = '') {
  $form = array();
  switch ($delta) {
    case 'branding':
      $form['delta_blocks_settings']['delta_blocks_branding_site_name_linked'] = array(
        '#type' => 'checkbox',
        '#title' => t('Link the site name to your front page'),
        '#default_value' => variable_get('delta_blocks_branding_site_name_linked', TRUE),
      );
      $form['delta_blocks_settings']['delta_blocks_branding_site_name_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide the site name via CSS'),
        '#default_value' => variable_get('delta_blocks_branding_site_name_hidden', FALSE),
      );
      $form['delta_blocks_settings']['delta_blocks_branding_site_slogan_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide site slogan via CSS'),
        '#default_value' => variable_get('delta_blocks_branding_site_slogan_hidden', FALSE),
      );
      $form['delta_blocks_settings']['delta_blocks_branding_logo_render'] = array(
        '#type' => 'checkbox',
        '#title' => t('Show the logo'),
        '#default_value' => variable_get('delta_blocks_branding_logo_render', TRUE),
      );
      $form['delta_blocks_settings']['delta_blocks_branding_logo_linked'] = array(
        '#type' => 'checkbox',
        '#title' => t('Link the logo to your front page'),
        '#default_value' => variable_get('delta_blocks_branding_logo_linked', TRUE),
        '#states' => array(
          'visible' => array(
            ':input[name="delta_blocks_branding_logo_render"]' => array(
              'checked' => TRUE,
            ),
          ),
        ),
      );
      break;
    case 'site-name':
      $form['delta_blocks_settings']['delta_blocks_site_name_linked'] = array(
        '#type' => 'checkbox',
        '#title' => t('Link the site name to your front page'),
        '#default_value' => variable_get('delta_blocks_site_name_linked', TRUE),
      );
      $form['delta_blocks_settings']['delta_blocks_site_name_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide the site name via CSS'),
        '#default_value' => variable_get('delta_blocks_site_name_hidden', TRUE),
      );
      break;
    case 'site-slogan':
      $form['delta_blocks_settings']['delta_blocks_site_slogan_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide the site slogan via CSS'),
        '#default_value' => variable_get('delta_blocks_site_slogan_hidden', TRUE),
      );
      break;
    case 'page-title':
      $form['delta_blocks_settings']['delta_blocks_page_title_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide page title via CSS'),
        '#default_value' => variable_get('delta_blocks_page_title_hidden', FALSE),
      );
      break;
    case 'logo':
      $form['delta_blocks_settings']['delta_blocks_logo_linked'] = array(
        '#type' => 'checkbox',
        '#title' => t('Link the logo to your front page'),
        '#default_value' => variable_get('delta_blocks_logo_linked', TRUE),
      );
      break;
    case 'breadcrumb':
      $form['delta_blocks_settings']['delta_blocks_breadcrumb_title_hidden'] = array(
        '#type' => 'checkbox',
        '#title' => t('Hide the block title via CSS'),
        '#default_value' => variable_get('delta_blocks_breadcrumb_title_hidden', TRUE),
      );
      $form['delta_blocks_settings']['delta_blocks_breadcrumb_current'] = array(
        '#type' => 'checkbox',
        '#title' => t('Append the current page to the breadcrumb navigation'),
        '#default_value' => variable_get('delta_blocks_breadcrumb_current', TRUE),
      );
      break;
  }
  if (!empty($form)) {
    $form['delta_blocks_settings'] += array(
      '#type' => 'fieldset',
      '#title' => t('Block settings'),
    );
  }
  return $form;
}