Commit 5622bce2 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#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
parent aaaf8f57
......@@ -2,9 +2,9 @@
// $Id$
/**
* @file
* This is the actions engine for executing stored actions.
*/
* @file
* This is the actions engine for executing stored actions.
*/
/**
* Perform a given list of actions by executing their callback functions.
......
......@@ -291,7 +291,7 @@ function _batch_finished() {
$batch =& batch_get();
// Execute the 'finished' callbacks for each batch set.
foreach($batch['sets'] as $key => $batch_set) {
foreach ($batch['sets'] as $key => $batch_set) {
if (isset($batch_set['finished'])) {
// Check if the set requires an additional file for functions definitions.
if (isset($batch_set['file']) && is_file($batch_set['file'])) {
......
......@@ -514,7 +514,7 @@ function db_change_field(&$ret, $table, $field, $field_new, $spec, $keys_new = a
$sql = 'ALTER TABLE {'. $table .'} CHANGE '. $field .' '.
_db_create_field_sql($field_new, _db_process_field($spec));
if (count($keys_new)) {
$sql .= ', ADD '.implode(', ADD ', _db_create_keys_sql($keys_new));
$sql .= ', ADD '. implode(', ADD ', _db_create_keys_sql($keys_new));
}
$ret[] = update_sql($sql);
}
......
......@@ -203,16 +203,16 @@ function db_fetch_array($result) {
}
/**
* Return an individual result field from the previous query.
*
* Only use this function if exactly one field is being selected; otherwise,
* use db_fetch_object() or db_fetch_array().
*
* @param $result
* A database query result resource, as returned from db_query().
* @return
* The resulting field or FALSE.
*/
* Return an individual result field from the previous query.
*
* Only use this function if exactly one field is being selected; otherwise,
* use db_fetch_object() or db_fetch_array().
*
* @param $result
* A database query result resource, as returned from db_query().
* @return
* The resulting field or FALSE.
*/
function db_result($result) {
if ($result && mysqli_num_rows($result) > 0) {
// The mysqli_fetch_row function has an optional second parameter $row
......
......@@ -1792,8 +1792,8 @@ function menu_link_save(&$item) {
}
/**
* Helper function to clear the page and block caches at most twice per page load.
*/
* Helper function to clear the page and block caches at most twice per page load.
*/
function _menu_clear_page_cache() {
static $cache_cleared = 0;
......@@ -1814,8 +1814,8 @@ function _menu_clear_page_cache() {
}
/**
* Helper function to update a list of menus with expanded items
*/
* Helper function to update a list of menus with expanded items
*/
function _menu_set_expanded_menus() {
$names = array();
$result = db_query("SELECT menu_name FROM {menu_links} WHERE expanded != 0 GROUP BY menu_name");
......
......@@ -7,7 +7,7 @@
Site: http://scripts.incutio.com/xmlrpc/
Manual: http://scripts.incutio.com/xmlrpc/manual.php
This version is made available under the GNU GPL License
*/
*/
/**
* Recursively turn a data structure into objects with 'data' and 'type' attributes.
......
......@@ -39,21 +39,21 @@
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);
/**
......
......@@ -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']);
}
......
......@@ -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.
......
......@@ -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);
......
......@@ -44,7 +44,7 @@ function openid_help($path, $arg) {
case 'user/%/openid':
$output = '<p>'. t('This site supports <a href="@openid-net">OpenID</a>, 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'))) .'</p>';
$output .= '<p>' . 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 <a href="@openid-providers">free public providers</a>. You can find out more about OpenID at <a href="@openid-net">this website</a>.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'</p>';
$output .= '<p>'. 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 <a href="@openid-providers">free public providers</a>. You can find out more about OpenID at <a href="@openid-net">this website</a>.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'</p>';
$output .= '<p>'. 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.') .'</p>';
return $output;
......
......@@ -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) {
......
......@@ -33,8 +33,8 @@ function profile_admin_overview(&$form_state = NULL) {
// 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;
}
}
......
......@@ -1655,7 +1655,7 @@ function system_sql() {
$result = db_query("SHOW STATUS");
while ($entry = db_fetch_object($result)) {
$data[$entry->Variable_name] = $entry->Value;
$data[$entry->variable_name] = $entry->value;
}
$output = '<h2>'. t('Command counters') .'</h2>';
......
......@@ -136,7 +136,7 @@ function system_elements() {
// Inputs
$type['submit'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#executes_submit_callback' => TRUE, '#process' => array('form_expand_ahah'));
$type['button'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#executes_submit_callback' => FALSE, '#process' => array('form_expand_ahah'));
$type['image_button'] = array('#input' => TRUE, '#button_type' => 'submit','#executes_submit_callback' => TRUE, '#process' => array('form_expand_ahah'), '#return_value' => TRUE, '#has_garbage_value' => TRUE, '#src' => NULL);
$type['image_button'] = array('#input' => TRUE, '#button_type' => 'submit', '#executes_submit_callback' => TRUE, '#process' => array('form_expand_ahah'), '#return_value' => TRUE, '#has_garbage_value' => TRUE, '#src' => NULL);
$type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE, '#process' => array('form_expand_ahah'));
$type['password'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#process' => array('form_expand_ahah'));
$type['password_confirm'] = array('#input' => TRUE, '#process' => array('expand_password_confirm'));
......@@ -507,7 +507,7 @@ function system_user($type, $edit, &$user, $category = NULL) {
* Generate a block with a promotional link to Drupal.org.
*/
function system_block($op = 'list', $delta = 0, $edit = NULL) {
switch($op) {
switch ($op) {
case 'list':
$blocks[0] = array(
'info' => t('Powered by Drupal'),
......
......@@ -263,7 +263,8 @@ function taxonomy_schema() {
),
'type' => array(
'type' => 'varchar',
'length' => 32,'not null' => TRUE,
'length' => 32,
'not null' => TRUE,
'default' => '',
'description' => t('The {node}.type of the node type for which the vocabulary may be used.'),
),
......
......@@ -69,7 +69,7 @@ function taxonomy_link($type, $node = NULL) {
else {
foreach ($term as $free_typed) {
$typed_terms = drupal_explode_tags($free_typed);
foreach($typed_terms as $typed_term) {
foreach ($typed_terms as $typed_term) {
$links['taxonomy_preview_term_'. $typed_term] = array(
'title' => $typed_term,
);
......@@ -1110,7 +1110,7 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
/**
* Accepts the result of a pager_query() call, such as that performed by
* taxonomy_select_nodes(), and formats each node along with a pager.
*/
*/
function taxonomy_render_nodes($result) {
$output = '';
$has_rows = FALSE;
......
......@@ -579,7 +579,7 @@ function upload_js() {
upload_node_form_submit(array(), $form_state);
$node->files = upload_load($node);
if (!empty($form_state['values']['files'])) {
foreach($form_state['values']['files'] as $fid => $file) {
foreach ($form_state['values']['files'] as $fid => $file) {
$node->files[$fid] = $file;
}
}
......
......@@ -624,7 +624,7 @@ function update_create_cache_tables() {
created int NOT NULL default '0',
headers text,
PRIMARY KEY (cid),
INDEX expire (expire)
INDEX expire (expire),
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
$ret[] = update_sql("CREATE TABLE {cache_menu} (
cid varchar(255) NOT NULL default '',
......@@ -633,7 +633,7 @@ function update_create_cache_tables() {
created int NOT NULL default '0',
headers text,
PRIMARY KEY (cid),
INDEX expire (expire)
INDEX expire (expire),
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
$ret[] = update_sql("CREATE TABLE {cache_page} (
cid varchar(255) BINARY NOT NULL default '',
......@@ -642,7 +642,7 @@ function update_create_cache_tables() {
created int NOT NULL default '0',
headers text,
PRIMARY KEY (cid),
INDEX expire (expire)
INDEX expire (expire),
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
case 'pgsql':
......@@ -652,7 +652,7 @@ function update_create_cache_tables() {
expire int NOT NULL default '0',
created int NOT NULL default '0',
headers text,
PRIMARY KEY (cid)
PRIMARY KEY (cid),
)");
$ret[] = update_sql("CREATE TABLE {cache_menu} (
cid varchar(255) NOT NULL default '',
......@@ -660,7 +660,7 @@ function update_create_cache_tables() {
expire int NOT NULL default '0',
created int NOT NULL default '0',
headers text,
PRIMARY KEY (cid)
PRIMARY KEY (cid),
)");
$ret[] = update_sql("CREATE TABLE {cache_page} (
cid varchar(255) NOT NULL default '',
......@@ -668,7 +668,7 @@ function update_create_cache_tables() {
expire int NOT NULL default '0',
created int NOT NULL default '0',
headers text,
PRIMARY KEY (cid)
PRIMARY KEY (cid),
)");
$ret[] = update_sql("CREATE INDEX {cache_filter}_expire_idx ON {cache_filter} (expire)");
$ret[] = update_sql("CREATE INDEX {cache_menu}_expire_idx ON {cache_menu} (expire)");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment