/** * Implements hook_preprocess_page(). */ function druiot_preprocess_page(&$variables) { global $user; // Header links. // $variables['header_links'] = theme('druiot_header_links'); // Search form. $variables['page']['header_search_form'] = array('#markup' => '<form action="/search" id="site-search"> <input name="s" value="" maxlength="128" class="form-search" type="text" placeholder="Поиск по сообществу"> </form>'); // Header profile data. $variables['page']['header_profile'] = array('#theme' => $user->uid ? 'druiot_auth_user' : 'druiot_auth_anon', '#user' => $user); // Tracker. $variables['druiot_tracker']['count'] = druio_tracker_count($user->uid); $variables['druiot_tracker']['status'] = _druio_messages_status($user->uid); }
/** * Implements hook_preprocess_page(). */ function druio_theme_preprocess_page(&$variables) { global $user; // Search form. $variables['header_search_form'] = format_string('<form action="@action" class="@form_class"> <input name="s" value="" maxlength="128" class="@input_class" type="text" placeholder="@placeholder"> </form>', array('@action' => '/search', '@form_class' => 'search-form', '@input_class' => 'search-input', '@placeholder' => 'Поиск по сообществу')); // Simple menu for header top line. Such as tracker and GitHub. $header_links = array(array('title' => 'Трекер', 'href' => '/tracker', 'classes' => array('tracker', _druio_messages_status()), 'attributes' => array('data-new-count' => druio_tracker_count())), array('title' => 'GitHub', 'href' => 'https://github.com/Niklan/Dru.io', 'classes' => array('github'), 'attributes' => array('target' => '_blank'))); $variables['header_links'] = theme('druio_theme_header_links', array('links' => $header_links)); // Header profile data. $header_auth_template = $user->uid ? 'druio_theme_auth_user' : 'druio_theme_auth_anon'; $variables['header_auth'] = theme($header_auth_template, array('user' => $user)); }
/** * Implements hook_preprocess_page(). */ function druio_theme_preprocess_page(&$variables) { global $user; // Search form. $variables['header_search_form'] = format_string('<form action="@action" class="@form_class"> <input name="s" value="" maxlength="128" class="@input_class" type="text" placeholder="@placeholder"> </form>', array('@action' => '/search', '@form_class' => 'search-form', '@input_class' => 'search-input', '@placeholder' => 'Поиск по сообществу')); // Simple menu for header top line. Such as tracker and GitHub. $header_links = array(array('title' => 'Трекер', 'href' => '/tracker', 'classes' => array('tracker', _druio_messages_status()), 'attributes' => array('data-new-count' => druio_tracker_count())), array('title' => 'GitHub', 'href' => 'https://github.com/dru-io/Dru.io', 'classes' => array('github'), 'attributes' => array('target' => '_blank'))); $variables['header_links'] = theme('druio_theme_header_links', array('links' => $header_links)); // Header profile data. $header_auth_template = $user->uid ? 'druio_theme_auth_user' : 'druio_theme_auth_anon'; $variables['header_auth'] = theme($header_auth_template, array('user' => $user)); $status = drupal_get_http_header("status"); if ($status == "403 Forbidden") { _druio_theme_preprocess_page_403($variables); } drupal_add_feed(url('rss/questions', array('absolute' => TRUE)), variable_get('site_name') . ': Вопросы'); drupal_add_feed(url('rss/posts', array('absolute' => TRUE)), variable_get('site_name') . ': Публикации'); }
?> " alt="<?php print $site_name; ?> " width="170" class="logo"> </a> </section> <section class="header__content"> <div class="header__firstline"> <?php print render($page['header_search_form']); ?> <div id="header-links"> <div class="header__tracker <?php print _druio_messages_status(); ?> " <?php print 'data-new-count="' . druio_tracker_count() . '">'; ?> <a href="/tracker"><span>Трекер</span></a></div> <a href="https://github.com/Niklan/Dru.io" class="header__github" rel="nofollow" target="_blank"><span>Мы на GitHub</span></a> </div> <?php print render($page['header_profile']); ?> </div> <?php print render($page['navigation']); ?>