Commit 1efed550 authored by webchick's avatar webchick

Issue #2123843 by damiankloip: Camelize views form methods.

parent 980fa7ed
...@@ -34,7 +34,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi ...@@ -34,7 +34,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function views_form_validate(&$form, &$form_state) { public function viewsFormValidate(&$form, &$form_state) {
$selected = array_filter($form_state['values'][$this->options['id']]); $selected = array_filter($form_state['values'][$this->options['id']]);
if (empty($selected)) { if (empty($selected)) {
form_set_error('', $form_state, t('No items selected.')); form_set_error('', $form_state, t('No items selected.'));
...@@ -44,8 +44,8 @@ public function views_form_validate(&$form, &$form_state) { ...@@ -44,8 +44,8 @@ public function views_form_validate(&$form, &$form_state) {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function views_form_submit(&$form, &$form_state) { public function viewsFormSubmit(&$form, &$form_state) {
parent::views_form_submit($form, $form_state); parent::viewsFormSubmit($form, $form_state);
if ($form_state['step'] == 'views_form_views_form') { if ($form_state['step'] == 'views_form_views_form') {
Cache::invalidateTags(array('content' => TRUE)); Cache::invalidateTags(array('content' => TRUE));
} }
......
...@@ -105,7 +105,7 @@ public function preRender(&$values) { ...@@ -105,7 +105,7 @@ public function preRender(&$values) {
* @param array $form_state * @param array $form_state
* An associative array containing the current state of the form. * An associative array containing the current state of the form.
*/ */
public function views_form(&$form, &$form_state) { public function viewsForm(&$form, &$form_state) {
// Add the tableselect javascript. // Add the tableselect javascript.
$form['#attached']['library'][] = array('system', 'drupal.tableselect'); $form['#attached']['library'][] = array('system', 'drupal.tableselect');
...@@ -173,7 +173,7 @@ protected function getBulkOptions() { ...@@ -173,7 +173,7 @@ protected function getBulkOptions() {
* @param array $form_state * @param array $form_state
* An associative array containing the current state of the form. * An associative array containing the current state of the form.
*/ */
public function views_form_submit(&$form, &$form_state) { public function viewsFormSubmit(&$form, &$form_state) {
if ($form_state['step'] == 'views_form_views_form') { if ($form_state['step'] == 'views_form_views_form') {
// Filter only selected checkboxes. // Filter only selected checkboxes.
$selected = array_filter($form_state['values'][$this->options['id']]); $selected = array_filter($form_state['values'][$this->options['id']]);
......
...@@ -38,8 +38,8 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi ...@@ -38,8 +38,8 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi
* *
* Provide a more useful title to improve the accessibility. * Provide a more useful title to improve the accessibility.
*/ */
public function views_form(&$form, &$form_state) { public function viewsForm(&$form, &$form_state) {
parent::views_form($form, $form_state); parent::viewsForm($form, $form_state);
if (!empty($this->view->result)) { if (!empty($this->view->result)) {
foreach ($this->view->result as $row_index => $result) { foreach ($this->view->result as $row_index => $result) {
...@@ -54,7 +54,7 @@ public function views_form(&$form, &$form_state) { ...@@ -54,7 +54,7 @@ public function views_form(&$form, &$form_state) {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function views_form_validate(&$form, &$form_state) { public function viewsFormValidate(&$form, &$form_state) {
$selected = array_filter($form_state['values'][$this->options['id']]); $selected = array_filter($form_state['values'][$this->options['id']]);
if (empty($selected)) { if (empty($selected)) {
form_set_error('', $form_state, t('No users selected.')); form_set_error('', $form_state, t('No users selected.'));
......
...@@ -62,8 +62,8 @@ public function buildForm(array $form, array &$form_state, ViewExecutable $view ...@@ -62,8 +62,8 @@ public function buildForm(array $form, array &$form_state, ViewExecutable $view
$callback($view, $field, $form, $form_state); $callback($view, $field, $form, $form_state);
$has_form = TRUE; $has_form = TRUE;
} }
elseif (method_exists($field, 'views_form')) { elseif (method_exists($field, 'viewsForm')) {
$field->views_form($form, $form_state); $field->viewsForm($form, $form_state);
$has_form = TRUE; $has_form = TRUE;
} }
...@@ -90,8 +90,8 @@ public function buildForm(array $form, array &$form_state, ViewExecutable $view ...@@ -90,8 +90,8 @@ public function buildForm(array $form, array &$form_state, ViewExecutable $view
$area_handlers = array_merge(array_values($view->header), array_values($view->footer)); $area_handlers = array_merge(array_values($view->header), array_values($view->footer));
$empty = empty($view->result); $empty = empty($view->result);
foreach ($area_handlers as $area) { foreach ($area_handlers as $area) {
if (method_exists($area, 'views_form') && !$area->views_form_empty($empty)) { if (method_exists($area, 'viewsForm') && !$area->viewsFormEmpty($empty)) {
$area->views_form($form, $form_state); $area->viewsForm($form, $form_state);
} }
} }
...@@ -111,16 +111,16 @@ public function validateForm(array &$form, array &$form_state) { ...@@ -111,16 +111,16 @@ public function validateForm(array &$form, array &$form_state) {
// Call the validation method on every field handler that has it. // Call the validation method on every field handler that has it.
foreach ($view->field as $field) { foreach ($view->field as $field) {
if (method_exists($field, 'views_form_validate')) { if (method_exists($field, 'viewsFormValidate')) {
$field->views_form_validate($form, $form_state); $field->viewsFormValidate($form, $form_state);
} }
} }
// Call the validate method on every area handler that has it. // Call the validate method on every area handler that has it.
foreach (array('header', 'footer') as $area) { foreach (array('header', 'footer') as $area) {
foreach ($view->{$area} as $area_handler) { foreach ($view->{$area} as $area_handler) {
if (method_exists($area_handler, 'views_form_validate')) { if (method_exists($area_handler, 'viewsFormValidate')) {
$area_handler->views_form_validate($form, $form_state); $area_handler->viewsFormValidate($form, $form_state);
} }
} }
} }
...@@ -134,16 +134,16 @@ public function submitForm(array &$form, array &$form_state) { ...@@ -134,16 +134,16 @@ public function submitForm(array &$form, array &$form_state) {
// Call the submit method on every field handler that has it. // Call the submit method on every field handler that has it.
foreach ($view->field as $field) { foreach ($view->field as $field) {
if (method_exists($field, 'views_form_submit')) { if (method_exists($field, 'viewsFormSubmit')) {
$field->views_form_submit($form, $form_state); $field->viewsFormSubmit($form, $form_state);
} }
} }
// Call the submit method on every area handler that has it. // Call the submit method on every area handler that has it.
foreach (array('header', 'footer') as $area) { foreach (array('header', 'footer') as $area) {
foreach ($view->{$area} as $area_handler) { foreach ($view->{$area} as $area_handler) {
if (method_exists($area_handler, 'views_form_submit')) { if (method_exists($area_handler, 'viewsFormSubmit')) {
$area_handler->views_form_submit($form, $form_state); $area_handler->viewsFormSubmit($form, $form_state);
} }
} }
} }
......
...@@ -98,10 +98,10 @@ protected function getBulkOptions($filtered = TRUE) { ...@@ -98,10 +98,10 @@ protected function getBulkOptions($filtered = TRUE) {
} }
/** /**
* Implements \Drupal\system\Plugin\views\field\BulkFormBase::views_form_submit(). * Implements \Drupal\system\Plugin\views\field\BulkFormBase::viewsFormSubmit().
*/ */
public function views_form_submit(&$form, &$form_state) { public function viewsFormSubmit(&$form, &$form_state) {
parent::views_form_submit($form, $form_state); parent::viewsFormSubmit($form, $form_state);
if ($form_state['step'] == 'views_form_views_form') { if ($form_state['step'] == 'views_form_views_form') {
$count = count(array_filter($form_state['values'][$this->options['id']])); $count = count(array_filter($form_state['values'][$this->options['id']]));
$action = $this->actions[$form_state['values']['action']]; $action = $this->actions[$form_state['values']['action']];
......
...@@ -990,14 +990,14 @@ function views_get_view($name) { ...@@ -990,14 +990,14 @@ function views_get_view($name) {
*/ */
function views_view_has_form_elements($view) { function views_view_has_form_elements($view) {
foreach ($view->field as $field) { foreach ($view->field as $field) {
if (property_exists($field, 'views_form_callback') || method_exists($field, 'views_form')) { if (property_exists($field, 'views_form_callback') || method_exists($field, 'viewsForm')) {
return TRUE; return TRUE;
} }
} }
$area_handlers = array_merge(array_values($view->header), array_values($view->footer)); $area_handlers = array_merge(array_values($view->header), array_values($view->footer));
$empty = empty($view->result); $empty = empty($view->result);
foreach ($area_handlers as $area) { foreach ($area_handlers as $area) {
if (method_exists($area, 'views_form') && !$area->views_form_empty($empty)) { if (method_exists($area, 'viewsForm') && !$area->viewsFormEmpty($empty)) {
return TRUE; return TRUE;
} }
} }
......
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