Select Git revision
DrupalKernel.php
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
common.inc 40.71 KiB
<?php
/* $Id$ */
/**
* @name Page title
* @ingroup common
*
* Functions to get and set the title of the current page.
* @{
*/
function drupal_set_title($title = NULL) {
static $stored_title;
if (isset($title)) {
$stored_title = ucfirst($title);
}
return $stored_title;
}
function drupal_get_title() {
$title = drupal_set_title();
if (!isset($title)) {
$title = menu_get_active_title();
}
return $title;
}
/* @} */
/**
* @name Page messages
* @ingroup common
*
* Functions to get and set the message of the current page.
* @{
*/
function drupal_set_message($message = NULL, $type = "status") {
if (!isset($_SESSION['messages'])) {
$_SESSION['messages'] = array();
}
if (isset($message)) {
$_SESSION['messages'][] = array($message, $type);
}
return $_SESSION['messages'];
}
function drupal_get_messages() {
$messages = drupal_set_message();
$_SESSION['messages'] = array();
return $messages;
}
/* @} */
/**
* @name Page breadcrumbs
* @ingroup common
*
* Functions to get and set the breadcrumb trail of the current page.
* @{
*/
/**
* @param $breadcrumb Array of links, starting with "home" and proceeding up
* to but not including the current page.
*/