function ultimenu_get_config in Ultimenu 7
The configuration for the requested block delta.
Parameters
string $delta: The delta that uniquely identifies the block in the block system. If not specified, the default configuration will be returned.
bool $original: If TRUE, return as is, otherwise convert url to actual path.
Return value
array An associated array of configuration options.
2 calls to ultimenu_get_config()
- ultimenu_block_view in ./
ultimenu.module - Implements hook_block_view().
- _ultimenu_block_configure in includes/
ultimenu.admin.inc - Implements hook_block_configure().
File
- includes/
ultimenu.utilities.inc, line 315 - Misc functions that hardly change.
Code
function ultimenu_get_config($delta = NULL, $original = FALSE) {
$config = array(
'skin' => '',
'skin_name' => '',
);
// Get the block configuration options.
if ($delta) {
static $blocks;
if (!isset($blocks)) {
$blocks = ultimenu_get_settings('blocks');
}
if (!empty($blocks[$delta])) {
$config['delta'] = $delta;
}
// Structure: main_menu => ultimenu-htb:module|ultimenu-orange.css.
$menu_name = str_replace(array(
"-",
"'",
), "_", $delta);
$config['menu_name'] = $delta;
$config['menu_name_truncated'] = ultimenu_truncate_menu_property($delta);
$setting = ultimenu_get_settings($menu_name);
list($config['orientation'], $url) = array_pad(array_map('trim', explode(":", $setting, 2)), 2, NULL);
if ($original) {
$config['skin'] = $url;
}
else {
$theme_skin = drupal_get_path('theme', variable_get('theme_default', 'bartik')) . '/css/ultimenu';
$custom_skin = ultimenu_get_settings('skins');
$module_skin = drupal_get_path('module', 'ultimenu') . '/skins';
if (strpos($url, "module|") !== FALSE) {
$config['skin'] = str_replace("module|", $module_skin . '/', $url);
}
elseif (strpos($url, "custom|") !== FALSE) {
$config['skin'] = str_replace("custom|", $custom_skin . '/', $url);
}
elseif (strpos($url, "theme|") !== FALSE) {
$config['skin'] = str_replace("theme|", $theme_skin . '/', $url);
}
}
if ($skin_name = $url) {
$skin_name = str_replace(".css", '', substr($skin_name, strrpos($skin_name, '|') + 1));
$config['skin_name'] = drupal_html_class($skin_name);
}
}
return $config;
}