You are here

function menu_block_get_config in Menu Block 6.2

Same name and namespace in other branches
  1. 7.3 menu_block.module \menu_block_get_config()
  2. 7.2 menu_block.module \menu_block_get_config()

Returns the configuration for the requested block delta.

Parameters

$delta: string The delta that uniquely identifies the block in the block system. If not specified, the default configuration will be returned.

Return value

array An associated array of configuration options.

6 calls to menu_block_get_config()
menu_block_configure_form in ./menu_block.admin.inc
Returns the configuration form for a menu tree.
menu_block_delete in ./menu_block.admin.inc
Menu callback: confirm deletion of menu blocks.
menu_block_menu_tree_content_type_content_types in plugins/content_types/menu_tree/menu_tree.inc
Supplies a list of menu tree content sub-types.
_menu_block_block_configure in ./menu_block.admin.inc
Returns the 'configure' $op info for hook_block().
_menu_block_block_list in ./menu_block.admin.inc
Returns the 'list' $op info for hook_block().

... See full list

File

./menu_block.module, line 172
Provides configurable blocks of menu items.

Code

function menu_block_get_config($delta = NULL) {
  $config = array(
    'delta' => $delta,
    'menu_name' => 'primary-links',
    'parent_mlid' => 0,
    'title_link' => 0,
    'admin_title' => '',
    'level' => 1,
    'follow' => 0,
    'depth' => 0,
    'expanded' => 0,
    'sort' => 0,
  );

  // Get the block configuration options.
  if ($delta) {
    $config['title_link'] = variable_get("menu_block_{$delta}_title_link", $config['title_link']);
    $config['admin_title'] = variable_get("menu_block_{$delta}_admin_title", $config['admin_title']);
    $config['level'] = variable_get("menu_block_{$delta}_level", $config['level']);
    $config['follow'] = variable_get("menu_block_{$delta}_follow", $config['follow']);
    $config['depth'] = variable_get("menu_block_{$delta}_depth", $config['depth']);
    $config['expanded'] = variable_get("menu_block_{$delta}_expanded", $config['expanded']);
    $config['sort'] = variable_get("menu_block_{$delta}_sort", $config['sort']);
    list($config['menu_name'], $config['parent_mlid']) = explode(':', variable_get("menu_block_{$delta}_parent", $config['menu_name'] . ':' . $config['parent_mlid']));
  }
  return $config;
}