本文整理汇总了PHP中drupal_get_title函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_get_title函数的具体用法?PHP drupal_get_title怎么用?PHP drupal_get_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drupal_get_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cmstheme_breadcrumb
/**
* 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"> > </div> ', $breadcrumb) . '</div>';
return $output;
}
}
示例2: eldir_preprocess_page
/**
* 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: drupal_theme_80_img_assist_page
/**
* 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: 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;
}
}
示例5: nbcu_breadcrumb
/**
* 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: boron_breadcrumb
/**
* 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: bl_commons_breadcrumb
/**
* Breadcrumb themeing
*/
function bl_commons_breadcrumb($breadcrumb)
{
$breadcrumb[] = drupal_get_title();
if (!empty($breadcrumb)) {
return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
}
}
示例8: atento_breadcrumb
/**
* 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>></span></li>\n";
}
$i++;
}
$crumbs .= "</ul>\n";
}
return $crumbs;
}
示例9: burzenski_breadcrumb
/**
* 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>></li><li>' . decode_entities($value) . '</li>';
}
}
$output .= '</ul>';
return $output;
}
}
示例10: u21dk2011_breadcrumb
/**
* 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: zen_breadcrumb
/**
* 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: ichado1_preprocess_page
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: plain_response_preprocess_page
/**
* 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: phptemplate_breadcrumb
function phptemplate_breadcrumb($breadcrumb)
{
$home = variable_get('site_name', 'drupal');
$sep = ' » ';
// 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: sky_preprocess_page
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'] . '">';
}
}