예제 #1
0
/**
 * Implemensts hook_breadcrumb().
 *
 * tth@bellcom.dk check if there is a better way to do this...
 */
function cmstheme_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    $nid = arg(1);
    if (is_numeric($nid)) {
        $node = node_load($nid);
    }
    if (!empty($breadcrumb)) {
        $output = '<div class="breadcrumb you-are-here">' . t('Du er her: ') . '</div>';
        $title = drupal_get_title();
        $breadcrumb[0] = l(t('Forside'), '<front>', array('attributes' => array('title' => 'Forside')));
        $breadcrumb[] = '<a href="#" title="' . $title . '">' . $title . '</a>';
        if ($title == 'Søg') {
            unset($breadcrumb);
            $breadcrumb[0] = l(t('Forside'), '<front>', array('attributes' => array('title' => 'Forside')));
            $breadcrumb[] = '<a href="#" title="Søgning">Søgning</a>';
        }
        if (isset($node) && is_object($node) && $node->type == 'meeting') {
            unset($breadcrumb);
            $breadcrumb[0] = l(t('Forside'), '<front>', array('attributes' => array('title' => 'Forside')));
            $breadcrumb[] = l(t('Politik & planer'), 'politik-og-planer', array('attributes' => array('title' => 'Politik og planer')));
            $breadcrumb[] = l(t('Søg i dagsordener og referater'), 'dagsorden-og-referat', array('attributes' => array('title' => 'Søg i dagsordner og referater')));
            $breadcrumb[] = l(t($title), '#');
        }
        $output .= '<div class="breadcrumb">' . implode('<div class="bread-crumb"> &gt; </div> ', $breadcrumb) . '</div>';
        return $output;
    }
}
예제 #2
0
/**
 * Preprocessor for theme_page().
 */
function eldir_preprocess_page(&$variables, $hook)
{
    // Prepare the svg URL
    if (strpos($variables['logo'], 'eldir')) {
        $variables['svg_logo'] = str_replace('logo.png', 'images-source/aegir_logo_horizontal.svg', $variables['logo']);
    }
    // Overlay is enabled.
    $variables['overlay'] = module_exists('overlay') && overlay_get_mode() === 'child';
    $variables['tabs2'] = $variables['tabs'];
    unset($variables['tabs']['#secondary']);
    unset($variables['tabs2']['#primary']);
    // Move the local actions into place of the secondary tabs, for now.
    if (is_array($variables['action_links'])) {
        foreach ($variables['action_links'] as $link) {
            $variables['tabs2']['#secondary'][] = $link;
            $variables['tabs2']['#theme'] = 'menu_local_tasks';
        }
        $variables['action_links']['#access'] = FALSE;
    }
    if (!isset($variables['title'])) {
        $variables['title'] = isset($variables['node']) ? $variables['node']->title : drupal_get_title();
    }
    $node = menu_get_object();
    if (!empty($node) && !$variables['overlay']) {
        // Add a node type label on node pages to help users.
        $types = node_type_get_types();
        $type = $node->type;
        if (!empty($types[$type])) {
            $variables['title'] = "<span class='label'>{$types[$type]->name}</span>" . $variables['title'];
        }
    }
}
예제 #3
0
/**
 * Image assist module support.
 * Using styles in IE
*/
function drupal_theme_80_img_assist_page($content, $attributes = NULL)
{
    $title = drupal_get_title();
    $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
    $output .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">' . "\n";
    $output .= "<head>\n";
    $output .= '<title>' . $title . "</title>\n";
    // Note on CSS files from Benjamin Shell:
    // Stylesheets are a problem with image assist. Image assist works great as a
    // TinyMCE plugin, so I want it to LOOK like a TinyMCE plugin. However, it's
    // not always a TinyMCE plugin, so then it should like a themed Drupal page.
    // Advanced users will be able to customize everything, even TinyMCE, so I'm
    // more concerned about everyone else. TinyMCE looks great out-of-the-box so I
    // want image assist to look great as well. My solution to this problem is as
    // follows:
    // If this image assist window was loaded from TinyMCE, then include the
    // TinyMCE popups_css file (configurable with the initialization string on the
    // page that loaded TinyMCE). Otherwise, load drupal.css and the theme's
    // styles. This still leaves out sites that allow users to use the TinyMCE
    // plugin AND the Add Image link (visibility of this link is now a setting).
    // However, on my site I turned off the text link since I use TinyMCE. I think
    // it would confuse users to have an Add Images link AND a button on the
    // TinyMCE toolbar.
    //
    // Note that in both cases the img_assist.css file is loaded last. This
    // provides a way to make style changes to img_assist independently of how it
    // was loaded.
    $output .= drupal_get_html_head();
    $output .= drupal_get_js();
    $output .= "\n<script type=\"text/javascript\"><!-- \n";
    $output .= "  if (parent.tinyMCE) {\n";
    $output .= "    document.write('<link href=\"' + parent.tinyMCE.getParam(\"popups_css\") + '\" rel=\"stylesheet\" type=\"text/css\">');\n";
    $output .= "  } else {\n";
    foreach (drupal_add_css() as $media => $type) {
        $paths = array_merge($type['module'], $type['theme']);
        foreach (array_keys($paths) as $path) {
            // Don't import img_assist.css twice.
            if (!strstr($path, 'img_assist.css')) {
                $output .= "  document.write('<style type=\"text/css\" media=\"{$media}\">@import \"" . base_path() . $path . "\";<\\/style>');\n";
            }
        }
    }
    $output .= "  }\n";
    $output .= "--></script>\n";
    // Ensure that img_assist.js is imported last.
    $path = drupal_get_path('module', 'img_assist') . '/img_assist.css';
    $output .= "<style type=\"text/css\" media=\"all\">@import \"" . base_path() . $path . "\";</style>\n";
    $output .= '<link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.css" type="text/css" />' . "\n";
    $output .= '<!--[if IE 6]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie6.css" type="text/css" /><![endif]-->' . "\n";
    $output .= '<!--[if IE 7]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie7.css" type="text/css" /><![endif]-->' . "\n";
    $output .= "</head>\n";
    $output .= '<body' . drupal_attributes($attributes) . ">\n";
    $output .= theme_status_messages();
    $output .= "\n";
    $output .= $content;
    $output .= "\n";
    $output .= '</body>';
    $output .= '</html>';
    return $output;
}
예제 #4
0
function cignaIndonesia_breadcrumb($variables)
{
    //$breadcrumb = $variables['breadcrumb'];
    $breadcrumb = drupal_get_breadcrumb();
    $breadcrumb = array_unique($breadcrumb);
    if (!empty($breadcrumb)) {
        // Provide a navigational heading to give context for breadcrumb links to
        // screen-reader users. Make the heading invisible with .element-invisible.
        $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
        $crumbs = '<div class="breadcrumb">';
        $array_size = count($breadcrumb);
        $i = 0;
        if (drupal_get_title() != "Search") {
            while ($i < $array_size) {
                $pos = strpos($breadcrumb[$i], drupal_get_title());
                //we stop duplicates entering where there is a sub nav based on page jumps
                if ($pos === false) {
                    $crumbs .= '<span class="breadcrumb-' . $i;
                    $crumbs .= '">' . $breadcrumb[$i] . '</span>';
                    $crumbs .= '<img src="' . base_path() . path_to_theme() . '/images/breadcrumbArrow.gif" width="7" height="6" alt="Breadcrumb arrow" title="Breadcrumb arrow" />';
                }
                $i++;
            }
            $crumbs .= '<span class="active">' . drupal_get_title() . '</span></div>';
        }
        if (drupal_get_title() == "Search") {
            $crumbs .= '<span class="breadcrumb-0';
            $crumbs .= '">' . $breadcrumb[0] . '</span>';
            $crumbs .= '<img src="' . base_path() . path_to_theme() . '/images/breadcrumbArrow.gif" width="7" height="6" alt="Breadcrumb arrow" title="Breadcrumb arrow" />';
            $crumbs .= '<span class="active">' . drupal_get_title() . '</span></div>';
        }
        return $crumbs;
    }
}
예제 #5
0
/**
 * Preprocess breadcrumb
 * This will display only the inmediate parent of the current page and discard the rest
 */
function nbcu_breadcrumb($variables)
{
    $hideBreadcrumb = false;
    /* Check if breadcrump should be visible */
    if (is_numeric(arg(1))) {
        $node = node_load(arg(1));
        if (isset($node->field_hide_breadcrumb['und'][0]['value'])) {
            if ($node->field_hide_breadcrumb['und'][0]['value'] == 1) {
                $hideBreadcrumb = true;
            }
        }
    }
    $breadcrumb = $variables['breadcrumb'];
    //dpm($variables['breadcrumb']);
    if (!empty($breadcrumb)) {
        // Use CSS to hide titile .element-invisible.
        //$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
        $breadcrumb[] = drupal_get_title();
        $total = count($breadcrumb);
        $breadcrumbHTML = $breadcrumb[$total - 2];
        //$output .= '<nav class="breadcrumb-nbc">' . implode(' » ', $breadcrumb) . '</nav>';
        $output = '<nav class="breadcrumb-nbc">' . $breadcrumbHTML . '</nav>';
        if ($hideBreadcrumb) {
            return '';
        } else {
            return $output;
        }
    }
}
예제 #6
0
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return
 *   A string containing the breadcrumb output.
 */
function boron_breadcrumb($vars)
{
    $breadcrumb = $vars['breadcrumb'];
    // Determine if we are to display the breadcrumb.
    $show_breadcrumb = theme_get_setting('breadcrumb_display');
    if ($show_breadcrumb == 'yes') {
        // Optionally get rid of the homepage link.
        $show_breadcrumb_home = theme_get_setting('breadcrumb_home');
        if (!$show_breadcrumb_home) {
            array_shift($breadcrumb);
        }
        // Return the breadcrumb with separators.
        if (!empty($breadcrumb)) {
            $separator = filter_xss(theme_get_setting('breadcrumb_separator'));
            $trailing_separator = $title = '';
            // Add the title and trailing separator
            if (theme_get_setting('breadcrumb_title')) {
                if ($title = drupal_get_title()) {
                    $trailing_separator = $separator;
                }
            } elseif (theme_get_setting('breadcrumb_trailing')) {
                $trailing_separator = $separator;
            }
            // Assemble the breadcrumb
            return implode($separator, $breadcrumb) . $trailing_separator . $title;
        }
    }
    // Otherwise, return an empty string.
    return '';
}
예제 #7
0
/**
 * Breadcrumb themeing
 */
function bl_commons_breadcrumb($breadcrumb)
{
    $breadcrumb[] = drupal_get_title();
    if (!empty($breadcrumb)) {
        return '<div class="breadcrumb">' . implode(' &raquo; ', $breadcrumb) . '</div>';
    }
}
예제 #8
0
/**
 * Overrides theme_breadcrumb.
 */
function atento_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    if (empty($breadcrumb)) {
        $breadcrumb[] = l('Home', '<front>');
    }
    $breadcrumb[] = drupal_get_title();
    if (!empty($breadcrumb)) {
        $crumbs = "<ul class=\"breadcrumbs\">\n";
        $i = 1;
        $count = count($breadcrumb);
        foreach ($breadcrumb as $value) {
            $classes = array();
            if ($i == 1) {
                $classes[] = 'first';
            }
            if ($i == $count) {
                $classes[] = 'last';
            }
            $classes[] = $i % 2 == 0 ? 'odd' : 'even';
            $class = implode(' ', $classes);
            $crumbs .= "  <li class=\"{$class}\">{$value}</li>\n";
            if ($i < $count) {
                $crumbs .= "  <li><span>&gt;</span></li>\n";
            }
            $i++;
        }
        $crumbs .= "</ul>\n";
    }
    return $crumbs;
}
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function burzenski_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    $breadcrumb[] = l(drupal_get_title(), $_GET["q"]);
    if (!empty($breadcrumb)) {
        $output = '<ul>';
        $first = true;
        foreach ($breadcrumb as $key => $value) {
            if ($first) {
                $output .= '<li>' . $value . '</li>';
                $first = false;
            } else {
                $pos = strpos($value, ">");
                $innerText = substr($value, $pos + 1, strlen($value) - $pos - 5);
                if (strlen($innerText) > 45) {
                    $newValue = substr($innerText, 0, 42) . "...";
                    $value = str_replace($innerText, $newValue, $value);
                }
                $output .= '<li>&gt;</li><li>' . decode_entities($value) . '</li>';
            }
        }
        $output .= '</ul>';
        return $output;
    }
}
예제 #10
0
파일: template.php 프로젝트: aakb/U21
/**
 * Add current page to breadcrumb
 */
function u21dk2011_breadcrumb($breadcrumb)
{
    if (!empty($breadcrumb)) {
        $title = drupal_get_title();
        // Fix 2x title in breadcrumb
        if (!empty($title) && strstr($breadcrumb[count($breadcrumb) - 1], $title)) {
            // Remove title
            array_pop($breadcrumb);
        }
        // Add title, but not as link
        if (!empty($title)) {
            $breadcrumb[] = $title;
        }
        // Get the request uri
        $uri = split('/', $_SERVER['REQUEST_URI']);
        // Fix profiles (/profile)
        if ($uri[1] == 'profile') {
            $tmp = $breadcrumb;
            $breadcrumb = array();
            $breadcrumb[] = array_shift($tmp);
            $breadcrumb[] = l(t('Profiles'), 'profile/jonas-l-ssl');
            $breadcrumb[] = $title;
        }
        // Fix /news and /events
        $type = $uri[count($uri) - 1];
        if ($type == 'news') {
            $breadcrumb[] = 'Nyheder';
        }
        if ($type == 'events') {
            $breadcrumb[] = 'Arrangementer';
        }
        // Fix all under regions (/location)
        if ($uri[1] == 'location' && $uri[2] != strtolower($title)) {
            $tmp = $breadcrumb;
            $breadcrumb = array();
            $breadcrumb[] = array_shift($tmp);
            if (count($tmp)) {
                $breadcrumb[] = l(ucfirst($uri[2]), $uri[1] . '/' . $uri[2]);
            } else {
                $breadcrumb[] = ucfirst($uri[2]);
            }
            // Fix events and news
            if (!empty($tmp)) {
                if (strstr($tmp[0], 'href="/news"')) {
                    $breadcrumb[] = l('Nyheder', $uri[1] . '/' . $uri[2] . '/news');
                    array_shift($tmp);
                }
                if (strstr($tmp[0], 'href="/events"')) {
                    $breadcrumb[] = l('Arrangementer', $uri[1] . '/' . $uri[2] . '/events');
                    array_shift($tmp);
                }
            }
            // Put the rest back.
            while (!empty($tmp)) {
                $breadcrumb[] = array_shift($tmp);
            }
        }
        return '<div class="breadcrumb">' . implode(' > ', $breadcrumb) . '</div>';
    }
}
예제 #11
0
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return
 *   A string containing the breadcrumb output.
 */
function zen_breadcrumb($breadcrumb)
{
    // Determine if we are to display the breadcrumb.
    $show_breadcrumb = theme_get_setting('zen_breadcrumb');
    if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {
        // Optionally get rid of the homepage link.
        $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');
        if (!$show_breadcrumb_home) {
            array_shift($breadcrumb);
        }
        // Return the breadcrumb with separators.
        if (!empty($breadcrumb)) {
            $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');
            $trailing_separator = $title = '';
            if (theme_get_setting('zen_breadcrumb_title')) {
                if ($title = drupal_get_title()) {
                    $trailing_separator = $breadcrumb_separator;
                }
            } elseif (theme_get_setting('zen_breadcrumb_trailing')) {
                $trailing_separator = $breadcrumb_separator;
            }
            return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "{$trailing_separator}{$title}</div>";
        }
    }
    // Otherwise, return an empty string.
    return '';
}
예제 #12
0
function ichado1_preprocess_page(&$vars)
{
    $a = 'a';
    $cur_path = current_path();
    $cur_path_alias = drupal_get_path_alias($cur_path);
    $add_breadcrumb = drupal_get_title();
    if ($cur_path == 'front') {
        drupal_add_js(drupal_get_path('theme', 'ichado1') . '/js/vktarget.js');
    }
    if ($cur_path == 'cart' || preg_match('/^checkout\\/[\\d]+$/', $cur_path) || preg_match('/^checkout\\/[\\d]+\\/complete$/', $cur_path) || preg_match('/^checkout\\/[\\d]+\\/review$/', $cur_path) || preg_match('/^news$/', $cur_path) || preg_match('/^o-nas$/', $cur_path_alias) || preg_match('/^kontakty$/', $cur_path_alias) || preg_match('/^kak-zakazat-0$/', $cur_path_alias) || preg_match('/^oplata$/', $cur_path_alias) || preg_match('/^dostavka$/', $cur_path_alias) || preg_match('/^garantii-vozvrata$/', $cur_path_alias) || $cur_path == 'user/register' || $cur_path == 'user/login') {
        $vars['title'] = '';
    }
    if ($cur_path == 'cart' || preg_match('/^checkout\\/[\\d]+$/', $cur_path) || preg_match('/^checkout\\/[\\d]+\\/review$/', $cur_path) || variable_get('auto_scroll', FALSE) || $cur_path == 'catalog' && preg_match('/cart/', $_SERVER['HTTP_REFERER'])) {
        drupal_add_js(drupal_get_path('theme', 'ichado1') . '/js/auto-scroll.js', 'file');
        variable_set('auto_scroll', FALSE);
    }
    if (preg_match('/catalog/', $cur_path) || preg_match('/catalog/', $cur_path_alias)) {
        libraries_load('jcarousel');
    }
    $vars['catalog_menu_drop'] = '';
    $context_get = context_get('context');
    if ($context_get && in_array('for_drop_down_menu', array_keys($context_get))) {
        $block = module_invoke('superfish', 'block_view', 1);
        $catalog_menu_drop = render($block['content']);
        $vars['catalog_menu_drop'] = $catalog_menu_drop;
    }
    /*
    drupal_add_js('//cdn.callbackhunter.com/cbh.js?hunter_code=7ab9ebf48fe3227cd14cdb9ba43f2cd5',
        array(
            'type'       => 'external',
            'scope'      => 'footer',
            'every_page' => TRUE,
        ));
    */
}
예제 #13
0
/**
 * Preprocessor for page.tpl.php
 * Adds site name and page name,
 * sets grid class names for site name and content areas.
 */
function plain_response_preprocess_page(&$vars)
{
    $vars['site_name'] = variable_get('site_name', '');
    $vars['page_title'] = drupal_get_title();
    $classes = array('site_name' => 'grid_16 alpha omega', 'logo' => 'grid_4 alpha', 'content' => 'grid_16', 'content_left' => '', 'content_right' => '', 'top_nav' => '');
    /* Make room for logo */
    if (!empty($vars['logo'])) {
        $classes['site_name'] = 'grid_12 omega';
    }
    /* Set column widths */
    if (!empty($vars['page']['content_left'])) {
        $classes['content_left'] = 'grid_6 alpha';
        $classes['content'] = 'grid_10 omega';
    }
    if (!empty($vars['page']['content_right'])) {
        $classes['content'] = 'grid_10 alpha';
        $classes['content_right'] = 'grid_6 omega';
    }
    if (!empty($vars['page']['content_left']) && !empty($vars['page']['content_right'])) {
        $classes['content_left'] = 'grid_3 alpha';
        $classes['content'] = 'grid_10';
        $classes['content_right'] = 'grid_3 omega';
    }
    /* Support fixing nav to top */
    if (theme_get_setting('fix_nav') == 1) {
        $classes['top_nav'] = 'top-fixed';
    }
    $vars['page_classes'] = $classes;
}
예제 #14
0
function phptemplate_breadcrumb($breadcrumb)
{
    $home = variable_get('site_name', 'drupal');
    $sep = ' &raquo; ';
    // Check if breadcrumb has more than 1 element.
    // Options: Change to the number of elements/crumbs a breadcrumb needs to be visible.
    if (count($breadcrumb) > 0) {
        $breadcrumb[0] = l(t($home), '');
        /*
            Optional: Include page title in breadcrumb.
               
            drupal_get_title() !== ''
                Check if title blank, if that is the case, we cannot include trailing page name.
            strstr(end($breadcrumb),drupal_get_title()) == FALSE
                Some modules will make it so path or breadcrumb will involve duplication of
                title and node name (such as in the Events module) to remove this, simply
                take out  && strstr(end($breadcrumb),drupal_get_title()) == FALSE
           
            Use: Simply uncomment the if structure below (3 lines).
            Special Use: If you wish to use this regardless of elements/crumbs in a breadcrumb
                simply cut/paste the statements inside the "if (count($breadcrumb) > 1)" outside
                of the structure, and delete the extranneous structure.
        */
        if (drupal_get_title() !== '' && strstr(end($breadcrumb), drupal_get_title()) == FALSE) {
            $breadcrumb[] = t(drupal_get_title(), '');
        }
        return '<div class="breadcrumb">' . implode($sep, $breadcrumb) . '</div>';
    } else {
        // Would only show a single element/crumb (or none), so return nothing.
        // You can remove this statement.
    }
}
예제 #15
0
function sky_preprocess_page(&$variables, $hook)
{
    // Add a page title variable using the site slogan on the front page
    if (theme_get_setting('sky_title')) {
        if ($variables['is_front'] && !is_null(variable_get('site_name', ''))) {
            $variables['sky_title'] = variable_get('site_name', '');
        } else {
            $variables['sky_title'] = drupal_get_title();
        }
    }
    // Add a transparent spacer image to the end of the footer message
    $variables['footer_message'] .= theme('image', path_to_theme() . '/images/transparent.gif', 'spacer', 'spacer', array('style' => 'height:2em;'));
    // How is the navigation aligned
    $navigation_alignment = theme_get_setting('sky_nav_alignment');
    // Prepare the menu markup for the Primary Links (make it a menu tree)
    if ($variables['primary_links']) {
        $pid = variable_get('menu_primary_links_source', 'primary-links');
        $tree = menu_tree($pid);
        $variables['primary_links'] = '<del class="wrap-' . $navigation_alignment . '">' . $tree . '</del>';
    }
    // Include advanced theme classes.
    if (theme_get_setting('sky_themer_classes') == 1) {
        include 'theme-classes.php';
        $variables['body_tag'] = '<body' . $variables['body_css'] . '>';
    } else {
        $variables['body_tag'] = '<body class="' . $variables['layout'] . '">';
    }
}
예제 #16
0
/**
 * Return a themed breadcrumb trail. (Taken from Zen)
 *
 * http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_menu_breadcrumb_alter/7
 * if ($breadcrumb[0]['href'] == '<front>') { $breadcrumb[0]['title'] = 'iish'; }
 * en ook breadcrumb op home
 *
 * @param $variables
 *   - title: An optional string to be used as a navigational heading to give
 *     context for breadcrumb links to screen-reader users.
 *   - title_attributes_array: Array of HTML attributes for the title. It is
 *     flattened into a string within the theme function.
 *   - breadcrumb: An array containing the breadcrumb links.
 * @return
 *   A string containing the breadcrumb output.
 */
function spanjestrijders_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    // Return the breadcrumb with separators.
    if (!empty($breadcrumb)) {
        $breadcrumb_separator = ' > ';
        $trailing_separator = $title = '';
        $item = menu_get_item();
        if (!empty($item['tab_parent'])) {
            // If we are on a non-default tab, use the tab's title.
            $title = check_plain($item['title']);
        } else {
            $title = drupal_get_title();
        }
        if ($title) {
            $trailing_separator = $breadcrumb_separator;
        }
        // Provide a navigational heading to give context for breadcrumb links to
        // screen-reader users.
        if (empty($variables['title'])) {
            $variables['title'] = t('You are here');
        }
        // Unless overridden by a preprocess function, make the heading invisible.
        if (!isset($variables['title_attributes_array']['class'])) {
            $variables['title_attributes_array']['class'][] = 'element-invisible';
        }
        $heading = '<h2' . drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . '</h2>';
        //    return '<div class="breadcrumb">' . $heading . implode($breadcrumb_separator, $breadcrumb) . $trailing_separator . $title . '</div>';
        return '<div class="breadcrumb">' . $heading . implode($breadcrumb_separator, $breadcrumb) . '</div>';
    }
    // Otherwise, return an empty string.
    return '';
}
예제 #17
0
function dms_breadcrumb($breadcrumb)
{
    if (!empty($breadcrumb)) {
        $breadcrumb[] = l(drupal_get_title(), $_GET['q']);
        return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
    }
}
예제 #18
0
/**
 * Override or insert variables for the breadcrumb theme function.
 *
 * @param $variables
 *   An array of variables to pass to the theme function.
 * @param $hook
 *   The name of the theme hook being called ("breadcrumb" in this case).
 *
 * @see zen_breadcrumb()
 */
function zen_preprocess_breadcrumb(&$variables, $hook)
{
    // Define variables for the breadcrumb-related theme settings. This is done
    // here so that sub-themes can dynamically change the settings under
    // particular conditions in a preprocess function of their own.
    $variables['display_breadcrumb'] = check_plain(theme_get_setting('zen_breadcrumb'));
    $variables['display_breadcrumb'] = $variables['display_breadcrumb'] == 'yes' || $variables['display_breadcrumb'] == 'admin' && arg(0) == 'admin' ? TRUE : FALSE;
    $variables['breadcrumb_separator'] = filter_xss_admin(theme_get_setting('zen_breadcrumb_separator'));
    $variables['display_trailing_separator'] = theme_get_setting('zen_breadcrumb_trailing') ? TRUE : FALSE;
    // Optionally get rid of the homepage link.
    if (!theme_get_setting('zen_breadcrumb_home')) {
        array_shift($variables['breadcrumb']);
    }
    // Add the title of the page to the end of the breadcrumb list.
    if (!empty($variables['breadcrumb']) && theme_get_setting('zen_breadcrumb_title')) {
        $item = menu_get_item();
        if (!empty($item['tab_parent'])) {
            // If we are on a non-default tab, use the tab's title.
            $variables['breadcrumb'][] = check_plain($item['title']);
        } else {
            $variables['breadcrumb'][] = drupal_get_title();
        }
        // Turn off the trailing separator.
        $variables['display_trailing_separator'] = FALSE;
    }
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users.
    if (empty($variables['title'])) {
        $variables['title'] = t('You are here');
    }
}
예제 #19
0
파일: template.php 프로젝트: EWB/grh
function academy_delta_blocks_breadcrumb($variables)
{
    $output = '';
    if (!empty($variables['breadcrumb'])) {
        if ($variables['breadcrumb_current']) {
            $variables['breadcrumb'][] = l(drupal_get_title(), current_path(), array('html' => TRUE));
        }
        $output = '<div id="breadcrumb" class="clearfix"><ul class="breadcrumb">';
        $switch = array('odd' => 'even', 'even' => 'odd');
        $zebra = 'even';
        $last = count($variables['breadcrumb']) - 1;
        foreach ($variables['breadcrumb'] as $key => $item) {
            $zebra = $switch[$zebra];
            $attributes['class'] = array('depth-' . ($key + 1), $zebra);
            if ($key == 0) {
                $attributes['class'][] = 'first';
            }
            if ($key == $last) {
                $attributes['class'][] = 'last';
                $output .= '<li' . drupal_attributes($attributes) . $item . '</li>';
            } else {
                $output .= '<li' . drupal_attributes($attributes) . '>' . $item . '</li>' . ' <span class="breadcrumb-separator">&#xBB;</span> ';
            }
        }
        $output .= '</ul></div>';
    }
    return $output;
}
예제 #20
0
function ardent_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    if (!empty($breadcrumb)) {
        $title = drupal_get_title();
        if (!empty($title)) {
            $breadcrumb[] = $title;
        }
        return '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
    }
    if (!empty($breadcrumb)) {
        // Provide a navigational heading to give context for breadcrumb links to
        // screen-reader users. Make the heading invisible with .element-invisible.
        $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
        $crumbs .= '<div class="breadcrumb">';
        $array_size = count($breadcrumb);
        $i = 0;
        while ($i < $array_size) {
            $crumbs .= '<span class="breadcrumb-' . $i;
            if ($i == 0) {
                $crumbs .= ' first';
            }
            /* if ($i+1 == $array_size) {
                 $crumbs .= ' last';
               } */
            $crumbs .= '">' . $breadcrumb[$i] . '</span> &raquo; ';
            $i++;
        }
        $crumbs .= '<span class="active">' . drupal_get_title() . '</span></div>';
        return $crumbs;
    }
}
예제 #21
0
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function phptemplate_breadcrumb($breadcrumb)
{
    if (!empty($breadcrumb)) {
        $breadcrumb[] = drupal_get_title();
        array_shift($breadcrumb);
        return '<div class="path"><p><!--<span>' . t('You are here') . '</span>-->' . implode(' / ', $breadcrumb) . '</p></div>';
    }
}
예제 #22
0
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return
 *   A string containing the breadcrumb output.
 */
function scholarly_lite_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    if (!empty($breadcrumb)) {
        $breadcrumb[] = drupal_get_title();
        return '<div>' . implode(' <span class="breadcrumb-separator"></span>', $breadcrumb) . '</div>';
    }
}
예제 #23
0
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return
 *   A string containing the breadcrumb output.
 */
function corporateclean_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    if (!empty($breadcrumb)) {
        $breadcrumb[] = drupal_get_title();
        return '<div class="breadcrumb">' . implode(' <span class="breadcrumb-separator">/</span> ', $breadcrumb) . '</div>';
    }
}
예제 #24
0
function futurium_isa_theme_preprocess_page(&$variables) {

  $item = menu_get_item();

  if (isset($_GET['period'])) {
    if ($_GET['q'] == 'analytics') {
      $period = str_replace('1_', ' ', $_GET['period']);
      $period = str_replace('_', ' ', $period);

      $title = drupal_get_title();
      $title .= ' - Last ' . $period;

      drupal_set_title($title);
    }
  }

  if (!user_is_logged_in()) {
    unset($variables['tabs']);
  }

  unset($variables['navbar_classes_array'][1]);
  $variables['navbar_classes_array'][] = 'container-fullwidth';

  if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) {
    $variables['content_column_class'] = ' class="col-sm-6"';
  }
  elseif (!empty($variables['page']['sidebar_first']) || !empty($variables['page']['sidebar_second'])) {
    $variables['content_column_class'] = ' class="col-sm-9"';
  }
  else {
    $variables['content_column_class'] = ' class="container-fullwidth"';
  }

  $search_form = drupal_get_form('search_form');
  $search_box = drupal_render($search_form);
  $variables['search_box'] = $search_box;

  $panels_callbacks = array(
    'page_manager_page_execute',
    'page_manager_node_view_page',
    'page_manager_user_view_page',
    'page_manager_user_edit_page',
    'page_manager_node_add',
    'page_manager_node_edit',
    'page_manager_term_view_page',
    'entity_translation_edit_page',
    'user_pages_user_users',
    'user_pages_user_user_login',
    'user_pages_user_user_register',
    'user_pages_user_user_password',
  );

  $variables['content_wrapper'] = !in_array($item['page_callback'], $panels_callbacks, TRUE);

  $variables['show_title'] = $variables['content_wrapper'];

}
예제 #25
0
/**
 * Returns the rendered site name.
 *
 * @ingroup themeable
 */
function neb_blockify_site_name($variables)
{
    $title = drupal_get_title();
    $site_name = $variables['site_name'];
    // If there is no page title set for this page, use an h1 for the site name.
    $tag = $title !== '' ? 'span' : 'h1';
    $link = array('#theme' => 'link', '#path' => '<front>', '#text' => '<span>' . $site_name . '</span>', '#prefix' => '<' . $tag . ' id="site-name">', '#suffix' => '</' . $tag . '>', '#options' => array('attributes' => array('title' => t('Return to the !site_name home page', array('!site_name' => $site_name)), 'rel' => 'home'), 'html' => TRUE));
    return render($link);
}
예제 #26
0
/**
 * Breadcrumb themeing
 */
function commons_connect_breadcrumb($breadcrumb)
{
    $breadcrumb[] = drupal_get_title();
    if (!empty($breadcrumb)) {
        $html = '<div class="crumbtitle">' . t('You are here:') . '</div>';
        $html .= '<div class="breadcrumb">' . implode(' &raquo; ', $breadcrumb) . '</div>';
        return $html;
    }
}
예제 #27
0
function odstheme_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    if (!empty($breadcrumb)) {
        $breadcrumb[] = drupal_get_title();
        $breadcrumb[0] = l('IADS Home', NULL);
        return '<div class="breadcrumb">' . implode(' <span class="breadcrumb-separator">&raquo;</span> ', $breadcrumb) . '</div>';
    }
}
예제 #28
0
파일: template.php 프로젝트: nlisgo/spgb
/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return
 *   A string containing the breadcrumb output.
 */
function newsplus_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    $breadcrumb_separator = theme_get_setting('breadcrumb_separator', 'newsplus');
    if (!empty($breadcrumb)) {
        $breadcrumb[] = drupal_get_title();
        return '<div>' . implode(' <span class="breadcrumb-separator">' . $breadcrumb_separator . '</span>', $breadcrumb) . '</div>';
    }
}
예제 #29
0
파일: template.php 프로젝트: besja/econ
function econ_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    if (!empty($breadcrumb)) {
        $breadcrumb[] = drupal_get_title();
        $output = '<div class="breadcrumbs">' . implode('', $breadcrumb) . '</div>';
        return $output;
    }
}
예제 #30
-1
/**
 * Implements template_preprocess_page().
 * 1. Check if sidebars have content; Add boolean to $variables
 * 2. Setup the user menu (by default displayed in header)
 */
function bear_skin_preprocess_page(&$variables)
{
    $page = $variables['page'];
    // set the page title for the homepage
    // for accessibility purposes
    $title = drupal_get_title();
    if (drupal_is_front_page() && empty($title)) {
        $variables['bear_page_title'] = variable_get('site_name', '') . ' Homepage';
    } else {
        $variables['bear_page_title'] = $title;
    }
    // check if there is content in the sidebars
    $variables['has_sidebar_first'] = FALSE;
    $variables['has_sidebar_second'] = FALSE;
    if (!empty($page['sidebar_first'])) {
        $variables['has_sidebar_first'] = TRUE;
    }
    if (!empty($page['sidebar_second'])) {
        $variables['has_sidebar_second'] = TRUE;
    }
    // setup the user menu to display in the header
    $variables['user_menu'] = theme('links__user_menu', array('links' => menu_navigation_links('user-menu'), 'attributes' => array('class ' => array('nav-user__list'), 'aria-labelledby' => 'userMenuLabel')));
    // include the basic search form if one exists
    if (module_exists('search')) {
        $bear_search_form = module_invoke('search', 'block_view', 'search');
        $variables['page']['bear_search_form'] = render($bear_search_form);
    }
}