Commit 0e0ca3b5 authored by Dries's avatar Dries

- Patch #457532 by Berdir: more PHP5 'fixes'.

parent 557128c9
......@@ -2388,7 +2388,7 @@ function form_process_vertical_tabs($element, &$form_state) {
* An associative array containing the properties and children of the
* fieldset.
*/
function theme_vertical_tabs(&$element) {
function theme_vertical_tabs($element) {
// Add required JavaScript and Stylesheet.
drupal_add_js('misc/vertical-tabs.js', array('weight' => JS_DEFAULT - 1));
drupal_add_css('misc/vertical-tabs.css');
......
......@@ -870,7 +870,7 @@ function blogapi_rsd() {
/**
* Handles extra information sent by clients according to MovableType's spec.
*/
function _blogapi_mt_extra(&$node, $struct) {
function _blogapi_mt_extra($node, $struct) {
if (is_array($node)) {
$was_array = TRUE;
$node = (object)$node;
......
......@@ -490,7 +490,7 @@ function _book_add_form_elements(&$form, $node) {
* Performs all additions and updates to the book outline through node addition,
* node editing, node deletion, or the outline tab.
*/
function _book_update_outline(&$node) {
function _book_update_outline($node) {
if (empty($node->book['bid'])) {
return FALSE;
}
......
......@@ -661,7 +661,7 @@ function _field_attach_preprocess($obj_type, &$object) {
*
* TODO D7: We do not yet know if this really belongs in Field API.
*/
function _field_attach_prepare_translation(&$node) {
function _field_attach_prepare_translation($node) {
// Prevent against invalid 'nodes' built by broken 3rd party code.
if (isset($node->type)) {
$type = content_types($node->type);
......
......@@ -297,7 +297,7 @@ function field_attach_preprocess($obj_type, &$object) {
*
* This function is an autoloader for _field_attach_prepare_translation() in modules/field/field.attach.inc.
*/
function field_attach_prepare_translation(&$node) {
function field_attach_prepare_translation($node) {
require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
return _field_attach_prepare_translation($node);
}
......
......@@ -538,7 +538,7 @@ function forum_block_view($delta = '') {
/**
* Implementation of hook_form().
*/
function forum_form(&$node, $form_state) {
function forum_form($node, $form_state) {
$type = node_get_types('type', $node);
$form['title'] = array('#type' => 'textfield', '#title' => check_plain($type->title_label), '#default_value' => !empty($node->title) ? $node->title : '', '#required' => TRUE, '#weight' => -5);
......
......@@ -294,7 +294,7 @@ function menu_block_view($delta = '') {
/**
* Implementation of hook_node_insert().
*/
function menu_node_insert(&$node) {
function menu_node_insert($node) {
if (isset($node->menu)) {
$item = &$node->menu;
if (!empty($item['delete'])) {
......@@ -316,7 +316,7 @@ function menu_node_insert(&$node) {
/**
* Implementation of hook_node_update().
*/
function menu_node_update(&$node) {
function menu_node_update($node) {
if (isset($node->menu)) {
$item = &$node->menu;
if (!empty($item['delete'])) {
......@@ -338,7 +338,7 @@ function menu_node_update(&$node) {
/**
* Implementation of hook_node_delete().
*/
function menu_node_delete(&$node) {
function menu_node_delete($node) {
// Delete all menu module links that point to this node.
$result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/'. $node->nid), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $m) {
......@@ -349,7 +349,7 @@ function menu_node_delete(&$node) {
/**
* Implementation of hook_node_prepare().
*/
function menu_node_prepare(&$node) {
function menu_node_prepare($node) {
if (empty($node->menu)) {
// Prepare the node for the edit form so that $node->menu always exists.
$menu_name = variable_get('menu_default_node_menu', 'main-menu');
......
......@@ -551,7 +551,7 @@ function hook_access($op, $node, $account) {
* to take action when a node is being deleted from the database by, for
* example, deleting information from related tables.
*
* @param &$node
* @param $node
* The node being deleted.
* @return
* None.
......@@ -561,7 +561,7 @@ function hook_access($op, $node, $account) {
*
* For a detailed usage example, see node_example.module.
*/
function hook_delete(&$node) {
function hook_delete($node) {
db_delete('mytable')
->condition('nid', $nid->nid)
->execute();
......@@ -571,14 +571,14 @@ function hook_delete(&$node) {
* This is a hook used by node modules. It is called after load but before the
* node is shown on the add/edit form.
*
* @param &$node
* @param $node
* The node being saved.
* @return
* None.
*
* For a usage example, see image.module.
*/
function hook_prepare(&$node) {
function hook_prepare($node) {
if ($file = file_check_upload($field_name)) {
$file = file_save_upload($field_name, _image_filename($file->filename, NULL, TRUE));
if ($file) {
......@@ -603,7 +603,7 @@ function hook_prepare(&$node) {
* that is displayed when one attempts to "create/edit" an item. This form is
* displayed at the URI http://www.example.com/?q=node/<add|edit>/nodetype.
*
* @param &$node
* @param $node
* The node being added or edited.
* @param $form_state
* The form state array. Changes made to this variable will have no effect.
......@@ -618,7 +618,7 @@ function hook_prepare(&$node) {
*
* For a detailed usage example, see node_example.module.
*/
function hook_form(&$node, $form_state) {
function hook_form($node, $form_state) {
$type = node_get_types('type', $node);
$form['title'] = array(
......
......@@ -738,14 +738,14 @@ function node_type_set_defaults($info = array()) {
/**
* Determine whether a node hook exists.
*
* @param &$node
* @param $node
* Either a node object, node array, or a string containing the node type.
* @param $hook
* A string containing the name of the hook.
* @return
* TRUE iff the $hook exists in the node type of $node.
*/
function node_hook(&$node, $hook) {
function node_hook($node, $hook) {
$base = node_get_types('base', $node);
return module_hook($base, $hook);
}
......@@ -753,7 +753,7 @@ function node_hook(&$node, $hook) {
/**
* Invoke a node hook.
*
* @param &$node
* @param $node
* Either a node object, node array, or a string containing the node type.
* @param $hook
* A string containing the name of the hook.
......@@ -762,7 +762,7 @@ function node_hook(&$node, $hook) {
* @return
* The returned value of the invoked hook.
*/
function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
if (node_hook($node, $hook)) {
$base = node_get_types('base', $node);
$function = $base . '_' . $hook;
......@@ -1040,7 +1040,7 @@ function node_submit($node) {
* The $node object to be saved. If $node->nid is
* omitted (or $node->is_new is TRUE), a new node will be added.
*/
function node_save(&$node) {
function node_save($node) {
field_attach_presave('node', $node);
// Let modules modify the node before it is saved to the database.
module_invoke_all('node_presave', $node);
......@@ -1146,7 +1146,7 @@ function node_save(&$node) {
* Node is taken by reference, because drupal_write_record() updates the
* $node with the revision id, and we need to pass that back to the caller.
*/
function _node_save_revision(&$node, $uid, $update = NULL) {
function _node_save_revision($node, $uid, $update = NULL) {
$temp_uid = $node->uid;
$node->uid = $uid;
if (isset($update)) {
......@@ -2984,7 +2984,7 @@ function node_action_info() {
* Implementation of a Drupal action.
* Sets the status of a node to 1, meaning published.
*/
function node_publish_action(&$node, $context = array()) {
function node_publish_action($node, $context = array()) {
$node->status = 1;
watchdog('action', 'Set @type %title to published.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
......@@ -2993,7 +2993,7 @@ function node_publish_action(&$node, $context = array()) {
* Implementation of a Drupal action.
* Sets the status of a node to 0, meaning unpublished.
*/
function node_unpublish_action(&$node, $context = array()) {
function node_unpublish_action($node, $context = array()) {
$node->status = 0;
watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
......@@ -3002,7 +3002,7 @@ function node_unpublish_action(&$node, $context = array()) {
* Implementation of a Drupal action.
* Sets the sticky-at-top-of-list property of a node to 1.
*/
function node_make_sticky_action(&$node, $context = array()) {
function node_make_sticky_action($node, $context = array()) {
$node->sticky = 1;
watchdog('action', 'Set @type %title to sticky.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
......@@ -3011,7 +3011,7 @@ function node_make_sticky_action(&$node, $context = array()) {
* Implementation of a Drupal action.
* Sets the sticky-at-top-of-list property of a node to 0.
*/
function node_make_unsticky_action(&$node, $context = array()) {
function node_make_unsticky_action($node, $context = array()) {
$node->sticky = 0;
watchdog('action', 'Set @type %title to unsticky.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
......@@ -3020,7 +3020,7 @@ function node_make_unsticky_action(&$node, $context = array()) {
* Implementation of a Drupal action.
* Sets the promote property of a node to 1.
*/
function node_promote_action(&$node, $context = array()) {
function node_promote_action($node, $context = array()) {
$node->promote = 1;
watchdog('action', 'Promoted @type %title to front page.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
......@@ -3029,7 +3029,7 @@ function node_promote_action(&$node, $context = array()) {
* Implementation of a Drupal action.
* Sets the promote property of a node to 0.
*/
function node_unpromote_action(&$node, $context = array()) {
function node_unpromote_action($node, $context = array()) {
$node->promote = 0;
watchdog('action', 'Removed @type %title from front page.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
......@@ -3047,7 +3047,7 @@ function node_save_action($node) {
* Implementation of a configurable Drupal action.
* Assigns ownership of a node to a user.
*/
function node_assign_owner_action(&$node, $context) {
function node_assign_owner_action($node, $context) {
$node->uid = $context['owner_uid'];
$owner_name = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $context['owner_uid']))->fetchField();
watchdog('action', 'Changed owner of @type %title to uid %name.', array('@type' => node_get_types('type', $node), '%title' => $node->title, '%name' => $owner_name));
......
......@@ -77,7 +77,7 @@ function node_form_validate($form, &$form_state) {
field_attach_form_validate('node', $node, $form, $form_state);
}
function node_object_prepare(&$node) {
function node_object_prepare($node) {
// Set up default values, if required.
$node_options = variable_get('node_options_' . $node->type, array('status', 'promote'));
// If this is a new node, fill in the default values.
......@@ -288,7 +288,7 @@ function node_form(&$form_state, $node) {
/**
* Return a node body field, with format and teaser.
*/
function node_body_field(&$node, $label, $word_count) {
function node_body_field($node, $label, $word_count) {
// Check if we need to restore the teaser at the beginning of the body.
$include = !isset($node->teaser) || ($node->teaser == substr($node->body, 0, strlen($node->teaser)));
......
......@@ -201,7 +201,7 @@ function poll_node_info() {
/**
* Implementation of hook_form().
*/
function poll_form(&$node, $form_state) {
function poll_form($node, $form_state) {
global $user;
$admin = user_access('administer nodes') || user_access('edit any poll content') || (user_access('edit own poll content') && $user->uid == $node->uid);
......@@ -694,7 +694,7 @@ function template_preprocess_poll_vote(&$variables) {
/**
* Generates a graphical representation of the results of a poll.
*/
function poll_view_results(&$node, $teaser, $block) {
function poll_view_results($node, $teaser, $block) {
// Count the votes and find the maximum
$total_votes = 0;
$max_votes = 0;
......
......@@ -167,7 +167,7 @@ function translation_form_alter(&$form, &$form_state, $form_id) {
* Display translation links with native language names, if this node
* is part of a translation set.
*/
function translation_node_view(&$node, $teaser = FALSE) {
function translation_node_view($node, $teaser = FALSE) {
if (isset($node->tnid) && $translations = translation_node_get_translations($node->tnid)) {
// Do not show link to the same node.
unset($translations[$node->language]);
......
......@@ -475,7 +475,7 @@ function upload_total_space_used() {
return db_query('SELECT SUM(f.filesize) FROM {files} f INNER JOIN {upload} u ON f.fid = u.fid')->fetchField();
}
function upload_save(&$node) {
function upload_save($node) {
if (empty($node->files) || !is_array($node->files)) {
return;
}
......
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