diff --git a/core/includes/form.inc b/core/includes/form.inc index 42206a4..161ca32 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -463,7 +463,7 @@ function form_state_values_clean(&$form_state) { // the value corresponding to this button. // We iterate over the #parents of this button and move a reference to // each parent in $form_state['values']. For example, if #parents is: - // array('foo', 'bar', 'baz') + // array('foo', 'bar', 'baz') // then the corresponding $form_state['values'] part will look like this: // array( // 'foo' => array( @@ -518,7 +518,7 @@ function form_type_image_button_value($form, $input, $form_state) { // in the same spot for its name, with '_x'. $input = $form_state['input']; foreach (explode('[', $form['#name']) as $element_name) { - // chop off the ] that may exist. + // Chop off the ] that may exist. if (substr($element_name, -1) == ']') { $element_name = substr($element_name, 0, -1); } @@ -539,7 +539,7 @@ function form_type_image_button_value($form, $input, $form_state) { /** * Determines the value for a checkbox form element. * - * @param $form + * @param $element * The form element whose value is being populated. * @param $input * The incoming input to populate the form element. If this is FALSE, @@ -970,8 +970,8 @@ function form_select_options($element, $choices = NULL) { } $choices = $element['#options']; } - // array_key_exists() accommodates the rare event where $element['#value'] is NULL. - // isset() fails in this situation. + // array_key_exists() accommodates the rare event where $element['#value'] is + // NULL, isset() fails in this situation. $value_valid = isset($element['#value']) || array_key_exists('#value', $element); $value_is_array = $value_valid && is_array($element['#value']); // Check if the element is multiple select and no value has been selected. @@ -1183,14 +1183,14 @@ function template_preprocess_radios(&$variables) { * Expand a password_confirm field into two text boxes. */ function form_process_password_confirm($element) { - $element['pass1'] = array( + $element['pass1'] = array( '#type' => 'password', '#title' => t('Password'), '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'], '#required' => $element['#required'], '#attributes' => array('class' => array('password-field')), ); - $element['pass2'] = array( + $element['pass2'] = array( '#type' => 'password', '#title' => t('Confirm password'), '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'], @@ -1478,7 +1478,7 @@ function form_process_actions($element, &$form_state) { } /** - * #pre_render callback for #type 'actions'. + * The #pre_render callback for #type 'actions'. * * This callback iterates over all child elements of the #type 'actions' * container to look for elements with a #dropbutton property, so as to group @@ -1524,7 +1524,7 @@ function form_pre_render_actions_dropbutton(array $element) { } /** - * #process callback for #pattern form element property. + * The #process callback for #pattern form element property. * * @param $element * An associative array containing the properties and children of the @@ -1547,7 +1547,7 @@ function form_process_pattern($element, &$form_state) { } /** - * #element_validate callback for #pattern form element property. + * The #element_validate callback for #pattern form element property. * * @param $element * An associative array containing the properties and children of the @@ -1775,7 +1775,7 @@ function form_process_tableselect($element) { } /** - * #process callback for #type 'table' to add tableselect support. + * The #process callback for #type 'table' to add tableselect support. * * @param array $element * An associative array containing the properties and children of the @@ -1868,7 +1868,7 @@ function form_process_table($element, &$form_state) { '#type' => $element['#multiple'] ? 'checkbox' : 'radio', '#id' => drupal_html_id('edit-' . implode('-', $element_parents)), // @todo If rows happen to use numeric indexes instead of string keys, - // this results in a first row with $key === 0, which is always FALSE. + // this results in a first row with $key === 0, which is always FALSE. '#return_value' => $key, '#attributes' => $element['#attributes'], '#wrapper_attributes' => array( @@ -1901,7 +1901,7 @@ function form_process_table($element, &$form_state) { } /** - * #element_validate callback for #type 'table'. + * The #element_validate callback for #type 'table'. * * @param array $element * An associative array containing the properties and children of the @@ -2291,6 +2291,7 @@ function template_preprocess_vertical_tabs(&$variables) { * '#autocomplete_route_name' => 'mymodule.autocomplete', * '#autocomplete_route_parameters' => array('a' => $some_key, 'b' => $some_id), * @endcode + * * The user types in "keywords" so the full path called is: * 'mymodule_autocomplete/$some_key/$some_id?q=keywords' * @@ -3018,7 +3019,7 @@ function theme_form_element_label($variables) { * * @param $element * The form element. - * @param $name + * @param $class * Array of new class names to be added. */ function _form_set_attributes(&$element, $class = array()) { @@ -3288,7 +3289,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU drupal_theme_initialize(); if (isset($batch)) { - // Add process information + // Add process information. $process_info = array( 'current_set' => 0, 'progressive' => TRUE, @@ -3320,7 +3321,19 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU if ($batch['progressive']) { // Now that we have a batch id, we can generate the redirection link in // the generic error message. - $batch['error_message'] = t('Please continue to the error page', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished'))))); + $batch['error_message'] = t('Please continue to the error page', + array( + '@error_url' => url( + $url, + array( + 'query' => array( + 'id' => $batch['id'], + 'op' => 'finished', + ) + ) + ) + ) + ); // Clear the way for the redirection to the batch processing page, by // saving and unsetting the 'destination', if there is any. @@ -3333,7 +3346,8 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU // Store the batch. \Drupal::service('batch.storage')->create($batch); - // Set the batch number in the session to guarantee that it will stay alive. + // Set the batch number in the session to guarantee that it will stay + // alive. $_SESSION['batches'][$batch['id']] = TRUE; // Redirect for processing.