You are here

function spaces_block in Spaces 6.3

Same name and namespace in other branches
  1. 5.2 spaces.module \spaces_block()
  2. 5 spaces.module \spaces_block()
  3. 6 spaces.module \spaces_block()

Implementation of hook_block().

File

./spaces.module, line 829

Code

function spaces_block($op, $delta = 0) {
  if (module_exists('jquery_ui')) {
    if ($op == 'list') {
      return array(
        'menu_editor' => array(
          'info' => t('Reorder menu'),
          'admin' => TRUE,
        ),
      );
    }
    elseif ($op == 'view' && $delta == 'menu_editor') {
      if (spaces_access_admin()) {

        // Check for User space type which doesn't support this feature.
        $space = spaces_get_space();
        if ($space && $space->type == 'user') {
          return array();
        }
        return array(
          'subject' => t('Reorder menu'),
          'content' => drupal_get_form('spaces_get_menu_editor'),
        );
      }
    }
  }
}