本文整理汇总了PHP中drupal_get_breadcrumb函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_get_breadcrumb函数的具体用法?PHP drupal_get_breadcrumb怎么用?PHP drupal_get_breadcrumb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drupal_get_breadcrumb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cignaIndonesia_breadcrumb
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;
}
}
示例2: breadcrumbSuppressed
/**
* Check if the breadcrumb is to be suppressed altogether.
*
* @return bool
*
* @see crumbs_CurrentPageInfo::$breadcrumbSuppressed
*/
protected function breadcrumbSuppressed()
{
// @todo Make this work!
return FALSE;
$existing_breadcrumb = drupal_get_breadcrumb();
// If the existing breadcrumb is empty, that means a module has
// intentionally removed it. Honor that, and stop here.
return empty($existing_breadcrumb);
}
示例3: casasrealprod_process_page
/**
* Override or insert variables into the page template.
*/
function casasrealprod_process_page(&$variables)
{
// Hook into color.module.
if (module_exists('color')) {
_color_page_alter($variables);
}
// Always print the site name and slogan, but if they are toggled off, we'll
// just hide them visually.
$variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE;
$variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
if ($variables['hide_site_name']) {
// If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
$variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
}
if ($variables['hide_site_slogan']) {
// If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
$variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
}
// Since the title and the shortcut link are both block level elements,
// positioning them next to each other is much simpler with a wrapper div.
if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
// Add a wrapper div using the title_prefix and title_suffix render elements.
$variables['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100);
$variables['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99);
// Make sure the shortcut link is the first item in title_suffix.
$variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
}
if (isset($variables['node']) && $variables['node']->type == "casas" && strpos(drupal_get_path_alias(), '/booking') > 0) {
drupal_add_js(drupal_get_path('theme', 'casasrealprod') . '/js/casas_booking_manager.js');
$breadcrumbs = array();
$breadcrumbs[] = l(t('Home'), '<front>');
$breadcrumbs[] = l(t('Las Casas'), 'node/10');
$breadcrumbs[] = l($variables['node']->title, 'node/' . $variables['node']->nid);
drupal_set_breadcrumb($breadcrumbs);
$variables['title'] = t('Search for Availability');
$variables['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb()));
}
if (strpos(drupal_get_path_alias(), 'bookings') !== FALSE) {
drupal_add_js(drupal_get_path('theme', 'casasrealprod') . '/js/casas_booking_manager.js');
}
if (strpos(drupal_get_path_alias(), 'checkout') !== FALSE) {
$parts = explode('/', current_path());
$last = array_pop($parts);
$title = drupal_get_title();
if (is_numeric($last)) {
$title = t('Fill your personal data');
} else {
if ($last == 'review') {
$title = t('Review order');
}
}
$variables['title'] = $title;
}
}
示例4: appendBreadCrumb
/**
* Append an additional breadcrumb tag to the existing breadcrumb
*
* @param string $title
* @param string $url
*
* @return void
* @access public
* @static
*/
static function appendBreadCrumb($breadCrumbs)
{
$breadCrumb = drupal_get_breadcrumb();
if (is_array($breadCrumbs)) {
foreach ($breadCrumbs as $crumbs) {
if (stripos($crumbs['url'], 'id%%')) {
$args = array('cid', 'mid');
foreach ($args as $a) {
$val = CRM_Utils_Request::retrieve($a, 'Positive', CRM_Core_DAO::$_nullObject, false, null, $_GET);
if ($val) {
$crumbs['url'] = str_ireplace("%%{$a}%%", $val, $crumbs['url']);
}
}
}
$breadCrumb[] = "<a href=\"{$crumbs['url']}\">{$crumbs['title']}</a>";
}
}
drupal_set_breadcrumb($breadCrumb);
}
示例5: wistar_preprocess_node
function wistar_preprocess_node(&$vars) {
$node = $vars['node'];
if( $vars['node'] ) {
$vars['template_files'][] = 'node-' . $vars['node']->nid;
}
$vars['node']->comment = $vars['node']->comments = $vars['node']->comment_form = 0;
if (module_exists('comment') && isset($vars['node'])) {
$vars['node']->comments = comment_render($vars['node']);
$vars['node']->comment_form = drupal_get_form('comment_form',array('nid' => $vars['node']->nid));
}
$node->comment = 0;
if($vars['node']->type=='newsletter') {
$crumbs = drupal_get_breadcrumb();
array_pop($crumbs);
$crumbs[] = l('Wistar Today', 'wistar-today');
$crumbs[] = l('News and Media', 'news-and-media');
$crumbs[] = l('Focus Newsletter', 'news-and-media/focus-newsletter');
$crumbs[] = $vars['node']->title;
drupal_set_breadcrumb($crumbs);
}
if($node->type=='article') {
$crumbs = drupal_get_breadcrumb();
array_pop($crumbs);
$crumbs[] = l('Wistar Today', 'wistar-today');
$crumbs[] = l('News and Media', 'news-and-media');
$crumbs[] = l('Focus Newsletter', 'news-and-media/focus-newsletter');
//pa($node->field_article_newsletter[0]['nid'],1);
if(!empty($node->field_article_newsletter[0]['nid'])){
$node_newsletter = node_load($node->field_article_newsletter[0]['nid']);
if(!empty($node_newsletter->field_newsletter_date[0]['value'])){
$crumbs[] = l($node_newsletter->field_newsletter_date[0]['value'], $node_newsletter->path);
}
}
$crumbs[] = $node->title;
drupal_set_breadcrumb($crumbs);
}
}
示例6: maxhealthcare_breadcrumb
/**
* Override theme_breadcrumb().
*/
function maxhealthcare_breadcrumb($breadcrumb)
{
$links = array();
$path = '';
// Get URL arguments
$arguments = explode('/', request_uri());
// Remove empty values
foreach ($arguments as $key => $value) {
if (empty($value)) {
unset($arguments[$key]);
}
}
$arguments = array_values($arguments);
// Add 'Home' link
$links[] = l(t('Home'), '<front>');
// Add other links
if (!empty($arguments)) {
foreach ($arguments as $key => $value) {
// Don't make last breadcrumb a link
if ($key == count($arguments) - 1) {
$links[] = drupal_get_title();
} else {
if (!empty($path)) {
$path .= '/' . $value;
} else {
$path .= $value;
}
$links[] = l(drupal_ucfirst($value), $path);
}
}
}
// Set custom breadcrumbs
drupal_set_breadcrumb($links);
// Get custom breadcrumbs
$breadcrumb = drupal_get_breadcrumb();
// Hide breadcrumbs if only 'Home' exists
if (count($breadcrumb) > 1) {
return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
}
}
示例7: scc_get_breadcrumb
/**
* Custom breadcrumb generator
*/
function scc_get_breadcrumb($variables)
{
$breadcrumbs = drupal_get_breadcrumb();
//$breadcrumbs_copy = $breadcrumbs; //Keep a copy for some usecases
$obj = menu_get_object();
/*
$path = (empty($obj)) ? $_GET['q'] : drupal_lookup_path('alias', $_GET['q']);
$sections = explode("/",$path);
$segment = '';
$breadcrumb_mappings = array(
//Browse
'index' => 'Browse',
);
//Iterate through url sections and generate crumbs based on mappings
if(!empty($sections) && !empty($breadcrumb_mappings[$sections[0]])) {
$breadcrumbs = array(l('Home','<front>'));
$this_path = "";
foreach($sections as $section) {
$this_path .= (empty($this_path)) ? $section : "/" . $section;
if(!empty($breadcrumb_mappings[$this_path])) {
$breadcrumbs[] = l($breadcrumb_mappings[$this_path], $this_path);
}
}
}
*/
if (!empty($obj) && ($obj->type == 'xf_biomaterial' || $obj->type == 'xf_bioassay')) {
$parent = _exframe_get_parent_experiment($obj);
$exp_url = drupal_get_path_alias('/node/' . $parent->nid);
$breadcrumbs[] = '<a href="' . $exp_url . '">' . $parent->title . '</a>';
}
//Add Node title to breadcrumb as it is currently empty
if (!empty($obj) && isset($obj->title)) {
$breadcrumbs[count($breadcrumbs)] = $obj->title;
}
return $breadcrumbs;
}
示例8: phptemplate_breadcrumb
function phptemplate_breadcrumb($breadcrumb)
{
if (drupal_is_front_page()) {
return "";
}
$bread_arr = drupal_get_breadcrumb();
$position = count(drupal_get_breadcrumb()) - 1;
$breadcrumb[] = l(ucwords($bread_arr[$position]), $_GET["q"], array("html" => TRUE));
if (!empty($breadcrumb)) {
unset($breadcrumb[0]);
$lat = sizeof($breadcrumb) - 1;
unset($breadcrumb[$lat]);
$retornado = '<div class="breadcrumb">' . ucfirst(implode(' / ', $breadcrumb)) . '</div>';
}
$url = explode('/', $_GET['q']);
if ($url[0] == 'node' && $url[1] == 'add' && $url[2] == 'profile') {
$retornado = '<div class="breadcrumb"><a href="">Request Membership</a></div>';
}
if ($url[0] == 'node' && $url[1] == 'edit' && $url[2] == 'profile') {
$retornado = '<div class="breadcrumb"><a href="">Update Profile</a></div>';
}
return $retornado;
}
示例9: ciclo20v2_breadcrumb
/**
* Breadcrumb themeing
*/
function ciclo20v2_breadcrumb($breadcrumb)
{
if (!empty($breadcrumb)) {
$html = '';
if (preg_match('/^og\\/users\\/\\d+\\/invite$/', $_GET[q]) == 1) {
$node = node_load(arg(2));
if (!empty($node)) {
$links = array();
$links[] = l(t('Home'), '<front>');
$links[] = l(t('Groups'), 'og');
$links[] = l($node->title, 'node/' . $node->nid);
$links[] = l(t('List'), 'og/users/' . $node->nid);
// Set custom breadcrumbs
drupal_set_breadcrumb($links);
// Get custom breadcrumbs
$breadcrumb = drupal_get_breadcrumb();
}
}
if (count($breadcrumb) > 1) {
$html .= '<div class="breadcrumb">' . implode(' > ', $breadcrumb) . '</div>';
}
return $html;
}
}
示例10: csa_base_preprocess_page
/**
* Implementation of template_preprocess_page().
*/
function csa_base_preprocess_page(&$variables)
{
$conditional = array();
$query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
$conditional['IE'] = array();
// Target all IE versions
$conditional['IE 6'] = array();
// Target Internet Explorer 6 only
$conditional['IE 7'] = array();
// Target Internet Explorer 7 only
$conditional['IE 8'] = array();
// Target Internet Explorer 8 only
$conditional['IE 6'][] .= '<script type="text/javascript">var blankImgIE="' . theme('theme_path', '/images/blank.gif') . '";</script>';
$conditional['IE 6'][] .= '<style type="text/css" media="all">@import "' . theme('theme_path', '/css/fix-ie-6.css') . $query_string . '";</style>';
$conditional['IE 6'][] .= '<style type="text/css">img { behavior: url(' . theme('theme_path', '/script/iepngfix.htc') . $query_string . ') }</style>';
$conditional['IE 7'][] .= '<style type="text/css" media="all">@import "' . theme('theme_path', '/css/fix-ie-7.css') . $query_string . '";</style>';
$conditional_output = '';
foreach ($conditional as $version => $rules) {
if (count($rules)) {
$conditional_output .= '<!--[if ' . $version . "]>\n";
foreach ($rules as $rule) {
$conditional_output .= $rule . "\n";
}
$conditional_output .= "<![endif]-->\n";
}
}
// Rebuild the $scripts output
$js = drupal_add_js();
// remove sticky table headers, we use our own modified version for this
unset($js['module']['misc/tableheader.js']);
$variables['scripts'] = drupal_get_js('header', $js) . $conditional_output;
// Rebuild the $styles output
$css = drupal_add_css();
$variables['styles'] = drupal_get_css($css);
$http = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$variables['styles'] .= "<link href='" . $http . "://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'>\n";
$variables['styles'] .= "<link href='" . $http . "://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>\n";
// add a var $admin_section to see if we are in the admin section of the site
$variables['admin_section'] = FALSE;
if (arg(0) == 'admin' || arg(2) == 'edit' || arg(2) == 'webform-results') {
$variables['body_classes'] .= ' admin-section';
$variables['admin_section'] = TRUE;
}
// Move second sidebar to first if this option is enabled in the theme settings and the user is viewing an admin page
if (theme_get_setting('csa_base_move_sidebar') && $variables['admin_section']) {
if (!empty($variables['sidebar_1']) && !empty($variables['sidebar_2'])) {
$variables['sidebar_1'] .= $variables['sidebar_2'];
unset($variables['sidebar_2']);
} elseif (!empty($variables['sidebar_2'])) {
$variables['sidebar_1'] = $variables['sidebar_2'];
unset($variables['sidebar_2']);
}
}
// Set up layout variable
$variables['layout'] = 'none';
if (!empty($variables['sidebar_1'])) {
$variables['layout'] = 'sidebar-1';
}
if (!empty($variables['sidebar_2'])) {
$variables['layout'] = $variables['layout'] == 'sidebar-1' ? 'both' : 'sidebar-2';
}
// Strip sidebar classes from the body
$variables['body_classes'] = str_replace(array('both', 'no-sidebars', 'two-sidebars', 'one-sidebar', 'sidebar-left', 'sidebar-right'), '', $variables['body_classes']);
// Remove excess spaces
$variables['body_classes'] = str_replace(' ', ' ', trim($variables['body_classes']));
// Add information about the number of sidebars
if ($variables['layout'] == 'both') {
$variables['body_classes'] .= ' two-sidebars';
} elseif ($variables['layout'] == 'none') {
$variables['body_classes'] .= ' no-sidebars';
} else {
$variables['body_classes'] .= ' one-sidebar ' . $variables['layout'];
}
// add the taxonomy terms to the body_classes
if (module_exists('taxonomy') && !empty($variables['node_terms'])) {
$terms = array();
foreach (taxonomy_node_get_terms($variables['node']) as $term) {
$terms[] = $variables['node_terms'] . csa_base_safe_css_name($term->name);
}
if (count($terms)) {
$variables['body_classes'] .= ' ' . implode(' ', $terms);
}
}
if (!empty($variables['logo'])) {
$logo_img = theme('image', substr($variables['logo'], strlen(base_path()), strlen($variables['logo'])), $variables['site_name'], $variables['site_name']);
$variables['logo'] = l($logo_img, "<front>", array('html' => 'true', 'attributes' => array('title' => $variables['site_name'])));
}
// Display mission statement on all pages?
if (theme_get_setting('mission_statement_pages') == 'all') {
$variables['mission'] = theme_get_setting('mission', FALSE);
}
// Show the title in the breadcrumb?
if (!theme_get_setting('breadcrumb_display_admin') && $variables['admin_section'] || theme_get_setting('breadcrumb_display') == 0 && !$variables['admin_section']) {
//Hide breadcrumb on all pages?
unset($variables['breadcrumb']);
} elseif (theme_get_setting('breadcrumb_with_title')) {
$variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb(), $variables['title']);
//.........这里部分代码省略.........
示例11: alim_preprocess_search_results
/**
* Process variables for search-results.tpl.php.
*
* The $variables array contains the following arguments:
* - $results
* - $type
*
* @see search-results.tpl.php
* default preprocess search function is altered for adding drupal collapsible fieldset to advanced search
*/
function alim_preprocess_search_results(&$variables) {
$keys = search_get_keys();
$tot_res_cnt = 0;
if($variables['type'] == 'alimsearch' ){ // only for advanced search groups the search results in to fieldsets
$variables['search_results'] = '';
$crumb = drupal_get_breadcrumb();
$c = count($crumb);
unset($crumb[$c-1]);
drupal_set_breadcrumb($crumb);
drupal_set_title('Search Results');
foreach($variables['results'] as $key => $val ){
$value = "";$ct ='';
$value .= $val['pagerval'];
if($val['empty'])
$value .= $val['empty'];
foreach ($val['results'] as $result) {
$value .= theme('search_result', $result, $variables['type']);
}
$tot_res_cnt += $val['tot_res_cnt'];
$ct .= '<div><a href="#search-'.$key.'" >'.$val['search_ind'].' </a></div>';
$variables['search_results'] .= theme('fieldset', // collpasible group of results in advanced search
array(
'#title' => $val['fullname'],
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#value' => $value,
'#attributes' => array('id' => 'search-'.$key)
)
);
$variables['counter_left'] .= $ct ;
}
// Provide alternate search results template.
$variables['template_files'][] = 'search-results-'. $variables['type']; // adding template sugessions
}else{ // for simple search
$variables['search_results'] = '';
$crumb = drupal_get_breadcrumb();
$c = count($crumb);
unset($crumb[$c-1]);
drupal_set_breadcrumb($crumb);
drupal_set_title('Search Results');
// $variables['search_results'] = '';
foreach ($variables['results'] as $result) {
$variables['search_results'] .= theme('search_result', $result, $variables['type']);
}
if(arg(0) == 'alimsearch' ){
$variables['pager'] = theme('pager', NULL, 10, 0);
}
else{
$variables['pager'] = theme('pager', NULL, 100, 0);
}
// Provide alternate search results template.
$variables['template_files'][] = 'search-results-'. $variables['type']; // adding template sugessions
global $pager_total_items;
$tot_res_cnt = $pager_total_items[0];
}
$script = "var search_key_value = '".$keys." => result count - ".substr($tot_res_cnt,0,30)."'";
drupal_add_js($script, 'inline', 'footer');
}
示例12: dgd7_page_alter
/**
* Implements hook_page_alter().
*
* hook_page_alter() allows us to control the contents the $page render array.
* This array contains populated theme regions and is printed in page.tpl.php.
*/
function dgd7_page_alter(&$page)
{
// Remove the block template wrapper from the main content block.
// The reason we don't use unset() is because #theme_wrappers is an array that
// can contain multiple values. Since other modules can potentially add to
// this value, here we make sure that we're specifically removing the block
// wrapper.
if (!empty($page['content']['system_main'])) {
$page['content']['system_main']['#theme_wrappers'] = array_diff($page['content']['system_main']['#theme_wrappers'], array('block'));
}
// If on the front page, remove the sidebars and content region.
// This will prevent the regions from printing in the page.tpl.php template or
// variation of it. You can also accomplish the same affect by creating a
// page--front.tpl.php, and removing the code that prints these variables.
if (drupal_is_front_page()) {
unset($page['sidebar_first'], $page['sidebar_second'], $page['content']);
}
// Add the breadcrumbs to the bottom of the footer region.
// This is example of adding new content to a render array (covered on pg.
// 325). The footer region already exists, and we are adding breadcrumbs to
// it. Note: This alone will cause the breadcrumbs to print twice on the page
// because the $breadcrumb variable is created during
// template_process_page() and printed in page.tpl.php. The variable needs to
// be removed and/or emptied in a process function. We've done this here in
// dgd7_process_page().
$page['footer']['breadcrumbs'] = array('#type' => 'container', '#attributes' => array('class' => array('breadcrumb-wrapper')), '#weight' => 10);
$page['footer']['breadcrumbs']['breadcrumb'] = array('#theme' => 'breadcrumb', '#breadcrumb' => drupal_get_breadcrumb());
// Trigger the contents of the footer region to be sorted.
$page['footer']['#sorted'] = FALSE;
// Move the messages into the help region.
// Note: This alone will cause the breadcrumbs to print twice on the page
// because the $messages variable is created during
// template_process_page() and printed in page.tpl.php. The variable needs to
// be removed and/or emptied in a process function. We've done this here in
// dgd7_process_page().
if ($page['#show_messages']) {
$page['help']['messages'] = array('#markup' => theme('status_messages'), '#weight' => -10);
// Trigger the contents of the help region to be sorted.
$page['help']['#sorted'] = FALSE;
}
}
示例13: aurora_preprocess_block
function aurora_preprocess_block(&$vars)
{
// Logo Block
if ($vars['block']->delta == 'blockify-logo') {
$vars['theme_hook_suggestions'][] = 'block__logo';
$site_name = filter_xss_admin(variable_get('site_name', 'Drupal'));
// Strip the base_path from the beginning of the logo path.
$path = preg_replace('|^' . base_path() . '|', '', theme_get_setting('logo'));
$image = array('#theme' => 'image', '#path' => $path, '#alt' => t('!site_name Logo', array('!site_name' => $site_name)));
$vars['logo'] = $image;
$vars['sitename'] = $site_name;
$vars['sitepath'] = url('<front>');
} else {
if ($vars['block']->delta == 'blockify-site-name') {
$vars['theme_hook_suggestions'][] = 'block__site_name';
$site_name = filter_xss_admin(variable_get('site_name', 'Drupal'));
$vars['sitename'] = $site_name;
$vars['sitepath'] = url('<front>');
} else {
if ($vars['block']->delta == 'blockify-site-slogan') {
$vars['theme_hook_suggestions'][] = 'block__site_slogan';
$slogan = filter_xss_admin(variable_get('site_slogan', 'Drupal'));
$vars['slogan'] = $slogan;
} else {
if ($vars['block']->delta == 'blockify-page-title') {
$vars['theme_hook_suggestions'][] = 'block__page_title';
$vars['page_title'] = drupal_get_title();
// Add this for legacy support. Should not be used in the template. #2370653
$vars['title'] = $vars['page_title'];
} else {
if ($vars['block']->delta == 'blockify-messages') {
$vars['theme_hook_suggestions'][] = 'block__messages';
} else {
if ($vars['block']->delta == 'blockify-breadcrumb') {
$vars['theme_hook_suggestions'][] = 'block__breadcrumbs';
$breadcrumbs = drupal_get_breadcrumb();
$vars['breadcrumbs'] = theme('breadcrumb', array('breadcrumb' => $breadcrumbs));
} else {
if ($vars['block']->delta == 'blockify-tabs') {
$vars['theme_hook_suggestions'][] = 'block__tabs';
$primary = menu_primary_local_tasks();
$secondary = menu_secondary_local_tasks();
$tabs = array('primary' => $primary, 'secondary' => $secondary);
$tabs = theme('menu_local_tasks', $tabs);
$vars['tabs'] = $tabs;
} else {
if ($vars['block']->delta == 'blockify-actions') {
$vars['theme_hook_suggestions'][] = 'block__actions';
$actions = menu_local_actions();
$vars['actions'] = $actions;
} else {
if ($vars['block']->delta == 'blockify-feed-icons') {
$vars['theme_hook_suggestions'][] = 'block__feed_icons';
$icons = drupal_get_feeds();
$vars['icons'] = $icons;
}
}
}
}
}
}
}
}
}
}
示例14: arquideasprod_breadcrumb
/**
* Breadcrumb themeing
*/
function arquideasprod_breadcrumb($breadcrumb)
{
if (!empty($breadcrumb)) {
global $language;
$html = '';
$pattern = '/^contest\\/\\d+\\/[a-z_]+$/';
$match = preg_match($pattern, $_GET[q]);
if ($match == 1) {
$arr = explode('/', $_GET[q]);
$current = '';
switch ($arr[2]) {
case 'canceled':
$current = t('Canceled');
break;
case 'finalists':
$current = t('Finalists');
break;
case 'selectfinal':
$current = t('Finalists selection');
break;
case 'inscripted':
$current = t('Inscripted');
break;
case 'juryvotes':
$current = t('Jury voting');
break;
case 'myvoting':
$current = t('My voting');
break;
case 'payment_pending':
$current = t('Payment pending');
break;
case 'preinscripted':
$current = t('Pre-inscripted');
break;
case 'preselect':
$current = t('Preselection');
break;
case 'publicvotationresults':
$current = t('Results of public voting');
break;
case 'publicvotation':
$current = t('Public voting');
break;
case 'submitted':
$current = t('Submitted');
break;
case 'votingresults':
$current = t('Voting results');
break;
case 'winners':
$current = t('Winners');
break;
case 'selectwinners':
$current = t('Winners selection');
break;
case 'all':
$current = t('All inscriptions');
break;
default:
break;
}
$links = array();
$links[] = l(t('Home'), '<front>');
$links[] = l(t('Contest'), 'node/' . $arr[1]);
$links[] = $current;
// Set custom breadcrumbs
drupal_set_breadcrumb($links);
// Get custom breadcrumbs
$breadcrumb = drupal_get_breadcrumb();
}
$pattern = '/^inscription\\/\\d+$/';
$match = preg_match($pattern, $_GET['q']);
if ($match == 1) {
$arr = explode('/', $_GET[q]);
$node = node_load($arr[1]);
$cnode = node_load($node->field_contest[0]['nid']);
if (!empty($node) && !empty($cnode)) {
$ctitle = $cnode->title;
if (!empty($cnode->tnid) && $cnode->tnid != 0) {
$translations = translation_node_get_translations($cnode->tnid);
if (!empty($translations[$language->language])) {
$cnode_trans = node_load($translations[$language->language]->nid);
if (!empty($cnode_trans)) {
$ctitle = $cnode_trans->title;
}
}
}
$links = array();
$links[] = l(t('Home'), '<front>');
$links[] = l($ctitle, 'node/' . $cnode->nid);
$links[] = $node->title;
// Set custom breadcrumbs
drupal_set_breadcrumb($links);
// Get custom breadcrumbs
$breadcrumb = drupal_get_breadcrumb();
}
//.........这里部分代码省略.........
示例15: mytheme_breadcrumb
/**
* Override theme_breadcrumb().
*
* Base breadcrumbs on paths e.g., about/our-organization/bob-jones
* turns into About Us > Our Organization > Bob Jones
*/
function mytheme_breadcrumb($breadcrumb) {
$links = array();
$path = '';
$arguments = explode('/', request_uri());
array_shift($arguments); //remove dsource folder name in breadcrumb
array_shift($arguments); //remove dsource folder name in breadcrumb
foreach ($arguments as $key => $value) {
if (empty($value)) {
unset($arguments[$key]);
}
}
$arguments = array_values($arguments);
$links[] = l(t('Home'), '<front>');
if (!empty($arguments)) {
foreach ($arguments as $key => $value) {
if ($key == (count($arguments) - 1)) {
$links[] = drupal_get_title();
}
else {
if (!empty($path)) {
$path .= '/'. $value;
} else {
$path .= $value;
}
$menu_item = menu_get_item(drupal_lookup_path('source', $path));
if ($menu_item['title']) {
$links[] = l($menu_item['title'], $path);
}
else {
$links[] = l(ucwords(str_replace('-', ' ', $value)), $path);
}
}
}
}
drupal_set_breadcrumb($links);
$breadcrumb = drupal_get_breadcrumb();
if (count($breadcrumb) > 1) {
return '<div class="breadcrumb">'. implode(' / ', $breadcrumb) .'</div>';
}
}