Commit 3904790e authored by Dries's avatar Dries
Browse files

- Tidied up the DoxyGen comments.  Patch by Kjartan.
parent bea3dbb7
......@@ -2,11 +2,11 @@
// $Id$
/**
@name drupal_title
Functions to get and set the title of the current page.
@{
**/
* @name drupal_title
*
* Functions to get and set the title of the current page.
* @{
*/
function drupal_set_title($title = NULL) {
static $stored_title;
......@@ -28,11 +28,11 @@ function drupal_get_title() {
// @}
/**
@name drupal_message
Functions to get and set the message of the current page.
@{
**/
* @name drupal_message
*
* Functions to get and set the message of the current page.
* @{
*/
function drupal_set_message($message = NULL, $type = "status") {
static $stored_message;
......@@ -50,14 +50,14 @@ function drupal_get_message() {
// @}
/**
@name drupal_breadcrumb
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.
@{
**/
* @name drupal_breadcrumb
*
* 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.
* @{
*/
function drupal_set_breadcrumb($breadcrumb = NULL) {
static $stored_breadcrumb;
......@@ -80,8 +80,8 @@ function drupal_get_breadcrumb() {
// @}
/**
Build the alias/path array
**/
* Build the alias/path array
*/
function drupal_get_path_map($action = "") {
static $cache;
......@@ -238,10 +238,10 @@ function drupal_specialchars($input, $quotes = ENT_NOQUOTES) {
}
/**
* Verify the syntax of the given e-mail address. Empty e-mail addresses
* are allowed. See RFC 2822 for details.
* Verify the syntax of the given e-mail address. Empty e-mail addresses are
* allowed. See RFC 2822 for details.
*
* @param $mail a email address
* @param $mail a email address
*/
function valid_email_address($mail) {
$user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
......@@ -260,7 +260,7 @@ function valid_email_address($mail) {
/**
* Verify the syntax of the given URL.
*
* @param $url an URL
* @param $url an URL
*/
function valid_url($url) {
......@@ -275,10 +275,10 @@ function valid_url($url) {
/**
* Format a single result entry of a search query:
*
* @param $item a single search result as returned by <i>module</i>_search of
* @param $item a single search result as returned by <i>module</i>_search of
* type array("count" => ..., "link" => ..., "title" => ..., "user" => ...,
* "date" => ..., "keywords" => ...)
* @param $type module type of this item
* "date" => ..., "keywords" => ...)
* @param $type module type of this item
*/
function search_item($item, $type) {
......@@ -303,15 +303,14 @@ function search_item($item, $type) {
* Render a generic search form.
*
* "Generic" means "universal usable" - that is, usable not only from
* 'site.com/search', but also as a simple seach box (without
* "Restrict search to", help text, etc) from theme's header etc.
* This means: provide options to only conditionally render certain
* parts of this form.
* 'site.com/search', but also as a simple seach box (without "Restrict search
* to", help text, etc) from theme's header etc. This means: provide options to
* only conditionally render certain parts of this form.
*
* @param $action Form action. Defaults to 'site.com/search'.
* @param $keys string containing keywords for the search.
* @param $options != 0: Render additional form fields/text
* ("Restrict search to", help text, etc).
* @param $action Form action. Defaults to 'site.com/search'.
* @param $keys string containing keywords for the search.
* @param $options != 0: Render additional form fields/text ("Restrict search
* to", help text, etc).
*/
function search_form($action = NULL, $keys = NULL, $options = NULL) {
......@@ -367,12 +366,12 @@ function search_data($keys = NULL) {
/**
* Display the search form and the resulting data.
*
* @param $type If set, search only nodes of this type.
* Otherwise, search all types.
* @param $action Form action. Defaults to 'site.com/search'.
* @param $keys Query string. Defaults to global $keys.
* @param $options != 0: Render additional form fields/text
* ("Restrict search to", help text, etc).
* @param $type If set, search only nodes of this type. Otherwise, search all
* types.
* @param $action Form action. Defaults to 'site.com/search'.
* @param $keys Query string. Defaults to global $keys.
* @param $options != 0: Render additional form fields/text ("Restrict search
* to", help text, etc).
*/
function search_type($type, $action = NULL, $keys = NULL, $options = NULL) {
......@@ -607,17 +606,16 @@ function format_rss_item($title, $link, $description, $args = array()) {
/**
* Formats a string with a count of items so that the string is pluralized
* correctly.
* format_plural calls t() by itself, make sure not to pass already localized
* strings to it.
* correctly. format_plural calls t() by itself, make sure not to pass already
* localized strings to it.
*
* @param $count The item count to display.
* @param $singular The string for the singular case. Please make sure it's clear
* this is singular, to ease translation. ("1 new comment" instead of
* "1 new").
* @param $plural The string for the plrual case. Please make sure it's clear
* this is plural, to ease translation. Use %count in places of the
* item count, as in "%count new comments".
* @param $count The item count to display.
* @param $singular The string for the singular case. Please make sure it's
* clear this is singular, to ease translation. ("1 new comment" instead of "1
* new").
* @param $plural The string for the plrual case. Please make sure it's clear
* this is plural, to ease translation. Use %count in places of the item
* count, as in "%count new comments".
*/
function format_plural($count, $singular, $plural) {
return t($count == 1 ? $singular : $plural, array("%count" => $count));
......
......@@ -24,8 +24,9 @@ function db_connect($url) {
/**
* Runs a query in the database.
*
* @param $query SQL query, followed by a variable number of arguments which are substituted into query by sprintf.
* @return a MySQL result or FALSE if the query was not executed correctly.
* @param $query SQL query, followed by a variable number of arguments which
* are substituted into query by sprintf.
* @return a MySQL result or FALSE if the query was not executed correctly.
*/
function db_query($query) {
$args = func_get_args();
......@@ -148,8 +149,11 @@ function db_affected_rows() {
/**
* Runs a LIMIT query in the database.
*
* @param $query SQL query, followed by a variable number of arguments which are substituted into query by sprintf, followed by 'from' and 'count' parameters. 'from' is the row to start fetching, 'count' the numbers of rows to fetch.
* @return a MySQL result or FALSE if the query was not executed correctly.
* @param $query SQL query, followed by a variable number of arguments which
* are substituted into query by sprintf, followed by 'from' and 'count'
* parameters. 'from' is the row to start fetching, 'count' the numbers of
* rows to fetch.
* @return a MySQL result or FALSE if the query was not executed correctly.
*/
function db_query_range($query) {
$args = func_get_args();
......
......@@ -18,8 +18,9 @@ function db_connect($url) {
/**
* Runs a query in the database.
*
* @param $query SQL query, followed by a variable number of arguments which are substituted into query by sprintf.
* @return a DB_Result object or a DB_Error
* @param $query SQL query, followed by a variable number of arguments which
* are substituted into query by sprintf.
* @return a DB_Result object or a DB_Error
*/
function db_query($query) {
......@@ -145,8 +146,11 @@ function db_affected_rows() {
/**
* Runs a LIMIT query in the database.
*
* @param $query SQL query followed by a variable number of arguments which are substituted into query by sprintf, followed by 'from' and 'count' parameters. 'from' is the row to start fetching, 'count' the numbers of rows to fetch.
* @return a DB_Result object or a DB_Error
* @param $query SQL query followed by a variable number of arguments which
* are substituted into query by sprintf, followed by 'from' and 'count'
* parameters. 'from' is the row to start fetching, 'count' the numbers of
* rows to fetch.
* @return a DB_Result object or a DB_Error
*/
function db_query_range($query) {
global $db_handle, $queries;
......
......@@ -49,8 +49,8 @@ function menu_get_active_item() {
}
/**
* Returns the title of the active menu item.
*/
* Returns the title of the active menu item.
*/
function menu_get_active_title() {
global $_list;
......@@ -60,8 +60,8 @@ function menu_get_active_title() {
}
/**
* Returns the help associated with the active menu item.
*/
* Returns the help associated with the active menu item.
*/
function menu_get_active_help() {
$path = $_GET["q"];
$output = "";
......
......@@ -2,41 +2,41 @@
// $Id$
/**
@defgroup pager_api Pager API
@{
Pager external functions (API).
**/
* @defgroup pager_api Pager API
* @{
*
* Pager external functions (API).
*/
/**
* Use this function when doing select queries you wish to be able to page.
* The pager uses LIMIT-based queries to fetch only the records required
* to render a certain page. However, it has to learn the total number
* of records returned by the query to (among others) compute the number
* of pages (= number of all records / number of records per page). This
* is done by inserting "COUNT(*)" in the original query, ie. by rewriting
* the original query, say "SELECT nid, type FROM node WHERE status = '1'
* ORDER BY static DESC, created DESC" to read "SELECT COUNT(*) FROM node
* WHERE status = '1' ORDER BY static DESC, created DESC". Rewriting the
* query is accomplished using a regular expression.
* Use this function when doing select queries you wish to be able to page. The
* pager uses LIMIT-based queries to fetch only the records required to render a
* certain page. However, it has to learn the total number of records returned
* by the query to (among others) compute the number of pages (= number of all
* records / number of records per page). This is done by inserting "COUNT(*)"
* in the original query, ie. by rewriting the original query, say "SELECT nid,
* type FROM node WHERE status = '1' ORDER BY static DESC, created DESC" to read
* "SELECT COUNT(*) FROM node WHERE status = '1' ORDER BY static DESC, created
* DESC". Rewriting the query is accomplished using a regular expression.
*
* Unfortunately, the rewrite rule does not always work as intended for
* queries that (already) have a "COUNT(*)" or a "GROUP BY" clause, and
* possibly for other complex queries. In those cases, you can optionally
* pass a query that will be used to count the records.
* Unfortunately, the rewrite rule does not always work as intended for queries
* that (already) have a "COUNT(*)" or a "GROUP BY" clause, and possibly for
* other complex queries. In those cases, you can optionally pass a query that
* will be used to count the records.
*
* For example, if you want to page this query: "SELECT COUNT(*), TYPE FROM
* node GROUP BY TYPE", pager_query() would invoke the wrong query, being:
* "SELECT COUNT(*) FROM node GROUP BY TYPE". So instead, you should pass
* "SELECT COUNT(DISTINCT(TYPE)) FROM node" as the optional $count_query
* parameter.
* For example, if you want to page this query: "SELECT COUNT(*), TYPE FROM node
* GROUP BY TYPE", pager_query() would invoke the wrong query, being: "SELECT
* COUNT(*) FROM node GROUP BY TYPE". So instead, you should pass "SELECT
* COUNT(DISTINCT(TYPE)) FROM node" as the optional $count_query parameter.
*
* @param $query the SQL query that needs paging
* @param $limit the number of rows per page
* @param $element optional attribute to distringuish between multiple pagers on one page
* @param $count_query an optional SQL query used to count records when rewriting the query would fail
* @param $query the SQL query that needs paging
* @param $limit the number of rows per page
* @param $element optional attribute to distringuish between multiple pagers
* on one page
* @param $count_query an optional SQL query used to count records when
* rewriting the query would fail
*
* @return SQL query result
* @return SQL query result
*/
function pager_query($query, $limit = 10, $element = 0, $count_query = "") {
global $pager_from_array, $pager_total;
......@@ -61,19 +61,21 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = "") {
/**
* Use this function in your module or theme to display a pager.
*
* @param $tags defines your buttons; text or img.
* @param $limit how many nodes are displayed per page
* @param $element support for multiple pagers per page (specify which this is)
* @param $type allows for distinction between pagers on main page and admin page, etc.
* Supported types are "default", "admin" and "simple".
* @param $attributes extra html attributes for \<a href> (eg. title, onMouseOver, etc.)
* @param $tags defines your buttons; text or img.
* @param $limit how many nodes are displayed per page
* @param $element support for multiple pagers per page (specify which this
* is)
* @param $type allows for distinction between pagers on main page and admin
* page, etc. Supported types are "default", "admin" and "simple".
* @param $attributes extra html attributes for \<a href> (eg. title,
* onMouseOver, etc.)
*
* @return string html of pager
* @return string html of pager
*/
function pager_display($tags = "", $limit = 10, $element = 0, $type = "default", $attributes = array()) {
return theme("pager_display_". $type, $tags, $limit, $element, $attributes);
}
/** @} End of defgroup pager_api **/
/** @} End of defgroup pager_api */
/**
* @addtogroup themeable
......@@ -81,10 +83,9 @@ function pager_display($tags = "", $limit = 10, $element = 0, $type = "default",
*/
/**
* DEFAULT PAGER:
* When writing themes, you can rewrite this pager function in your
* theme. This is the most common pager type, and thus the main one
* to re-write in your theme.
* DEFAULT PAGER: When writing themes, you can rewrite this pager function in
* your theme. This is the most common pager type, and thus the main one to
* re-write in your theme.
*
* @see pager_display
*/
......@@ -104,10 +105,9 @@ function theme_pager_display_default($tags = "", $limit = 10, $element = 0, $att
}
/**
* SIMPLE PAGER:
* When writing themes, you can rewrite this pager function in your
* theme. Keep in mind that the pager it defines is intended to have
* a "simple" look, possibly located in a table or block.
* SIMPLE PAGER: When writing themes, you can rewrite this pager function in
* your theme. Keep in mind that the pager it defines is intended to have a
* "simple" look, possibly located in a table or block.
*
* @see pager_display
*/
......@@ -121,10 +121,9 @@ function theme_pager_display_simple($tags = "", $limit = 10, $element = 0, $attr
}
/**
* ADMIN PAGER:
* When writing themes, you can rewrite this pager function in your
* theme. Most themes will probably NOT re-write this function, as
* admin pages are not normally themed.
* ADMIN PAGER: When writing themes, you can rewrite this pager function in your
* theme. Most themes will probably NOT re-write this function, as admin pages
* are not normally themed.
*
* @see pager_display
*/
......@@ -136,24 +135,25 @@ function theme_pager_display_admin($tags = "", $limit = 10, $element = 0, $attri
*/
return theme_pager_display_default($tags, $limit, $element, $attributes);
}
/** @} End of addtogroup themeable **/
/** @} End of addtogroup themeable */
/**
* @name pager pieces
* Use these pieces to construct your own custom pagers in your theme. Note
* that you should NOT modify this file to customize your pager.
* @name pager pieces Use these pieces to construct your own custom pagers in
* your theme. Note that you should NOT modify this file to customize your
* pager.
* @{
*/
/**
* displays a "first-page" link
*
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $attributes extra html attributes for \<a href> (eg. title, onMouseOver, etc.)
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $attributes extra html attributes for \<a href> (eg. title,
* onMouseOver, etc.)
*
* @return string html of this pager piece
* @return string html of this pager piece
*/
function pager_first($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array;
......@@ -170,13 +170,14 @@ function pager_first($text, $limit, $element = 0, $attributes = array()) {
/**
* displays a "previous-page" link
*
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $n how many pages we move back (defaults to 1)
* @param $attributes extra html attributes for \<a href> (eg. title, onMouseOver, etc.)
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $n how many pages we move back (defaults to 1)
* @param $attributes extra html attributes for \<a href> (eg. title,
* onMouseOver, etc.)
*
* @return string html of this pager piece
* @return string html of this pager piece
*/
function pager_previous($text, $limit, $element = 0, $n = 1, $attributes = array()) {
global $pager_from_array;
......@@ -190,13 +191,14 @@ function pager_previous($text, $limit, $element = 0, $n = 1, $attributes = array
/**
* displays a "next-page" link
*
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $n how many pages we move back (defaults to 1)
* @param $attributes extra html attributes for \<a href> (eg. title, onMouseOver, etc.)
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $n how many pages we move back (defaults to 1)
* @param $attributes extra html attributes for \<a href> (eg. title,
* onMouseOver, etc.)
*
* @return string html of this pager piece
* @return string html of this pager piece
*/
function pager_next($text, $limit, $element = 0, $n = 1, $attributes = array()) {
global $pager_from_array, $pager_total;
......@@ -210,12 +212,13 @@ function pager_next($text, $limit, $element = 0, $n = 1, $attributes = array())
/**
* displays a "last-page" link
*
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $attributes extra html attributes for \<a href> (eg. title, onMouseOver, etc.)
* @param $text defines the name (or image) of the link
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $attributes extra html attributes for \<a href> (eg. title,
* onMouseOver, etc.)
*
* @return string html of this pager piece
* @return string html of this pager piece
*/
function pager_last($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array, $pager_total;
......@@ -233,11 +236,11 @@ function pager_last($text, $limit, $element = 0, $attributes = array()) {
/**
* displays "%d through %d of $d" type detail about the cur page
*
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $format allows you to reword the format string
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $format allows you to reword the format string
*
* @return string html of this pager piece
* @return string html of this pager piece
*/
function pager_detail($limit, $element = 0, $format = "%d through %d of %d.") {
global $pager_from_array, $pager_total;
......@@ -252,13 +255,14 @@ function pager_detail($limit, $element = 0, $format = "%d through %d of %d.") {
/**
* displays a list of nearby pages with additional nodes
*
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $quantity defines the length of the page list
* @param $text optional text to display before the page list
* @param $attributes extra html attributes for \<a href> (eg. title, onMouseOver, etc.)
* @param $limit how many nodes are displayed per page
* @param $element distinguish between multiple pagers on one page
* @param $quantity defines the length of the page list
* @param $text optional text to display before the page list
* @param $attributes extra html attributes for \<a href> (eg. title,
* onMouseOver, etc.)
*
* @return string html of this pager piece
* @return string html of this pager piece
*/
function pager_list($limit, $element = 0, $quantity = 5, $text = "", $attributes = array()) {
global $pager_from_array, $pager_total;
......
......@@ -2,24 +2,24 @@
/* $Id$ */
/**
@file
Theme System - controls the output of Drupal.
The theme system allows for nearly all output of the Drupal system to be
customized by user themes.
@see <a href="http://drupal.org/node/view/253">Theme system</a>
@see themeable
**/
* @file
*
* Theme System - controls the output of Drupal.
*
* The theme system allows for nearly all output of the Drupal system to be
* customized by user themes.
*
* @see <a href="http://drupal.org/node/view/253">Theme system</a>
* @see themeable
*/
/**
Hook Help - returns theme specific help and information.
@param section defines the \a section of the help to be returned.
@return a string containing the help output.
**/
* Hook Help - returns theme specific help and information.
*
* @param section defines the @a section of the help to be returned.
*
* @return a string containing the help output.
*/
function theme_help($section) {
$ouptout = "";
......@@ -32,10 +32,10 @@ function theme_help($section) {
}
/**
Initialized the theme system.
@return the name of the currently selected theme.
**/
* Initialized the theme system.
*
* @return the name of the currently selected theme.
*/
function init_theme() {
global $user;
......@@ -55,12 +55,12 @@ function init_theme() {
}
/**
Provides a list of currently available themes.
@param $refresh
@return an array of the currently available themes.
**/
* Provides a list of currently available themes.
*
* @param $refresh
*
* @return an array of the currently available themes.
*/
function list_themes($refresh = 0) {
static $list;
......@@ -82,16 +82,15 @@ function list_themes($refresh = 0) {
}
/**
External interface of the theme system to all other modules, and core files.
All requests for themed functions must go through this function. It examines
the request and routes it to the appropriate theme function. If the current
theme does not implement the requested function, then the base theme function
is called.
Example: \verbatim $header_text = theme("header"); \endverbatim
@return themed output.
**/
* External interface of the theme system to all other modules, and core files.
*
* All requests for themed functions must go through this function. It examines
* the request and routes it to the appropriate theme function. If the current
* theme does not implement the requested function, then the base theme function
* is called. Example: @verbatim $header_text = theme("header"); @endverbatim
*
* @return themed output.
*/
function theme() {
global $theme;
......@@ -107,30 +106,30 @@ function theme() {
}
/**
Returns the path to the currently selected theme.
@return the path to the the currently selected theme.
**/
* Returns the path to the currently selected theme.
*
* @return the path to the the currently selected theme.
*/
function path_to_theme() {
global $theme;
return $theme->path;
}
/**
@defgroup themeable Themeable functions
@{
Themeable functions - functions that can be styled differently in themes.
@see theme
@see theme.inc
**/
* @defgroup themeable Themeable functions
* @{
*
* Themeable functions - functions that can be styled differently in themes.
*
* @see theme
* @see theme.inc
*/
/**
Returns the theme header.