summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/aggregator.module4
-rw-r--r--modules/aggregator/aggregator.module4
-rw-r--r--modules/blogapi.module22
-rw-r--r--modules/blogapi/blogapi.module22
-rw-r--r--modules/book.module4
-rw-r--r--modules/book/book.module4
-rw-r--r--modules/filter.module42
-rw-r--r--modules/filter/filter.module42
-rw-r--r--modules/forum.module2
-rw-r--r--modules/forum/forum.module2
-rw-r--r--modules/node.module26
-rw-r--r--modules/node/node.module26
-rw-r--r--modules/poll.module2
-rw-r--r--modules/poll/poll.module2
-rw-r--r--modules/profile.module8
-rw-r--r--modules/profile/profile.module8
-rw-r--r--modules/search.module44
-rw-r--r--modules/search/search.module44
-rw-r--r--modules/system.module12
-rw-r--r--modules/system/system.module12
-rw-r--r--modules/taxonomy.module2
-rw-r--r--modules/taxonomy/taxonomy.module2
-rw-r--r--modules/upload.module14
-rw-r--r--modules/upload/upload.module14
-rw-r--r--modules/user.module12
-rw-r--r--modules/user/user.module12
26 files changed, 194 insertions, 194 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 74e138661..142c1c135 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -1069,11 +1069,11 @@ function _aggregator_page_list($sql, $op, $header = '') {
$selected[] = $category->cid;
}
}
- $done = true;
+ $done = TRUE;
$form['categories'][$item->iid] = array(
'#type' => variable_get('aggregator_category_selector', 'checkboxes'),
'#default_value' => $selected, '#options' => $categories,
- '#size' => 10, '#multiple' => true
+ '#size' => 10, '#multiple' => TRUE
);
}
}
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 74e138661..142c1c135 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -1069,11 +1069,11 @@ function _aggregator_page_list($sql, $op, $header = '') {
$selected[] = $category->cid;
}
}
- $done = true;
+ $done = TRUE;
$form['categories'][$item->iid] = array(
'#type' => variable_get('aggregator_category_selector', 'checkboxes'),
'#default_value' => $selected, '#options' => $categories,
- '#size' => 10, '#multiple' => true
+ '#size' => 10, '#multiple' => TRUE
);
}
}
diff --git a/modules/blogapi.module b/modules/blogapi.module
index 381824858..ab8b648c1 100644
--- a/modules/blogapi.module
+++ b/modules/blogapi.module
@@ -151,7 +151,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) {
$types = _blogapi_get_node_types();
$structs = array();
foreach ($types as $type) {
- $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, true), 'blogid' => $type, 'blogName' => $user->name . ": " . $type);
+ $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, TRUE), 'blogid' => $type, 'blogName' => $user->name . ": " . $type);
}
return $structs;
}
@@ -174,7 +174,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) {
'firstname' => $name[0],
'nickname' => $user->name,
'email' => $user->mail,
- 'url' => url('blog/' . $user->uid, NULL, NULL, true));
+ 'url' => url('blog/' . $user->uid, NULL, NULL, TRUE));
}
else {
return blogapi_error($user);
@@ -285,7 +285,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
node_save($node);
if ($node->nid) {
watchdog('content', t('%type: updated %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
- return true;
+ return TRUE;
}
return blogapi_error(t('Error storing post.'));
@@ -302,7 +302,7 @@ function blogapi_blogger_get_post($appkey, $postid, $username, $password) {
$node = node_load($postid);
- return _blogapi_get_post($node, true);
+ return _blogapi_get_post($node, TRUE);
}
/**
@@ -315,7 +315,7 @@ function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $pu
}
node_delete($postid);
- return true;
+ return TRUE;
}
/**
@@ -433,7 +433,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) {
foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) {
$term_name = $parent->name . '/' . $term_name;
}
- $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => true);
+ $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE);
}
return $categories;
}
@@ -502,7 +502,7 @@ function blogap_mti_publish_post($postid, $username, $password) {
node_save($node);
- return true;
+ return TRUE;
}
/**
@@ -630,7 +630,7 @@ __RSD__;
*/
function _blogapi_mt_extra(&$node, $struct) {
if (is_array($node)) {
- $was_array = true;
+ $was_array = TRUE;
$node = (object)$node;
}
@@ -687,14 +687,14 @@ function _blogapi_mt_extra(&$node, $struct) {
}
}
-function _blogapi_get_post($node, $bodies = true) {
+function _blogapi_get_post($node, $bodies = TRUE) {
$xmlrpcval = array (
'userid' => $node->name,
'dateCreated' => xmlrpc_date($node->created),
'title' => $node->title,
'postid' => $node->nid,
- 'link' => url('node/'.$node->nid, NULL, NULL, true),
- 'permaLink' => url('node/'.$node->nid, NULL, NULL, true),
+ 'link' => url('node/'.$node->nid, NULL, NULL, TRUE),
+ 'permaLink' => url('node/'.$node->nid, NULL, NULL, TRUE),
);
if ($bodies) {
if ($node->comment = 1) {
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 381824858..ab8b648c1 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -151,7 +151,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) {
$types = _blogapi_get_node_types();
$structs = array();
foreach ($types as $type) {
- $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, true), 'blogid' => $type, 'blogName' => $user->name . ": " . $type);
+ $structs[] = array('url' => url('blog/' . $user->uid, NULL, NULL, TRUE), 'blogid' => $type, 'blogName' => $user->name . ": " . $type);
}
return $structs;
}
@@ -174,7 +174,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) {
'firstname' => $name[0],
'nickname' => $user->name,
'email' => $user->mail,
- 'url' => url('blog/' . $user->uid, NULL, NULL, true));
+ 'url' => url('blog/' . $user->uid, NULL, NULL, TRUE));
}
else {
return blogapi_error($user);
@@ -285,7 +285,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
node_save($node);
if ($node->nid) {
watchdog('content', t('%type: updated %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
- return true;
+ return TRUE;
}
return blogapi_error(t('Error storing post.'));
@@ -302,7 +302,7 @@ function blogapi_blogger_get_post($appkey, $postid, $username, $password) {
$node = node_load($postid);
- return _blogapi_get_post($node, true);
+ return _blogapi_get_post($node, TRUE);
}
/**
@@ -315,7 +315,7 @@ function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $pu
}
node_delete($postid);
- return true;
+ return TRUE;
}
/**
@@ -433,7 +433,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) {
foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) {
$term_name = $parent->name . '/' . $term_name;
}
- $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => true);
+ $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE);
}
return $categories;
}
@@ -502,7 +502,7 @@ function blogap_mti_publish_post($postid, $username, $password) {
node_save($node);
- return true;
+ return TRUE;
}
/**
@@ -630,7 +630,7 @@ __RSD__;
*/
function _blogapi_mt_extra(&$node, $struct) {
if (is_array($node)) {
- $was_array = true;
+ $was_array = TRUE;
$node = (object)$node;
}
@@ -687,14 +687,14 @@ function _blogapi_mt_extra(&$node, $struct) {
}
}
-function _blogapi_get_post($node, $bodies = true) {
+function _blogapi_get_post($node, $bodies = TRUE) {
$xmlrpcval = array (
'userid' => $node->name,
'dateCreated' => xmlrpc_date($node->created),
'title' => $node->title,
'postid' => $node->nid,
- 'link' => url('node/'.$node->nid, NULL, NULL, true),
- 'permaLink' => url('node/'.$node->nid, NULL, NULL, true),
+ 'link' => url('node/'.$node->nid, NULL, NULL, TRUE),
+ 'permaLink' => url('node/'.$node->nid, NULL, NULL, TRUE),
);
if ($bodies) {
if ($node->comment = 1) {
diff --git a/modules/book.module b/modules/book.module
index c7f18d872..43d71edca 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -427,7 +427,7 @@ function book_next($node) {
}
/**
- * Returns the content of a given node. If $teaser if true, returns
+ * Returns the content of a given node. If $teaser if TRUE, returns
* the teaser rather than full content. Displays the most recently
* approved revision of a node (if any) unless we have to display this
* page in the context of the moderation queue.
@@ -802,7 +802,7 @@ function book_node_visitor_html_pre($node, $depth, $nid) {
$node = node_invoke($node, 'content');
}
// Allow modules to change $node->body before viewing.
- node_invoke_nodeapi($node, 'print', $node->body, false);
+ node_invoke_nodeapi($node, 'print', $node->body, FALSE);
$output .= "<div id=\"node-". $node->nid ."\" class=\"section-$depth\">\n";
$output .= "<h1 class=\"book-heading\">". check_plain($node->title) ."</h1>\n";
diff --git a/modules/book/book.module b/modules/book/book.module
index c7f18d872..43d71edca 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -427,7 +427,7 @@ function book_next($node) {
}
/**
- * Returns the content of a given node. If $teaser if true, returns
+ * Returns the content of a given node. If $teaser if TRUE, returns
* the teaser rather than full content. Displays the most recently
* approved revision of a node (if any) unless we have to display this
* page in the context of the moderation queue.
@@ -802,7 +802,7 @@ function book_node_visitor_html_pre($node, $depth, $nid) {
$node = node_invoke($node, 'content');
}
// Allow modules to change $node->body before viewing.
- node_invoke_nodeapi($node, 'print', $node->body, false);
+ node_invoke_nodeapi($node, 'print', $node->body, FALSE);
$output .= "<div id=\"node-". $node->nid ."\" class=\"section-$depth\">\n";
$output .= "<h1 class=\"book-heading\">". check_plain($node->title) ."</h1>\n";
diff --git a/modules/filter.module b/modules/filter.module
index e3c65344c..9f3f15db8 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -146,7 +146,7 @@ function filter_perm() {
/**
* Implementation of hook_filter_tips().
*/
-function filter_filter_tips($delta, $format, $long = false) {
+function filter_filter_tips($delta, $format, $long = FALSE) {
global $base_url;
switch ($delta) {
case 0:
@@ -294,7 +294,7 @@ function filter_admin_overview() {
// Overview of all formats.
$formats = filter_formats();
- $error = false;
+ $error = FALSE;
$rows = array();
foreach ($formats as $id => $format) {
@@ -383,7 +383,7 @@ function filter_admin_delete_submit($form_id, $form_values) {
db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_values['format']);
db_query("UPDATE {boxes} SET format = %d WHERE format = %d", $default, $form_values['format']);
- cache_clear_all('filter:'. $form_values['format'], true);
+ cache_clear_all('filter:'. $form_values['format'], TRUE);
drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $form_values['name']))));
return 'admin/filters';
@@ -445,9 +445,9 @@ function filter_admin_format_form($format = NULL) {
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
// Composition tips (guidelines)
- $tips = _filter_tips($format->format, false);
+ $tips = _filter_tips($format->format, FALSE);
$extra = l(t('More information about formatting options'), 'filter/tips');
- $tiplist = theme('filter_tips', $tips, false, $extra);
+ $tiplist = theme('filter_tips', $tips, FALSE, $extra);
if (!$tiplist) {
$tiplist = t('<p>No guidelines available.</p>');
}
@@ -508,7 +508,7 @@ function filter_admin_format_form_submit($form_id, $form_values) {
}
// We store the roles as a string for ease of use.
- // We should always set all roles to true when saving a default role.
+ // We should always set all roles to TRUE when saving a default role.
// We use leading and trailing comma's to allow easy substring matching.
$roles = array();
if (isset($form_values['roles'])) {
@@ -522,7 +522,7 @@ function filter_admin_format_form_submit($form_id, $form_values) {
db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
- cache_clear_all('filter:'. $format, true);
+ cache_clear_all('filter:'. $format, TRUE);
// If a new filter was added, return to the main list of filters. Otherwise, stay on edit filter page to show new changes.
if ($new) {
@@ -580,7 +580,7 @@ function filter_admin_order_submit($form_id, $form_values) {
}
drupal_set_message(t('The filter ordering has been saved.'));
- cache_clear_all('filter:'. $form_values['format'], true);
+ cache_clear_all('filter:'. $form_values['format'], TRUE);
}
/**
@@ -739,7 +739,7 @@ function filter_list_format($format) {
* set to TRUE so the user's permissions are checked.
*/
function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
- // When $check = true, do an access check on $format.
+ // When $check = TRUE, do an access check on $format.
if (isset($text) && (!$check || filter_access($format))) {
$format = filter_resolve_format($format);
@@ -816,7 +816,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
'#default_value' => $value,
'#return_value' => $format->format,
'#parents' => $parents,
- '#description' => theme('filter_tips', _filter_tips($format->format, false)),
+ '#description' => theme('filter_tips', _filter_tips($format->format, FALSE)),
);
}
}
@@ -824,10 +824,10 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
// Only one format available: use a hidden form item and only show tips.
$format = array_shift($formats);
$form[$format->format] = array('#type' => 'value', '#value' => $format->format, '#parents' => $parents);
- $tips = _filter_tips(variable_get('filter_default_format', 1), false);
+ $tips = _filter_tips(variable_get('filter_default_format', 1), FALSE);
$form['format']['guidelines'] = array(
'#title' => t('Formatting guidelines'),
- '#value' => theme('filter_tips', $tips, false, $extra),
+ '#value' => theme('filter_tips', $tips, FALSE, $extra),
);
}
$form[] = array(
@@ -848,12 +848,12 @@ function filter_form_validate($form) {
}
/**
- * Returns true if the user is allowed to access this format.
+ * Returns TRUE if the user is allowed to access this format.
*/
function filter_access($format) {
$format = filter_resolve_format($format);
if (user_access('administer filters') || ($format == variable_get('filter_default_format', 1))) {
- return true;
+ return TRUE;
}
else {
$formats = filter_formats();
@@ -870,10 +870,10 @@ function filter_access($format) {
function filter_tips_long() {
$format = arg(2);
if ($format) {
- $output = theme('filter_tips', _filter_tips($format, true), true);
+ $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
}
else {
- $output = theme('filter_tips', _filter_tips(-1, true), true);
+ $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
}
return $output;
}
@@ -881,7 +881,7 @@ function filter_tips_long() {
/**
* Helper function for fetching filter tips.
*/
-function _filter_tips($format, $long = false) {
+function _filter_tips($format, $long = FALSE) {
if ($format == -1) {
$formats = filter_formats();
}
@@ -910,7 +910,7 @@ function _filter_tips($format, $long = false) {
*
* @ingroup themeable
*/
-function theme_filter_tips($tips, $long = false, $extra = '') {
+function theme_filter_tips($tips, $long = FALSE, $extra = '') {
$output = '';
$multiple = count($tips) > 1;
@@ -1057,7 +1057,7 @@ function _filter_autop($text) {
$chunks = preg_split('@(</?(?:pre|script|style)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting NULL as required).
- $ignore = false;
+ $ignore = FALSE;
$ignoretag = '';
$output = '';
foreach ($chunks as $i => $chunk) {
@@ -1067,13 +1067,13 @@ function _filter_autop($text) {
list($tag) = split('[ >]', substr($chunk, 2 - $open), 2);
if (!$ignore) {
if ($open) {
- $ignore = true;
+ $ignore = TRUE;
$ignoretag = $tag;
}
}
// Only allow a matching tag to close it.
else if (!$open && $ignoretag == $tag) {
- $ignore = false;
+ $ignore = FALSE;
$ignoretag = '';
}
}
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index e3c65344c..9f3f15db8 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -146,7 +146,7 @@ function filter_perm() {
/**
* Implementation of hook_filter_tips().
*/
-function filter_filter_tips($delta, $format, $long = false) {
+function filter_filter_tips($delta, $format, $long = FALSE) {
global $base_url;
switch ($delta) {
case 0:
@@ -294,7 +294,7 @@ function filter_admin_overview() {
// Overview of all formats.
$formats = filter_formats();
- $error = false;
+ $error = FALSE;
$rows = array();
foreach ($formats as $id => $format) {
@@ -383,7 +383,7 @@ function filter_admin_delete_submit($form_id, $form_values) {
db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_values['format']);
db_query("UPDATE {boxes} SET format = %d WHERE format = %d", $default, $form_values['format']);
- cache_clear_all('filter:'. $form_values['format'], true);
+ cache_clear_all('filter:'. $form_values['format'], TRUE);
drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $form_values['name']))));
return 'admin/filters';
@@ -445,9 +445,9 @@ function filter_admin_format_form($format = NULL) {
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
// Composition tips (guidelines)
- $tips = _filter_tips($format->format, false);
+ $tips = _filter_tips($format->format, FALSE);
$extra = l(t('More information about formatting options'), 'filter/tips');
- $tiplist = theme('filter_tips', $tips, false, $extra);
+ $tiplist = theme('filter_tips', $tips, FALSE, $extra);
if (!$tiplist) {
$tiplist = t('<p>No guidelines available.</p>');
}
@@ -508,7 +508,7 @@ function filter_admin_format_form_submit($form_id, $form_values) {
}
// We store the roles as a string for ease of use.
- // We should always set all roles to true when saving a default role.
+ // We should always set all roles to TRUE when saving a default role.
// We use leading and trailing comma's to allow easy substring matching.
$roles = array();
if (isset($form_values['roles'])) {
@@ -522,7 +522,7 @@ function filter_admin_format_form_submit($form_id, $form_values) {
db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
- cache_clear_all('filter:'. $format, true);
+ cache_clear_all('filter:'. $format, TRUE);
// If a new filter was added, return to the main list of filters. Otherwise, stay on edit filter page to show new changes.
if ($new) {
@@ -580,7 +580,7 @@ function filter_admin_order_submit($form_id, $form_values) {
}
drupal_set_message(t('The filter ordering has been saved.'));
- cache_clear_all('filter:'. $form_values['format'], true);
+ cache_clear_all('filter:'. $form_values['format'], TRUE);
}
/**
@@ -739,7 +739,7 @@ function filter_list_format($format) {
* set to TRUE so the user's permissions are checked.
*/
function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
- // When $check = true, do an access check on $format.
+ // When $check = TRUE, do an access check on $format.
if (isset($text) && (!$check || filter_access($format))) {
$format = filter_resolve_format($format);
@@ -816,7 +816,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
'#default_value' => $value,
'#return_value' => $format->format,
'#parents' => $parents,
- '#description' => theme('filter_tips', _filter_tips($format->format, false)),
+ '#description' => theme('filter_tips', _filter_tips($format->format, FALSE)),
);
}
}
@@ -824,10 +824,10 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
// Only one format available: use a hidden form item and only show tips.
$format = array_shift($formats);
$form[$format->format] = array('#type' => 'value', '#value' => $format->format, '#parents' => $parents);
- $tips = _filter_tips(variable_get('filter_default_format', 1), false);
+ $tips = _filter_tips(variable_get('filter_default_format', 1), FALSE);
$form['format']['guidelines'] = array(
'#title' => t('Formatting guidelines'),
- '#value' => theme('filter_tips', $tips, false, $extra),
+ '#value' => theme('filter_tips', $tips, FALSE, $extra),
);
}
$form[] = array(
@@ -848,12 +848,12 @@ function filter_form_validate($form) {
}
/**
- * Returns true if the user is allowed to access this format.
+ * Returns TRUE if the user is allowed to access this format.
*/
function filter_access($format) {
$format = filter_resolve_format($format);
if (user_access('administer filters') || ($format == variable_get('filter_default_format', 1))) {
- return true;
+ return TRUE;
}
else {
$formats = filter_formats();
@@ -870,10 +870,10 @@ function filter_access($format) {
function filter_tips_long() {
$format = arg(2);
if ($format) {
- $output = theme('filter_tips', _filter_tips($format, true), true);
+ $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
}
else {
- $output = theme('filter_tips', _filter_tips(-1, true), true);
+ $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
}
return $output;
}
@@ -881,7 +881,7 @@ function filter_tips_long() {
/**
* Helper function for fetching filter tips.
*/
-function _filter_tips($format, $long = false) {
+function _filter_tips($format, $long = FALSE) {
if ($format == -1) {
$formats = filter_formats();
}
@@ -910,7 +910,7 @@ function _filter_tips($format, $long = false) {
*
* @ingroup themeable
*/
-function theme_filter_tips($tips, $long = false, $extra = '') {
+function theme_filter_tips($tips, $long = FALSE, $extra = '') {
$output = '';
$multiple = count($tips) > 1;
@@ -1057,7 +1057,7 @@ function _filter_autop($text) {
$chunks = preg_split('@(</?(?:pre|script|style)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting NULL as required).
- $ignore = false;
+ $ignore = FALSE;
$ignoretag = '';
$output = '';
foreach ($chunks as $i => $chunk) {
@@ -1067,13 +1067,13 @@ function _filter_autop($text) {
list($tag) = split('[ >]', substr($chunk, 2 - $open), 2);
if (!$ignore) {
if ($open) {
- $ignore = true;
+ $ignore = TRUE;
$ignoretag = $tag;
}
}
// Only allow a matching tag to close it.
else if (!$open && $ignoretag == $tag) {
- $ignore = false;
+ $ignore = FALSE;
$ignoretag = '';
}
}
diff --git a/modules/forum.module b/modules/forum.module
index 4ba752d73..07eba7922 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -520,7 +520,7 @@ function forum_form_submit($form_id, $form_values) {
$type = t('forum container');
}
else {
- $container = false;
+ $container = FALSE;
$type = t('forum');
}
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 4ba752d73..07eba7922 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -520,7 +520,7 @@ function forum_form_submit($form_id, $form_values) {
$type = t('forum container');
}
else {
- $container = false;
+ $container = FALSE;
$type = t('forum');
}
diff --git a/modules/node.module b/modules/node.module
index 129659abd..93b51985e 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -401,12 +401,12 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
function node_save(&$node) {
global $user;
- $node->is_new = false;
+ $node->is_new = FALSE;
// Apply filters to some default node fields:
if (empty($node->nid)) {
// Insert a new node.
- $node->is_new = true;
+ $node->is_new = TRUE;
$node->nid = db_next_id('{node}_nid');
$node->vid = db_next_id('{node_revisions}_vid');;
@@ -593,7 +593,7 @@ function node_perm() {
/**
* Implementation of hook_search().
*/
-function node_search($op = 'search', $keys = null) {
+function node_search($op = 'search', $keys = NULL) {
switch ($op) {
case 'name':
return t('content');
@@ -666,7 +666,7 @@ function node_search($op = 'search', $keys = null) {
$arguments2 = array();
$join2 = '';
// Used to avoid joining on node_comment_statistics twice
- $stats_join = false;
+ $stats_join = FALSE;
if ($weight = (int)variable_get('node_rank_relevance', 5)) {
// Average relevance values hover around 0.15
$ranking[] = '%d * i.relevance';
@@ -678,7 +678,7 @@ function node_search($op = 'search', $keys = null) {
$arguments2[] = $weight;
$arguments2[] = (int)variable_get('node_cron_last', 0);
$join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
- $stats_join = true;
+ $stats_join = TRUE;
}
if (module_exist('comment') && $weight = (int)variable_get('node_rank_comments', 5)) {
// Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
@@ -711,13 +711,13 @@ function node_search($op = 'search', $keys = null) {
// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {
- node_invoke($node, 'view', false, false);
+ node_invoke($node, 'view', FALSE, FALSE);
}
else {
- $node = node_prepare($node, false);
+ $node = node_prepare($node, FALSE);
}
// Allow modules to change $node->body before viewing.
- node_invoke_nodeapi($node, 'view', false, false);
+ node_invoke_nodeapi($node, 'view', FALSE, FALSE);
// Fetch comments for snippet
$node->body .= module_invoke('comment', 'nodeapi', $node, 'update index');
@@ -1203,7 +1203,7 @@ function node_multiple_delete_confirm() {
$edit = $_POST['edit'];
$form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
- // array_filter returns only elements with true values
+ // array_filter returns only elements with TRUE values
foreach (array_filter($edit['nodes']) as $nid => $value) {
$title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid));
$form['nodes'][$nid] = array('#type' => 'hidden', '#value' => $nid, '#prefix' => '<li>', '#suffix' => check_plain($title) ."</li>\n");
@@ -1457,7 +1457,7 @@ function node_feed($nodes = 0, $channel = array()) {
// Allow modules to add additional item fields
$extra = node_invoke_nodeapi($item, 'rss item');
- $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
+ $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'FALSE'))));
foreach ($extra as $element) {
if ($element['namespace']) {
$namespaces = array_merge($namespaces, $element['namespace']);
@@ -2113,13 +2113,13 @@ function node_update_index() {
// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {
- node_invoke($node, 'view', false, false);
+ node_invoke($node, 'view', FALSE, FALSE);
}
else {
- $node = node_prepare($node, false);
+ $node = node_prepare($node, FALSE);
}
// Allow modules to change $node->body before viewing.
- node_invoke_nodeapi($node, 'view', false, false);
+ node_invoke_nodeapi($node, 'view', FALSE, FALSE);
$text = '<h1>'. check_plain($node->title) .'</h1>'. $node->body;
diff --git a/modules/node/node.module b/modules/node/node.module
index 129659abd..93b51985e 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -401,12 +401,12 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
function node_save(&$node) {
global $user;
- $node->is_new = false;
+ $node->is_new = FALSE;
// Apply filters to some default node fields:
if (empty($node->nid)) {
// Insert a new node.
- $node->is_new = true;
+ $node->is_new = TRUE;
$node->nid = db_next_id('{node}_nid');
$node->vid = db_next_id('{node_revisions}_vid');;
@@ -593,7 +593,7 @@ function node_perm() {
/**
* Implementation of hook_search().
*/
-function node_search($op = 'search', $keys = null) {
+function node_search($op = 'search', $keys = NULL) {
switch ($op) {
case 'name':
return t('content');
@@ -666,7 +666,7 @@ function node_search($op = 'search', $keys = null) {
$arguments2 = array();
$join2 = '';
// Used to avoid joining on node_comment_statistics twice
- $stats_join = false;
+ $stats_join = FALSE;
if ($weight = (int)variable_get('node_rank_relevance', 5)) {
// Average relevance values hover around 0.15
$ranking[] = '%d * i.relevance';
@@ -678,7 +678,7 @@ function node_search($op = 'search', $keys = null) {
$arguments2[] = $weight;
$arguments2[] = (int)variable_get('node_cron_last', 0);
$join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
- $stats_join = true;
+ $stats_join = TRUE;
}
if (module_exist('comment') && $weight = (int)variable_get('node_rank_comments', 5)) {
// Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
@@ -711,13 +711,13 @@ function node_search($op = 'search', $keys = null) {
// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {
- node_invoke($node, 'view', false, false);
+ node_invoke($node, 'view', FALSE, FALSE);
}
else {
- $node = node_prepare($node, false);
+ $node = node_prepare($node, FALSE);
}
// Allow modules to change $node->body before viewing.
- node_invoke_nodeapi($node, 'view', false, false);
+ node_invoke_nodeapi($node, 'view', FALSE, FALSE);
// Fetch comments for snippet
$node->body .= module_invoke('comment', 'nodeapi', $node, 'update index');
@@ -1203,7 +1203,7 @@ function node_multiple_delete_confirm() {
$edit = $_POST['edit'];
$form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
- // array_filter returns only elements with true values
+ // array_filter returns only elements with TRUE values
foreach (array_filter($edit['nodes']) as $nid => $value) {
$title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid));
$form['nodes'][$nid] = array('#type' => 'hidden', '#value' => $nid, '#prefix' => '<li>', '#suffix' => check_plain($title) ."</li>\n");
@@ -1457,7 +1457,7 @@ function node_feed($nodes = 0, $channel = array()) {
// Allow modules to add additional item fields
$extra = node_invoke_nodeapi($item, 'rss item');
- $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
+ $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'FALSE'))));
foreach ($extra as $element) {
if ($element['namespace']) {
$namespaces = array_merge($namespaces, $element['namespace']);
@@ -2113,13 +2113,13 @@ function node_update_index() {
// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {
- node_invoke($node, 'view', false, false);
+ node_invoke($node, 'view', FALSE, FALSE);
}
else {
- $node = node_prepare($node, false);
+ $node = node_prepare($node, FALSE);
}
// Allow modules to change $node->body before viewing.
- node_invoke_nodeapi($node, 'view', false, false);
+ node_invoke_nodeapi($node, 'view', FALSE, FALSE);
$text = '<h1>'. check_plain($node->title) .'</h1>'. $node->body;
diff --git a/modules/poll.module b/modules/poll.module
index 9247f2ed0..1f2494da3 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -513,7 +513,7 @@ function poll_cancel(&$node) {
// Subtract from the votes.
db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice);
- $node->allowvotes = true;
+ $node->allowvotes = TRUE;
$node->choice[$choice]['chvotes']--;
drupal_set_message(t('Your vote was canceled.'));
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 9247f2ed0..1f2494da3 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -513,7 +513,7 @@ function poll_cancel(&$node) {
// Subtract from the votes.
db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice);
- $node->allowvotes = true;
+ $node->allowvotes = TRUE;
$node->choice[$choice]['chvotes']--;
drupal_set_message(t('Your vote was canceled.'));
}
diff --git a/modules/profile.module b/modules/profile.module
index 067da9f3f..4a36e208b 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -137,7 +137,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
if ($fields) {
$fields = _profile_update_user_fields($fields, $account);
- $output .= theme('profile_block', $account, $fields, true);
+ $output .= theme('profile_block', $account, $fields, TRUE);
}
if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
@@ -562,8 +562,8 @@ function profile_view_field($user, $field) {
'm' => sprintf('%02d', $value['month']),
'M' => map_month($value['month']),
'Y' => $value['year'],
- 'H:i' => null,
- 'g:ia' => null);
+ 'H:i' => NULL,
+ 'g:ia' => NULL);
return strtr($format, $replace);
case 'list':
$values = split("[,\n\r]", $value);
@@ -749,7 +749,7 @@ function profile_validate_profile($edit, $category) {
while ($field = db_fetch_object($result)) {
if ($edit[$field->name]) {
if ($field->type == 'url') {
- if (!valid_url($edit[$field->name], true)) {
+ if (!valid_url($edit[$field->name], TRUE)) {
form_set_error($field->name, t('The value provided for %field is not a valid URL.', array('%field' => theme('placeholder', $field->title))));
}
}
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 067da9f3f..4a36e208b 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -137,7 +137,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
if ($fields) {
$fields = _profile_update_user_fields($fields, $account);
- $output .= theme('profile_block', $account, $fields, true);
+ $output .= theme('profile_block', $account, $fields, TRUE);
}
if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
@@ -562,8 +562,8 @@ function profile_view_field($user, $field) {
'm' => sprintf('%02d', $value['month']),
'M' => map_month($value['month']),
'Y' => $value['year'],
- 'H:i' => null,
- 'g:ia' => null);
+ 'H:i' => NULL,
+ 'g:ia' => NULL);
return strtr($format, $replace);
case 'list':
$values = split("[,\n\r]", $value);
@@ -749,7 +749,7 @@ function profile_validate_profile($edit, $category) {
while ($field = db_fetch_object($result)) {
if ($edit[$field->name]) {
if ($field->type == 'url') {
- if (!valid_url($edit[$field->name], true)) {
+ if (!valid_url($edit[$field->name], TRUE)) {
form_set_error($field->name, t('The value provided for %field is not a valid URL.', array('%field' => theme('placeholder', $field->title))));
}
}
diff --git a/modules/search.module b/modules/search.module
index 4a81a8fdb..b94adfffa 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -187,7 +187,7 @@ function search_settings_form_validate($form_id, &$form) {
}
// If these settings change, the index needs to be rebuilt.
if ((variable_get('minimum_word_size', 3) != $form['minimum_word_size']) ||
- (variable_get('overlap_cjk', true) != $form['overlap_cjk'])) {
+ (variable_get('overlap_cjk', TRUE) != $form['overlap_cjk'])) {
drupal_set_message(t('The index will be rebuilt.'));
search_wipe();
}
@@ -223,7 +223,7 @@ function search_settings() {
$form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings'));
$form['indexing_settings']['info'] = array('#type' => 'markup', '#value' => '<em>'. t('<p>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</p><p>The default settings should be appropriate for the majority of sites.</p>') .'</em>');
$form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
- $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', true), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
+ $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
// Per module settings
$form = array_merge($form, module_invoke_all('search', 'admin'));
@@ -275,10 +275,10 @@ function search_wipe($sid = NULL, $type = NULL, $reindex = FALSE) {
* during indexing (cron). Words which are dirty have outdated total counts in
* the search_total table, and need to be recounted.
*/
-function search_dirty($word = null) {
+function search_dirty($word = NULL) {
static $dirty = array();
- if ($word !== null) {
- $dirty[$word] = true;
+ if ($word !== NULL) {
+ $dirty[$word] = TRUE;
}
else {
return $dirty;
@@ -341,7 +341,7 @@ function search_simplify($text) {
search_preprocess($text);
// Simple CJK handling
- if (variable_get('overlap_cjk', true)) {
+ if (variable_get('overlap_cjk', TRUE)) {
$text = preg_replace_callback('/['. PREG_CLASS_CJK .']+/u', 'search_expand_cjk', $text);
}
@@ -397,8 +397,8 @@ function search_expand_cjk($matches) {
* Splits a string into tokens for indexing.
*/
function search_index_split($text) {
- static $last = null;
- static $lastsplit = null;
+ static $last = NULL;
+ static $lastsplit = NULL;
if ($last == $text) {
return $lastsplit;
@@ -477,8 +477,8 @@ function search_index($sid, $type, $text) {
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting $null as required).
- $tag = false; // Odd/even counter. Tag or no tag.
- $link = false; // State variable for link analyser
+ $tag = FALSE; // Odd/even counter. Tag or no tag.
+ $link = FALSE; // State variable for link analyser
$score = 1; // Starting score per word
$accum = ' '; // Accumulator for cleaned up data
$tagstack = array(); // Stack with open tags
@@ -505,7 +505,7 @@ function search_index($sid, $type, $text) {
$score = max(1, $score - $tags[array_shift($tagstack)]);
}
if ($tagname == 'a') {
- $link = false;
+ $link = FALSE;
}
}
else {
@@ -530,7 +530,7 @@ function search_index($sid, $type, $text) {
// Note: ignore links to uncachable nodes to avoid redirect bugs.
$node = db_fetch_object(db_query('SELECT n.title, n.nid, n.vid, r.format FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE n.nid = %d', $linknid));
if (filter_format_allowcache($node->format)) {
- $link = true;
+ $link = TRUE;
$linktitle = $node->title;
}
}
@@ -647,13 +647,13 @@ function search_parse_query($text) {
}
// Classify tokens
- $or = false;
+ $or = FALSE;
foreach ($matches as $match) {
- $phrase = false;
+ $phrase = FALSE;
// Strip off phrase quotes
if ($match[2]{0} == '"') {
$match[2] = substr($match[2], 1, -1);
- $phrase = true;
+ $phrase = TRUE;
}
// Simplify keyword according to indexing rules and external preprocessors
$words = search_simplify($match[2]);
@@ -672,7 +672,7 @@ function search_parse_query($text) {
$last = array($last);
}
$keys['positive'][] = $last;
- $or = true;
+ $or = TRUE;
continue;
}
// Plain keyword
@@ -685,7 +685,7 @@ function search_parse_query($text) {
$keys['positive'] = array_merge($keys['positive'], $words);
}
}
- $or = false;
+ $or = FALSE;
}
// Convert keywords into SQL statements.
@@ -699,7 +699,7 @@ function search_parse_query($text) {
// Group of ORed terms
if (is_array($key) && count($key)) {
$queryor = array();
- $any = false;
+ $any = FALSE;
foreach ($key as $or) {
list($q, $count) = _search_parse_query($or, $arguments2);
$any |= $count;
@@ -727,7 +727,7 @@ function search_parse_query($text) {
}
// Negative matches
foreach ($keys['negative'] as $key) {
- list($q) = _search_parse_query($key, $arguments2, true);
+ list($q) = _search_parse_query($key, $arguments2, TRUE);
if ($q) {
$query[] = $q;
$arguments[] = $key;
@@ -744,7 +744,7 @@ function search_parse_query($text) {
/**
* Helper function for search_parse_query();
*/
-function _search_parse_query(&$word, &$scores, $not = false) {
+function _search_parse_query(&$word, &$scores, $not = FALSE) {
$count = 0;
// Determine the scorewords of this word/phrase
if (!$not) {
@@ -1134,9 +1134,9 @@ function search_excerpt($keys, $text) {
// $q) and behind it (position $s)
if (preg_match('/'. $boundary . $key . $boundary .'/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) {
$p = $match[0][1];
- if (($q = strpos($text, ' ', max(0, $p - 60))) !== false) {
+ if (($q = strpos($text, ' ', max(0, $p - 60))) !== FALSE) {
$end = substr($text, $p, 80);
- if (($s = strrpos($end, ' ')) !== false) {
+ if (($s = strrpos($end, ' ')) !== FALSE) {
$ranges[$q] = $p + $s;
$length += $p + $s - $q;
$included[$key] = $p + 1;
diff --git a/modules/search/search.module b/modules/search/search.module
index 4a81a8fdb..b94adfffa 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -187,7 +187,7 @@ function search_settings_form_validate($form_id, &$form) {
}
// If these settings change, the index needs to be rebuilt.
if ((variable_get('minimum_word_size', 3) != $form['minimum_word_size']) ||
- (variable_get('overlap_cjk', true) != $form['overlap_cjk'])) {
+ (variable_get('overlap_cjk', TRUE) != $form['overlap_cjk'])) {
drupal_set_message(t('The index will be rebuilt.'));
search_wipe();
}
@@ -223,7 +223,7 @@ function search_settings() {
$form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings'));
$form['indexing_settings']['info'] = array('#type' => 'markup', '#value' => '<em>'. t('<p>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</p><p>The default settings should be appropriate for the majority of sites.</p>') .'</em>');
$form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
- $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', true), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
+ $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
// Per module settings
$form = array_merge($form, module_invoke_all('search', 'admin'));
@@ -275,10 +275,10 @@ function search_wipe($sid = NULL, $type = NULL, $reindex = FALSE) {
* during indexing (cron). Words which are dirty have outdated total counts in
* the search_total table, and need to be recounted.
*/
-function search_dirty($word = null) {
+function search_dirty($word = NULL) {
static $dirty = array();
- if ($word !== null) {
- $dirty[$word] = true;
+ if ($word !== NULL) {
+ $dirty[$word] = TRUE;
}
else {
return $dirty;
@@ -341,7 +341,7 @@ function search_simplify($text) {
search_preprocess($text);
// Simple CJK handling
- if (variable_get('overlap_cjk', true)) {
+ if (variable_get('overlap_cjk', TRUE)) {
$text = preg_replace_callback('/['. PREG_CLASS_CJK .']+/u', 'search_expand_cjk', $text);
}
@@ -397,8 +397,8 @@ function search_expand_cjk($matches) {
* Splits a string into tokens for indexing.
*/
function search_index_split($text) {
- static $last = null;
- static $lastsplit = null;
+ static $last = NULL;
+ static $lastsplit = NULL;
if ($last == $text) {
return $lastsplit;
@@ -477,8 +477,8 @@ function search_index($sid, $type, $text) {
// Note: PHP ensures the array consists of alternating delimiters and literals
// and begins and ends with a literal (inserting $null as required).
- $tag = false; // Odd/even counter. Tag or no tag.
- $link = false; // State variable for link analyser
+ $tag = FALSE; // Odd/even counter. Tag or no tag.
+ $link = FALSE; // State variable for link analyser
$score = 1; // Starting score per word
$accum = ' '; // Accumulator for cleaned up data
$tagstack = array(); // Stack with open tags
@@ -505,7 +505,7 @@ function search_index($sid, $type, $text) {
$score = max(1, $score - $tags[array_shift($tagstack)]);
}
if ($tagname == 'a') {
- $link = false;
+ $link = FALSE;
}
}
else {
@@ -530,7 +530,7 @@ function search_index($sid, $type, $text) {
// Note: ignore links to uncachable nodes to avoid redirect bugs.
$node = db_fetch_object(db_query('SELECT n.title, n.nid, n.vid, r.format FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE n.nid = %d', $linknid));
if (filter_format_allowcache($node->format)) {
- $link = true;
+ $link = TRUE;
$linktitle = $node->title;
}
}
@@ -647,13 +647,13 @@ function search_parse_query($text) {
}
// Classify tokens
- $or = false;
+ $or = FALSE;
foreach ($matches as $match) {
- $phrase = false;
+ $phrase = FALSE;
// Strip off phrase quotes
if ($match[2]{0} == '"') {
$match[2] = substr($match[2], 1, -1);
- $phrase = true;
+ $phrase = TRUE;
}
// Simplify keyword according to indexing rules and external preprocessors
$words = search_simplify($match[2]);
@@ -672,7 +672,7 @@ function search_parse_query($text) {
$last = array($last);
}
$keys['positive'][] = $last;
- $or = true;
+ $or = TRUE;
continue;
}
// Plain keyword
@@ -685,7 +685,7 @@ function search_parse_query($text) {
$keys['positive'] = array_merge($keys['positive'], $words);
}
}
- $or = false;
+ $or = FALSE;
}
// Convert keywords into SQL statements.
@@ -699,7 +699,7 @@ function search_parse_query($text) {
// Group of ORed terms
if (is_array($key) && count($key)) {
$queryor = array();
- $any = false;
+ $any = FALSE;
foreach ($key as $or) {
list($q, $count) = _search_parse_query($or, $arguments2);
$any |= $count;
@@ -727,7 +727,7 @@ function search_parse_query($text) {
}
// Negative matches
foreach ($keys['negative'] as $key) {
- list($q) = _search_parse_query($key, $arguments2, true);
+ list($q) = _search_parse_query($key, $arguments2, TRUE);
if ($q) {
$query[] = $q;
$arguments[] = $key;
@@ -744,7 +744,7 @@ function search_parse_query($text) {
/**
* Helper function for search_parse_query();
*/
-function _search_parse_query(&$word, &$scores, $not = false) {
+function _search_parse_query(&$word, &$scores, $not = FALSE) {
$count = 0;
// Determine the scorewords of this word/phrase
if (!$not) {
@@ -1134,9 +1134,9 @@ function search_excerpt($keys, $text) {
// $q) and behind it (position $s)
if (preg_match('/'. $boundary . $key . $boundary .'/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) {
$p = $match[0][1];
- if (($q = strpos($text, ' ', max(0, $p - 60))) !== false) {
+ if (($q = strpos($text, ' ', max(0, $p - 60))) !== FALSE) {
$end = substr($text, $p, 80);
- if (($s = strrpos($end, ' ')) !== false) {
+ if (($s = strrpos($end, ' ')) !== FALSE) {
$ranges[$q] = $p + $s;
$length += $p + $s - $q;
$included[$key] = $p + 1;
diff --git a/modules/system.module b/modules/system.module
index 7a4c71588..b306b7e82 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -204,7 +204,7 @@ function system_theme_select_form($description = '', $default_value = '', $weigh
$info->key = $info->name == variable_get('theme_default', 'bluemarine') ? '' : $info->name;
$info->screenshot = dirname($info->filename) . '/screenshot.png';
- $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot');
+ $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form['themes'][$info->key]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot);
$form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'bluemarine') ? t('<br /> <em>(site default theme)</em>') : ''));
@@ -375,7 +375,7 @@ function system_view_general() {
// Image handling:
$toolkits_available = image_get_available_toolkits();
if (count($toolkits_available) > 1) {
- $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => true);
+ $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => TRUE);
$form['image']['image_toolkit'] = array(
'#type' => 'radios', '#title' => t('Select an image processing toolkit'),
'#default_value' => variable_get('image_toolkit', image_get_toolkit()), '#options' => $toolkits_available
@@ -814,7 +814,7 @@ function system_themes() {
foreach ($themes as $info) {
$info->screenshot = dirname($info->filename) . '/screenshot.png';
- $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot');
+ $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form[$info->name]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot);
$form[$info->name]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename));
@@ -1107,11 +1107,11 @@ function system_theme_settings($key = '') {
// Some features are not always available
$disabled = array();
if (!variable_get('user_pictures', 0)) {
- $disabled['toggle_node_user_picture'] = true;
- $disabled['toggle_comment_user_picture'] = true;
+ $disabled['toggle_node_user_picture'] = TRUE;
+ $disabled['toggle_comment_user_picture'] = TRUE;
}
if (!module_exist('search')) {
- $disabled['toggle_search'] = true;
+ $disabled['toggle_search'] = TRUE;
}
$form['theme_settings'] = array(
diff --git a/modules/system/system.module b/modules/system/system.module
index 7a4c71588..b306b7e82 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -204,7 +204,7 @@ function system_theme_select_form($description = '', $default_value = '', $weigh
$info->key = $info->name == variable_get('theme_default', 'bluemarine') ? '' : $info->name;
$info->screenshot = dirname($info->filename) . '/screenshot.png';
- $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot');
+ $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form['themes'][$info->key]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot);
$form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'bluemarine') ? t('<br /> <em>(site default theme)</em>') : ''));
@@ -375,7 +375,7 @@ function system_view_general() {
// Image handling:
$toolkits_available = image_get_available_toolkits();
if (count($toolkits_available) > 1) {
- $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => true);
+ $form['image'] = array('#type' => 'fieldset', '#title' => t('Image handling'), '#collapsible' => TRUE, '#collapsed' => TRUE);
$form['image']['image_toolkit'] = array(
'#type' => 'radios', '#title' => t('Select an image processing toolkit'),
'#default_value' => variable_get('image_toolkit', image_get_toolkit()), '#options' => $toolkits_available
@@ -814,7 +814,7 @@ function system_themes() {
foreach ($themes as $info) {
$info->screenshot = dirname($info->filename) . '/screenshot.png';
- $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot');
+ $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form[$info->name]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot);
$form[$info->name]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename));
@@ -1107,11 +1107,11 @@ function system_theme_settings($key = '') {
// Some features are not always available
$disabled = array();
if (!variable_get('user_pictures', 0)) {
- $disabled['toggle_node_user_picture'] = true;
- $disabled['toggle_comment_user_picture'] = true;
+ $disabled['toggle_node_user_picture'] = TRUE;
+ $disabled['toggle_comment_user_picture'] = TRUE;
}
if (!module_exist('search')) {
- $disabled['toggle_search'] = true;
+ $disabled['toggle_search'] = TRUE;
}
$form['theme_settings'] = array(
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 23349c322..4e17af388 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -959,7 +959,7 @@ function taxonomy_term_count_nodes($tid, $type = 0) {
static $count;
if (!isset($count[$type])) {
- // $type == 0 always evaluates true is $type is a string
+ // $type == 0 always evaluates TRUE is $type is a string
if (is_numeric($type)) {
$result = db_query(db_rewrite_sql('SELECT t.tid, COUNT(n.nid) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 GROUP BY t.tid'));
}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 23349c322..4e17af388 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -959,7 +959,7 @@ function taxonomy_term_count_nodes($tid, $type = 0) {
static $count;
if (!isset($count[$type])) {
- // $type == 0 always evaluates true is $type is a string
+ // $type == 0 always evaluates TRUE is $type is a string
if (is_numeric($type)) {
$result = db_query(db_rewrite_sql('SELECT t.tid, COUNT(n.nid) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 GROUP BY t.tid'));
}
diff --git a/modules/upload.module b/modules/upload.module
index 78c1c47b9..fa1c6482e 100644
--- a/modules/upload.module
+++ b/modules/upload.module
@@ -86,7 +86,7 @@ function upload_menu($may_cache) {
$filename = file_create_filename($file->filename, file_create_path());
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
// strip file_directory_path() from filename. @see file_create_url
- if (strpos($filename, file_directory_path()) !== false) {
+ if (strpos($filename, file_directory_path()) !== FALSE) {
$filename = trim(substr($filename, strlen(file_directory_path())), '\\/');
}
$filename = 'system/files/' . $filename;
@@ -334,7 +334,7 @@ function _upload_validate(&$node) {
$file = (object)$file;
// Validate new uploads.
- if (strpos($fid, 'upload') !== false && !$file->remove) {
+ if (strpos($fid, 'upload') !== FALSE && !$file->remove) {
global $user;
// Bypass validation for uid = 1.
@@ -424,7 +424,7 @@ function upload_nodeapi(&$node, $op, $teaser) {
if (!variable_get('clean_url', 0)) {
$previews = array();
foreach ($node->files as $file) {
- if (strpos($file->fid, 'upload') !== false) {
+ if (strpos($file->fid, 'upload') !== FALSE) {
$previews[] = $file;
}
}
@@ -465,7 +465,7 @@ function upload_nodeapi(&$node, $op, $teaser) {
break;
case 'search result':
- return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : null;
+ return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : NULL;
case 'rss item':
if (is_array($node->files)) {
@@ -607,7 +607,7 @@ function upload_save($node) {
// will be required.
if ($file->remove) {
// Remove file previews...
- if (strpos($file->fid, 'upload') !== false) {
+ if (strpos($file->fid, 'upload') !== FALSE) {
file_delete($file->filepath);
}
@@ -624,7 +624,7 @@ function upload_save($node) {
}
// New file upload
- elseif (strpos($file->fid, 'upload') !== false) {
+ elseif (strpos($file->fid, 'upload') !== FALSE) {
if ($file = file_save_upload($file, $file->filename)) {
$file->fid = db_next_id('{files}_fid');
db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
@@ -688,7 +688,7 @@ function _upload_form($node) {
$form['files']['#theme'] = 'upload_form_current';
$form['files']['#tree'] = TRUE;
foreach ($node->files as $key => $file) {
- $description = file_create_url((strpos($file->fid, 'upload') === false ? $file->filepath : file_create_filename($file->filename, file_create_path())));
+ $description = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path())));
$description = "<small>". check_plain($description) ."</small>";
$form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description );
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 78c1c47b9..fa1c6482e 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -86,7 +86,7 @@ function upload_menu($may_cache) {
$filename = file_create_filename($file->filename, file_create_path());
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
// strip file_directory_path() from filename. @see file_create_url
- if (strpos($filename, file_directory_path()) !== false) {
+ if (strpos($filename, file_directory_path()) !== FALSE) {
$filename = trim(substr($filename, strlen(file_directory_path())), '\\/');
}
$filename = 'system/files/' . $filename;
@@ -334,7 +334,7 @@ function _upload_validate(&$node) {
$file = (object)$file;
// Validate new uploads.
- if (strpos($fid, 'upload') !== false && !$file->remove) {
+ if (strpos($fid, 'upload') !== FALSE && !$file->remove) {
global $user;
// Bypass validation for uid = 1.
@@ -424,7 +424,7 @@ function upload_nodeapi(&$node, $op, $teaser) {
if (!variable_get('clean_url', 0)) {
$previews = array();
foreach ($node->files as $file) {
- if (strpos($file->fid, 'upload') !== false) {
+ if (strpos($file->fid, 'upload') !== FALSE) {
$previews[] = $file;
}
}
@@ -465,7 +465,7 @@ function upload_nodeapi(&$node, $op, $teaser) {
break;
case 'search result':
- return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : null;
+ return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : NULL;
case 'rss item':
if (is_array($node->files)) {
@@ -607,7 +607,7 @@ function upload_save($node) {
// will be required.
if ($file->remove) {
// Remove file previews...
- if (strpos($file->fid, 'upload') !== false) {
+ if (strpos($file->fid, 'upload') !== FALSE) {
file_delete($file->filepath);
}
@@ -624,7 +624,7 @@ function upload_save($node) {
}
// New file upload
- elseif (strpos($file->fid, 'upload') !== false) {
+ elseif (strpos($file->fid, 'upload') !== FALSE) {
if ($file = file_save_upload($file, $file->filename)) {
$file->fid = db_next_id('{files}_fid');
db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
@@ -688,7 +688,7 @@ function _upload_form($node) {
$form['files']['#theme'] = 'upload_form_current';
$form['files']['#tree'] = TRUE;
foreach ($node->files as $key => $file) {
- $description = file_create_url((strpos($file->fid, 'upload') === false ? $file->filepath : file_create_filename($file->filename, file_create_path())));
+ $description = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path())));
$description = "<small>". check_plain($description) ."</small>";
$form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => (strlen($file->description)) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description );
diff --git a/modules/user.module b/modules/user.module
index 02ee1bc66..d53bf74aa 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -96,7 +96,7 @@ function user_load($array = array()) {
*
* @param $array
* An array of fields and values to save. For example array('name' => 'My name');
- * Setting a field to null deletes it from the data column.
+ * Setting a field to NULL deletes it from the data column.
*
* @param $category
* (optional) The category for storing profile information in.
@@ -121,7 +121,7 @@ function user_save($account, $array = array(), $category = 'account') {
}
else if ($key != 'roles') {
// Roles is a special case: it used below.
- if ($value === null) {
+ if ($value === NULL) {
unset($data[$key]);
}
else {
@@ -198,7 +198,7 @@ function user_save($account, $array = array(), $category = 'account') {
// Build and save the serialized data field now
$data = array();
foreach ($array as $key => $value) {
- if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== null)) {
+ if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== NULL)) {
$data[$key] = $value;
}
}
@@ -372,7 +372,7 @@ function user_access($string, $account = NULL) {
/**
* Checks for usernames blocked by user administration
*
- * @return boolean true for blocked users, false for active
+ * @return boolean TRUE for blocked users, FALSE for active
*/
function user_is_blocked($name) {
$allow = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 1 AND name = LOWER('%s')", $name));
@@ -458,7 +458,7 @@ function user_file_download($file) {
/**
* Implementation of hook_search().
*/
-function user_search($op = 'search', $keys = null) {
+function user_search($op = 'search', $keys = NULL) {
switch ($op) {
case 'name':
if (user_access('access user profiles')) {
@@ -637,7 +637,7 @@ function theme_user_picture($account) {
if (isset($picture)) {
$alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous')));
- $picture = theme('image', $picture, $alt, $alt, '', false);
+ $picture = theme('image', $picture, $alt, $alt, '', FALSE);
if (!empty($account->uid) && user_access('access user profiles')) {
$picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
}
diff --git a/modules/user/user.module b/modules/user/user.module
index 02ee1bc66..d53bf74aa 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -96,7 +96,7 @@ function user_load($array = array()) {
*
* @param $array
* An array of fields and values to save. For example array('name' => 'My name');
- * Setting a field to null deletes it from the data column.
+ * Setting a field to NULL deletes it from the data column.
*
* @param $category
* (optional) The category for storing profile information in.
@@ -121,7 +121,7 @@ function user_save($account, $array = array(), $category = 'account') {
}
else if ($key != 'roles') {
// Roles is a special case: it used below.
- if ($value === null) {
+ if ($value === NULL) {
unset($data[$key]);
}
else {
@@ -198,7 +198,7 @@ function user_save($account, $array = array(), $category = 'account') {
// Build and save the serialized data field now
$data = array();
foreach ($array as $key => $value) {
- if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== null)) {
+ if ((substr($key, 0, 4) !== 'auth') && ($key != 'roles') && (!in_array($key, $user_fields)) && ($value !== NULL)) {
$data[$key] = $value;
}
}
@@ -372,7 +372,7 @@ function user_access($string, $account = NULL) {
/**
* Checks for usernames blocked by user administration
*
- * @return boolean true for blocked users, false for active
+ * @return boolean TRUE for blocked users, FALSE for active
*/
function user_is_blocked($name) {
$allow = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 1 AND name = LOWER('%s')", $name));
@@ -458,7 +458,7 @@ function user_file_download($file) {
/**
* Implementation of hook_search().
*/
-function user_search($op = 'search', $keys = null) {
+function user_search($op = 'search', $keys = NULL) {
switch ($op) {
case 'name':
if (user_access('access user profiles')) {
@@ -637,7 +637,7 @@ function theme_user_picture($account) {
if (isset($picture)) {
$alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous')));
- $picture = theme('image', $picture, $alt, $alt, '', false);
+ $picture = theme('image', $picture, $alt, $alt, '', FALSE);
if (!empty($account->uid) && user_access('access user profiles')) {
$picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
}