From 5622bce2d52904922a7fd450088bcaed417af7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Sat, 8 Dec 2007 14:06:23 +0000 Subject: #198579 by webernet and hswong3i: a huge set of coding style fixes, including: - whitespaces at end of lines - indentation - control structure usage - whitespace in empty lines - phpdoc comment formatting --- modules/aggregator/aggregator.install | 2 +- modules/aggregator/aggregator.module | 2 +- modules/block/block.module | 18 ++++----- modules/book/book.admin.inc | 2 +- modules/comment/comment.install | 76 +++++++++++++++++------------------ modules/comment/comment.module | 6 +-- modules/filter/filter.module | 2 +- modules/forum/forum.module | 2 +- modules/node/node.admin.inc | 2 +- modules/node/node.module | 4 +- modules/node/node.pages.inc | 8 ++-- modules/openid/openid.module | 2 +- modules/path/path.module | 2 +- modules/poll/poll.module | 2 +- modules/profile/profile.admin.inc | 24 +++++------ modules/profile/profile.js | 2 +- modules/profile/profile.module | 14 +++---- modules/profile/profile.pages.inc | 4 +- modules/search/search.module | 2 +- modules/system/page.tpl.php | 2 +- modules/system/system.admin.inc | 2 +- modules/system/system.module | 10 ++--- modules/taxonomy/taxonomy.admin.inc | 2 +- modules/taxonomy/taxonomy.install | 3 +- modules/taxonomy/taxonomy.module | 8 ++-- modules/upload/upload.module | 2 +- modules/user/user.module | 28 ++++++------- 27 files changed, 117 insertions(+), 116 deletions(-) (limited to 'modules') diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install index 5dbc4ddc9..b49a4c96b 100644 --- a/modules/aggregator/aggregator.install +++ b/modules/aggregator/aggregator.install @@ -73,7 +73,7 @@ function aggregator_schema() { 'not null' => TRUE, 'default' => 0, 'description' => t('The {aggregator_category}.cid to which the feed is being assigned.'), - ) + ) ), 'primary key' => array('fid', 'cid'), ); diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index b848b0eb5..ba330cd85 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -577,7 +577,7 @@ function aggregator_refresh($feed) { case 302: case 307: // Filter the input data: - if (aggregator_parse_feed($result->data, $feed)) { + if (aggregator_parse_feed($result->data, $feed)) { $modified = empty($result->headers['Last-Modified']) ? 0 : strtotime($result->headers['Last-Modified']); diff --git a/modules/block/block.module b/modules/block/block.module index 002a890a4..354d4528e 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -39,21 +39,21 @@ define('BLOCK_REGION_NONE', -1); define('BLOCK_NO_CACHE', -1); /** -* The block can change depending on the roles the user viewing the page belongs to. -* This is the default setting, used when the block does not specify anything. -*/ + * The block can change depending on the roles the user viewing the page belongs to. + * This is the default setting, used when the block does not specify anything. + */ define('BLOCK_CACHE_PER_ROLE', 0x0001); /** -* The block can change depending on the user viewing the page. -* This setting can be resource-consuming for sites with large number of users, -* and thus should only be used when BLOCK_CACHE_PER_ROLE is not sufficient. -*/ + * The block can change depending on the user viewing the page. + * This setting can be resource-consuming for sites with large number of users, + * and thus should only be used when BLOCK_CACHE_PER_ROLE is not sufficient. + */ define('BLOCK_CACHE_PER_USER', 0x0002); /** -* The block can change depending on the page being viewed. -*/ + * The block can change depending on the page being viewed. + */ define('BLOCK_CACHE_PER_PAGE', 0x0004); /** diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index 22180e4d3..1fddfec4e 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -231,7 +231,7 @@ function theme_book_admin_table($form) { */ function _book_admin_sort_tree(&$tree) { uasort($tree, '_book_admin_compare'); - foreach($tree as $key => $subtree) { + foreach ($tree as $key => $subtree) { if (!empty($tree[$key]['below'])) { _book_admin_sort_tree($tree[$key]['below']); } diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 054919530..4cbc31fe5 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -159,44 +159,44 @@ function comment_schema() { 'primary key' => array('cid'), ); - $schema['node_comment_statistics'] = array( - 'description' => t('Maintains statistics of node and comments posts to show "new" and "updated" flags.'), - 'fields' => array( - 'nid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - 'description' => t('The {node}.nid for which the statistics are compiled.'), - ), - 'last_comment_timestamp' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - 'description' => t('The Unix timestamp of the last comment that was posted within this node, from {comments}.timestamp.'), - ), - 'last_comment_name' => array( - 'type' => 'varchar', - 'length' => 60, - 'not null' => FALSE, - 'description' => t('The name of the latest author to post a comment on this node, from {comments}.name.'), - ), - 'last_comment_uid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - 'description' => t('The user ID of the latest author to post a comment on this node, from {comments}.uid.'), - ), - 'comment_count' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - 'description' => t('The total number of comments on this node.'), - ), - ), - 'indexes' => array('node_comment_timestamp' => array('last_comment_timestamp')), - 'primary key' => array('nid'), + $schema['node_comment_statistics'] = array( + 'description' => t('Maintains statistics of node and comments posts to show "new" and "updated" flags.'), + 'fields' => array( + 'nid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => t('The {node}.nid for which the statistics are compiled.'), + ), + 'last_comment_timestamp' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => t('The Unix timestamp of the last comment that was posted within this node, from {comments}.timestamp.'), + ), + 'last_comment_name' => array( + 'type' => 'varchar', + 'length' => 60, + 'not null' => FALSE, + 'description' => t('The name of the latest author to post a comment on this node, from {comments}.name.'), + ), + 'last_comment_uid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => t('The user ID of the latest author to post a comment on this node, from {comments}.uid.'), + ), + 'comment_count' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => t('The total number of comments on this node.'), + ), + ), + 'indexes' => array('node_comment_timestamp' => array('last_comment_timestamp')), + 'primary key' => array('nid'), ); return $schema; diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 4876fe638..08cdfd8ea 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1050,8 +1050,8 @@ function comment_operations($action = NULL) { } /** -*** misc functions: helpers, privates, history -**/ + * Misc functions: helpers, privates, history + */ /** * Load the entire comment by cid. @@ -1318,7 +1318,7 @@ function comment_form(&$form_state, $edit, $title = NULL) { if (!form_get_errors() && ((variable_get('comment_preview_'. $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) { $form['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#weight' => 19); } - + $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 20); $form['#token'] = 'comment'. $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : ''); diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 4f4ed8240..d87f715d2 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -274,7 +274,7 @@ function filter_filter_tips($delta, $format, $long = FALSE) { } break; case 2: - return t('Web page addresses and e-mail addresses turn into links automatically.'); + return t('Web page addresses and e-mail addresses turn into links automatically.'); } } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 46f0a9615..c7f0e55cd 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -190,7 +190,7 @@ function forum_nodeapi(&$node, $op, $teaser, $page) { if ($parents = taxonomy_get_parents_all($node->tid)) { $parents = array_reverse($parents); foreach ($parents as $p) { - $breadcrumb[] = l($p->name, 'forum/'.$p->tid); + $breadcrumb[] = l($p->name, 'forum/'. $p->tid); } } drupal_set_breadcrumb($breadcrumb); diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index e441e3e3d..db9cebe9b 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -384,7 +384,7 @@ function node_admin_nodes() { '#submit' => array('node_admin_nodes_submit'), ); - $languages = language_list(); + $languages = language_list(); $destination = drupal_get_destination(); $nodes = array(); while ($node = db_fetch_object($result)) { diff --git a/modules/node/node.module b/modules/node/node.module index e2a800bf8..197cb12d6 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -253,7 +253,7 @@ function node_teaser_js(&$form, &$form_state) { * @param $size * The desired character length of the teaser. If omitted, the default * value will be used. Ignored if the special delimiter is present - * in $body. + * in $body. * @return * The generated teaser. */ @@ -514,7 +514,7 @@ function _node_types_build() { // Types defined by the node module in the database (rather than by a separate // module using hook_node_info) have a module value of 'node'. if ($type_object->module != 'node' && empty($info_array[$type_object->type])) { - $type_object->disabled = TRUE; + $type_object->disabled = TRUE; } if (!isset($_node_types[$type_object->type]) || $type_object->modified) { $_node_types[$type_object->type] = $type_object; diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 975f3d8f6..71c458cb0 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -384,10 +384,10 @@ function node_preview($node) { // 'teaser' form item). if (!isset($node->teaser)) { $node->teaser = empty($node->body) ? '' : node_teaser($node->body, $node->format); - // Chop off the teaser from the body if needed. - if (!$node->teaser_include && $node->teaser == substr($node->body, 0, strlen($node->teaser))) { - $node->body = substr($node->body, strlen($node->teaser)); - } + // Chop off the teaser from the body if needed. + if (!$node->teaser_include && $node->teaser == substr($node->body, 0, strlen($node->teaser))) { + $node->body = substr($node->body, strlen($node->teaser)); + } } // Display a preview of the node: diff --git a/modules/openid/openid.module b/modules/openid/openid.module index 98b795189..30718d9c8 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -44,7 +44,7 @@ function openid_help($path, $arg) { case 'user/%/openid': $output = '

'. t('This site supports OpenID, a secure way to log into many websites using a single username and password. OpenID can reduce the necessity of managing many usernames and passwords for many websites.', array('@openid-net' => url('http://openid.net'))) .'

'; - $output .= '

' . t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the free public providers. You can find out more about OpenID at this website.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'

'; + $output .= '

'. t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the free public providers. You can find out more about OpenID at this website.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'

'; $output .= '

'. t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') .'

'; return $output; diff --git a/modules/path/path.module b/modules/path/path.module index cbd30f4f0..154e6065e 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -117,7 +117,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '' } else { db_query("DELETE FROM {url_alias} WHERE src = '%s'", $path); - } + } } drupal_clear_path_cache(); } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 586610553..920c1b3cc 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -304,7 +304,7 @@ function _poll_choice_form($delta, $value = '', $votes = 0) { '#type' => 'textfield', '#title' => t('Choice @n', array('@n' => ($delta + 1))), '#default_value' => $value, - '#parents' => array('choice', $delta,'chtext'), + '#parents' => array('choice', $delta, 'chtext'), ); if ($admin) { diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 4268c01a6..488666ed7 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -8,13 +8,13 @@ /** * Form builder to display a listing of all editable profile fields. - * + * * @ingroup forms * @see profile_admin_overview_submit(). */ function profile_admin_overview(&$form_state = NULL) { $result = db_query('SELECT title, name, type, category, fid, weight FROM {profile_fields} ORDER BY category, weight'); - + $form = array(); $categories = array(); while ($field = db_fetch_object($result)) { @@ -30,15 +30,15 @@ function profile_admin_overview(&$form_state = NULL) { $form[$field->fid]['edit'] = array('#value' => l(t('edit'), "admin/user/profile/edit/$field->fid")); $form[$field->fid]['delete'] = array('#value' => l(t('delete'), "admin/user/profile/delete/$field->fid")); } - + // Add the cateogory combo boxes $categories = array_unique($categories); - foreach($form as $fid => $field) { - foreach($categories as $cat => $category) { + foreach ($form as $fid => $field) { + foreach ($categories as $cat => $category) { $form[$fid]['category']['#options'][$category] = $category; } } - + // Display the submit button only when there's more than one field if (count($form) > 1) { $form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration')); @@ -51,7 +51,7 @@ function profile_admin_overview(&$form_state = NULL) { } } $form['#tree'] = TRUE; - + $addnewfields = '

'. t('Add new field') .'

'; $addnewfields .= '