/** * Implements theme_process_page(). */ function basetpl_process_page(&$variables) { global $base_path; // show/hide breadcrumb $variables['show_breadcrumb'] = TRUE; // var theme_path $variables['theme_path'] = $base_path . path_to_theme(); // var site_info $variables['site_info'] = $variables['logo'] || $variables['site_name'] || $variables['site_slogan'] ? TRUE : FALSE; // check if page is system page $variables['system_page'] = isset($variables['node']) ? FALSE : TRUE; // backend if (user_is_logged_in() && path_is_admin(current_path())) { $variables['site_info'] = FALSE; $variables['system_page'] = TRUE; foreach (element_children($variables['page']) as $region) { if ($region != 'content') { $variables['page'][$region] = FALSE; } } } // show/hide page title $variables['title'] = $variables['system_page'] ? $variables['title'] : FALSE; // add robots to head if (theme_get_setting('robots') == 1) { $robots = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'robots', 'content' => 'noindex,nofollow')); drupal_add_html_head($robots, 'robots'); } }
/** * Implements hook_css_alter(). */ function omega_css_alter(&$css) { $omega = drupal_get_path('theme', 'omega'); // The CSS_SYSTEM aggregation group doesn't make any sense. Therefore, we are // pre-pending it to the CSS_DEFAULT group. This has the same effect as giving // it a separate (low-weighted) group but also allows it to be aggregated // together with the rest of the CSS. foreach ($css as &$item) { if ($item['group'] == CSS_SYSTEM) { $item['group'] = CSS_DEFAULT; $item['weight'] = $item['weight'] - 100; } } // Clean up core and contrib module CSS. $overrides = array('aggregator' => array('aggregator.css' => array('theme' => 'aggregator.theme.css'), 'aggregator-rtl.css' => array('theme' => 'aggregator.theme-rtl.css')), 'block' => array('block.css' => array('admin' => 'block.admin.css', 'demo' => 'block.demo.css')), 'book' => array('book.css' => array('theme' => 'book.theme.css', 'admin' => 'book.admin.css'), 'book-rtl.css' => array('theme' => 'book.theme-rtl.css')), 'color' => array('color.css' => array('admin' => 'color.admin.css'), 'color-rtl.css' => array('admin' => 'color.admin-rtl.css')), 'comment' => array('comment.css' => array('theme' => 'comment.theme.css'), 'comment-rtl.css' => array('theme' => 'comment.theme-rtl.css')), 'contextual' => array('contextual.css' => array('base' => 'contextual.base.css', 'theme' => 'contextual.theme.css'), 'contextual-rtl.css' => array('base' => 'contextual.base-rtl.css', 'theme' => 'contextual.theme-rtl.css')), 'field' => array('theme/field.css' => array('theme' => 'field.theme.css'), 'theme/field-rtl.css' => array('theme' => 'field.theme-rtl.css')), 'field_ui' => array('field_ui.css' => array('admin' => 'field_ui.admin.css'), 'field_ui-rtl.css' => array('admin' => 'field_ui.admin-rtl.css')), 'file' => array('file.css' => array('theme' => 'file.theme.css')), 'filter' => array('filter.css' => array('theme' => 'filter.theme.css')), 'forum' => array('forum.css' => array('theme' => 'forum.theme.css'), 'forum-rtl.css' => array('theme' => 'forum.theme-rtl.css')), 'image' => array('image.css' => array('theme' => 'image.theme.css'), 'image-rtl.css' => array('theme' => 'image.theme-rtl.css'), 'image.admin.css' => array('admin' => 'image.admin.css')), 'locale' => array('locale.css' => array('admin' => 'locale.admin.css'), 'locale-rtl.css' => array('admin' => 'locale.admin-rtl.css')), 'openid' => array('openid.css' => array('base' => 'openid.base.css', 'theme' => 'openid.theme.css'), 'openid-rtl.css' => array('base' => 'openid.base-rtl.css', 'theme' => 'openid.theme-rtl.css')), 'poll' => array('poll.css' => array('admin' => 'poll.admin.css', 'theme' => 'poll.theme.css'), 'poll-rtl.css' => array('theme' => 'poll.theme-rtl.css')), 'search' => array('search.css' => array('theme' => 'search.theme.css'), 'search-rtl.css' => array('theme' => 'search.theme-rtl.css')), 'system' => array('system.base.css' => array('base' => 'system.base.css'), 'system.base-rtl.css' => array('base' => 'system.base-rtl.css'), 'system.theme.css' => array('theme' => 'system.theme.css'), 'system.theme-rtl.css' => array('theme' => 'system.theme-rtl.css'), 'system.admin.css' => array('admin' => 'system.admin.css'), 'system.admin-rtl.css' => array('admin' => 'system.admin-rtl.css'), 'system.menus.css' => array('theme' => 'system.menus.theme.css'), 'system.menus-rtl.css' => array('theme' => 'system.menus.theme-rtl.css'), 'system.messages.css' => array('theme' => 'system.messages.theme.css'), 'system.messages-rtl.css' => array('theme' => 'system.messages.theme-rtl.css')), 'taxonomy' => array('taxonomy.css' => array('admin' => 'taxonomy.admin.css')), 'user' => array('user.css' => array('base' => 'user.base.css', 'admin' => 'user.admin.css', 'theme' => 'user.theme.css'), 'user-rtl.css' => array('admin' => 'user.admin-rtl.css', 'theme' => 'user.theme-rtl.css'))); // Check if we are on an admin page. Otherwise, we can skip admin CSS. $path = current_path(); $types = path_is_admin($path) ? array('base', 'theme', 'admin') : array('base', 'theme'); // Add a special case for the block demo page. $types = strpos($path, 'admin/structure/block/demo') === 0 ? array_merge($types, array('demo')) : $types; // Override module provided CSS with clean and modern alternatives provided // by Omega. foreach ($overrides as $module => $files) { // We gathered the CSS files with paths relative to the providing module. $path = drupal_get_path('module', $module); foreach ($files as $file => $items) { if (isset($css[$path . '/' . $file])) { // Keep a copy of the original file array so we can merge that with our // overrides in order to keep the 'weight' and 'group' declarations. $original = $css[$path . '/' . $file]; unset($css[$path . '/' . $file]); // Omega 4.x tries to follow the pattern described in // http://drupal.org/node/1089868 for declaring CSS files. Therefore, it // may take more than a single file to override a .css file added by // core. This gives us better granularity when overriding .css files // in a sub-theme. foreach ($types as $type) { if (isset($items[$type])) { $css[$omega . '/css/modules/' . $module . '/' . $items[$type]] = array('data' => $omega . '/css/modules/' . $module . '/' . $items[$type]) + $original; } } } } } // Exclude CSS files as declared in the theme settings. if (omega_extension_enabled('assets')) { omega_css_js_alter($css, 'css'); } // Allow themes to specify no-query fallback CSS files. require_once "{$omega}/includes/assets.inc"; $mapping = omega_assets_generate_mapping($css); foreach (preg_grep('/\\.no-query(-rtl)?\\.css$/', $mapping) as $key => $fallback) { // Don't modify browser settings if they have already been modified. if ($css[$key]['browsers']['IE'] === TRUE && $css[$key]['browsers']['!IE'] === TRUE) { $css[$key]['browsers'] = array('!IE' => FALSE, 'IE' => 'lte IE 8'); // Make sure that we don't break any CSS aggregation groups. $css[$key]['weight'] += 100; } } }
/** * Preprocess html.tpl.php. * * @see bootstrap_material_js_alter() */ function bootstrap_material_preprocess_html(&$vars) { // Add class to help us style admin pages. if (path_is_admin(current_path())) { $vars['classes_array'][] = 'admin'; } // Prepare to initialize. drupal_add_js('(function ($){ $.material.init(); })(jQuery);', array('type' => 'inline', 'group' => JS_BOOTSTRAP_MATERIAL, 'scope' => 'footer', 'weight' => 2)); }
/** * Implements hook_css_alter(). */ function omega_css_alter(&$css) { $omega = drupal_get_path('theme', 'omega'); // The CSS_SYSTEM aggregation group doesn't make any sense. Therefore, we are // pre-pending it to the CSS_DEFAULT group. This has the same effect as giving // it a separate (low-weighted) group but also allows it to be aggregated // together with the rest of the CSS. foreach ($css as &$item) { if ($item['group'] == CSS_SYSTEM) { $item['group'] = CSS_DEFAULT; $item['weight'] = $item['weight'] - 100; } } // Clean up core and contrib module CSS. $overrides = array('aggregator' => array('aggregator.css' => array('theme' => 'aggregator.theme.css'), 'aggregator-rtl.css' => array('theme' => 'aggregator.theme-rtl.css')), 'block' => array('block.css' => array('admin' => 'block.admin.css', 'demo' => 'block.demo.css')), 'book' => array('book.css' => array('theme' => 'book.theme.css', 'admin' => 'book.admin.css'), 'book-rtl.css' => array('theme' => 'book.theme-rtl.css')), 'color' => array('color.css' => array('admin' => 'color.admin.css'), 'color-rtl.css' => array('admin' => 'color.admin-rtl.css')), 'comment' => array('comment.css' => array('theme' => 'comment.theme.css'), 'comment-rtl.css' => array('theme' => 'comment.theme-rtl.css')), 'contextual' => array('contextual.css' => array('base' => 'contextual.base.css', 'theme' => 'contextual.theme.css'), 'contextual-rtl.css' => array('base' => 'contextual.base-rtl.css', 'theme' => 'contextual.theme-rtl.css')), 'field' => array('theme/field.css' => array('theme' => 'field.theme.css'), 'theme/field-rtl.css' => array('theme' => 'field.theme-rtl.css')), 'field_ui' => array('field_ui.css' => array('admin' => 'field_ui.admin.css'), 'field_ui-rtl.css' => array('admin' => 'field_ui.admin-rtl.css')), 'file' => array('file.css' => array('theme' => 'file.theme.css')), 'filter' => array('filter.css' => array('theme' => 'filter.theme.css')), 'forum' => array('forum.css' => array('theme' => 'forum.theme.css'), 'forum-rtl.css' => array('theme' => 'forum.theme-rtl.css')), 'image' => array('image.css' => array('theme' => 'image.theme.css'), 'image-rtl.css' => array('theme' => 'image.theme-rtl.css'), 'image.admin.css' => array('admin' => 'image.admin.css')), 'locale' => array('locale.css' => array('admin' => 'locale.admin.css'), 'locale-rtl.css' => array('admin' => 'locale.admin-rtl.css')), 'openid' => array('openid.css' => array('base' => 'openid.base.css', 'theme' => 'openid.theme.css'), 'openid-rtl.css' => array('base' => 'openid.base-rtl.css', 'theme' => 'openid.theme-rtl.css')), 'poll' => array('poll.css' => array('admin' => 'poll.admin.css', 'theme' => 'poll.theme.css'), 'poll-rtl.css' => array('theme' => 'poll.theme-rtl.css')), 'search' => array('search.css' => array('theme' => 'search.theme.css'), 'search-rtl.css' => array('theme' => 'search.theme-rtl.css')), 'system' => array('system.base.css' => array('base' => 'system.base.css'), 'system.base-rtl.css' => array('base' => 'system.base-rtl.css'), 'system.theme.css' => array('theme' => 'system.theme.css'), 'system.theme-rtl.css' => array('theme' => 'system.theme-rtl.css'), 'system.admin.css' => array('admin' => 'system.admin.css'), 'system.admin-rtl.css' => array('admin' => 'system.admin-rtl.css'), 'system.menus.css' => array('theme' => 'system.menus.theme.css'), 'system.menus-rtl.css' => array('theme' => 'system.menus.theme-rtl.css'), 'system.messages.css' => array('theme' => 'system.messages.theme.css'), 'system.messages-rtl.css' => array('theme' => 'system.messages.theme-rtl.css')), 'taxonomy' => array('taxonomy.css' => array('admin' => 'taxonomy.admin.css')), 'user' => array('user.css' => array('base' => 'user.base.css', 'admin' => 'user.admin.css', 'theme' => 'user.theme.css'), 'user-rtl.css' => array('admin' => 'user.admin-rtl.css', 'theme' => 'user.theme-rtl.css'))); // Check if we are on an admin page. Otherwise, we can skip admin CSS. $path = current_path(); $types = path_is_admin($path) ? array('base', 'theme', 'admin') : array('base', 'theme'); // Add a special case for the block demo page. $types = strpos($path, 'admin/structure/block/demo') === 0 ? array_merge($types, array('demo')) : $types; // Override module provided CSS with clean and modern alternatives provided // by Omega. foreach ($overrides as $module => $files) { // We gathered the CSS files with paths relative to the providing module. $path = drupal_get_path('module', $module); foreach ($files as $file => $items) { if (isset($css[$path . '/' . $file])) { // Keep a copy of the original file array so we can merge that with our // overrides in order to keep the 'weight' and 'group' declarations. $original = $css[$path . '/' . $file]; unset($css[$path . '/' . $file]); // Omega 4.x tries to follow the pattern described in // http://drupal.org/node/1089868 for declaring CSS files. Therefore, it // may take more than a single file to override a .css file added by // core. This gives us better granularity when overriding .css files // in a sub-theme. foreach ($types as $type) { if (isset($items[$type])) { $css[$omega . '/css/modules/' . $module . '/' . $items[$type]] = array('data' => $omega . '/css/modules/' . $module . '/' . $items[$type]) + $original; } } } } } // Exclude CSS files as declared in the theme settings. if (omega_extension_enabled('assets') && ($regex = omega_theme_get_setting('omega_css_exclude_regex'))) { // Make sure that RTL styles are excluded as well when a file name has been // specified with it's full .css file extension. $regex = preg_replace('/\\\\.css$/', '(\\.css|-rtl\\.css)', $regex); omega_exclude_assets($css, $regex); } }
/** * Implement hook_js_alter() * Attempt to replace the system jQuery on non admin and non node admin pages with a newer version provided by the theme */ function govdexsupport_js_alter(&$javascript) { $node_admin_paths = array('node/*/edit', 'node/add', 'node/add/*', 'node/*/extend_review_date'); $replace_jquery = TRUE; if (path_is_admin(current_path())) { $replace_jquery = FALSE; } else { foreach ($node_admin_paths as $node_admin_path) { if (drupal_match_path(current_path(), $node_admin_path)) { $replace_jquery = FALSE; } } } // Swap out jQuery to use an updated version of the library. if ($replace_jquery) { $javascript['misc/jquery.js']['data'] = '//code.jquery.com/jquery-2.1.4.min.js'; } }
/** * Implements theme_preprocess_html(). */ function subtpl_preprocess_html(&$variables, $hook) { // add body frontpage class if (!empty($variables['page']['content']['system_main']['nodes'])) { $node = reset($variables['page']['content']['system_main']['nodes']); if ($node['#bundle'] == 'frontpage' && !drupal_is_front_page()) { $variables['classes_array'][] = 'frontpage'; } } // add stylesheet for logged in users & login pages if (user_is_logged_in() || arg(0) == 'user') { drupal_add_css(path_to_theme() . '/less/system.less', array('group' => CSS_DEFAULT, 'weight' => 98)); } // add stylesheet for admin backend if (user_is_logged_in() && path_is_admin(current_path())) { drupal_add_css(path_to_theme() . '/less/admin.less', array('group' => CSS_DEFAULT, 'weight' => 99)); } // add google webfont drupal_add_css('https://fonts.googleapis.com/css?family=Titillium+Web:400,300,300italic,400italic,600,600italic,700,700italic,900', array('type' => 'external')); }
/** * Implements theme_js_alter(). */ function basetpl_js_alter(&$javascript) { unset($javascript['sites/all/modules/views_bulk_operations/js/views_bulk_operations.js']); unset($javascript['modules/user/user.permissions.js']); if (!user_is_logged_in() && !path_is_admin(current_path())) { unset($javascript['sites/all/modules/linkit/js/linkit.js']); unset($javascript['sites/all/modules/linkit/editors/ckeditor/linkitDialog.js']); unset($javascript['misc/progress.js']); unset($javascript['misc/ui/jquery.ui.core.min.js']); unset($javascript['misc/ui/jquery.ui.button.min.js']); unset($javascript['misc/ui/jquery.ui.widget.min.js']); unset($javascript['misc/ui/jquery.ui.dialog.min.js']); unset($javascript['misc/ui/jquery.ui.mouse.min.js']); unset($javascript['misc/ui/jquery.ui.draggable.min.js']); unset($javascript['misc/ui/jquery.ui.position.min.js']); unset($javascript['misc/ui/jquery.ui.resizable.min.js']); unset($javascript['misc/tableheader.js']); unset($javascript['sites/all/modules/views/js/jquery.ui.dialog.patch.js']); unset($javascript['sites/all/modules/iframe/iframe.js']); unset($javascript['modules/contextual/contextual.js']); } }
print $content_column_class; ?> > <?php if (!empty($page['highlighted'])) { ?> <div class="highlighted jumbotron"><?php print render($page['highlighted']); ?> </div> <?php } ?> <?php if (!path_is_admin(current_path()) && !empty($breadcrumb)) { ?> <?php print $breadcrumb; ?> <?php } ?> <a id="main-content"></a> <?php print render($title_prefix); ?> <?php if (!empty($title)) { ?>
/** * Implements hook_preprocess_html(). */ function apigee_responsive_preprocess_html(&$vars) { $header_bg_color = theme_get_setting('header_bg_color'); $header_txt_color = theme_get_setting('header_txt_color'); $header_hover_bg_color = theme_get_setting('header_hover_bg_color'); $header_hover_txt_color = theme_get_setting('header_hover_txt_color'); $link_color = theme_get_setting('link_color'); $link_hover_color = theme_get_setting('link_hover_color'); $footer_bg_color = theme_get_setting('footer_bg_color'); $footer_link_color = theme_get_setting('footer_link_color'); $footer_link_hover_color = theme_get_setting('footer_link_hover_color'); $button_background_color = theme_get_setting('button_background_color'); $button_text_color = theme_get_setting('button_text_color'); $button_hover_background_color = theme_get_setting('button_hover_background_color'); $button_hover_text_color = theme_get_setting('button_hover_text_color'); // Add additional class to the body to adjust the body padding according to // the logo size. This is to prevent the search box from going beneath the // header. $vars['classes_array'][] = "logo_" . theme_get_setting('logo_size'); $cdn = theme_get_setting('bootstrap_cdn'); if (!(bool) $cdn || !isset($cdn) || empty($cdn)) { drupal_add_css(drupal_get_path('theme', 'bootstrap') . '/css/overrides.css', array('group' => CSS_SYSTEM)); drupal_add_css(drupal_get_path('theme', 'apigee_responsive') . '/css/bootstrap.min.css', array('group' => CSS_SYSTEM)); drupal_add_js(drupal_get_path('theme', 'apigee_responsive') . '/js/bootstrap.min.js', array('group' => CSS_SYSTEM)); } if (module_exists('devconnect_monetization')) { require_once drupal_get_path('theme', 'apigee_responsive') . '/templates/monetization/template.php'; drupal_add_css(drupal_get_path('theme', 'apigee_responsive') . '/templates/monetization/css/monetization.css'); } drupal_add_css(".faq .collapsed {display:block !important}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar {background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar {border-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-toggle {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-collapse:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-toggle:hover {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-toggle:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-nav > .open > a {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-nav > .open > a:hover {border-color: {$header_bg_color}; background-color: {$header_hover_bg_color}; color:{$header_hover_txt_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-inverse .navbar-nav > .open > a:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-toggle:hover {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-toggle:active {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-toggle:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-collapse {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-collapse:hover {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-collapse:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-nav > .open > a {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-nav > .open > a:hover {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .navbar-default .navbar-nav > .open > a:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar.navbar-nav > .open > a {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar.navbar-nav > .open > a:hover {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar.navbar-nav > .open > a:focus {border-color: {$header_bg_color}; background-color: {$header_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar .nav > li > a {color: {$header_txt_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar .nav > li > a:hover {background-color: {$header_hover_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form, .navbar-inverse .navbar-toggle,\n .navbar-default .navbar-collapse, .navbar-default .navbar-form, .navbar-default .navbar-toggle, header.navbar.navbar-collapse,\n header.navbar.navbar-form, header.navbar.navbar-toggle {border-color: {$header_hover_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-inverse .navbar-toggle, .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus,\n .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus,\n .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:active, .navbar-default .navbar-toggle:focus,\n .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus,\n header.navbar.navbar-nav > .open > a, header.navbar.navbar-nav > .open > a:hover, header.navbar.navbar-nav > .open > a:focus {background-color: {$header_hover_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar .nav .active > a, body .navbar .nav .active > a:hover, .navbar.navbar-fixed-top #main-menu li a:hover {background-color: {$header_hover_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body header.navbar .nav > li > a:hover {color: {$header_hover_txt_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body a {color: {$link_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body a:hover {color: {$link_hover_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .footer {background-color: {$footer_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .footer .navbar ul.footer-links > li > a {color: {$footer_link_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .footer .navbar ul.footer-links > li > a:hover {color: {$footer_link_hover_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn {background-color: {$button_background_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn {color: {$button_text_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn:hover {background-color: {$button_hover_background_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn:hover {color: {$button_hover_text_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn:focus {background-color: {$button_hover_background_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn:focus {color: {$button_hover_text_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn:active {background-color: {$button_hover_background_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn:active {color: {$button_hover_text_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn.active {background-color: {$button_hover_background_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .btn.active {color: {$button_hover_text_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .open .dropdown-toggle.btn {background-color: {$button_hover_background_color};}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("body .open .dropdown-toggle.btn {color: {$button_hover_text_color};}", array('group' => CSS_THEME, 'type' => 'inline')); // Main menu expanded drop down colors. drupal_add_css(".navbar-nav > li > span {color: {$header_txt_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-nav > li > span:hover {color: {$header_hover_txt_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-nav > li.expanded span:hover {background-color: {$header_hover_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-nav > li.expanded.active {background-color: {$header_hover_bg_color}}", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-nav > li > span > span.caret {border-bottom-color: {$header_txt_color}; border-top-color: {$header_txt_color}; color: {$header_txt_color};}", array('group' => CSS_THEME, 'type' => 'inline')); switch (theme_get_setting('logo_size')) { case 'big': drupal_add_css("body #navbar.navbar { height:60px; }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("@media(max-width:767px) { body #navbar.navbar { height:inherit; } }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-nav > li > a { line-height:30px; }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("@media(min-width:992px) { .logo > img { width:100%; } }", array('group' => CSS_THEME, 'type' => 'inline')); break; case 'bigger': drupal_add_css("body #navbar.navbar { height:70px; }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("@media(max-width:767px) { body #navbar.navbar { height:inherit; } }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css(".navbar-nav > li > a { line-height:40px; }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("@media(min-width:992px) { .logo > img { width:100%; } }", array('group' => CSS_THEME, 'type' => 'inline')); break; default: break; } switch (theme_get_setting('footer_position')) { case 'fixed': drupal_add_css("body #push { height: 100px; }", array('group' => CSS_THEME, 'type' => 'inline')); if (path_is_admin(current_path())) { drupal_add_css("#module-filter-tabs.bottom-fixed { bottom: 100px; }", array('group' => CSS_THEME, 'type' => 'inline')); drupal_add_css("html.js #module-filter-submit { padding: 10px; }", array('group' => CSS_THEME, 'type' => 'inline')); } break; case 'static': drupal_add_css(".footer.footer-fixed-bottom { position:static }", array('group' => CSS_THEME, 'type' => 'inline')); break; default: } }
/** * Checks if the current page is an admin page * @return mixed: returns 1 if matched, 0 if no match, false if error occurs */ public static function is_admin_page() { return path_is_admin(current_path()); }
/** * Local function * * Builds a sidebar menu based on the current path. * * @return HTML content or false * * @todo Refactor */ function _uw_boundless_uw_sidebar_menu() { global $theme; // check the theme setting for visibility if (!theme_get_setting('uw_boundless_sidebar_menu_visibility')) { return FALSE; } // get some data $current_path = current_path(); $active_trail = menu_get_active_trail(); $current_depth = count($active_trail); $active_trail_key = $current_depth - 1; // no trail, no sidebar menu if ($active_trail_key < 1) { return FALSE; } // prevent admin paths from building the sidebar menu if (path_is_admin($current_path)) { return FALSE; } // is menu_name a key in the active trail if (!array_key_exists('menu_name', $active_trail[1])) { return FALSE; } // don't build the sidebar if menu_name is not the main-menu if (!$active_trail[1]['menu_name'] == 'main-menu') { $_message = 'I\'m sorry, there\'s an issue with the sidebar menu. I can\'t build it. The active trail of this page does not appear to be the main-menu. It looks like it\'s using menu "' . $active_trail[1]['menu_name'] . '".'; drupal_set_message($_message, 'warning'); // write to log watchdog_exception($theme, new Exception($_message)); return FALSE; } // get the current menu link $current_link = menu_link_get_preferred($current_path, 'main-menu'); $output = TRUE; $output_menu = ''; $output_menu .= '<ul>'; // only display sidebar menu when there's a parent and it's not hidden if (isset($current_link['plid']) && !$current_link['hidden']) { // first level links if ($current_depth == 2 && $current_link['has_children']) { // show sub tree of current node $output_menu .= '<li class="page_item page_item_has_children current_page_item">'; $output_menu .= l($current_link['link_title'], $current_link['link_path']); // parameters to build the tree $parameters = array('active_trail' => array($current_link['plid']), 'only_active_trail' => FALSE, 'min_depth' => $current_link['depth'] + 1, 'max_depth' => $current_link['depth'] + 1, 'conditions' => array('plid' => $current_link['mlid'])); // get the children $children = menu_build_tree($current_link['menu_name'], $parameters); $output_menu .= '<ul class="children">'; foreach ($children as $child) { if (!$child['link']['hidden']) { $output_menu .= '<li class="page_item">'; $output_menu .= l($child['link']['link_title'], $child['link']['link_path']); $output_menu .= '</li>'; } } $output_menu .= '</ul>'; $output_menu .= '</li>'; } elseif ($current_depth > 2) { // show sub tree of parent and // display current node as current page item // get active parent by moving one up the trail $active_parent = $active_trail[$active_trail_key - 1]; // create flag if parent points home $active_parent_is_front = $active_parent['link_path'] === '<front>' ? TRUE : FALSE; // get the parent menu link $parent_link = menu_link_get_preferred($active_parent['link_path'], 'main-menu'); // however, if active parent points home, create a new array // using front as path if ($active_parent_is_front) { $parent_link = array('link_title' => $active_parent['link_title'], 'link_path' => '<front>', 'plid' => $active_parent['plid'], 'mlid' => $active_parent['mlid'], 'menu_name' => $active_parent['menu_name'], 'depth' => $active_parent['depth']); } $output_menu .= '<li class="page_item page_item_has_children current_page_ancestor current_page_parent">'; $output_menu .= l($parent_link['link_title'], $parent_link['link_path']); // parameters to build the tree $parameters = array('active_trail' => array($parent_link['plid']), 'only_active_trail' => FALSE, 'min_depth' => $parent_link['depth'] + 1, 'max_depth' => $parent_link['depth'] + 1, 'conditions' => array('plid' => $parent_link['mlid'])); // get the children $children = menu_build_tree($parent_link['menu_name'], $parameters); $output_menu .= '<ul class="children">'; foreach ($children as $child) { if (!$child['link']['hidden']) { if ($current_path == $child['link']['link_path']) { $output_menu .= '<li class="page_item current_page_item">'; $output_menu .= '<span>' . $child['link']['link_title'] . '</span>'; if ($child['link']['has_children']) { // get the grandchildren // parameters to build the tree $parameters = array('active_trail' => array($child['link']['plid']), 'only_active_trail' => FALSE, 'min_depth' => $child['link']['depth'] + 1, 'max_depth' => $child['link']['depth'] + 1, 'conditions' => array('plid' => $child['link']['mlid'])); $grandchildren = menu_build_tree($child['link']['menu_name'], $parameters); $output_menu .= '<ul class="children">'; foreach ($grandchildren as $grandchild) { if (!$grandchild['link']['hidden']) { $output_menu .= '<li class="page_item">'; $output_menu .= l($grandchild['link']['link_title'], $grandchild['link']['link_path']); $output_menu .= '</li>'; } } $output_menu .= '</ul>'; } } else { $output_menu .= '<li class="page_item">'; $output_menu .= l($child['link']['link_title'], $child['link']['link_path']); } $output_menu .= '</li>'; } } $output_menu .= '</ul>'; $output_menu .= '</li>'; } else { // link has no children $output = FALSE; } } else { $output = FALSE; } $output_menu .= '</ul>'; return $output ? $output_menu : $output; }
protected function lookup($type, $lookup, $langcode = null) { if (self::SOURCE !== $type) { // Exclude all admin paths if ($this->excludeAdminPath && path_is_admin($lookup)) { return $lookup; } // Also check for whitelist if (false !== $this->whitelist && !isset($this->whitelist[strtok($lookup, '/')])) { return $lookup; } } if (!$langcode) { $langcode = $GLOBALS['language']->getId(); } // Compute cache key lookup if (self::SOURCE === $type) { $dest = self::ALIAS; } else { $type = self::ALIAS; $dest = self::SOURCE; if ($this->doCache && !$this->isPreloaded) { if (empty($this->data[self::ALIAS][$langcode])) { $this->data[self::ALIAS][$langcode] = []; } $this->data[self::ALIAS][$langcode] += $this->preloadSourceItems($langcode); $this->isPreloaded = true; } } if (isset($this->data[$type][$langcode][$lookup])) { $found = $this->data[$type][$langcode][$lookup]; return $found ? $found : $lookup; } $this->dataIsUpdated = true; if (self::SOURCE === $type) { $found = $this->storage->lookupPathSource($lookup, $langcode); } else { $found = $this->storage->lookupPathAlias($lookup, $langcode); } if ($found) { $this->data[$type][$langcode][$lookup] = $found; $this->data[$dest][$langcode][$found] = $lookup; } else { $this->data[$type][$langcode][$lookup] = false; } return $found ? $found : $lookup; }