You are here

function domain_nav_block in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_nav/domain_nav.module \domain_nav_block()

Implement hook_block()

1 string reference to 'domain_nav_block'
domain_nav_render in domain_nav/domain_nav.module
Renders output for the block.

File

domain_nav/domain_nav.module, line 68
Navigation block and menu options for Domain Access

Code

function domain_nav_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $block[0]['info'] = t('Domain list navigator');
      break;
    case 'view':
      $block['subject'] = '';
      $block['content'] = domain_nav_render();
      break;
    case 'configure':
      $form['domain_nav_block'] = array(
        '#type' => 'radios',
        '#title' => t('Link paths'),
        '#default_value' => variable_get('domain_nav_block', 0),
        '#options' => array(
          0 => t('Link to site home page'),
          1 => t('Link to active url'),
        ),
      );
      $form['domain_nav_theme'] = array(
        '#type' => 'radios',
        '#title' => t('Link theme'),
        '#default_value' => variable_get('domain_nav_theme', 'default'),
        '#options' => array(
          'default' => t('JavaScript select list'),
          'menus' => t('Menu-style tab links'),
          'ul' => t('Unordered list of links'),
        ),
      );
      return $form;
      break;
    case 'save':
      variable_set('domain_nav_block', $edit['domain_nav_block']);
      variable_set('domain_nav_theme', $edit['domain_nav_theme']);
      break;
  }
  return $block;
}