/** * Implements hook_preprocess_region(). */ function spartan_preprocess_region(&$vars) { global $language; switch ($vars['region']) { // Menu region. case 'menu': $footer_menu_cache = cache_get("footer_menu_data:" . $language->language); if ($footer_menu_cache) { $footer_menu = $footer_menu_cache->data; } else { $footer_menu = menu_tree_output(_spartan_menu_build_tree('main-menu', array('max_depth' => 2))); cache_set("footer_menu_data:" . $language->language, $footer_menu); } //set the active trail $active_trail = menu_get_active_trail(); foreach ($active_trail as $trail) { if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) { $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail'; } } $vars['dropdown_menu'] = $footer_menu; break; // Default footer content. // Default footer content. case 'footer_first': $footer_menu_cache = cache_get("footer_menu_data:" . $language->language); if ($footer_menu_cache) { $footer_menu = $footer_menu_cache->data; } else { $footer_menu = menu_tree_output(_spartan_menu_build_tree('main-menu', array('max_depth' => 2))); cache_set("footer_menu_data:" . $language->language, $footer_menu); } //set the active trail $active_trail = menu_get_active_trail(); foreach ($active_trail as $trail) { if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) { $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail'; } } $vars['footer_menu'] = $footer_menu; $vars['site_name'] = $site_name = variable_get('site_name'); $vars['footer_logo'] = l(theme('image', array('path' => drupal_get_path('theme', 'spartan') . "/logo-sm.png", 'alt' => "{$site_name} logo")), '', array("html" => TRUE, 'attributes' => array('class' => 'logo'))); if (function_exists('defaultcontent_get_node') && ($node = defaultcontent_get_node("email_update"))) { $node = node_view($node); $vars['subscribe_form'] = $node['webform']; } //krumo($vars['footer_menu']); break; } }
/** * Implements hook_preprocess_region(). */ function openomega_preprocess_region(&$vars) { global $language; switch ($vars['region']) { // menu region case 'menu': $dropdown_menu = menu_tree_output(_openomega_menu_build_tree('main-menu', array('max_depth' => 2))); //set the active trail $active_trail = menu_get_active_trail(); foreach ($active_trail as $trail) { if (isset($trail['mlid']) && isset($dropdown_menu[$trail['mlid']])) { $dropdown_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail'; } } // Set the tab index for those with drop downs so can access the links. foreach ($dropdown_menu as $key => $item) { if (!empty($dropdown_menu[$key]['#below'])) { $dropdown_menu[$key]['#attributes']['tabindex'] = 0; } } $vars['dropdown_menu'] = $dropdown_menu; break; // default footer content // default footer content case 'footer_first': $footer_menu = menu_tree_output(_openomega_menu_build_tree('main-menu', array('max_depth' => 2))); //set the active trail $active_trail = menu_get_active_trail(); foreach ($active_trail as $trail) { if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) { $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail'; } } $vars['footer_menu'] = $footer_menu; $vars['site_name'] = $site_name = variable_get('site_name'); $vars['footer_logo'] = l(theme('image', array('path' => drupal_get_path('theme', 'openomega') . "/logo-sm.png", 'alt' => "{$site_name} logo")), '', array("html" => TRUE, 'attributes' => array('class' => 'logo'))); if (function_exists('defaultcontent_get_node') && ($node = defaultcontent_get_node("email_update"))) { $node = node_view($node); $vars['subscribe_form'] = $node['webform']; } break; } }
/** function open_omega_system_themes_page_alter(&$theme_groups) { $hidden = array( 'alpha', 'omega', ); foreach ($theme_groups as $state => &$group) { if ($state == 'disabled') { foreach ($theme_groups[$state] as $id => &$theme) { if (in_array($theme, $hidden)) { unset($theme_groups[$state][$id]); } } } } } */ function agency_1_preprocess_region(&$vars) { global $language; switch ($vars['region']) { // menu region case 'menu': $footer_menu_cache = cache_get("footer_menu_data:" . $language->language); if ($footer_menu_cache) { $footer_menu = $footer_menu_cache->data; } else { $footer_menu = menu_tree_output(_agency_1_menu_build_tree('main-menu', array('max_depth' => 2))); cache_set("footer_menu_data:" . $language->language, $footer_menu); } //set the active trail $active_trail = menu_get_active_trail(); foreach ($active_trail as $trail) { if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) { $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail'; } } $vars['dropdown_menu'] = $footer_menu; break; // default footer content // default footer content case 'footer_first': $footer_menu_cache = cache_get("footer_menu_data:" . $language->language); if ($footer_menu_cache) { $footer_menu = $footer_menu_cache->data; } else { $footer_menu = menu_tree_output(_agency_1_menu_build_tree('main-menu', array('max_depth' => 2))); cache_set("footer_menu_data", $footer_menu); } //set the active trail $active_trail = menu_get_active_trail(); foreach ($active_trail as $trail) { if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) { $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail'; } } $vars['footer_menu'] = $footer_menu; $vars['site_name'] = $site_name = variable_get('site_name'); $vars['footer_logo'] = l(theme('image', array('path' => drupal_get_path('theme', 'agency_1') . "/logo-sm.png", 'alt' => "{$site_name} logo")), '', array("html" => TRUE, 'attributes' => array('class' => 'logo'))); //Branding $vars['display_footer_branding'] = theme_get_setting('display_footer_branding'); //Contact Us Block $vars['display_footer_contact'] = theme_get_setting('display_footer_contact'); $vars['footer_contact_us_title'] = theme_get_setting('footer_contact_us_title'); $vars['footer_contact_us_agency_title'] = theme_get_setting('footer_contact_us_agency_title'); $vars['footer_contact_us_address_1'] = theme_get_setting('footer_contact_us_address_1'); $vars['footer_contact_us_address_2'] = theme_get_setting('footer_contact_us_address_2'); $vars['footer_contact_us_phone'] = theme_get_setting('footer_contact_us_phone'); $vars['footer_contact_us_fax'] = theme_get_setting('footer_contact_us_fax'); $vars['footer_contact_us_map_link'] = theme_get_setting('footer_contact_us_map_link'); $vars['footer_contact_us_map_image'] = theme_get_setting('footer_contact_us_map_image'); $vars['footer_contact_us_title_link'] = theme_get_setting('footer_contact_us_title_link'); $vars['footer_contact_us_map_path'] = theme_get_setting('footer_contact_us_map_path'); if (function_exists('defaultcontent_get_node') && ($node = defaultcontent_get_node("email_update"))) { $node = node_view($node); $vars['subscribe_form'] = $node['webform']; } //krumo($vars['footer_menu']); break; } }
/** * Load * * Loads an existing node with the specified identifier. * * @param mixed $identifier This can be a number or a string. If it's a number, * it is sent through node_load as a NID. If it is a * string, it is sent through defaultcontent to try and * grab a node with a matching machine name. * * @return Node */ public static function load($identifier) { $base = null; if (is_numeric($identifier)) { $base = \node_load($identifier); } else { // Try getting the UUID first, then the machine name. if (function_exists('entity_uuid_load')) { $n = entity_uuid_load('node', array($identifier)); $base = array_pop($n); } elseif (function_exists('defaultcontent_get_node')) { $base = \defaultcontent_get_node($identifier); } else { trigger_error("When loading the node: '{$identifier}', a non-number was given, " . "but only a number is supported.", E_USER_WARNING); } } if (!$base) { trigger_error("The node: '{$identifier}' does not exist.", E_USER_WARNING); } else { return new self($base); } return false; }