/** * Adds mobile menu controls to menubar. */ function hwpi_basetheme_page_alter(&$page) { // Avoid adding responsive menu in case of an AJAX call. if (strstr($_GET['q'], 'ajax')) { return; } $page['responsive_menu']['#sorted'] = false; $page['responsive_menu']['mobile'] = array('#theme' => 'links', '#attributes' => array('class' => array('mobile-buttons')), '#weight' => 5000, '#links' => array('mobi-main' => array('href' => '#', 'title' => '<span aria-hidden="true" class="icon-menu"></span>', 'external' => true, 'html' => true, 'attributes' => array('data-target' => '#block-os-primary-menu')), 'mobi-util' => array('href' => '#', 'title' => '<span aria-hidden="true" class="icon-plus"></span><span class="move">Utility Menu</span>', 'external' => true, 'html' => true, 'attributes' => array('data-target' => '#block-os-quick-links, #block-os-secondary-menu, #header .os-custom-menu')), 'mobi-search' => array('href' => '#', 'title' => '<span aria-hidden="true" class="icon-search3"></span><span class="move">Search</span>', 'external' => true, 'html' => true, 'attributes' => array('data-target' => '#block-os-search-db-site-search, #block-os-search-solr-site-search')))); if (context_isset('context', 'os_public') && variable_get('enable_responsive', false)) { $path = drupal_get_path('theme', 'hwpi_basetheme') . '/css/'; drupal_add_css($path . 'responsive.base.css'); drupal_add_css($path . 'responsive.layout.css'); drupal_add_css($path . 'responsive.nav.css'); drupal_add_css($path . 'responsive.slideshow.css'); drupal_add_css($path . 'responsive.widgets.css'); $theme = $GLOBALS['theme']; $theme_path = drupal_get_path('theme', $theme) . '/css/'; drupal_add_css($theme_path . 'responsive.' . str_replace('hwpi_', '', $theme) . '.css'); } }
/** * Preprocessor for theme_comment(). */ function ginkgo_preprocess_comment(&$vars) { // Add a time decay class. $decay = _ginkgo_get_comment_decay($vars['node']->nid, $vars['comment']->timestamp); $vars['attr']['class'] .= " decay-{$decay['decay']}"; // If subject field not enabled, replace the title with a number. if (!variable_get("comment_subject_field_{$vars['node']->type}", 1)) { $vars['title'] = l("#{$decay['order']}", "node/{$vars['node']->nid}", array('fragment' => "comment-{$vars['comment']->cid}")); } // We're totally previewing a comment... set a context so others can bail. if (module_exists('context')) { if (empty($vars['comment']->cid) && !empty($vars['comment']->form_id)) { context_set('comment', 'preview', TRUE); } else if (context_isset('comment', 'preview')) { $vars = array(); } } }
?> <?php } ?> </div> <?php } ?> <?php // We hide the comments and links now so that we can render them later. hide($content['comments']); hide($content['links']); hide($content['rate_likeme']); if (isset($content['group_opg_reviewer'])) { if (!node_access('update', $node) and !context_isset('context', 'opg_core_reviewer')) { hide($content['group_opg_reviewer']); } } print render($content); ?> <?php if ($node_block) { ?> <div id="node-block"> <?php print render($node_block); ?> </div> <?php
/** * Preprocessor for theme_comment(). */ function ginkgo_preprocess_comment(&$vars) { $vars['submitted'] = theme('seed_byline', $vars['comment']); // We're totally previewing a comment... set a context so others can bail. if (module_exists('context')) { if (empty($vars['comment']->cid) && !empty($vars['comment']->form_id)) { context_set('comment', 'preview', TRUE); } else { if (context_isset('comment', 'preview')) { $vars = array(); } } } }
/** * Override or insert variables into the page templates. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("page" in this case.) */ function bbcom_theme_preprocess_page(&$vars, $hook) { global $user; $vars['always_right'] = TRUE; $vars['inner_title'] = FALSE; $vars['head'] .= '<meta name="viewport" content="width=960; initial-scale=1.0" />'; // set some defaults to get rid of PHP warnings $vars['lang_spec'] = $vars['post_title'] = $vars['tabs2'] = NULL; if (isset($vars['node'])) { $func = 'bbcom_theme_preprocess_node_' . $vars['node']->type; if (function_exists($func)) { $func($vars, $hook); } } $vars['language_switcher'] = drupal_get_form('bbcom_theme_language_switcher_form', $vars['node']); if ($user->uid) { $links = array(theme('bbcom_join_btn', url("wial/{$user->uid}/edit"), t('Words I Am Learning')), l(t('My Account'), 'user/' . $user->uid), l(t('Sign out'), 'logout')); /* $route = menu_get_item('support'); if ($route['access']) { array_splice($links, 1, 0, '<strong>' . l(t('Customer support'), 'support') . '</strong>'); //array_unshift($links, '<strong>' . l(t('Customer support'), 'support') . '</strong>'); } */ $vars['account_links'] = theme('bbcom_account_links', $links); } else { $login_options = array(); if ($_GET['q'] != 'user/login') { $login_options['query']['destination'] = $_GET['q']; } $vars['account_links'] = theme('bbcom_account_links', array(theme('bbcom_join_btn', url('user/register'), t('JOIN')), l(t('Sign in'), 'user/login', $login_options))); } // put the secondary local tasks in the $tab2 variable because we removed them from $tab if ($secondary = menu_secondary_local_tasks()) { $vars['tabs2'] = "<ul class=\"tabs secondary\">\n" . $secondary . "</ul>\n"; } // Remove the right sidebar when on the marketing pages, or in the forum. //if ($_GET['q'] == 'about' || context_get('bbcom', 'section') == 'forum') { //if (preg_match('/^user\/\d+/', $_GET['q']) || context_isset('context', 'bbcom-section-forum')) { if (module_exists('context') && (context_isset('context', 'bbcom-section-forum') || context_isset('context', 'bbcom-section-support'))) { // TODO: replace this with context_layouts $vars['always_right'] = FALSE; } elseif (in_array($_GET['q'], array('node/4509', 'node/4510'))) { // TODO: replace this with context_layouts $vars['always_right'] = FALSE; } // disable breadcrumbs everywhere except the forum if (!module_exists('context') || !context_isset('context', 'bbcom-section-forum')) { $vars['breadcrumb'] = ''; } // hack enabling inner_title on the library page /* if ($_GET['q'] == 'content') { $vars['inner_title'] = TRUE; } */ }
/** * Preprocessor for theme_comment(). */ function ginkgo_preprocess_comment(&$vars) { // Only show subjects if enabled. $vars['title'] = variable_get("comment_subject_field_{$vars['node']->type}", 1) ? $vars['title'] : ''; $vars['submitted'] = theme('seed_byline', $vars['comment']); // We're totally previewing a comment... set a context so others can bail. if (module_exists('context')) { if (empty($vars['comment']->cid) && !empty($vars['comment']->form_id)) { context_set('comment', 'preview', TRUE); } else { if (context_isset('comment', 'preview')) { $vars = array(); } } } }