summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-11-27 13:31:04 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-11-27 13:31:04 +0000
commit172a35faf4492bf01543b7d09c25ab8754079a1d (patch)
tree8c4e069b8cad0758436dbe7b0b99f059167f53dc /modules/node
parent1f299b52e0571d01cd9b15ae53ec60ca099c18fa (diff)
downloadbrdo-172a35faf4492bf01543b7d09c25ab8754079a1d.tar.gz
brdo-172a35faf4492bf01543b7d09c25ab8754079a1d.tar.bz2
#184968 spin off coding style fixes to let the substance of the patch get reviewed
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module18
-rw-r--r--modules/node/node.pages.inc65
2 files changed, 67 insertions, 16 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index e7eaf458d..4433a1084 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1077,9 +1077,14 @@ function node_search($op = 'search', $keys = NULL) {
case 'admin':
$form = array();
// Output form for defining rank factor weights.
- $form['content_ranking'] = array('#type' => 'fieldset', '#title' => t('Content ranking'));
+ $form['content_ranking'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Content ranking'),
+ );
$form['content_ranking']['#theme'] = 'node_search_admin';
- $form['content_ranking']['info'] = array('#value' => '<em>'. t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') .'</em>');
+ $form['content_ranking']['info'] = array(
+ '#value' => '<em>'. t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') .'</em>'
+ );
$ranking = array('node_rank_relevance' => t('Keyword relevance'),
'node_rank_recent' => t('Recently posted'));
@@ -1093,7 +1098,12 @@ function node_search($op = 'search', $keys = NULL) {
// Note: reversed to reflect that higher number = higher ranking.
$options = drupal_map_assoc(range(0, 10));
foreach ($ranking as $var => $title) {
- $form['content_ranking']['factors'][$var] = array('#title' => $title, '#type' => 'select', '#options' => $options, '#default_value' => variable_get($var, 5));
+ $form['content_ranking']['factors'][$var] = array(
+ '#title' => $title,
+ '#type' => 'select',
+ '#options' => $options,
+ '#default_value' => variable_get($var, 5),
+ );
}
return $form;
@@ -2592,7 +2602,7 @@ function node_mass_update($nodes, $updates) {
batch_set($batch);
}
else {
- foreach($nodes as $nid) {
+ foreach ($nodes as $nid) {
_node_mass_update_helper($nid, $updates);
}
drupal_set_message(t('The update has been performed.'));
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 809f14555..7fee7e481 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -115,11 +115,17 @@ function node_form(&$form_state, $node) {
* These elements are just values so they are not even sent to the client.
*/
foreach (array('nid', 'vid', 'uid', 'created', 'type', 'language') as $key) {
- $form[$key] = array('#type' => 'value', '#value' => isset($node->$key) ? $node->$key : NULL);
+ $form[$key] = array(
+ '#type' => 'value',
+ '#value' => isset($node->$key) ? $node->$key : NULL,
+ );
}
// Changed must be sent to the client, for later overwrite error checking.
- $form['changed'] = array('#type' => 'hidden', '#default_value' => isset($node->changed) ? $node->changed : NULL);
+ $form['changed'] = array(
+ '#type' => 'hidden',
+ '#default_value' => isset($node->changed) ? $node->changed : NULL,
+ );
// Get the node-specific bits.
if ($extra = node_invoke($node, 'form', $form_state)) {
$form = array_merge_recursive($form, $extra);
@@ -164,8 +170,21 @@ function node_form(&$form_state, $node) {
'#collapsed' => TRUE,
'#weight' => 20,
);
- $form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#default_value' => $node->name ? $node->name : '', '#weight' => -1, '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))));
- $form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, '#description' => t('Format: %time. Leave blank to use the time of form submission.', array('%time' => !empty($node->date) ? $node->date : format_date($node->created, 'custom', 'Y-m-d H:i:s O'))));
+ $form['author']['name'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Authored by'),
+ '#maxlength' => 60,
+ '#autocomplete_path' => 'user/autocomplete',
+ '#default_value' => $node->name ? $node->name : '',
+ '#weight' => -1,
+ '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
+ );
+ $form['author']['date'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Authored on'),
+ '#maxlength' => 25,
+ '#description' => t('Format: %time. Leave blank to use the time of form submission.', array('%time' => !empty($node->date) ? $node->date : format_date($node->created, 'custom', 'Y-m-d H:i:s O'))),
+ );
if (isset($node->date)) {
$form['author']['date']['#default_value'] = $node->date;
@@ -180,13 +199,28 @@ function node_form(&$form_state, $node) {
'#collapsed' => TRUE,
'#weight' => 25,
);
- $form['options']['status'] = array('#type' => 'checkbox', '#title' => t('Published'), '#default_value' => $node->status);
- $form['options']['promote'] = array('#type' => 'checkbox', '#title' => t('Promoted to front page'), '#default_value' => $node->promote);
- $form['options']['sticky'] = array('#type' => 'checkbox', '#title' => t('Sticky at top of lists'), '#default_value' => $node->sticky);
+ $form['options']['status'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Published'),
+ '#default_value' => $node->status,
+ );
+ $form['options']['promote'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Promoted to front page'),
+ '#default_value' => $node->promote,
+ );
+ $form['options']['sticky'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Sticky at top of lists'),
+ '#default_value' => $node->sticky,
+ );
// These values are used when the user has no administrator access.
foreach (array('uid', 'created') as $key) {
- $form[$key] = array('#type' => 'value', '#value' => $node->$key);
+ $form[$key] = array(
+ '#type' => 'value',
+ '#value' => $node->$key,
+ );
}
// Add the buttons.
@@ -232,7 +266,8 @@ function node_body_field(&$node, $label, $word_count) {
'#rows' => 10,
'#teaser' => 'edit-body',
'#teaser_checkbox' => 'edit-teaser-include',
- '#disabled' => TRUE);
+ '#disabled' => TRUE,
+ );
$form['teaser_include'] = array(
'#type' => 'checkbox',
@@ -247,7 +282,8 @@ function node_body_field(&$node, $label, $word_count) {
'#title' => check_plain($label),
'#default_value' => $include ? $node->body : ($node->teaser . $node->body),
'#rows' => 20,
- '#required' => ($word_count > 0));
+ '#required' => ($word_count > 0),
+ );
$form['format'] = filter_form($node->format);
@@ -428,13 +464,18 @@ function node_form_submit_build_node($form, &$form_state) {
* Menu callback -- ask for confirmation of node deletion
*/
function node_delete_confirm(&$form_state, $node) {
- $form['nid'] = array('#type' => 'value', '#value' => $node->nid);
+ $form['nid'] = array(
+ '#type' => 'value',
+ '#value' => $node->nid,
+ );
return confirm_form($form,
t('Are you sure you want to delete %title?', array('%title' => $node->title)),
isset($_GET['destination']) ? $_GET['destination'] : 'node/'. $node->nid,
t('This action cannot be undone.'),
- t('Delete'), t('Cancel'));
+ t('Delete'),
+ t('Cancel')
+ );
}
/**