From d83289f857853b2efca194cd663267c24dbfd305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= <gabor@hojtsy.hu> Date: Thu, 6 Dec 2007 09:58:34 +0000 Subject: [PATCH] #196667 (GHOP 45) by fberci: add '@ingroup themeable' to all themeable functions --- includes/form.inc | 53 ++++++++++++++++++++++++++++- includes/locale.inc | 2 ++ includes/menu.inc | 8 +++++ includes/pager.inc | 2 ++ includes/theme.inc | 10 ++++++ includes/theme.maintenance.inc | 2 ++ modules/color/color.module | 2 ++ modules/comment/comment.module | 38 ++++++++++++++++++++- modules/dblog/dblog.module | 2 ++ modules/filter/filter.admin.inc | 2 ++ modules/filter/filter.module | 1 - modules/menu/menu.admin.inc | 2 ++ modules/node/node.admin.inc | 6 ++++ modules/node/node.module | 14 ++++++++ modules/node/node.pages.inc | 12 +++++++ modules/poll/poll.module | 2 ++ modules/syslog/syslog.module | 5 +++ modules/system/system.admin.inc | 11 ++++-- modules/system/system.module | 5 +++ modules/taxonomy/taxonomy.module | 5 ++- modules/taxonomy/taxonomy.pages.inc | 2 ++ modules/trigger/trigger.admin.inc | 2 ++ modules/update/update.report.inc | 7 ++++ modules/upload/upload.module | 6 ++++ 24 files changed, 194 insertions(+), 7 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index 0748b20d6e08..d7a41e4827b0 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1315,6 +1315,8 @@ function form_options_flatten($array, $reset = TRUE) { * @return * A themed HTML string representing the form element. * + * @ingroup themeable + * * It is possible to group options together; to do this, change the format of * $options to an associative array in which the keys are group labels, and the * values are associative arrays in the normal $options format. @@ -1417,6 +1419,8 @@ function form_get_options($element, $key) { * Properties used: attributes, title, value, description, children, collapsible, collapsed * @return * A themed HTML string representing the form item group. + * + * @ingroup themeable */ function theme_fieldset($element) { if ($element['#collapsible']) { @@ -1443,6 +1447,8 @@ function theme_fieldset($element) { * Properties used: required, return_value, value, attributes, title, description * @return * A themed HTML string representing the form item group. + * + * @ingroup themeable */ function theme_radio($element) { _form_set_class($element, array('form-radio')); @@ -1467,6 +1473,8 @@ function theme_radio($element) { * Properties used: title, value, options, description, required and attributes. * @return * A themed HTML string representing the radio button set. + * + * @ingroup themeable */ function theme_radios($element) { $class = 'form-radios'; @@ -1491,6 +1499,8 @@ function theme_radios($element) { * Properties used: title, value, id, required, error. * @return * A themed HTML string representing the form item. + * + * @ingroup themeable */ function theme_password_confirm($element) { return theme('form_element', $element, $element['#children']); @@ -1557,6 +1567,8 @@ function password_confirm_validate($form, &$form_state) { * Properties used: title, value, options, description, required and attributes. * @return * A themed HTML string representing the date selection boxes. + * + * @ingroup themeable */ function theme_date($element) { return theme('form_element', $element, '<div class="container-inline">'. $element['#children'] .'</div>'); @@ -1748,6 +1760,8 @@ function form_expand_ahah($element) { * Properties used: title, value, description, required, error * @return * A themed HTML string representing the form item. + * + * @ingroup themeable */ function theme_item($element) { return theme('form_element', $element, $element['#value'] . (!empty($element['#children']) ? $element['#children'] : '')); @@ -1761,6 +1775,8 @@ function theme_item($element) { * Properties used: title, value, return_value, description, required * @return * A themed HTML string representing the checkbox. + * + * @ingroup themeable */ function theme_checkbox($element) { _form_set_class($element, array('form-checkbox')); @@ -1787,6 +1803,8 @@ function theme_checkbox($element) { * An associative array containing the properties of the element. * @return * A themed HTML string representing the checkbox set. + * + * @ingroup themeable */ function theme_checkboxes($element) { $class = 'form-checkboxes'; @@ -1819,10 +1837,20 @@ function expand_checkboxes($element) { return $element; } +/** + * Theme a form submit button. + * + * @ingroup themeable + */ function theme_submit($element) { return theme('button', $element); } +/** + * Theme a form button. + * + * @ingroup themeable + */ function theme_button($element) { // Make sure not to overwrite classes. if (isset($element['#attributes']['class'])) { @@ -1836,7 +1864,9 @@ function theme_button($element) { } /** - * Theme an image button. + * Theme a form image button. + * + * @ingroup themeable */ function theme_image_button($element) { // Make sure not to overwrite classes. @@ -1864,11 +1894,18 @@ function theme_image_button($element) { * Properties used: value, edit * @return * A themed HTML string representing the hidden form field. + * + * @ingroup themeable */ function theme_hidden($element) { return '<input type="hidden" name="'. $element['#name'] .'" id="'. $element['#id'] .'" value="'. check_plain($element['#value']) ."\" ". drupal_attributes($element['#attributes']) ." />\n"; } +/** + * Format a form token. + * + * @ingroup themeable + */ function theme_token($element) { return theme('hidden', $element); } @@ -1881,6 +1918,8 @@ function theme_token($element) { * Properties used: title, value, description, size, maxlength, required, attributes autocomplete_path * @return * A themed HTML string representing the textfield. + * + * @ingroup themeable */ function theme_textfield($element) { $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"'; @@ -1917,6 +1956,8 @@ function theme_textfield($element) { * Properties used: action, method, attributes, children * @return * A themed HTML string representing the form. + * + * @ingroup themeable */ function theme_form($element) { // Anonymous div to satisfy XHTML compliance. @@ -1932,6 +1973,8 @@ function theme_form($element) { * Properties used: title, value, description, rows, cols, required, attributes * @return * A themed HTML string representing the textarea. + * + * @ingroup themeable */ function theme_textarea($element) { $class = array('form-textarea'); @@ -1965,6 +2008,8 @@ function theme_textarea($element) { * Properties used: value, children. * @return * A themed HTML string representing the HTML markup. + * + * @ingroup themeable */ function theme_markup($element) { @@ -1979,6 +2024,8 @@ function theme_markup($element) { * Properties used: title, value, description, size, maxlength, required, attributes * @return * A themed HTML string representing the form. + * + * @ingroup themeable */ function theme_password($element) { $size = $element['#size'] ? ' size="'. $element['#size'] .'" ' : ''; @@ -2019,6 +2066,8 @@ function process_weight($element) { * @return * A themed HTML string representing the field. * + * @ingroup themeable + * * For assistance with handling the uploaded file correctly, see the API * provided by file.inc. */ @@ -2037,6 +2086,8 @@ function theme_file($element) { * The form element's data. * @return * A string representing the form element. + * + * @ingroup themeable */ function theme_form_element($element, $value) { // This is also used in the installer, pre-database setup. diff --git a/includes/locale.inc b/includes/locale.inc index a97d3497acbc..e05732d46c37 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -63,6 +63,8 @@ function locale_languages_overview_form() { /** * Theme the language overview form. + * + * @ingroup themeable */ function theme_locale_languages_overview_form($form) { $default = language_default(); diff --git a/includes/menu.inc b/includes/menu.inc index b25ad9376bad..0b59c936285b 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -979,6 +979,8 @@ function _menu_tree_data($result, $parents, $depth, $previous_element = '') { /** * Generate the HTML output for a single menu link. + * + * @ingroup themeable */ function theme_menu_item_link($link) { if (empty($link['options'])) { @@ -990,6 +992,8 @@ function theme_menu_item_link($link) { /** * Generate the HTML output for a menu tree + * + * @ingroup themeable */ function theme_menu_tree($tree) { return '<ul class="menu">'. $tree .'</ul>'; @@ -997,6 +1001,8 @@ function theme_menu_tree($tree) { /** * Generate the HTML output for a menu item and submenu. + * + * @ingroup themeable */ function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')); @@ -1011,6 +1017,8 @@ function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FA /** * Generate the HTML output for a single local task link. + * + * @ingroup themeable */ function theme_menu_local_task($link, $active = FALSE) { return '<li '. ($active ? 'class="active" ' : '') .'>'. $link .'</li>'; diff --git a/includes/pager.inc b/includes/pager.inc index 11f4db002f08..68e453ac7861 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -369,6 +369,8 @@ function theme_pager_last($text, $limit, $element = 0, $parameters = array()) { * An associative array of HTML attributes to apply to a pager anchor tag. * @return * An HTML string that generates the link. + * + * @ingroup themeable */ function theme_pager_link($text, $page_new, $element, $parameters = array(), $attributes = array()) { $page = isset($_GET['page']) ? $_GET['page'] : ''; diff --git a/includes/theme.inc b/includes/theme.inc index 04271ae1c1aa..e621c139c837 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1545,6 +1545,16 @@ function theme_username($object) { return $output; } +/** + * Return a themed progress bar. + * + * @param $percent + * The percentage of the progress. + * @param $message + * A string containing information to be displayed. + * @return + * A themed HTML string representing the progress bar. + */ function theme_progress_bar($percent, $message) { $output = '<div id="progress" class="progress">'; $output .= '<div class="bar"><div class="filled" style="width: '. $percent .'%"></div></div>'; diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index 142ae91ee2a9..3570ede69325 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -78,6 +78,8 @@ function _theme_load_offline_registry($theme, $base_theme = NULL, $theme_engine /** * Return a themed list of maintenance tasks to perform. + * + * @ingroup themeable */ function theme_task_list($items, $active = NULL) { $done = isset($items[$active]) || $active == NULL; diff --git a/modules/color/color.module b/modules/color/color.module index 516e98c691a4..d6cfb205045d 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -160,6 +160,8 @@ function color_scheme_form(&$form_state, $theme) { /** * Theme color form. + * + * @ingroup @themeable */ function theme_color_scheme_form($form) { // Include stylesheet diff --git a/modules/comment/comment.module b/modules/comment/comment.module index dc217aca6f89..4876fe638aa9 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1448,6 +1448,11 @@ function comment_form_submit($form, &$form_state) { } } +/** + * Return a themed comment. + * + * @ingroup themeable + */ function theme_comment_view($comment, $node, $links = array(), $visible = 1) { static $first_new = TRUE; @@ -1506,7 +1511,11 @@ function comment_controls($mode = COMMENT_MODE_THREADED_EXPANDED, $order = COMME return $form; } - +/** + * Theme comment controls box where the user can change the default display mode and display order of comments. + * + * @ingroup themeable + */ function theme_comment_controls($form) { $output = '<div class="container-inline">'; $output .= drupal_render($form); @@ -1575,22 +1584,47 @@ function template_preprocess_comment_folded(&$variables) { $variables['title'] = l($comment->subject, comment_node_url() .'/'. $comment->cid, array('fragment' => "comment-$comment->cid")); } +/** + * Theme collapsed flat type comment. + * + * @ingroup themeable + */ function theme_comment_flat_collapsed($comment, $node) { return theme('comment_view', $comment, $node, '', 0); } +/** + * Theme expanded flat type comment. + * + * @ingroup themeable + */ function theme_comment_flat_expanded($comment, $node) { return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0)); } +/** + * Theme collapsed thread type comment. + * + * @ingroup themeable + */ function theme_comment_thread_collapsed($comment, $node) { return theme('comment_view', $comment, $node, '', 0); } +/** + * Theme expanded thread type comment. + * + * @ingroup themeable + */ function theme_comment_thread_expanded($comment, $node) { return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0)); } +/** + * Theme the "comment posting is forbidden" message. + * + * @ingroup themeable + */ function theme_comment_post_forbidden($node) { global $user; if ($user->uid) { @@ -1634,6 +1668,8 @@ function template_preprocess_comment_wrapper(&$variables) { /** * Make the submitted variable themable + * + * @ingroup themeable */ function theme_comment_submitted($comment) { return t('Submitted by !username on @datetime.', diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index 0bacc217ef86..2ff90b91f985 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -145,6 +145,8 @@ function dblog_watchdog($log = array()) { /** * Theme dblog administration filter selector. + * + * @ingroup themeable */ function theme_dblog_filters($form) { $output = ''; diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index 45a3836ad854..36f253775e6a 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -350,6 +350,8 @@ function filter_admin_order(&$form_state, $format = NULL) { /** * Theme filter order configuration form. + * + * @ingroup themeable */ function theme_filter_admin_order($form) { $header = array(t('Name'), t('Weight')); diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 306d6ff8b05d..4f4ed8240f7c 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -576,7 +576,6 @@ function _filter_tips($format, $long = FALSE) { * * @ingroup themeable */ - function theme_filter_tips_more_info() { return '<p>'. l(t('More information about formatting options'), 'filter/tips') .'</p>'; } diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index 779399b0585d..9996f5106f71 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -163,6 +163,8 @@ function menu_overview_form_submit($form, &$form_state) { /** * Theme the menu overview form into a table. + * + * @ingroup themeable */ function theme_menu_overview_form($form) { drupal_add_tabledrag('menu-overview', 'match', 'parent', 'menu-plid', 'menu-plid', 'menu-mlid', TRUE, MENU_MAX_DEPTH - 1); diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index d665233c54bd..e441e3e3d047 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -236,6 +236,8 @@ function node_filter_form() { /** * Theme node administration filter form. + * + * @ingroup themeable */ function theme_node_filter_form($form) { $output = ''; @@ -248,6 +250,8 @@ function theme_node_filter_form($form) { /** * Theme node administration filter selector. + * + * @ingroup themeable */ function theme_node_filters($form) { $output = ''; @@ -403,6 +407,8 @@ function node_admin_nodes() { /** * Theme node administration overview. + * + * @ingroup themeable */ function theme_node_admin_nodes($form) { // If there are rows in this form, then $form['title'] contains a list of diff --git a/modules/node/node.module b/modules/node/node.module index c4ea1336e700..e2a800bf85c6 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -148,6 +148,8 @@ function node_title_list($result, $title = NULL) { /** * Format a listing of links to nodes. + * + * @ingroup themeable */ function theme_node_list($items, $title = NULL) { return theme('item_list', $items, $title); @@ -1045,6 +1047,11 @@ function node_show($node, $cid) { return $output; } +/** + * Theme a log message. + * + * @ingroup themeable + */ function theme_node_log_message($log) { return '<div class="log"><div class="title">'. t('Log') .':</div>'. $log .'</div>'; } @@ -1234,6 +1241,11 @@ function node_user($op, &$edit, &$user) { } } +/** + * Theme the content ranking part of the search settings admin page. + * + * @ingroup themeable + */ function theme_node_search_admin($form) { $output = drupal_render($form['info']); @@ -2315,6 +2327,8 @@ function node_forms() { /** * Format the "Submitted by username on date/time" for each node + * + * @ingroup themeable */ function theme_node_submitted($node) { return t('Submitted by !username on @datetime', diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index d7f09af478ca..975f3d8f61f7 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -21,6 +21,11 @@ function node_add_page() { return theme('node_add_list', $content); } +/** + * Display the list of available node types for node creation. + * + * @ingroup themeable + */ function theme_node_add_list($content) { $output = ''; @@ -309,6 +314,11 @@ function node_form_build_preview($form, &$form_state) { $form_state['node_preview'] = node_preview($node); } +/** + * Present a node submission form. + * + * @ingroup themeable + */ function theme_node_form($form) { $output = "\n<div class=\"node-form\">\n"; @@ -399,6 +409,8 @@ function node_preview($node) { * * @param $node * The node object which is being previewed. + * + * @ingroup themeable */ function theme_node_preview($node) { $output = '<div class="preview">'; diff --git a/modules/poll/poll.module b/modules/poll/poll.module index dca6d09a92d8..586610553cad 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -636,6 +636,8 @@ function poll_view_results(&$node, $teaser, $page, $block) { /** * Theme the admin poll form for choices. + * + * @ingroup themeable */ function theme_poll_choices($form) { // Change the button title to reflect the behavior when using JavaScript. diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module index 9c00aaa4f82b..58ff3e7ce349 100644 --- a/modules/syslog/syslog.module +++ b/modules/syslog/syslog.module @@ -88,6 +88,11 @@ function syslog_theme() { ); } +/** + * Format a system log entry. + * + * @ingroup themeable + */ function theme_syslog_format($entry) { global $base_url; diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 72f49b9a46eb..e48c583a7c95 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1711,7 +1711,8 @@ function system_batch_page() { * @param $block * An array containing information about the block. It should * include a 'title', a 'description' and a formatted 'content'. - * @themeable + * + * @ingroup themeable */ function theme_admin_block($block) { // Don't display the block if it has no content to display. @@ -1741,7 +1742,8 @@ function theme_admin_block($block) { * @param $block * An array containing information about the block. It should * include a 'title', a 'description' and a formatted 'content'. - * @themeable + * + * @ingroup themeable */ function theme_admin_block_content($content) { if (!$content) { @@ -1778,7 +1780,8 @@ function theme_admin_block_content($content) { * 'title', a 'description', a formatted 'content' and a * 'position' which will control which container it will be * in. This is usually 'left' or 'right'. - * @themeable + * + * @ingroup themeable */ function theme_admin_page($blocks) { $stripe = 0; @@ -1818,6 +1821,8 @@ function theme_admin_page($blocks) { /** * Theme output of the dashboard page. + * + * @ingroup themeable */ function theme_system_admin_by_module($menu_items) { $stripe = 0; diff --git a/modules/system/system.module b/modules/system/system.module index ca8e54703dc5..4849b7489614 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1706,6 +1706,11 @@ function _system_zonelist() { return $zones; } +/** + * Format the Powered by Drupal text. + * + * @ingroup themeable + */ function theme_system_powered_by($image_path) { $image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system')); return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index a247954b1907..097e7c1ffc39 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1036,7 +1036,10 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti } /** - * We use the default selection field for choosing terms. + * Format the selection field for choosing terms + * (by deafult the default selection field is used). + * + * @ingroup themeable */ function theme_taxonomy_term_select($element) { return theme('select', $element); diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc index 74f1db504e75..94dca76332d4 100644 --- a/modules/taxonomy/taxonomy.pages.inc +++ b/modules/taxonomy/taxonomy.pages.inc @@ -82,6 +82,8 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { * An array of term ids. * @param $result * A pager_query() result, such as that performed by taxonomy_select_nodes(). + * + * @ingroup themeable */ function theme_taxonomy_term_page($tids, $result) { $output = ''; diff --git a/modules/trigger/trigger.admin.inc b/modules/trigger/trigger.admin.inc index 4d50904220d4..0573ac8afcb7 100644 --- a/modules/trigger/trigger.admin.inc +++ b/modules/trigger/trigger.admin.inc @@ -226,6 +226,8 @@ function trigger_assign_form_submit($form, $form_state) { * The fieldset including all assigned actions. * @return * The rendered form with the table prepended. + * + * @ingroup themeable */ function theme_trigger_display($element) { $header = array(); diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index 84c34c40ca52..2c5c283f46e2 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -22,6 +22,8 @@ function update_status() { /** * Theme project status report. + * + * @ingroup themeable */ function theme_update_report($data) { $last = variable_get('update_last_check', 0); @@ -197,6 +199,11 @@ function theme_update_report($data) { return $output; } +/** + * Theme the version display of a project. + * + * @ingroup themeable + */ function theme_update_version($version, $tag, $class) { $output = ''; $output .= '<table class="version '. $class .'">'; diff --git a/modules/upload/upload.module b/modules/upload/upload.module index fcd2f5a9237a..c35776426ea3 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -340,6 +340,8 @@ function upload_nodeapi(&$node, $op, $teaser) { /** * Displays file attachments in table + * + * @ingroup themeable */ function theme_upload_attachments($files) { $header = array(t('Attachment'), t('Size')); @@ -517,6 +519,8 @@ function _upload_form($node) { /** * Theme the attachments list. + * + * @ingroup themeable */ function theme_upload_form_current(&$form) { $header = array('', t('Delete'), t('List'), t('Description'), t('Weight'), t('Size')); @@ -542,6 +546,8 @@ function theme_upload_form_current(&$form) { /** * Theme the attachment form. * Note: required to output prefix/suffix. + * + * @ingroup themeable */ function theme_upload_form_new($form) { $output = drupal_render($form); -- GitLab