diff --git a/includes/admin.inc b/includes/admin.inc index 85f4c35abd2399d410b0fbd015cf496e37892df5..71bd265cfce0a18b8381c2e9fb592687e0308b9c 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -2514,7 +2514,7 @@ function views_ui_standard_submit($form, &$form_state) { $display = &$form_state['view']->display[$form_state['display_id']]; // optionsOverride toggles the override of this section. $display->handler->optionsOverride($form, $form_state); - $display->handler->options_submit($form, $form_state); + $display->handler->submitOptionsForm($form, $form_state); } elseif (!$was_defaulted && $is_defaulted) { // We used to have an override for this display, but the user now wants @@ -2524,7 +2524,7 @@ function views_ui_standard_submit($form, &$form_state) { $display = &$form_state['view']->display[$form_state['display_id']]; // optionsOverride toggles the override of this section. $display->handler->optionsOverride($form, $form_state); - $display->handler->options_submit($form, $form_state); + $display->handler->submitOptionsForm($form, $form_state); } $submit_handler = $form['#form_id'] . '_submit'; @@ -3210,7 +3210,7 @@ function views_ui_edit_display_form($form, &$form_state) { '#theme_wrappers' => array('container'), '#attributes' => array('class' => array('scroll')), ); - $display->handler->options_form($form['options'], $form_state); + $display->handler->buildOptionsForm($form['options'], $form_state); // The handler options form sets $form['#title'], which we need on the entire // $form instead of just the ['options'] section. @@ -3237,7 +3237,7 @@ function views_ui_edit_display_form($form, &$form_state) { */ function views_ui_edit_display_form_validate($form, &$form_state) { $display = &$form_state['view']->display[$form_state['display_id']]; - $display->handler->options_validate($form['options'], $form_state); + $display->handler->validateOptionsForm($form['options'], $form_state); if (form_get_errors()) { $form_state['rerender'] = TRUE; @@ -3249,7 +3249,7 @@ function views_ui_edit_display_form_validate($form, &$form_state) { */ function views_ui_edit_display_form_submit($form, &$form_state) { $display = &$form_state['view']->display[$form_state['display_id']]; - $display->handler->options_submit($form, $form_state); + $display->handler->submitOptionsForm($form, $form_state); views_ui_cache_set($form_state['view']); } @@ -4306,7 +4306,7 @@ function views_ui_config_item_form($form, &$form_state) { $form['#section'] = $display_id . '-' . $type . '-' . $id; // Get form from the handler. - $handler->options_form($form['options'], $form_state); + $handler->buildOptionsForm($form['options'], $form_state); $form_state['handler'] = &$handler; } @@ -4328,7 +4328,7 @@ function views_ui_config_item_form($form, &$form_state) { * Submit handler for configing new item(s) to a view. */ function views_ui_config_item_form_validate($form, &$form_state) { - $form_state['handler']->options_validate($form['options'], $form_state); + $form_state['handler']->validateOptionsForm($form['options'], $form_state); if (form_get_errors()) { $form_state['rerender'] = TRUE; @@ -4341,7 +4341,7 @@ function views_ui_config_item_form_validate($form, &$form_state) { */ function views_ui_config_item_form_submit_temporary($form, &$form_state) { // Run it through the handler's submit function. - $form_state['handler']->options_submit($form['options'], $form_state); + $form_state['handler']->submitOptionsForm($form['options'], $form_state); $item = $form_state['handler']->options; $types = View::viewsObjectTypes(); @@ -4374,7 +4374,7 @@ function views_ui_config_item_form_submit_temporary($form, &$form_state) { // This unpacks only options that are in the definition, ensuring random // extra stuff on the form is not sent through. - $handler->unpack_options($handler->options, $options, NULL, FALSE); + $handler->unpackOptions($handler->options, $options, NULL, FALSE); // Store the item back on the view $form_state['view']->temporary_options[$type][$form_state['id']] = $handler->options; @@ -4395,7 +4395,7 @@ function views_ui_config_item_form_submit_temporary($form, &$form_state) { */ function views_ui_config_item_form_submit($form, &$form_state) { // Run it through the handler's submit function. - $form_state['handler']->options_submit($form['options'], $form_state); + $form_state['handler']->submitOptionsForm($form['options'], $form_state); $item = $form_state['handler']->options; $types = View::viewsObjectTypes(); @@ -4428,7 +4428,7 @@ function views_ui_config_item_form_submit($form, &$form_state) { // This unpacks only options that are in the definition, ensuring random // extra stuff on the form is not sent through. - $handler->unpack_options($handler->options, $options, NULL, FALSE); + $handler->unpackOptions($handler->options, $options, NULL, FALSE); // Store the item back on the view $form_state['view']->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $handler->options); @@ -4658,7 +4658,7 @@ function views_ui_config_style_form($form, &$form_state) { ); $plugin->init($view, $view->display[$display_id], $handler->options['style_options']); - $plugin->options_form($form['style_options'], $form_state); + $plugin->buildOptionsForm($form['style_options'], $form_state); } $form_state['handler'] = &$handler; @@ -4674,7 +4674,7 @@ function views_ui_config_style_form($form, &$form_state) { */ function views_ui_config_style_form_submit($form, &$form_state) { // Run it through the handler's submit function. - $form_state['handler']->options_submit($form['style_options'], $form_state); + $form_state['handler']->submitOptionsForm($form['style_options'], $form_state); $item = $form_state['handler']->options; // Store the data we're given. diff --git a/lib/Drupal/views/ManyToOneHelper.php b/lib/Drupal/views/ManyToOneHelper.php index 0795aad47d53d159a86eeef8b8da246263e50875..f6b9eb61282b62f5721251153b177ed04c1d83a7 100644 --- a/lib/Drupal/views/ManyToOneHelper.php +++ b/lib/Drupal/views/ManyToOneHelper.php @@ -27,11 +27,11 @@ function __construct($handler) { $this->handler = $handler; } - static function option_definition(&$options) { + public static function defineOptions(&$options) { $options['reduce_duplicates'] = array('default' => FALSE, 'bool' => TRUE); } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['reduce_duplicates'] = array( '#type' => 'checkbox', '#title' => t('Reduce duplicates'), diff --git a/lib/Drupal/views/Plugin/views/HandlerBase.php b/lib/Drupal/views/Plugin/views/HandlerBase.php index bb855eadd00806ff1eba75de0cdc659be45096e7..cad342acc9fccc0c02d558f64eb47022b0bc43d1 100644 --- a/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -110,7 +110,7 @@ function init(&$view, &$options) { $options['id'] ); - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); // This exist on most handlers, but not all. So they are still optional. if (isset($options['table'])) { @@ -135,8 +135,8 @@ function init(&$view, &$options) { $this->query = &$view->query; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['id'] = array('default' => ''); $options['table'] = array('default' => ''); @@ -263,12 +263,12 @@ function case_transform($string, $option) { /** * Validate the options form. */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Build the options form. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { // Some form elements belong in a fieldset for presentation, but can't // be moved into one because of the form_state['values'] hierarchy. Those // elements can add a #fieldset => 'fieldset_name' property, and they'll @@ -300,7 +300,7 @@ function options_form(&$form, &$form_state) { * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } /** * Provides the handler some groupby. @@ -602,14 +602,14 @@ function get_join() { * Validates the handler against the complete View. * * This is called when the complete View is being validated. For validating - * the handler options form use options_validate(). + * the handler options form use validateOptionsForm(). * - * @see views_handler::options_validate() + * @see views_handler::validateOptionsForm() * * @return * Empty array if the handler is valid; an array of error strings if it is not. */ - function validate() { return array(); } + public function validate() { return array(); } /** * Determine if the handler is considered 'broken', meaning it's a diff --git a/lib/Drupal/views/Plugin/views/PluginBase.php b/lib/Drupal/views/Plugin/views/PluginBase.php index 463fe092103bc6ea93c98c4a4d3b30e0b79a9961..2e254e884b305fd29ab7a53dd01122063531ab3c 100644 --- a/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/lib/Drupal/views/Plugin/views/PluginBase.php @@ -81,31 +81,31 @@ public function __construct(array $configuration, $plugin_id) { * @return array * Returns the options of this handler/plugin. * - * @see Drupal\views\Plugin\views\PluginBase::export_option() - * @see Drupal\views\Plugin\views\PluginBase::unpack_translatable() + * @see Drupal\views\Plugin\views\PluginBase::exportOption() + * @see Drupal\views\Plugin\views\PluginBase::unpackTranslatable() */ - function option_definition() { return array(); } + protected function defineOptions() { return array(); } /** * Views handlers use a special construct function so that we can more * easily construct them with variable arguments. */ - function construct() { $this->set_default_options(); } + public function construct() { $this->setDefaultOptions(); } /** * Set default options. * For backward compatibility, it sends the options array; this is a * feature that will likely disappear at some point. */ - function set_default_options() { - $this->_set_option_defaults($this->options, $this->option_definition()); + protected function setDefaultOptions() { + $this->setOptionDefaults($this->options, $this->defineOptions()); } - function _set_option_defaults(&$storage, $options, $level = 0) { + protected function setOptionDefaults(&$storage, $options, $level = 0) { foreach ($options as $option => $definition) { if (isset($definition['contains']) && is_array($definition['contains'])) { $storage[$option] = array(); - $this->_set_option_defaults($storage[$option], $definition['contains'], $level++); + $this->setOptionDefaults($storage[$option], $definition['contains'], $level++); } elseif (!empty($definition['translatable']) && !empty($definition['default'])) { $storage[$option] = t($definition['default']); @@ -120,13 +120,13 @@ function _set_option_defaults(&$storage, $options, $level = 0) { * Unpack options over our existing defaults, drilling down into arrays * so that defaults don't get totally blown away. */ - function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE, $check = TRUE, $localization_keys = array()) { + public function unpackOptions(&$storage, $options, $definition = NULL, $all = TRUE, $check = TRUE, $localization_keys = array()) { if ($check && !is_array($options)) { return; } if (!isset($definition)) { - $definition = $this->option_definition(); + $definition = $this->defineOptions(); } if (!empty($this->view)) { @@ -165,7 +165,7 @@ function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE, $c continue; } - $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array(), $all, FALSE, array_merge($localization_keys, array($key))); + $this->unpackOptions($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array(), $all, FALSE, array_merge($localization_keys, array($key))); } // Don't localize strings during editing. When editing, we need to work with // the original data, not the translated version. @@ -200,7 +200,7 @@ function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE, $c /** * Let the handler know what its full definition is. */ - function setDefinition($definition) { + public function setDefinition($definition) { $this->definition = $definition; if (isset($definition['id'])) { $this->plugin_id = $definition['id']; @@ -210,7 +210,7 @@ function setDefinition($definition) { } } - function destroy() { + public function destroy() { if (isset($this->view)) { unset($this->view); } @@ -224,16 +224,16 @@ function destroy() { } } - function export_options($indent, $prefix) { + public function exportOptions($indent, $prefix) { $output = ''; - foreach ($this->option_definition() as $option => $definition) { - $output .= $this->export_option($indent, $prefix, $this->options, $option, $definition, array()); + foreach ($this->defineOptions() as $option => $definition) { + $output .= $this->exportOption($indent, $prefix, $this->options, $option, $definition, array()); } return $output; } - function export_option($indent, $prefix, $storage, $option, $definition, $parents) { + protected function exportOption($indent, $prefix, $storage, $option, $definition, $parents) { // Do not export options for which we have no settings. if (!isset($storage[$option])) { return; @@ -257,7 +257,7 @@ function export_option($indent, $prefix, $storage, $option, $definition, $parent // If it has child items, export those separately. if (isset($definition['contains'])) { foreach ($definition['contains'] as $sub_option => $sub_definition) { - $output .= $this->export_option($indent, $prefix, $storage[$option], $sub_option, $sub_definition, $parents); + $output .= $this->exportOption($indent, $prefix, $storage[$option], $sub_option, $sub_definition, $parents); } } // Otherwise export just this item. @@ -286,9 +286,9 @@ function export_option($indent, $prefix, $storage, $option, $definition, $parent /** * Unpacks each handler to store translatable texts. */ - function unpack_translatables(&$translatable, $parents = array()) { - foreach ($this->option_definition() as $option => $definition) { - $this->unpack_translatable($translatable, $this->options, $option, $definition, $parents, array()); + public function unpackTranslatables(&$translatable, $parents = array()) { + foreach ($this->defineOptions() as $option => $definition) { + $this->unpackTranslatable($translatable, $this->options, $option, $definition, $parents, array()); } } @@ -305,7 +305,7 @@ function unpack_translatables(&$translatable, $parents = array()) { * @param $parents * @param $keys */ - function unpack_translatable(&$translatable, $storage, $option, $definition, $parents, $keys = array()) { + protected function unpackTranslatable(&$translatable, $storage, $option, $definition, $parents, $keys = array()) { // Do not export options for which we have no settings. if (!isset($storage[$option])) { return; @@ -329,7 +329,7 @@ function unpack_translatable(&$translatable, $storage, $option, $definition, $pa if (isset($definition['contains'])) { foreach ($definition['contains'] as $sub_option => $sub_definition) { $translation_keys = array_merge($keys, array($sub_option)); - $this->unpack_translatable($translatable, $storage[$option], $sub_option, $sub_definition, $parents, $translation_keys); + $this->unpackTranslatable($translatable, $storage[$option], $sub_option, $sub_definition, $parents, $translation_keys); } } @@ -339,7 +339,7 @@ function unpack_translatable(&$translatable, $storage, $option, $definition, $pa foreach ($options as $key => $value) { $translation_keys = array_merge($keys, array($key)); if (is_array($value)) { - $this->unpack_translatable($translatable, $options, $key, $definition, $parents, $translation_keys); + $this->unpackTranslatable($translatable, $options, $key, $definition, $parents, $translation_keys); } else if (!empty($definition[$key]['translatable']) && !empty($value)) { // Build source data and add to the array @@ -378,7 +378,7 @@ function unpack_translatable(&$translatable, $storage, $option, $definition, $pa /** * Provide a form to edit options for this plugin. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { // Some form elements belong in a fieldset for presentation, but can't // be moved into one because of the form_state['values'] hierarchy. Those // elements can add a #fieldset => 'fieldset_name' property, and they'll @@ -389,29 +389,29 @@ function options_form(&$form, &$form_state) { /** * Validate the options form. */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Handle any special handling on the validate form. */ - function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } /** * Add anything to the query that we might need to. */ - function query() { } + public function query() { } /** * Provide a full list of possible theme templates used by this style. */ - function theme_functions() { + public function themeFunctions() { return views_theme_functions($this->definition['theme'], $this->view, $this->display); } /** * Provide a list of additional theme functions for the theme information page */ - function additional_theme_functions() { + public function additionalThemeFunctions() { $funcs = array(); if (!empty($this->definition['additional themes'])) { foreach ($this->definition['additional themes'] as $theme => $type) { @@ -428,20 +428,21 @@ function additional_theme_functions() { * An array of error strings to tell the user what is wrong with this * plugin. */ - function validate() { return array(); } + public function validate() { return array(); } /** * Returns the summary of the settings in the display. */ - function summary_title() { + public function summaryTitle() { return t('Settings'); } + /** * Return the human readable name of the display. * * This appears on the ui beside each plugin and beside the settings link. */ - function plugin_title() { + public function pluginTitle() { if (isset($this->definition['short_title'])) { return check_plain($this->definition['short_title']); } diff --git a/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php b/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php index dcc7ae5599632a7f2f91477cbc4d0ea8c91fa9c2..bb38c758861e7a6871cbd1a4b5e2698d7334b689 100644 --- a/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php +++ b/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php @@ -37,7 +37,7 @@ function init(&$view, &$display) { if (is_object($display->handler)) { $options = $display->handler->getOption('access'); // Overlay incoming options on top of defaults - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } } @@ -45,28 +45,28 @@ function init(&$view, &$display) { * Retrieve the options when this is a new access * control plugin */ - function option_definition() { return array(); } + protected function defineOptions() { return array(); } /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { } + public function buildOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for validating options */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for submitting options */ - function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } /** * Return a string to display as the clickable title for the * access control. */ - function summary_title() { + public function summaryTitle() { return t('Unknown'); } diff --git a/lib/Drupal/views/Plugin/views/access/None.php b/lib/Drupal/views/Plugin/views/access/None.php index 2d08a8f53899b397fc20e38adbdc5d43e398b507..55c589ee5682df5ae2c10ddbebe03082c7d78feb 100644 --- a/lib/Drupal/views/Plugin/views/access/None.php +++ b/lib/Drupal/views/Plugin/views/access/None.php @@ -23,7 +23,7 @@ */ class None extends AccessPluginBase { - function summary_title() { + public function summaryTitle() { return t('Unrestricted'); } diff --git a/lib/Drupal/views/Plugin/views/access/Permission.php b/lib/Drupal/views/Plugin/views/access/Permission.php index e3859d027523294e55987efbb8e7049538fe4210..4c36624154d0158f14ce17f182e02f17b6297782 100644 --- a/lib/Drupal/views/Plugin/views/access/Permission.php +++ b/lib/Drupal/views/Plugin/views/access/Permission.php @@ -36,7 +36,7 @@ function get_access_callback() { return array('views_check_perm', array($this->options['perm'])); } - function summary_title() { + public function summaryTitle() { $permissions = module_invoke_all('permission'); if (isset($permissions[$this->options['perm']])) { return $permissions[$this->options['perm']]['title']; @@ -46,15 +46,15 @@ function summary_title() { } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['perm'] = array('default' => 'access content'); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $perms = array(); $module_info = system_get_info('module'); diff --git a/lib/Drupal/views/Plugin/views/access/Role.php b/lib/Drupal/views/Plugin/views/access/Role.php index c8ac7f97e58981fd0f66dbf6deb0062ad3ed7edb..643bd37d8f9498473d3a1fa205ad9e0cf2238d0c 100644 --- a/lib/Drupal/views/Plugin/views/access/Role.php +++ b/lib/Drupal/views/Plugin/views/access/Role.php @@ -36,7 +36,7 @@ function get_access_callback() { return array('views_check_roles', array(array_filter($this->options['role']))); } - function summary_title() { + public function summaryTitle() { $count = count($this->options['role']); if ($count < 1) { return t('No role(s) selected'); @@ -52,15 +52,15 @@ function summary_title() { } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['role'] = array('default' => array()); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['role'] = array( '#type' => 'checkboxes', '#title' => t('Role'), @@ -70,13 +70,13 @@ function options_form(&$form, &$form_state) { ); } - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { if (!array_filter($form_state['values']['access_options']['role'])) { form_error($form['role'], t('You must select at least one role if type is "by role"')); } } - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { // I hate checkboxes. $form_state['values']['access_options']['role'] = array_filter($form_state['values']['access_options']['role']); } diff --git a/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php b/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php index ae50cbc5659ba68284e31f9cad0278d76d358101..6b7a9d098109cccc7d910c659f37fa8982504f0e 100644 --- a/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php +++ b/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php @@ -47,8 +47,8 @@ function label() { return $this->options['label']; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $this->definition['field'] = !empty($this->definition['field']) ? $this->definition['field'] : ''; $label = !empty($this->definition['label']) ? $this->definition['label'] : $this->definition['field']; @@ -69,8 +69,8 @@ function admin_summary() { * Default options form that provides the label widget that all fields * should have. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['label'] = array( '#type' => 'textfield', '#title' => t('Label'), @@ -90,7 +90,7 @@ function options_form(&$form, &$form_state) { /** * Don't run a query */ - function query() { } + public function query() { } /** * Render the area diff --git a/lib/Drupal/views/Plugin/views/area/Broken.php b/lib/Drupal/views/Plugin/views/area/Broken.php index 070cd9a684a9dde6ed9253b92d52b0ef442aab73..56d0124f3a805b50f48536042a066b9860e429a1 100644 --- a/lib/Drupal/views/Plugin/views/area/Broken.php +++ b/lib/Drupal/views/Plugin/views/area/Broken.php @@ -25,9 +25,9 @@ function ui_name($short = FALSE) { } function ensure_my_table() { /* No table to ensure! */ } - function query($group_by = FALSE) { /* No query to run */ } + public function query($group_by = FALSE) { /* No query to run */ } function render($empty = FALSE) { return ''; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>', ); diff --git a/lib/Drupal/views/Plugin/views/area/Result.php b/lib/Drupal/views/Plugin/views/area/Result.php index debe61c169f7bf4af1abb08f2ec26501cb813230..6bf0732aa6e8e1ac4f7b19aca5f9fbcdcebfa109 100644 --- a/lib/Drupal/views/Plugin/views/area/Result.php +++ b/lib/Drupal/views/Plugin/views/area/Result.php @@ -20,8 +20,8 @@ */ class Result extends AreaPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['content'] = array( 'default' => 'Displaying @start - @end of @total', @@ -31,8 +31,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $variables = array( 'items' => array( '@start -- the initial record number in the set', diff --git a/lib/Drupal/views/Plugin/views/area/Text.php b/lib/Drupal/views/Plugin/views/area/Text.php index 14f975ab7f57dd4dcfc1695bc1d74c701d7f2c7d..48931c473a49b7a3a4a5d6c984953d548f2041d2 100644 --- a/lib/Drupal/views/Plugin/views/area/Text.php +++ b/lib/Drupal/views/Plugin/views/area/Text.php @@ -20,16 +20,16 @@ */ class Text extends AreaPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['content'] = array('default' => '', 'translatable' => TRUE, 'format_key' => 'format'); $options['format'] = array('default' => NULL); $options['tokenize'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['content'] = array( '#type' => 'text_format', @@ -90,10 +90,10 @@ function options_form(&$form, &$form_state) { } } - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { $form_state['values']['options']['format'] = $form_state['values']['options']['content']['format']; $form_state['values']['options']['content'] = $form_state['values']['options']['content']['value']; - parent::options_submit($form, $form_state); + parent::submitOptionsForm($form, $form_state); } function render($empty = FALSE) { diff --git a/lib/Drupal/views/Plugin/views/area/TextCustom.php b/lib/Drupal/views/Plugin/views/area/TextCustom.php index 68858d2fb1551dfcad6801e92d8819a4fe6a831f..2bf75fe34a3ee8e6482449de439ae5d96ec2ce59 100644 --- a/lib/Drupal/views/Plugin/views/area/TextCustom.php +++ b/lib/Drupal/views/Plugin/views/area/TextCustom.php @@ -20,14 +20,14 @@ */ class TextCustom extends AreaPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); unset($options['format']); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // Alter the form element, to be a regular text area. $form['content']['#type'] = 'textarea'; @@ -35,8 +35,8 @@ function options_form(&$form, &$form_state) { unset($form['content']['#wysiwyg']); } - // Empty, so we don't inherit options_submit from the parent. - function options_submit(&$form, &$form_state) { + // Empty, so we don't inherit submitOptionsForm from the parent. + public function submitOptionsForm(&$form, &$form_state) { } function render($empty = FALSE) { diff --git a/lib/Drupal/views/Plugin/views/area/View.php b/lib/Drupal/views/Plugin/views/area/View.php index 46125a16cfa13f62401a9d943de9fc9eb009868d..0c589b81d6e207ed0fbcdf021a8216adc3c927ab 100644 --- a/lib/Drupal/views/Plugin/views/area/View.php +++ b/lib/Drupal/views/Plugin/views/area/View.php @@ -20,8 +20,8 @@ */ class View extends AreaPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['view_to_insert'] = array('default' => ''); $options['inherit_arguments'] = array('default' => FALSE, 'bool' => TRUE); @@ -32,8 +32,8 @@ function option_definition() { * Default options form that provides the label widget that all fields * should have. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $view_display = $this->view->name . ':' . $this->view->current_display; diff --git a/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index 8d5a737714312324709018d06cb0a139e00c1caa..9ce6fd9586b780a47aee7f08c519ee3558e7774a 100644 --- a/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -63,7 +63,7 @@ abstract class ArgumentPluginBase extends HandlerBase { /** * Constructor */ - function construct() { + public function construct() { parent::construct(); if (!empty($this->definition['name field'])) { @@ -119,8 +119,8 @@ function needs_style_plugin() { return !empty($info['style plugin']) || !empty($validate_info['style plugin']); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['default_action'] = array('default' => 'ignore'); $options['exception'] = array( @@ -157,8 +157,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $argument_text = $this->view->display_handler->getArgumentText(); @@ -342,7 +342,7 @@ function options_form(&$form, &$form_state) { ), '#id' => 'edit-options-validate-options-' . $id, ); - $plugin->options_form($form['validate']['options'][$id], $form_state); + $plugin->buildOptionsForm($form['validate']['options'][$id], $form_state); $validate_types[$id] = $info['title']; } } @@ -366,7 +366,7 @@ function options_form(&$form, &$form_state) { ); } - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { if (empty($form_state['values']['options'])) { return; } @@ -375,25 +375,25 @@ function options_validate(&$form, &$form_state) { $default_id = $form_state['values']['options']['default_argument_type']; $plugin = $this->get_plugin('argument_default', $default_id); if ($plugin) { - $plugin->options_validate($form['argument_default'][$default_id], $form_state, $form_state['values']['options']['argument_default'][$default_id]); + $plugin->validateOptionsForm($form['argument_default'][$default_id], $form_state, $form_state['values']['options']['argument_default'][$default_id]); } // summary plugin $summary_id = $form_state['values']['options']['summary']['format']; $plugin = $this->get_plugin('style', $summary_id); if ($plugin) { - $plugin->options_validate($form['summary']['options'][$summary_id], $form_state, $form_state['values']['options']['summary']['options'][$summary_id]); + $plugin->validateOptionsForm($form['summary']['options'][$summary_id], $form_state, $form_state['values']['options']['summary']['options'][$summary_id]); } $validate_id = $form_state['values']['options']['validate']['type']; $plugin = $this->get_plugin('argument_validator', $validate_id); if ($plugin) { - $plugin->options_validate($form['validate']['options'][$default_id], $form_state, $form_state['values']['options']['validate']['options'][$validate_id]); + $plugin->validateOptionsForm($form['validate']['options'][$default_id], $form_state, $form_state['values']['options']['validate']['options'][$validate_id]); } } - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { if (empty($form_state['values']['options'])) { return; } @@ -403,7 +403,7 @@ function options_submit(&$form, &$form_state) { $plugin = $this->get_plugin('argument_default', $default_id); if ($plugin) { $options = &$form_state['values']['options']['argument_default'][$default_id]; - $plugin->options_submit($form['argument_default'][$default_id], $form_state, $options); + $plugin->submitOptionsForm($form['argument_default'][$default_id], $form_state, $options); // Copy the now submitted options to their final resting place so they get saved. $form_state['values']['options']['default_argument_options'] = $options; } @@ -413,7 +413,7 @@ function options_submit(&$form, &$form_state) { $plugin = $this->get_plugin('style', $summary_id); if ($plugin) { $options = &$form_state['values']['options']['summary']['options'][$summary_id]; - $plugin->options_submit($form['summary']['options'][$summary_id], $form_state, $options); + $plugin->submitOptionsForm($form['summary']['options'][$summary_id], $form_state, $options); // Copy the now submitted options to their final resting place so they get saved. $form_state['values']['options']['summary_options'] = $options; } @@ -422,7 +422,7 @@ function options_submit(&$form, &$form_state) { $plugin = $this->get_plugin('argument_validator', $validate_id); if ($plugin) { $options = &$form_state['values']['options']['validate']['options'][$validate_id]; - $plugin->options_submit($form['validate']['options'][$validate_id], $form_state, $options); + $plugin->submitOptionsForm($form['validate']['options'][$validate_id], $form_state, $options); // Copy the now submitted options to their final resting place so they get saved. $form_state['values']['options']['validate_options'] = $options; } @@ -548,7 +548,7 @@ function default_argument_form(&$form, &$form_state) { ), ); $options[$id] = $info['title']; - $plugin->options_form($form['argument_default'][$id], $form_state); + $plugin->buildOptionsForm($form['argument_default'][$id], $form_state); } } } @@ -635,7 +635,7 @@ function default_summary_form(&$form, &$form_state) { ), ); $options[$id] = $info['title']; - $plugin->options_form($form['summary']['options'][$id], $form_state); + $plugin->buildOptionsForm($form['summary']['options'][$id], $form_state); } } } @@ -669,7 +669,7 @@ function default_action($info = NULL) { /** * How to act if validation failes */ - function validate_fail() { + public function validateFail() { $info = $this->default_actions($this->options['validate']['fail']); return $this->default_action($info); } @@ -906,7 +906,7 @@ function summary_name($data) { * * The argument sent may be found at $this->argument. */ - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); $this->query->add_where(0, "$this->table_alias.$this->real_field", $this->argument); } @@ -936,7 +936,7 @@ function get_title() { /** * Validate that this argument works. By default, all arguments are valid. */ - function validate_arg($arg) { + public function validateArgument($arg) { // By using % in URLs, arguments could be validated twice; this eases // that pain. if (isset($this->argument_validated)) { @@ -973,7 +973,7 @@ function validate_argument($arg) { return TRUE; } - $rc = $this->validate_arg($arg); + $rc = $this->validateArgument($arg); // If the validator has changed the validate fail condition to a // soft fail, deal with that: @@ -1011,7 +1011,7 @@ function validate_argument_basic($arg) { */ function set_argument($arg) { $this->argument = $arg; - return $this->validate_arg($arg); + return $this->validateArgument($arg); } /** @@ -1072,7 +1072,7 @@ function export_summary($indent, $prefix, $storage, $option, $definition, $paren $output .= $indent . $prefix . "['summary']['$option'] = '$name';\n"; // Pass off to the plugin to export itself. - $output .= $plugin->export_options($indent, $prefix . "['summary_options']"); + $output .= $plugin->exportOptions($indent, $prefix . "['summary_options']"); } return $output; @@ -1096,7 +1096,7 @@ function export_validation($indent, $prefix, $storage, $option, $definition, $pa $output .= $indent . $prefix . "['validate']['$option'] = '$name';\n"; // Pass off to the plugin to export itself. - $output .= $plugin->export_options($indent, $prefix . "['validate_options']"); + $output .= $plugin->exportOptions($indent, $prefix . "['validate_options']"); } return $output; @@ -1123,7 +1123,7 @@ function export_plugin($indent, $prefix, $storage, $option, $definition, $parent $output .= $indent . $prefix . "['$option'] = '$name';\n"; // Pass off to the plugin to export itself. - $output .= $plugin->export_options($indent, $prefix . "['$option_name']"); + $output .= $plugin->exportOptions($indent, $prefix . "['$option_name']"); } return $output; diff --git a/lib/Drupal/views/Plugin/views/argument/Broken.php b/lib/Drupal/views/Plugin/views/argument/Broken.php index b9b912c723551c868f93373621341e53a55e8fd5..5414188c40ad4bb91b4fb45b1c9604ff215ab28d 100644 --- a/lib/Drupal/views/Plugin/views/argument/Broken.php +++ b/lib/Drupal/views/Plugin/views/argument/Broken.php @@ -25,8 +25,8 @@ function ui_name($short = FALSE) { } function ensure_my_table() { /* No table to ensure! */ } - function query($group_by = FALSE) { /* No query to run */ } - function options_form(&$form, &$form_state) { + public function query($group_by = FALSE) { /* No query to run */ } + public function buildOptionsForm(&$form, &$form_state) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>', ); diff --git a/lib/Drupal/views/Plugin/views/argument/Formula.php b/lib/Drupal/views/Plugin/views/argument/Formula.php index b6dc040274d65e923648161c9cc2f0caae864996..50e4ffaddf682d66c668b0b6fffac52e0b909a7a 100644 --- a/lib/Drupal/views/Plugin/views/argument/Formula.php +++ b/lib/Drupal/views/Plugin/views/argument/Formula.php @@ -30,7 +30,7 @@ class Formula extends ArgumentPluginBase { /** * Constructor */ - function construct() { + public function construct() { parent::construct(); if (!empty($this->definition['formula'])) { @@ -60,7 +60,7 @@ function summary_query() { /** * Build the query based upon the formula */ - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); // Now that our table is secure, get our formula. $placeholder = $this->placeholder(); diff --git a/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php b/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php index 7f8ae5be0b58995cb082358ead51f4c0cfc8320f..93044dbbffd7f53fa3ba6b3108328b4adba1ef5a 100644 --- a/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php +++ b/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php @@ -20,7 +20,7 @@ */ class GroupByNumeric extends ArgumentPluginBase { - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); $field = $this->get_field(); $placeholder = $this->placeholder(); diff --git a/lib/Drupal/views/Plugin/views/argument/ManyToOne.php b/lib/Drupal/views/Plugin/views/argument/ManyToOne.php index b06f3ee708ddf2ea775421972bd1fe7c247b5303..13813a7f4cd7aa1b57435cecf78b94139e12d621 100644 --- a/lib/Drupal/views/Plugin/views/argument/ManyToOne.php +++ b/lib/Drupal/views/Plugin/views/argument/ManyToOne.php @@ -38,8 +38,8 @@ function init(&$view, &$options) { $this->value = array(); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); if (!empty($this->definition['numeric'])) { $options['break_phrase'] = array('default' => FALSE, 'bool' => TRUE); @@ -49,18 +49,18 @@ function option_definition() { $options['require_value'] = array('default' => FALSE, 'bool' => TRUE); if (isset($this->helper)) { - $this->helper->option_definition($options); + $this->helper->defineOptions($options); } else { $helper = new ManyToOneHelper($this); - $helper->option_definition($options); + $helper->defineOptions($options); } return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // allow + for or, , for and $form['break_phrase'] = array( @@ -86,7 +86,7 @@ function options_form(&$form, &$form_state) { '#fieldset' => 'more', ); - $this->helper->options_form($form, $form_state); + $this->helper->buildOptionsForm($form, $form_state); } /** @@ -97,7 +97,7 @@ function ensure_my_table() { $this->helper->ensure_my_table(); } - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $empty = FALSE; if (isset($this->definition['zero is null']) && $this->definition['zero is null']) { if (empty($this->argument)) { diff --git a/lib/Drupal/views/Plugin/views/argument/Null.php b/lib/Drupal/views/Plugin/views/argument/Null.php index a43135ced9825d4e9a88199f3bb07a0f8428c662..ce998cc235e98b3669bd4851859dc5ca07e9c043 100644 --- a/lib/Drupal/views/Plugin/views/argument/Null.php +++ b/lib/Drupal/views/Plugin/views/argument/Null.php @@ -20,18 +20,18 @@ */ class Null extends ArgumentPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['must_not_be'] = array('default' => FALSE, 'bool' => TRUE); return $options; } /** - * Override options_form() so that only the relevant options + * Override buildOptionsForm() so that only the relevant options * are displayed to the user. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['must_not_be'] = array( '#type' => 'checkbox', '#title' => t('Fail basic validation if any argument is given'), @@ -72,6 +72,6 @@ function validate_argument_basic($arg) { * Override the behavior of query() to prevent the query * from being changed in any way. */ - function query($group_by = FALSE) {} + public function query($group_by = FALSE) {} } diff --git a/lib/Drupal/views/Plugin/views/argument/Numeric.php b/lib/Drupal/views/Plugin/views/argument/Numeric.php index fa005bacf2ccbb94c6ab2be717b7be466ea98634..02c27fe5bba9125438ee9b19a4202452eecd711c 100644 --- a/lib/Drupal/views/Plugin/views/argument/Numeric.php +++ b/lib/Drupal/views/Plugin/views/argument/Numeric.php @@ -33,8 +33,8 @@ class Numeric extends ArgumentPluginBase { */ var $value; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['break_phrase'] = array('default' => FALSE, 'bool' => TRUE); $options['not'] = array('default' => FALSE, 'bool' => TRUE); @@ -42,8 +42,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // allow + for or, , for and $form['break_phrase'] = array( @@ -96,7 +96,7 @@ function title_query() { return $this->value; } - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); if (!empty($this->options['break_phrase'])) { diff --git a/lib/Drupal/views/Plugin/views/argument/String.php b/lib/Drupal/views/Plugin/views/argument/String.php index 470a590389a09fc22ed50500c5bfc50ce3e67114..7e1e1267d7973bc8c0fa39be90693967f7916df3 100644 --- a/lib/Drupal/views/Plugin/views/argument/String.php +++ b/lib/Drupal/views/Plugin/views/argument/String.php @@ -33,8 +33,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['glossary'] = array('default' => FALSE, 'bool' => TRUE); $options['limit'] = array('default' => 0); @@ -51,8 +51,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['glossary'] = array( '#type' => 'checkbox', @@ -178,7 +178,7 @@ function get_formula() { /** * Build the query based upon the formula */ - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $argument = $this->argument; if (!empty($this->options['transform_dash'])) { $argument = strtr($argument, '-', ' '); diff --git a/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php b/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php index 65ed2862daba821d278843e54621273e6d9b74d6..782bc338caaf72458a555838fe41699d459cf75f 100644 --- a/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php +++ b/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php @@ -37,29 +37,29 @@ function init(&$view, &$argument, $options) { $this->view = &$view; $this->argument = &$argument; - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } /** * Retrieve the options when this is a new access * control plugin */ - function option_definition() { return array(); } + protected function defineOptions() { return array(); } /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { } + public function buildOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for validating options */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for submitting options */ - function options_submit(&$form, &$form_state, &$options = array()) { } + public function submitOptionsForm(&$form, &$form_state, &$options = array()) { } /** * Determine if the administrator has the privileges to use this @@ -71,7 +71,7 @@ function access() { return TRUE; } * If we don't have access to the form but are showing it anyway, ensure that * the form is safe and cannot be changed from user input. * - * This is only called by child objects if specified in the options_form(), + * This is only called by child objects if specified in the buildOptionsForm(), * so it will not always be used. */ function check_access(&$form, $option_name) { diff --git a/lib/Drupal/views/Plugin/views/argument_default/Fixed.php b/lib/Drupal/views/Plugin/views/argument_default/Fixed.php index a6c6be7846d7a76003993157b464a708ec302027..977a01cdfb624c2e27224fef063addddc9def06b 100644 --- a/lib/Drupal/views/Plugin/views/argument_default/Fixed.php +++ b/lib/Drupal/views/Plugin/views/argument_default/Fixed.php @@ -22,15 +22,15 @@ */ class Fixed extends ArgumentDefaultPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['argument'] = array('default' => ''); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['argument'] = array( '#type' => 'textfield', '#title' => t('Fixed value'), diff --git a/lib/Drupal/views/Plugin/views/argument_default/Php.php b/lib/Drupal/views/Plugin/views/argument_default/Php.php index 0a013b2de67b4b62ff3bfa450d312ceb3cd18af6..9ff24bd17b4ce406479f8a1a162e18ff16040c4b 100644 --- a/lib/Drupal/views/Plugin/views/argument_default/Php.php +++ b/lib/Drupal/views/Plugin/views/argument_default/Php.php @@ -22,15 +22,15 @@ */ class Php extends ArgumentDefaultPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['code'] = array('default' => ''); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['code'] = array( '#type' => 'textarea', '#title' => t('PHP contextual filter code'), diff --git a/lib/Drupal/views/Plugin/views/argument_default/Raw.php b/lib/Drupal/views/Plugin/views/argument_default/Raw.php index bf360d2427a1ed97734dbb533b0fde81599bb197..636e3f37c06426c4bd744012c431ade90bb8d29f 100644 --- a/lib/Drupal/views/Plugin/views/argument_default/Raw.php +++ b/lib/Drupal/views/Plugin/views/argument_default/Raw.php @@ -22,16 +22,16 @@ */ class Raw extends ArgumentDefaultPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['index'] = array('default' => ''); $options['use_alias'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // Using range(1, 10) will create an array keyed 0-9, which allows arg() to // properly function since it is also zero-based. $form['index'] = array( diff --git a/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php b/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php index bdf3ff307e1d8d72bfdbb123eecca8aac615ddb8..d4878f9fe53a8794265e6bf29ed52fee7a4e8c49 100644 --- a/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php +++ b/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php @@ -30,29 +30,29 @@ function init(&$view, &$argument, $options) { $this->view = &$view; $this->argument = &$argument; - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } /** * Retrieve the options when this is a new access * control plugin */ - function option_definition() { return array(); } + protected function defineOptions() { return array(); } /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { } + public function buildOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for validating options */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for submitting options */ - function options_submit(&$form, &$form_state, &$options = array()) { } + public function submitOptionsForm(&$form, &$form_state, &$options = array()) { } /** * Determine if the administrator has the privileges to use this plugin @@ -63,7 +63,7 @@ function access() { return TRUE; } * If we don't have access to the form but are showing it anyway, ensure that * the form is safe and cannot be changed from user input. * - * This is only called by child objects if specified in the options_form(), + * This is only called by child objects if specified in the buildOptionsForm(), * so it will not always be used. */ function check_access(&$form, $option_name) { diff --git a/lib/Drupal/views/Plugin/views/argument_validator/Php.php b/lib/Drupal/views/Plugin/views/argument_validator/Php.php index b6699c39fdf5d30e878334efaf72ff6b9b2edd64..82da314a727225c67296ccde02c75ac2898bca2c 100644 --- a/lib/Drupal/views/Plugin/views/argument_validator/Php.php +++ b/lib/Drupal/views/Plugin/views/argument_validator/Php.php @@ -22,15 +22,15 @@ */ class Php extends ArgumentValidatorPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['code'] = array('default' => ''); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['code'] = array( '#type' => 'textarea', '#title' => t('PHP validate code'), diff --git a/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php index 7039e7b8bc7a59150a4e754380b2286078b2c3d0..38cdd0d1056dde1794a585448d544a2cf662e730 100644 --- a/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php +++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php @@ -66,7 +66,7 @@ function init(&$view, &$display) { if (is_object($display->handler)) { $options = $display->handler->getOption('cache'); // Overlay incoming options on top of defaults - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } } @@ -74,7 +74,7 @@ function init(&$view, &$display) { * Return a string to display as the clickable title for the * access control. */ - function summary_title() { + public function summaryTitle() { return t('Unknown'); } diff --git a/lib/Drupal/views/Plugin/views/cache/None.php b/lib/Drupal/views/Plugin/views/cache/None.php index 5ed403528b2aa160f321495c9eb1effa6a9ea29a..89e17033b7754e16cb8bea1147356f0aa6f2e443 100644 --- a/lib/Drupal/views/Plugin/views/cache/None.php +++ b/lib/Drupal/views/Plugin/views/cache/None.php @@ -25,7 +25,7 @@ class None extends CachePluginBase { function cache_start() { /* do nothing */ } - function summary_title() { + public function summaryTitle() { return t('None'); } diff --git a/lib/Drupal/views/Plugin/views/cache/Time.php b/lib/Drupal/views/Plugin/views/cache/Time.php index fb739c9c2102c07e2fe6df66aa52f9f5bf4ba2d7..39a0b7b752f8de8dbe617b9793d0a1b483110686 100644 --- a/lib/Drupal/views/Plugin/views/cache/Time.php +++ b/lib/Drupal/views/Plugin/views/cache/Time.php @@ -28,8 +28,8 @@ class Time extends CachePluginBase { */ protected $usesOptions = TRUE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['results_lifespan'] = array('default' => 3600); $options['results_lifespan_custom'] = array('default' => 0); $options['output_lifespan'] = array('default' => 3600); @@ -38,8 +38,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $options = array(60, 300, 1800, 3600, 21600, 518400); $options = drupal_map_assoc($options, 'format_interval'); $options = array(-1 => t('Never cache')) + $options + array('custom' => t('Custom')); @@ -86,7 +86,7 @@ function options_form(&$form, &$form_state) { ); } - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { $custom_fields = array('output_lifespan', 'results_lifespan'); foreach ($custom_fields as $field) { if ($form_state['values']['cache_options'][$field] == 'custom' && !is_numeric($form_state['values']['cache_options'][$field . '_custom'])) { @@ -95,7 +95,7 @@ function options_validate(&$form, &$form_state) { } } - function summary_title() { + public function summaryTitle() { $results_lifespan = $this->get_lifespan('results'); $output_lifespan = $this->get_lifespan('output'); return format_interval($results_lifespan, 1) . '/' . format_interval($output_lifespan, 1); diff --git a/lib/Drupal/views/Plugin/views/display/Attachment.php b/lib/Drupal/views/Plugin/views/display/Attachment.php index 6320a00cbad32f3c33328d2e2bc794171bef6729..7a1fc1af59c29ce38f9bafa6db5fd4f17587de5d 100644 --- a/lib/Drupal/views/Plugin/views/display/Attachment.php +++ b/lib/Drupal/views/Plugin/views/display/Attachment.php @@ -36,8 +36,8 @@ class Attachment extends DisplayPluginBase { */ protected $usesPager = FALSE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['displays'] = array('default' => array()); $options['attachment_position'] = array('default' => 'before'); @@ -140,9 +140,9 @@ public function optionsSummary(&$categories, &$options) { /** * Provide the default form for setting options. */ - public function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); switch ($form_state['section']) { case 'inherit_arguments': @@ -212,9 +212,9 @@ public function options_form(&$form, &$form_state) { * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - public function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_submit($form, $form_state); + parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { case 'inherit_arguments': case 'inherit_pager': diff --git a/lib/Drupal/views/Plugin/views/display/Block.php b/lib/Drupal/views/Plugin/views/display/Block.php index c21cf5e90c38253370502add667e89f276c788a0..97d66d038b23875839a9a32323286a1c5fb41e4a 100644 --- a/lib/Drupal/views/Plugin/views/display/Block.php +++ b/lib/Drupal/views/Plugin/views/display/Block.php @@ -34,8 +34,8 @@ class Block extends DisplayPluginBase { */ protected $usesAttachments = TRUE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['block_description'] = array('default' => '', 'translatable' => TRUE); $options['block_caching'] = array('default' => DRUPAL_NO_CACHE); @@ -147,9 +147,9 @@ protected function getCacheType() { /** * Provide the default form for setting options. */ - public function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); switch ($form_state['section']) { case 'block_description': @@ -185,9 +185,9 @@ public function options_form(&$form, &$form_state) { * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - public function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_submit($form, $form_state); + parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { case 'display_id': $this->updateBlockBid($form_state['view']->name, $this->display->id, $this->display->new_id); diff --git a/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index b9df99576c00e1654e5f9e5607b28d70283f22db..2908635ae704918a4fec394b92a3e43f85d64458 100644 --- a/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -116,17 +116,17 @@ public function init(&$view, &$display, $options = NULL) { } views_include('cache'); - // Cache for unpack_options, but not if we are in the ui. + // Cache for unpackOptions, but not if we are in the ui. static $unpack_options = array(); if (empty($view->editing)) { - $cid = 'unpack_options:' . md5(serialize(array($this->options, $options))); + $cid = 'unpackOptions:' . md5(serialize(array($this->options, $options))); if (empty($unpack_options[$cid])) { $cache = views_cache_get($cid, TRUE); if (!empty($cache->data)) { $this->options = $cache->data; } else { - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); views_cache_set($cid, $this->options, TRUE); } $unpack_options[$cid] = $this->options; @@ -136,7 +136,7 @@ public function init(&$view, &$display, $options = NULL) { } } else { - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } // Convert the field_language and field_language_add_to_query settings. @@ -412,7 +412,7 @@ public function defaultableSections($section = NULL) { } } - public function option_definition() { + protected function defineOptions() { $options = array( 'defaults' => array( 'default' => array( @@ -1118,8 +1118,8 @@ public function optionsSummary(&$categories, &$options) { $manager = new ViewsPluginManager('style'); $style_plugin = $manager->getDefinition($this->getOption('style_plugin')); $style_plugin_instance = $this->getPlugin('style'); - $style_summary = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin_instance->summary_title(); - $style_title = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin_instance->plugin_title(); + $style_summary = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin_instance->summaryTitle(); + $style_title = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin_instance->pluginTitle(); $style = ''; @@ -1140,8 +1140,8 @@ public function optionsSummary(&$categories, &$options) { $manager = new ViewsPluginManager('row'); $row_plugin = $manager->getDefinition($this->getOption('row_plugin')); $row_plugin_instance = $this->getPlugin('row'); - $row_summary = empty($row_plugin['title']) ? t('Missing style plugin') : $row_plugin_instance->summary_title(); - $row_title = empty($row_plugin['title']) ? t('Missing style plugin') : $row_plugin_instance->plugin_title(); + $row_summary = empty($row_plugin['title']) ? t('Missing style plugin') : $row_plugin_instance->summaryTitle(); + $row_title = empty($row_plugin['title']) ? t('Missing style plugin') : $row_plugin_instance->pluginTitle(); $options['row_plugin'] = array( 'category' => 'format', @@ -1186,12 +1186,12 @@ public function optionsSummary(&$categories, &$options) { $pager_plugin = views_get_plugin('pager', 'none'); } - $pager_str = $pager_plugin->summary_title(); + $pager_str = $pager_plugin->summaryTitle(); $options['pager'] = array( 'category' => 'pager', 'title' => t('Use pager'), - 'value' => $pager_plugin->plugin_title(), + 'value' => $pager_plugin->pluginTitle(), 'setting' => $pager_str, 'desc' => t("Change this display's pager setting."), ); @@ -1252,12 +1252,12 @@ public function optionsSummary(&$categories, &$options) { $access_plugin = views_get_plugin('access', 'none'); } - $access_str = $access_plugin->summary_title(); + $access_str = $access_plugin->summaryTitle(); $options['access'] = array( 'category' => 'access', 'title' => t('Access'), - 'value' => $access_plugin->plugin_title(), + 'value' => $access_plugin->pluginTitle(), 'setting' => $access_str, 'desc' => t('Specify access control type for this display.'), ); @@ -1272,12 +1272,12 @@ public function optionsSummary(&$categories, &$options) { $cache_plugin = views_get_plugin('cache', 'none'); } - $cache_str = $cache_plugin->summary_title(); + $cache_str = $cache_plugin->summaryTitle(); $options['cache'] = array( 'category' => 'other', 'title' => t('Caching'), - 'value' => $cache_plugin->plugin_title(), + 'value' => $cache_plugin->pluginTitle(), 'setting' => $cache_str, 'desc' => t('Specify caching type for this display.'), ); @@ -1317,12 +1317,12 @@ public function optionsSummary(&$categories, &$options) { $exposed_form_plugin = views_get_plugin('exposed_form', 'basic'); } - $exposed_form_str = $exposed_form_plugin->summary_title(); + $exposed_form_str = $exposed_form_plugin->summaryTitle(); $options['exposed_form'] = array( 'category' => 'exposed', 'title' => t('Exposed form style'), - 'value' => $exposed_form_plugin->plugin_title(), + 'value' => $exposed_form_plugin->pluginTitle(), 'setting' => $exposed_form_str, 'desc' => t('Select the kind of exposed filter to use.'), ); @@ -1358,8 +1358,8 @@ public function optionsSummary(&$categories, &$options) { /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); if ($this->defaultableSections($form_state['section'])) { views_ui_standard_display_dropdown($form, $form_state, $form_state['section']); } @@ -1530,7 +1530,7 @@ function options_form(&$form, &$form_state) { '#type' => 'value', '#value' => $access['type'], ); - $plugin->options_form($form['access_options'], $form_state); + $plugin->buildOptionsForm($form['access_options'], $form_state); } break; case 'cache': @@ -1569,7 +1569,7 @@ function options_form(&$form, &$form_state) { '#type' => 'value', '#value' => $cache['type'], ); - $plugin->options_form($form['cache_options'], $form_state); + $plugin->buildOptionsForm($form['cache_options'], $form_state); } break; case 'query': @@ -1590,7 +1590,7 @@ function options_form(&$form, &$form_state) { ), ); - $this->view->query->options_form($form['query']['options'], $form_state); + $this->view->query->buildOptionsForm($form['query']['options'], $form_state); } break; case 'field_language': @@ -1673,7 +1673,7 @@ function options_form(&$form, &$form_state) { $form[$form_state['section']] = array( '#tree' => TRUE, ); - $plugin->options_form($form[$form_state['section']], $form_state); + $plugin->buildOptionsForm($form[$form_state['section']], $form_state); } break; case 'row_plugin': @@ -1823,8 +1823,8 @@ function options_form(&$form, &$form_state) { // not have themes. The 'feed' display, for example, completely // delegates to the style. if (!empty($this->definition['theme'])) { - $funcs[] = $this->optionLink(t('Display output'), 'analyze-theme-display') . ': ' . $this->formatThemes($this->theme_functions()); - $themes = $this->additional_theme_functions(); + $funcs[] = $this->optionLink(t('Display output'), 'analyze-theme-display') . ': ' . $this->formatThemes($this->themeFunctions()); + $themes = $this->additionalThemeFunctions(); if ($themes) { foreach ($themes as $theme) { $funcs[] = $this->optionLink(t('Alternative display output'), 'analyze-theme-display') . ': ' . $this->formatThemes($theme); @@ -1834,8 +1834,8 @@ function options_form(&$form, &$form_state) { $plugin = $this->getPlugin(); if ($plugin) { - $funcs[] = $this->optionLink(t('Style output'), 'analyze-theme-style') . ': ' . $this->formatThemes($plugin->theme_functions(), $plugin->additional_theme_functions()); - $themes = $plugin->additional_theme_functions(); + $funcs[] = $this->optionLink(t('Style output'), 'analyze-theme-style') . ': ' . $this->formatThemes($plugin->themeFunctions(), $plugin->additionalThemeFunctions()); + $themes = $plugin->additionalThemeFunctions(); if ($themes) { foreach ($themes as $theme) { $funcs[] = $this->optionLink(t('Alternative style'), 'analyze-theme-style') . ': ' . $this->formatThemes($theme); @@ -1845,8 +1845,8 @@ function options_form(&$form, &$form_state) { if ($plugin->usesRowPlugin()) { $row_plugin = $this->getPlugin('row'); if ($row_plugin) { - $funcs[] = $this->optionLink(t('Row style output'), 'analyze-theme-row') . ': ' . $this->formatThemes($row_plugin->theme_functions()); - $themes = $row_plugin->additional_theme_functions(); + $funcs[] = $this->optionLink(t('Row style output'), 'analyze-theme-row') . ': ' . $this->formatThemes($row_plugin->themeFunctions()); + $themes = $row_plugin->additionalThemeFunctions(); if ($themes) { foreach ($themes as $theme) { $funcs[] = $this->optionLink(t('Alternative row style'), 'analyze-theme-row') . ': ' . $this->formatThemes($theme); @@ -1857,7 +1857,7 @@ function options_form(&$form, &$form_state) { if ($plugin->usesFields()) { foreach ($this->getHandlers('field') as $id => $handler) { - $funcs[] = $this->optionLink(t('Field @field (ID: @id)', array('@field' => $handler->ui_name(), '@id' => $id)), 'analyze-theme-field') . ': ' . $this->formatThemes($handler->theme_functions()); + $funcs[] = $this->optionLink(t('Field @field (ID: @id)', array('@field' => $handler->ui_name(), '@id' => $id)), 'analyze-theme-field') . ': ' . $this->formatThemes($handler->themeFunctions()); } } } @@ -2053,7 +2053,7 @@ function options_form(&$form, &$form_state) { $form['exposed_form_options'] = array( '#tree' => TRUE, ); - $plugin->options_form($form['exposed_form_options'], $form_state); + $plugin->buildOptionsForm($form['exposed_form_options'], $form_state); } break; case 'pager': @@ -2088,13 +2088,13 @@ function options_form(&$form, &$form_state) { $form['pager_options'] = array( '#tree' => TRUE, ); - $plugin->options_form($form['pager_options'], $form_state); + $plugin->buildOptionsForm($form['pager_options'], $form_state); } break; } foreach ($this->extender as $extender) { - $extender->options_form($form, $form_state); + $extender->buildOptionsForm($form, $form_state); } } @@ -2129,7 +2129,7 @@ protected function formatThemes($themes) { /** * Validate the options form. */ - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { switch ($form_state['section']) { case 'display_title': if (empty($form_state['values']['display_title'])) { @@ -2161,42 +2161,42 @@ function options_validate(&$form, &$form_state) { // if row, $style will be empty. $plugin = $this->getPlugin(empty($style) ? 'row' : 'style'); if ($plugin) { - $plugin->options_validate($form[$form_state['section']], $form_state); + $plugin->validateOptionsForm($form[$form_state['section']], $form_state); } break; case 'access_options': $plugin = $this->getPlugin('access'); if ($plugin) { - $plugin->options_validate($form['access_options'], $form_state); + $plugin->validateOptionsForm($form['access_options'], $form_state); } break; case 'query': if ($this->view->query) { - $this->view->query->options_validate($form['query'], $form_state); + $this->view->query->validateOptionsForm($form['query'], $form_state); } break; case 'cache_options': $plugin = $this->getPlugin('cache'); if ($plugin) { - $plugin->options_validate($form['cache_options'], $form_state); + $plugin->validateOptionsForm($form['cache_options'], $form_state); } break; case 'exposed_form_options': $plugin = $this->getPlugin('exposed_form'); if ($plugin) { - $plugin->options_validate($form['exposed_form_options'], $form_state); + $plugin->validateOptionsForm($form['exposed_form_options'], $form_state); } break; case 'pager_options': $plugin = $this->getPlugin('pager'); if ($plugin) { - $plugin->options_validate($form['pager_options'], $form_state); + $plugin->validateOptionsForm($form['pager_options'], $form_state); } break; } foreach ($this->extender as $extender) { - $extender->options_validate($form, $form_state); + $extender->validateOptionsForm($form, $form_state); } } @@ -2204,7 +2204,7 @@ function options_validate(&$form, &$form_state) { * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { // Not sure I like this being here, but it seems (?) like a logical place. $cache_plugin = $this->getPlugin('cache'); if ($cache_plugin) { @@ -2239,7 +2239,7 @@ function options_submit(&$form, &$form_state) { case 'access_options': $plugin = views_get_plugin('access', $form_state['values'][$section]['type']); if ($plugin) { - $plugin->options_submit($form['access_options'], $form_state); + $plugin->submitOptionsForm($form['access_options'], $form_state); $this->setOption('access', $form_state['values'][$section]); } break; @@ -2260,14 +2260,14 @@ function options_submit(&$form, &$form_state) { case 'cache_options': $plugin = views_get_plugin('cache', $form_state['values'][$section]['type']); if ($plugin) { - $plugin->options_submit($form['cache_options'], $form_state); + $plugin->submitOptionsForm($form['cache_options'], $form_state); $this->setOption('cache', $form_state['values'][$section]); } break; case 'query': $plugin = $this->get_plugin('query'); if ($plugin) { - $plugin->options_submit($form['query']['options'], $form_state); + $plugin->submitOptionsForm($form['query']['options'], $form_state); $this->setOption('query', $form_state['values'][$section]); } break; @@ -2335,7 +2335,7 @@ function options_submit(&$form, &$form_state) { // if row, $style will be empty. $plugin = $this->getPlugin(empty($style) ? 'row' : 'style'); if ($plugin) { - $plugin->options_submit($form['options'][$section], $form_state); + $plugin->submitOptionsForm($form['options'][$section], $form_state); } $this->setOption($section, $form_state['values'][$section]); break; @@ -2360,7 +2360,7 @@ function options_submit(&$form, &$form_state) { $plugin = $this->getPlugin('exposed_form'); if ($plugin) { $exposed_form = $this->getOption('exposed_form'); - $plugin->options_submit($form['exposed_form_options'], $form_state); + $plugin->submitOptionsForm($form['exposed_form_options'], $form_state); $exposed_form['options'] = $form_state['values'][$section]; $this->setOption('exposed_form', $exposed_form); } @@ -2387,7 +2387,7 @@ function options_submit(&$form, &$form_state) { $plugin = $this->getPlugin('pager'); if ($plugin) { $pager = $this->getOption('pager'); - $plugin->options_submit($form['pager_options'], $form_state); + $plugin->submitOptionsForm($form['pager_options'], $form_state); $pager['options'] = $form_state['values'][$section]; $this->setOption('pager', $pager); } @@ -2395,7 +2395,7 @@ function options_submit(&$form, &$form_state) { } foreach ($this->extender as $extender) { - $extender->options_submit($form, $form_state); + $extender->submitOptionsForm($form, $form_state); } } @@ -2533,7 +2533,7 @@ public function hookMenu() { return array(); } * Render this display. */ public function render() { - return theme($this->theme_functions(), array('view' => $this->view)); + return theme($this->themeFunctions(), array('view' => $this->view)); } public function renderArea($area, $empty = FALSE) { @@ -2743,12 +2743,12 @@ public function viewSpecialBlocks($type) { } /** - * Override of export_option() + * Override of exportOption() * * Because displays do not want to export options that are NOT overridden from the * default display, we need some special handling during the export process. */ - function export_option($indent, $prefix, $storage, $option, $definition, $parents) { + public function exportOption($indent, $prefix, $storage, $option, $definition, $parents) { // The $prefix is wrong because we store our actual options a little differently: $prefix = '$handler->display->display_options'; $output = ''; @@ -2765,14 +2765,14 @@ function export_option($indent, $prefix, $storage, $option, $definition, $parent } } - $output .= parent::export_option($indent, $prefix, $storage, $option, $definition, $parents); + $output .= parent::exportOption($indent, $prefix, $storage, $option, $definition, $parents); return $output; } /** * Special method to export items that have handlers. * - * This method was specified in the option_definition() as the method to utilize to + * This method was specified in the defineOptions() as the method to utilize to * export fields, filters, sort criteria, relationships and arguments. This passes * the export off to the individual handlers so that they can export themselves * properly. @@ -2813,7 +2813,7 @@ public function exportHandler($indent, $prefix, $storage, $option, $definition, if ($handler) { $handler->init($this->view, $info); $output .= $indent . '/* ' . $types[$type]['stitle'] . ': ' . $handler->ui_name() . " */\n"; - $output .= $handler->export_options($indent, $prefix . "['$option']['$id']"); + $output .= $handler->exportOptions($indent, $prefix . "['$option']['$id']"); } // Prevent reference problems. @@ -2855,7 +2855,7 @@ public function exportStyle($indent, $prefix, $storage, $option, $definition, $p $output .= $indent . $prefix . "['$option'] = '$value';\n"; // Pass off to the plugin to export itself. - $output .= $plugin->export_options($indent, $prefix . "['$options_field']"); + $output .= $plugin->exportOptions($indent, $prefix . "['$options_field']"); } return $output; @@ -2885,7 +2885,7 @@ public function exportPlugin($indent, $prefix, $storage, $option, $definition, $ } // Pass off to the plugin to export itself. - $output .= $plugin->export_options($indent, $new_prefix); + $output .= $plugin->exportOptions($indent, $new_prefix); } return $output; @@ -2911,7 +2911,7 @@ public function unpackStyle($indent, $prefix, $storage, $option, $definition, $p } if ($plugin) { - return $plugin->unpack_translatables($translatable, $parents); + return $plugin->unpackTranslatables($translatable, $parents); } } @@ -2923,14 +2923,14 @@ public function unpackPlugin(&$translatable, $storage, $option, $definition, $pa $plugin = $this->getPlugin($plugin_type); if ($plugin) { // Write which plugin to use. - return $plugin->unpack_translatables($translatable, $parents); + return $plugin->unpackTranslatables($translatable, $parents); } } /** * Special method to unpack items that have handlers. * - * This method was specified in the option_definition() as the method to utilize to + * This method was specified in the defineOptions() as the method to utilize to * export fields, filters, sort criteria, relationships and arguments. This passes * the export off to the individual handlers so that they can export themselves * properly. @@ -2957,7 +2957,7 @@ public function unpackHandler(&$translatable, $storage, $option, $definition, $p $handler = views_get_handler($info['table'], $info['field'], $handler_type); if ($handler) { $handler->init($this->view, $info); - $handler->unpack_translatables($translatable, array_merge($parents, array($type, $info['table'], $info['id']))); + $handler->unpackTranslatables($translatable, array_merge($parents, array($type, $info['table'], $info['id']))); } // Prevent reference problems. diff --git a/lib/Drupal/views/Plugin/views/display/Feed.php b/lib/Drupal/views/Plugin/views/display/Feed.php index 93ee122f0712165ba541a0393b32e1d03e8f7f21..5be7fa289508f266c78fd415181147415bb893e0 100644 --- a/lib/Drupal/views/Plugin/views/display/Feed.php +++ b/lib/Drupal/views/Plugin/views/display/Feed.php @@ -107,8 +107,8 @@ public function defaultableSections($section = NULL) { return $sections; } - public function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['displays'] = array('default' => array()); @@ -171,10 +171,10 @@ public function optionsSummary(&$categories, &$options) { /** * Provide the default form for setting options. */ - public function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // It is very important to call the parent function here. - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); switch ($form_state['section']) { case 'title': @@ -217,9 +217,9 @@ public function options_form(&$form, &$form_state) { * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - public function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_submit($form, $form_state); + parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { case 'title': $this->setOption('sitename_title', $form_state['values']['sitename_title']); diff --git a/lib/Drupal/views/Plugin/views/display/Page.php b/lib/Drupal/views/Plugin/views/display/Page.php index 517473e459c5f910585bf2e7fa3eed0ccff264b1..3d0f0b568d8732eb5f42e4d242bc4fbbea56e0b1 100644 --- a/lib/Drupal/views/Plugin/views/display/Page.php +++ b/lib/Drupal/views/Plugin/views/display/Page.php @@ -42,8 +42,8 @@ class Page extends DisplayPluginBase { public function hasPath() { return TRUE; } public function usesBreadcrumb() { return TRUE; } - public function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['path'] = array('default' => ''); $options['menu'] = array( @@ -321,10 +321,10 @@ public function optionsSummary(&$categories, &$options) { /** * Provide the default form for setting options. */ - public function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // It is very important to call the parent function here: - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); switch ($form_state['section']) { case 'path': @@ -562,9 +562,9 @@ public function options_form(&$form, &$form_state) { } } - public function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_validate($form, $form_state); + parent::validateOptionsForm($form, $form_state); switch ($form_state['section']) { case 'path': if (strpos($form_state['values']['path'], '$arg') !== FALSE) { @@ -599,9 +599,9 @@ public function options_validate(&$form, &$form_state) { } } - public function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { // It is very important to call the parent function here: - parent::options_submit($form, $form_state); + parent::submitOptionsForm($form, $form_state); switch ($form_state['section']) { case 'path': $this->setOption('path', $form_state['values']['path']); diff --git a/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php b/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php index 198adcd5af6f41d651d5aca038ba15a439d928c4..d9904a3e5a5c3c6464819ccc3b0b73d2d58b2c01 100644 --- a/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php +++ b/lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php @@ -30,17 +30,17 @@ public function options_definition_alter(&$options) { } /** * Provide a form to edit options for this plugin. */ - public function options_form(&$form, &$form_state) { } + public function buildOptionsForm(&$form, &$form_state) { } /** * Validate the options form. */ - public function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Handle any special handling on the validate form. */ - public function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } /** * Set up any variables on the view prior to execution. diff --git a/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php b/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php index 40fecf795c7379669788ff5a0e8f785cc2330f49..aecbfa7e1a8409b6637b58614e7ce3fc94c7378e 100644 --- a/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php +++ b/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php @@ -41,11 +41,11 @@ function init(&$view, &$display, $options = array()) { $this->view = &$view; $this->display = &$display; - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['submit_button'] = array('default' => 'Apply', 'translatable' => TRUE); $options['reset_button'] = array('default' => FALSE, 'bool' => TRUE); $options['reset_button_label'] = array('default' => 'Reset', 'translatable' => TRUE); @@ -57,8 +57,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['submit_button'] = array( '#type' => 'textfield', '#title' => t('Submit button text'), @@ -172,7 +172,7 @@ function render_exposed_form($block = FALSE) { } } - function query() { + public function query() { $view = $this->view; $exposed_data = isset($view->exposed_data) ? $view->exposed_data : array(); $sort_by = isset($exposed_data['sort_by']) ? $exposed_data['sort_by'] : NULL; diff --git a/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php b/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php index 3ec4f9eeb074310dd8d41c9be555955998bd9aa7..c73a10e52998e75cf41612cb4c7673923a8b88e7 100644 --- a/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php +++ b/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php @@ -23,16 +23,16 @@ */ class InputRequired extends ExposedFormPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['text_input_required'] = array('default' => 'Select any filter and click on Apply to see results', 'translatable' => TRUE); $options['text_input_required_format'] = array('default' => NULL); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['text_input_required'] = array( '#type' => 'text_format', @@ -44,10 +44,10 @@ function options_form(&$form, &$form_state) { ); } - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { $form_state['values']['exposed_form_options']['text_input_required_format'] = $form_state['values']['exposed_form_options']['text_input_required']['format']; $form_state['values']['exposed_form_options']['text_input_required'] = $form_state['values']['exposed_form_options']['text_input_required']['value']; - parent::options_submit($form, $form_state); + parent::submitOptionsForm($form, $form_state); } function exposed_filter_applied() { @@ -92,7 +92,7 @@ function pre_render($values) { } } - function query() { + public function query() { if (!$this->exposed_filter_applied()) { // We return with no query; this will force the empty text. $this->view->built = TRUE; diff --git a/lib/Drupal/views/Plugin/views/field/Boolean.php b/lib/Drupal/views/Plugin/views/field/Boolean.php index 018724e214fc77bec45ae277bde4bf1657f84395..d14a50987ddab5e3c62a35904920b69db34c6b2c 100644 --- a/lib/Drupal/views/Plugin/views/field/Boolean.php +++ b/lib/Drupal/views/Plugin/views/field/Boolean.php @@ -30,8 +30,8 @@ */ class Boolean extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['type'] = array('default' => 'yes-no'); $options['not'] = array('definition bool' => 'reverse'); @@ -52,7 +52,7 @@ function init(&$view, &$options) { $this->formats = array_merge($default_formats, $output_formats); } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { foreach ($this->formats as $key => $item) { $options[$key] = implode('/', $item); } @@ -69,7 +69,7 @@ function options_form(&$form, &$form_state) { '#description' => t('If checked, true will be displayed as false.'), '#default_value' => $this->options['not'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Drupal/views/Plugin/views/field/Broken.php b/lib/Drupal/views/Plugin/views/field/Broken.php index f1edd29e5e844fc22a550f8c11957094c1b939af..d1064fd729f08681a04ac8f6275ff7a3222035c0 100644 --- a/lib/Drupal/views/Plugin/views/field/Broken.php +++ b/lib/Drupal/views/Plugin/views/field/Broken.php @@ -25,8 +25,8 @@ function ui_name($short = FALSE) { } function ensure_my_table() { /* No table to ensure! */ } - function query($group_by = FALSE) { /* No query to run */ } - function options_form(&$form, &$form_state) { + public function query($group_by = FALSE) { /* No query to run */ } + public function buildOptionsForm(&$form, &$form_state) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>', ); diff --git a/lib/Drupal/views/Plugin/views/field/ContextualLinks.php b/lib/Drupal/views/Plugin/views/field/ContextualLinks.php index 7aedacb321ab0d09900bda5dd902e215574400d8..ce7d957744de13f9f96e78a1e1c1464782f2bcc6 100644 --- a/lib/Drupal/views/Plugin/views/field/ContextualLinks.php +++ b/lib/Drupal/views/Plugin/views/field/ContextualLinks.php @@ -20,8 +20,8 @@ */ class ContextualLinks extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['fields'] = array('default' => array()); $options['destination'] = array('default' => 1); @@ -29,7 +29,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $all_fields = $this->view->display_handler->getFieldLabels(); // Offer to include only those fields that follow this one. $field_options = array_slice($all_fields, 0, array_search($this->options['id'], array_keys($all_fields))); @@ -111,6 +111,6 @@ function render($values) { } } - function query() { } + public function query() { } } diff --git a/lib/Drupal/views/Plugin/views/field/Counter.php b/lib/Drupal/views/Plugin/views/field/Counter.php index e44b38a000a7ccc837dbe5aec60f2368a2c3f441..de0289a00b37285630df93e9956e1bbb983600bb 100644 --- a/lib/Drupal/views/Plugin/views/field/Counter.php +++ b/lib/Drupal/views/Plugin/views/field/Counter.php @@ -20,13 +20,13 @@ */ class Counter extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['counter_start'] = array('default' => 1); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['counter_start'] = array( '#type' => 'textfield', '#title' => t('Starting value'), @@ -35,10 +35,10 @@ function options_form(&$form, &$form_state) { '#size' => 2, ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() { + public function query() { // do nothing -- to override the parent query. } diff --git a/lib/Drupal/views/Plugin/views/field/Custom.php b/lib/Drupal/views/Plugin/views/field/Custom.php index f59932ecf2f1eb11154e941fe5818bdbed64e2e8..6c10baab098b9ba350a401b7d4b1a21706814370 100644 --- a/lib/Drupal/views/Plugin/views/field/Custom.php +++ b/lib/Drupal/views/Plugin/views/field/Custom.php @@ -20,12 +20,12 @@ */ class Custom extends FieldPluginBase { - function query() { + public function query() { // do nothing -- to override the parent query. } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); // Override the alter text option to always alter the text. $options['alter']['contains']['alter_text'] = array('default' => TRUE, 'bool' => TRUE); @@ -33,8 +33,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // Remove the checkbox unset($form['alter']['alter_text']); diff --git a/lib/Drupal/views/Plugin/views/field/Date.php b/lib/Drupal/views/Plugin/views/field/Date.php index 3155639d8e47c463c9d2403b0061ab3ef8cda6a8..dd5f2fa88c2c205a7f64bf2280d2eca7741db956 100644 --- a/lib/Drupal/views/Plugin/views/field/Date.php +++ b/lib/Drupal/views/Plugin/views/field/Date.php @@ -20,8 +20,8 @@ */ class Date extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['date_format'] = array('default' => 'small'); $options['custom_date_format'] = array('default' => ''); @@ -30,7 +30,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $date_formats = array(); $date_types = system_get_date_types(); @@ -78,7 +78,7 @@ function options_form(&$form, &$form_state) { ); } - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 9829edbb6ce3f8cf1d4989406e7cbcdfe7651945..e0b764ff5f787fa3f250b537c9191518ad0193c3 100644 --- a/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -69,7 +69,7 @@ abstract class FieldPluginBase extends HandlerBase { /** * Construct a new field handler. */ - function construct() { + public function construct() { parent::construct(); $this->additional_fields = array(); @@ -95,7 +95,7 @@ function allow_advanced_render() { /** * Called to add the field to a query. */ - function query() { + public function query() { $this->ensure_my_table(); // Add the field. $params = $this->options['group_type'] != 'group' ? array('function' => $this->options['group_type']) : array(); @@ -407,8 +407,8 @@ function use_string_group_by() { return TRUE; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['label'] = array('default' => $this->definition['title'], 'translatable' => TRUE); $options['exclude'] = array('default' => FALSE, 'bool' => TRUE); @@ -465,7 +465,7 @@ function option_definition() { /** * Performs some cleanup tasks on the options array before saving it. */ - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { $options = &$form_state['values']['options']; $types = array('element_type', 'element_label_type', 'element_wrapper_type'); $classes = array_combine(array('element_class', 'element_label_class', 'element_wrapper_class'), $types); @@ -492,8 +492,8 @@ function options_submit(&$form, &$form_state) { * Default options form that provides the label widget that all fields * should have. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $label = $this->label(); $form['custom_label'] = array( @@ -1591,7 +1591,7 @@ function document_self_tokens(&$tokens) { } * allows sites to override output fairly easily. */ function theme($values) { - return theme($this->theme_functions(), + return theme($this->themeFunctions(), array( 'view' => $this->view, 'field' => $this, @@ -1599,7 +1599,7 @@ function theme($values) { )); } - function theme_functions() { + public function themeFunctions() { $themes = array(); $hook = 'views_view_field'; diff --git a/lib/Drupal/views/Plugin/views/field/FileSize.php b/lib/Drupal/views/Plugin/views/field/FileSize.php index c50eb61e9dab1fb58f3756a9bec7a446a539a757..e52f134d61042e86edc8c35e8f1e8a36bb5f6e17 100644 --- a/lib/Drupal/views/Plugin/views/field/FileSize.php +++ b/lib/Drupal/views/Plugin/views/field/FileSize.php @@ -20,16 +20,16 @@ */ class FileSize extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['file_size_display'] = array('default' => 'formatted'); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['file_size_display'] = array( '#title' => t('File size display'), '#type' => 'select', diff --git a/lib/Drupal/views/Plugin/views/field/MachineName.php b/lib/Drupal/views/Plugin/views/field/MachineName.php index c8dc649bc18aa011c68db762e02a0d26473b8158..14a81c951c99dd53528400408779de01aa03bc9b 100644 --- a/lib/Drupal/views/Plugin/views/field/MachineName.php +++ b/lib/Drupal/views/Plugin/views/field/MachineName.php @@ -46,15 +46,15 @@ function get_value_options() { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['machine_name'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['machine_name'] = array( '#title' => t('Output machine name'), diff --git a/lib/Drupal/views/Plugin/views/field/Markup.php b/lib/Drupal/views/Plugin/views/field/Markup.php index e13d56054c534dcb77683e0d59bfeb4d0377f4b7..1bf71a170fd08db8a3f06462ad9403ea413684da 100644 --- a/lib/Drupal/views/Plugin/views/field/Markup.php +++ b/lib/Drupal/views/Plugin/views/field/Markup.php @@ -29,7 +29,7 @@ class Markup extends FieldPluginBase { /** * Constructor; calls to base object constructor. */ - function construct() { + public function construct() { parent::construct(); $this->format = $this->definition['format']; diff --git a/lib/Drupal/views/Plugin/views/field/Numeric.php b/lib/Drupal/views/Plugin/views/field/Numeric.php index bfafee55fc5fedcb31352690763a946d525b267a..a94028a990119bad6f52a5810e07ea9cf3163c24 100644 --- a/lib/Drupal/views/Plugin/views/field/Numeric.php +++ b/lib/Drupal/views/Plugin/views/field/Numeric.php @@ -24,8 +24,8 @@ */ class Numeric extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['set_precision'] = array('default' => FALSE, 'bool' => TRUE); $options['precision'] = array('default' => 0); @@ -40,7 +40,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { if (!empty($this->definition['float'])) { $form['set_precision'] = array( '#type' => 'checkbox', @@ -123,7 +123,7 @@ function options_form(&$form, &$form_state) { '#description' => t('Text to put after the number, such as currency symbol.'), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Drupal/views/Plugin/views/field/PrerenderList.php b/lib/Drupal/views/Plugin/views/field/PrerenderList.php index 22ee4826dd2ec66f1149d76f1475c3f9796bb112..1a4e130f8f74c48c11c883821a0253400191648e 100644 --- a/lib/Drupal/views/Plugin/views/field/PrerenderList.php +++ b/lib/Drupal/views/Plugin/views/field/PrerenderList.php @@ -35,8 +35,8 @@ class PrerenderList extends FieldPluginBase { */ var $items = array(); - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['type'] = array('default' => 'separator'); $options['separator'] = array('default' => ', '); @@ -44,7 +44,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['type'] = array( '#type' => 'radios', '#title' => t('Display type'), @@ -66,7 +66,7 @@ function options_form(&$form, &$form_state) { ), ), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** diff --git a/lib/Drupal/views/Plugin/views/field/Serialized.php b/lib/Drupal/views/Plugin/views/field/Serialized.php index e94c97da25461476188971c729e631297f0fd298..1598a8a3a547b45f0978c8ccd9fdbe3690b27073 100644 --- a/lib/Drupal/views/Plugin/views/field/Serialized.php +++ b/lib/Drupal/views/Plugin/views/field/Serialized.php @@ -20,16 +20,16 @@ */ class Serialized extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['format'] = array('default' => 'unserialized'); $options['key'] = array('default' => ''); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['format'] = array( '#type' => 'select', @@ -54,7 +54,7 @@ function options_form(&$form, &$form_state) { ); } - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { // Require a key if the format is key. if ($form_state['values']['options']['format'] == 'key' && $form_state['values']['options']['key'] == '') { form_error($form['key'], t('You have to enter a key if you want to display a key of the data.')); diff --git a/lib/Drupal/views/Plugin/views/field/TimeInterval.php b/lib/Drupal/views/Plugin/views/field/TimeInterval.php index 1e81b39309f896efca1c029a2f100a63a7cd278f..ff53056c98540bbb7e0f200f766e07b7ada4ee61 100644 --- a/lib/Drupal/views/Plugin/views/field/TimeInterval.php +++ b/lib/Drupal/views/Plugin/views/field/TimeInterval.php @@ -20,16 +20,16 @@ */ class TimeInterval extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['granularity'] = array('default' => 2); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['granularity'] = array( '#type' => 'textfield', diff --git a/lib/Drupal/views/Plugin/views/field/Url.php b/lib/Drupal/views/Plugin/views/field/Url.php index b3b6a32dd26e92d93f2d36614568446131d2518b..a4c5f12bbc216d9708e5983baec5ff4bf1463163 100644 --- a/lib/Drupal/views/Plugin/views/field/Url.php +++ b/lib/Drupal/views/Plugin/views/field/Url.php @@ -20,8 +20,8 @@ */ class Url extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['display_as_link'] = array('default' => TRUE, 'bool' => TRUE); @@ -31,13 +31,13 @@ function option_definition() { /** * Provide link to the page being visited. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['display_as_link'] = array( '#title' => t('Display as link'), '#type' => 'checkbox', '#default_value' => !empty($this->options['display_as_link']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php b/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php index 9fd6526d9755eb0ce9c1566a00f99447b7db5154..881e1b29e57371d0cd173a4131edca0f477003a3 100644 --- a/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php +++ b/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php @@ -38,7 +38,7 @@ class BooleanOperator extends FilterPluginBase { // Whether to accept NULL as a false value or not var $accept_null = FALSE; - function construct() { + public function construct() { $this->value_value = t('True'); if (isset($this->definition['label'])) { $this->value_value = $this->definition['label']; @@ -84,8 +84,8 @@ function get_value_options() { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['value']['default'] = FALSE; @@ -161,7 +161,7 @@ function expose_options() { $this->options['expose']['required'] = TRUE; } - function query() { + public function query() { $this->ensure_my_table(); $field = "$this->table_alias.$this->real_field"; diff --git a/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php b/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php index cdda5422f06802516689915d52cc1da7b4e5444e..e0300d9c19513deccf27cd64a4c75272ad4eea6a 100644 --- a/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php +++ b/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php @@ -26,7 +26,7 @@ */ class BooleanOperatorString extends BooleanOperator { - function query() { + public function query() { $this->ensure_my_table(); $where = "$this->table_alias.$this->real_field "; diff --git a/lib/Drupal/views/Plugin/views/filter/Broken.php b/lib/Drupal/views/Plugin/views/filter/Broken.php index 768def9869fca42e719f6ae7a167f357a24749c9..6eda1ec246e9e4e20dedd7ae01544f0a7a9fc668 100644 --- a/lib/Drupal/views/Plugin/views/filter/Broken.php +++ b/lib/Drupal/views/Plugin/views/filter/Broken.php @@ -25,8 +25,8 @@ function ui_name($short = FALSE) { } function ensure_my_table() { /* No table to ensure! */ } - function query($group_by = FALSE) { /* No query to run */ } - function options_form(&$form, &$form_state) { + public function query($group_by = FALSE) { /* No query to run */ } + public function buildOptionsForm(&$form, &$form_state) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>', ); diff --git a/lib/Drupal/views/Plugin/views/filter/Combine.php b/lib/Drupal/views/Plugin/views/filter/Combine.php index 01bded9818ee7d69276d39f170ae75d65a28f955..e21f884cfaf5bca9b9993d8f7231738f998cf78d 100644 --- a/lib/Drupal/views/Plugin/views/filter/Combine.php +++ b/lib/Drupal/views/Plugin/views/filter/Combine.php @@ -25,15 +25,15 @@ class Combine extends String { */ var $query; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['fields'] = array('default' => array()); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $this->view->initStyle(); // Allow to choose all fields as possible @@ -58,7 +58,7 @@ function options_form(&$form, &$form_state) { } } - function query() { + public function query() { $this->view->_build('field'); $fields = array(); // Only add the fields if they have a proper field and table alias. diff --git a/lib/Drupal/views/Plugin/views/filter/Date.php b/lib/Drupal/views/Plugin/views/filter/Date.php index c3cd59399c17d26e7b32d90d1ec7c7ea78c36e4b..bbc4f2ec6e6287ec101190dcb406624af2c2f9c8 100644 --- a/lib/Drupal/views/Plugin/views/filter/Date.php +++ b/lib/Drupal/views/Plugin/views/filter/Date.php @@ -20,8 +20,8 @@ */ class Date extends Numeric { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); // value is already set up properly, we're just adding our new field to it. $options['value']['contains']['type']['default'] = 'date'; @@ -47,15 +47,15 @@ function value_form(&$form, &$form_state) { parent::value_form($form, $form_state); } - function options_validate(&$form, &$form_state) { - parent::options_validate($form, $form_state); + public function validateOptionsForm(&$form, &$form_state) { + parent::validateOptionsForm($form, $form_state); if (!empty($this->options['exposed']) && empty($form_state['values']['options']['expose']['required'])) { // Who cares what the value is if it's exposed and non-required. return; } - $this->validate_valid_time($form['value'], $form_state['values']['options']['operator'], $form_state['values']['options']['value']); + $this->validateValidTime($form['value'], $form_state['values']['options']['operator'], $form_state['values']['options']['value']); } function exposed_validate(&$form, &$form_state) { @@ -76,14 +76,14 @@ function exposed_validate(&$form, &$form_state) { $operator = $this->operator; } - $this->validate_valid_time($this->options['expose']['identifier'], $operator, $value); + $this->validateValidTime($this->options['expose']['identifier'], $operator, $value); } /** * Validate that the time values convert to something usable. */ - function validate_valid_time(&$form, $operator, $value) { + public function validateValidTime(&$form, $operator, $value) { $operators = $this->operators(); if ($operators[$operator]['values'] == 1) { diff --git a/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php index e71fb26eb210e09ce7d3eb535493ea7b8acad577..be96c7df3071d1851d14cea938215d814f0594fc 100644 --- a/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php +++ b/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php @@ -104,8 +104,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['operator'] = array('default' => '='); $options['value'] = array('default' => ''); @@ -188,8 +188,8 @@ function is_a_group() { * or to at least make sure all of the functions in this form * are called. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); if ($this->can_expose()) { $this->show_expose_button($form, $form_state); } @@ -229,7 +229,7 @@ function options_form(&$form, &$form_state) { /** * Simple validate handler */ - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { $this->operator_validate($form, $form_state); $this->value_validate($form, $form_state); if (!empty($this->options['exposed']) && !$this->is_a_group()) { @@ -243,7 +243,7 @@ function options_validate(&$form, &$form_state) { /** * Simple submit handler */ - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { unset($form_state['values']['expose_button']); // don't store this. unset($form_state['values']['group_button']); // don't store this. if (!$this->is_a_group()) { @@ -273,7 +273,7 @@ function show_operator_form(&$form, &$form_state) { * This may be overridden by child classes, and it must * define $form['operator']; * - * @see options_form() + * @see buildOptionsForm() */ function operator_form(&$form, &$form_state) { $options = $this->operator_options(); @@ -321,7 +321,7 @@ function show_value_form(&$form, &$form_state) { * This should be overridden by all child classes and it must * define $form['value'] * - * @see options_form() + * @see buildOptionsForm() */ function value_form(&$form, &$form_state) { $form['value'] = array(); } @@ -460,7 +460,7 @@ function show_expose_button(&$form, &$form_state) { /** * Options form subform for exposed filter options. * - * @see options_form() + * @see buildOptionsForm() */ function expose_form(&$form, &$form_state) { $form['#theme'] = 'views_ui_expose_filter_form'; @@ -1367,7 +1367,7 @@ function store_exposed_input($input, $status) { * level of indirection. You will find them in $this->operator * and $this->value respectively. */ - function query() { + public function query() { $this->ensure_my_table(); $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", $this->value, $this->operator); } diff --git a/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php b/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php index 43891ea94176456edaff92da809005cab2d04485..d80e414f6863503cb8a670e297cf8de228392600 100644 --- a/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php +++ b/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php @@ -20,7 +20,7 @@ */ class GroupByNumeric extends Numeric { - function query() { + public function query() { $this->ensure_my_table(); $field = $this->get_field(); diff --git a/lib/Drupal/views/Plugin/views/filter/InOperator.php b/lib/Drupal/views/Plugin/views/filter/InOperator.php index 26448c7538ba2c3d96b8b0325715d357fc62752d..2c33ca2536bc7e71d5015ac1bedd8ed04da97ee4 100644 --- a/lib/Drupal/views/Plugin/views/filter/InOperator.php +++ b/lib/Drupal/views/Plugin/views/filter/InOperator.php @@ -32,7 +32,7 @@ class InOperator extends FilterPluginBase { */ var $value_options = NULL; - function construct() { + public function construct() { parent::construct(); $this->value_title = t('Options'); $this->value_options = NULL; @@ -84,8 +84,8 @@ function expose_form(&$form, &$form_state) { ); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['operator']['default'] = 'in'; $options['value']['default'] = array(); @@ -365,7 +365,7 @@ function admin_summary() { return $operator . (($values !== '') ? ' ' . $values : ''); } - function query() { + public function query() { $info = $this->operators(); if (!empty($info[$this->operator]['method'])) { $this->{$info[$this->operator]['method']}(); @@ -395,7 +395,7 @@ function op_empty() { $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", NULL, $operator); } - function validate() { + public function validate() { $this->get_value_options(); $errors = array(); diff --git a/lib/Drupal/views/Plugin/views/filter/ManyToOne.php b/lib/Drupal/views/Plugin/views/filter/ManyToOne.php index b4ce48a35d9360cff747cdc5fb1f17582e365fd9..7000291c73e3bf0a76b5e1797766be8f2a99da3c 100644 --- a/lib/Drupal/views/Plugin/views/filter/ManyToOne.php +++ b/lib/Drupal/views/Plugin/views/filter/ManyToOne.php @@ -38,18 +38,18 @@ function init(&$view, &$options) { $this->helper = new ManyToOneHelper($this); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['operator']['default'] = 'or'; $options['value']['default'] = array(); if (isset($this->helper)) { - $this->helper->option_definition($options); + $this->helper->defineOptions($options); } else { $helper = new ManyToOneHelper($this); - $helper->option_definition($options); + $helper->defineOptions($options); } return $options; @@ -108,7 +108,7 @@ function value_form(&$form, &$form_state) { parent::value_form($form, $form_state); if (empty($form_state['exposed'])) { - $this->helper->options_form($form, $form_state); + $this->helper->buildOptionsForm($form, $form_state); } } diff --git a/lib/Drupal/views/Plugin/views/filter/Numeric.php b/lib/Drupal/views/Plugin/views/filter/Numeric.php index 417c2dd63c7d9412d84469f34a61a1964f30f460..a6ed129d0fe39b10cb1519916e750ae9db98e9bf 100644 --- a/lib/Drupal/views/Plugin/views/filter/Numeric.php +++ b/lib/Drupal/views/Plugin/views/filter/Numeric.php @@ -23,8 +23,8 @@ class Numeric extends FilterPluginBase { var $always_multiple = TRUE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['value'] = array( 'contains' => array( @@ -243,7 +243,7 @@ function value_form(&$form, &$form_state) { } } - function query() { + public function query() { $this->ensure_my_table(); $field = "$this->table_alias.$this->real_field"; diff --git a/lib/Drupal/views/Plugin/views/filter/String.php b/lib/Drupal/views/Plugin/views/filter/String.php index 70ff23f0fe172e59a462b4a7335c3fc13efbb402..b13d1748241be17f9ce446cd44e6b9591afd990d 100644 --- a/lib/Drupal/views/Plugin/views/filter/String.php +++ b/lib/Drupal/views/Plugin/views/filter/String.php @@ -25,8 +25,8 @@ class String extends FilterPluginBase { // exposed filter options var $always_multiple = TRUE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['expose']['contains']['required'] = array('default' => FALSE, 'bool' => TRUE); @@ -252,7 +252,7 @@ function operator() { * level of indirection. You will find them in $this->operator * and $this->value respectively. */ - function query() { + public function query() { $this->ensure_my_table(); $field = "$this->table_alias.$this->real_field"; diff --git a/lib/Drupal/views/Plugin/views/localization/LocalizationPluginBase.php b/lib/Drupal/views/Plugin/views/localization/LocalizationPluginBase.php index bd3992c7b602ed846b0d86d8ba7c9a840d1cac6a..bc01e5ad62188ab7d549f0c31c80f730c584b326 100644 --- a/lib/Drupal/views/Plugin/views/localization/LocalizationPluginBase.php +++ b/lib/Drupal/views/Plugin/views/localization/LocalizationPluginBase.php @@ -152,7 +152,7 @@ function process_locale_strings($op) { } // Unpack handlers. if (is_object($this->view->display[$display_id]->handler)) { - $this->view->display[$display_id]->handler->unpack_translatables($translatable); + $this->view->display[$display_id]->handler->unpackTranslatables($translatable); } foreach ($translatable as $data) { $data['keys'] = array_merge(array($this->view->name, $display_id), $data['keys']); diff --git a/lib/Drupal/views/Plugin/views/pager/Full.php b/lib/Drupal/views/Plugin/views/pager/Full.php index 95727b6b6a071246851ea099430d5f187be43dd5..68ab731253fdcf04f77cdffb6d55a2a889375570 100644 --- a/lib/Drupal/views/Plugin/views/pager/Full.php +++ b/lib/Drupal/views/Plugin/views/pager/Full.php @@ -24,15 +24,15 @@ */ class Full extends PagerPluginBase { - function summary_title() { + public function summaryTitle() { if (!empty($this->options['offset'])) { return format_plural($this->options['items_per_page'], '@count item, skip @skip', 'Paged, @count items, skip @skip', array('@count' => $this->options['items_per_page'], '@skip' => $this->options['offset'])); } return format_plural($this->options['items_per_page'], '@count item', 'Paged, @count items', array('@count' => $this->options['items_per_page'])); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['items_per_page'] = array('default' => 10); $options['offset'] = array('default' => 0); $options['id'] = array('default' => 0); @@ -65,8 +65,8 @@ function option_definition() { /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $pager_text = $this->display->handler->getPagerText(); $form['items_per_page'] = array( '#title' => $pager_text['items per page title'], @@ -225,7 +225,7 @@ function options_form(&$form, &$form_state) { ); } - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { // Only accept integer values. $error = FALSE; $exposed_options = $form_state['values']['pager_options']['expose']['items_per_page_options']; @@ -258,7 +258,7 @@ function options_validate(&$form, &$form_state) { } } - function query() { + public function query() { if ($this->items_per_page_exposed()) { $query = drupal_container()->get('request')->query; $items_per_page = $query->get('items_per_page'); diff --git a/lib/Drupal/views/Plugin/views/pager/Mini.php b/lib/Drupal/views/Plugin/views/pager/Mini.php index 3eb871a6b7c3f13eb59ad17265582fda2caa755f..d3adb1a126e16fa5404cbf00e4e7f76df240b5a1 100644 --- a/lib/Drupal/views/Plugin/views/pager/Mini.php +++ b/lib/Drupal/views/Plugin/views/pager/Mini.php @@ -24,7 +24,7 @@ */ class Mini extends PagerPluginBase { - function summary_title() { + public function summaryTitle() { if (!empty($this->options['offset'])) { return format_plural($this->options['items_per_page'], 'Mini pager, @count item, skip @skip', 'Mini pager, @count items, skip @skip', array('@count' => $this->options['items_per_page'], '@skip' => $this->options['offset'])); } diff --git a/lib/Drupal/views/Plugin/views/pager/None.php b/lib/Drupal/views/Plugin/views/pager/None.php index b7276a40f7c198d07efc5fd5741a7fdc5359d90d..06ddac843970b77f2d3b43399d085322d24c70df 100644 --- a/lib/Drupal/views/Plugin/views/pager/None.php +++ b/lib/Drupal/views/Plugin/views/pager/None.php @@ -31,15 +31,15 @@ function init(&$view, &$display, $options = array()) { $this->set_items_per_page(0); } - function summary_title() { + public function summaryTitle() { if (!empty($this->options['offset'])) { return t('All items, skip @skip', array('@skip' => $this->options['offset'])); } return t('All items'); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['offset'] = array('default' => 0); return $options; @@ -48,8 +48,8 @@ function option_definition() { /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['offset'] = array( '#type' => 'textfield', '#title' => t('Offset'), @@ -78,7 +78,7 @@ function post_execute(&$result) { $this->total_items = count($result); } - function query() { + public function query() { // The only query modifications we might do are offsets. if (!empty($this->options['offset'])) { $this->view->query->set_offset($this->options['offset']); diff --git a/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php b/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php index d5d2de5f5e590c9185289b0809e1bf9af652ee3f..a6f68c5166036708c726fe1fa86e83f31444867e 100644 --- a/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php +++ b/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php @@ -43,7 +43,7 @@ function init(&$view, &$display, $options = array()) { $this->view = &$view; $this->display = &$display; - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } /** @@ -124,18 +124,18 @@ function get_pager_id() { /** * Provide the default form form for validating options */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Provide the default form form for submitting options */ - function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } /** * Return a string to display as the clickable title for the * pager plugin. */ - function summary_title() { + public function summaryTitle() { return t('Unknown'); } @@ -184,7 +184,7 @@ function update_page_info() { * * This is called during the build phase and can directly modify the query. */ - function query() { } + public function query() { } /** * Perform any needed actions just prior to the query executing. diff --git a/lib/Drupal/views/Plugin/views/pager/Some.php b/lib/Drupal/views/Plugin/views/pager/Some.php index cc6f6c27f60c2ccb51c2b615e14fad3efd04f91b..aa79b06f7d725d4979b0ff34b3340e7db095bca0 100644 --- a/lib/Drupal/views/Plugin/views/pager/Some.php +++ b/lib/Drupal/views/Plugin/views/pager/Some.php @@ -24,15 +24,15 @@ */ class Some extends PagerPluginBase { - function summary_title() { + public function summaryTitle() { if (!empty($this->options['offset'])) { return format_plural($this->options['items_per_page'], '@count item, skip @skip', '@count items, skip @skip', array('@count' => $this->options['items_per_page'], '@skip' => $this->options['offset'])); } return format_plural($this->options['items_per_page'], '@count item', '@count items', array('@count' => $this->options['items_per_page'])); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['items_per_page'] = array('default' => 10); $options['offset'] = array('default' => 0); @@ -42,8 +42,8 @@ function option_definition() { /** * Provide the default form for setting options. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $pager_text = $this->display->handler->getPagerText(); $form['items_per_page'] = array( '#title' => $pager_text['items per page title'], @@ -68,7 +68,7 @@ function use_count_query() { return FALSE; } - function query() { + public function query() { $this->view->query->set_limit($this->options['items_per_page']); $this->view->query->set_offset($this->options['offset']); } diff --git a/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php b/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php index a52f23ded4dc40d7f7ed72369705c19f8b59e74f..62520f0e163cf1839402f3bfa1bda31534ca411f 100644 --- a/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php +++ b/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php @@ -27,7 +27,7 @@ abstract class QueryPluginBase extends PluginBase implements QueryInterface { function init($base_table, $base_field, $options) { $this->base_table = $base_table; $this->base_field = $base_field; - $this->unpack_options($this->options, $options); + $this->unpackOptions($this->options, $options); } /** @@ -37,7 +37,7 @@ function init($base_table, $base_field, $options) { * @param $get_count * Provide a countquery if this is true, otherwise provide a normal query. */ - function query($get_count = FALSE) { } + public function query($get_count = FALSE) { } /** * Let modules modify the query just prior to finalizing it. @@ -91,15 +91,15 @@ function get_aggregation_info() { } /** * Add settings for the ui. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); } - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } - function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } - function summary_title() { + public function summaryTitle() { return t('Settings'); } diff --git a/lib/Drupal/views/Plugin/views/query/Sql.php b/lib/Drupal/views/Plugin/views/query/Sql.php index 9146d4f6be7f768fa6fc75c4b5318f3334a95cce..c1434efbd7ca8dfb7f3d8560a7c640ec1840086c 100644 --- a/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/lib/Drupal/views/Plugin/views/query/Sql.php @@ -184,8 +184,8 @@ function set_header($header) { $this->header = $header; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['disable_sql_rewrite'] = array( 'default' => FALSE, 'translatable' => FALSE, @@ -212,8 +212,8 @@ function option_definition() { /** * Add settings for the ui. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['disable_sql_rewrite'] = array( '#title' => t('Disable SQL rewriting'), @@ -253,7 +253,7 @@ function options_form(&$form, &$form_state) { /** * Special submit handling. */ - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { $element = array('#parents' => array('query', 'options', 'query_tags')); $value = explode(',', drupal_array_get_nested_value($form_state['values'], $element['#parents'])); $value = array_filter(array_map('trim', $value)); @@ -1240,7 +1240,7 @@ function compile_fields($query) { * @param $get_count * Provide a countquery if this is true, otherwise provide a normal query. */ - function query($get_count = FALSE) { + public function query($get_count = FALSE) { // Check query distinct value. if (empty($this->no_distinct) && $this->distinct && !empty($this->fields)) { $base_field_alias = $this->add_field($this->base_table, $this->base_field); diff --git a/lib/Drupal/views/Plugin/views/relationship/Broken.php b/lib/Drupal/views/Plugin/views/relationship/Broken.php index d551db07352b1ed6467b484d63400847b2b9d408..4bf31dd89dce315526f730ba9c80018d0e7d526f 100644 --- a/lib/Drupal/views/Plugin/views/relationship/Broken.php +++ b/lib/Drupal/views/Plugin/views/relationship/Broken.php @@ -25,8 +25,8 @@ function ui_name($short = FALSE) { } function ensure_my_table() { /* No table to ensure! */ } - function query() { /* No query to run */ } - function options_form(&$form, &$form_state) { + public function query() { /* No query to run */ } + public function buildOptionsForm(&$form, &$form_state) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>', ); diff --git a/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php b/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php index 45c49e643bf28684ef1a2c90c5c2205527181ab5..4712dd15cad18920b13442a32f2b86bd1ba04119 100644 --- a/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php +++ b/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php @@ -68,8 +68,8 @@ class GroupwiseMax extends RelationshipPluginBase { /** * Defines default values for options. */ - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['subquery_sort'] = array('default' => NULL); // Descending more useful. @@ -85,8 +85,8 @@ function option_definition() { * Extends the relationship's basic options, allowing the user to pick * a sort and an order for it. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // Get the sorts that apply to our base. $sorts = views_fetch_fields($this->definition['base'], 'sort'); @@ -172,7 +172,7 @@ function get_temporary_view() { /** * When the form is submitted, take sure to clear the subquery string cache. */ - function options_form_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { $cid = 'views_relationship_groupwise_max:' . $this->view->name . ':' . $this->view->current_display . ':' . $this->options['id']; cache('views_data')->delete($cid); } @@ -338,7 +338,7 @@ function condition_namespace($string) { * This is mostly a copy of our parent's query() except for this bit with * the join class. */ - function query() { + public function query() { // Figure out what base table this relationship brings to the party. $table_data = views_fetch_data($this->definition['base']); $base_field = empty($this->definition['base field']) ? $table_data['table']['base']['field'] : $this->definition['base field']; diff --git a/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php b/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php index 7a268dba182fd4fb112094cd2faba9cc5c084c58..603859db18ac9c1217234c9883ed2d7612209775 100644 --- a/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php +++ b/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php @@ -69,8 +69,8 @@ function label() { return $this->options['label']; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); // Relationships definitions should define a default label, but if they aren't get another default value. @@ -91,8 +91,8 @@ function option_definition() { * Default options form that provides the label widget that all fields * should have. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['label'] = array( '#type' => 'textfield', '#title' => t('Identifier'), @@ -112,7 +112,7 @@ function options_form(&$form, &$form_state) { /** * Called to implement a relationship in a query. */ - function query() { + public function query() { // Figure out what base table this relationship brings to the party. $table_data = views_fetch_data($this->definition['base']); $base_field = empty($this->definition['base field']) ? $table_data['table']['base']['field'] : $this->definition['base field']; diff --git a/lib/Drupal/views/Plugin/views/row/Fields.php b/lib/Drupal/views/Plugin/views/row/Fields.php index 6d79ad8dd86239962f8609cc0a60fc0fca8b7bf0..673457e3362e48d036a0e97db936adbd10cb489b 100644 --- a/lib/Drupal/views/Plugin/views/row/Fields.php +++ b/lib/Drupal/views/Plugin/views/row/Fields.php @@ -35,8 +35,8 @@ class Fields extends RowPluginBase { */ protected $usesFields = TRUE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['inline'] = array('default' => array()); $options['separator'] = array('default' => ''); @@ -48,8 +48,8 @@ function option_definition() { /** * Provide a form for setting options. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $options = $this->display->handler->getFieldLabels(); if (empty($this->options['inline'])) { @@ -102,7 +102,7 @@ function options_form(&$form, &$form_state) { * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { $form_state['values']['row_options']['inline'] = array_filter($form_state['values']['row_options']['inline']); } diff --git a/lib/Drupal/views/Plugin/views/row/RowPluginBase.php b/lib/Drupal/views/Plugin/views/row/RowPluginBase.php index 42be73d31f1e8dea8e6f0b48bef6c75ff4b7b73d..4c23ca01bd376d2816b94751e39e465049e6c378 100644 --- a/lib/Drupal/views/Plugin/views/row/RowPluginBase.php +++ b/lib/Drupal/views/Plugin/views/row/RowPluginBase.php @@ -46,7 +46,7 @@ function init(&$view, &$display, $options = NULL) { $this->display = &$display; // Overlay incoming options on top of defaults - $this->unpack_options($this->options, isset($options) ? $options : $display->handler->getOption('row_options')); + $this->unpackOptions($this->options, isset($options) ? $options : $display->handler->getOption('row_options')); } /** @@ -59,8 +59,8 @@ function usesFields() { } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); if (isset($this->base_table)) { $options['relationship'] = array('default' => 'none'); } @@ -71,8 +71,8 @@ function option_definition() { /** * Provide a form for setting options. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); if (isset($this->base_table)) { $view = &$form_state['view']; @@ -120,15 +120,15 @@ function options_form(&$form, &$form_state) { /** * Validate the options form. */ - function options_validate(&$form, &$form_state) { } + public function validateOptionsForm(&$form, &$form_state) { } /** * Perform any necessary changes to the form values prior to storage. * There is no need for this function to actually store the data. */ - function options_submit(&$form, &$form_state) { } + public function submitOptionsForm(&$form, &$form_state) { } - function query() { + public function query() { if (isset($this->base_table)) { if (isset($this->options['relationship']) && isset($this->view->relationship[$this->options['relationship']])) { $relationship = $this->view->relationship[$this->options['relationship']]; @@ -159,7 +159,7 @@ function pre_render($result) { } * The rendered output of a single row, used by the style plugin. */ function render($row) { - return theme($this->theme_functions(), + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, diff --git a/lib/Drupal/views/Plugin/views/row/RssFields.php b/lib/Drupal/views/Plugin/views/row/RssFields.php index 8077bf8f08f0f81488562525205a0c8cb0e04795..03de8dd05e4597b607213bfd17cc4e1ff894544b 100644 --- a/lib/Drupal/views/Plugin/views/row/RssFields.php +++ b/lib/Drupal/views/Plugin/views/row/RssFields.php @@ -30,8 +30,8 @@ class RssFields extends RowPluginBase { */ protected $usesFields = TRUE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['title_field'] = array('default' => ''); $options['link_field'] = array('default' => ''); $options['description_field'] = array('default' => ''); @@ -42,8 +42,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $initial_labels = array('' => t('- None -')); $view_fields_labels = $this->display->handler->getFieldLabels(); @@ -111,7 +111,7 @@ function options_form(&$form, &$form_state) { ); } - function validate() { + public function validate() { $errors = parent::validate(); $required_options = array('title_field', 'link_field', 'description_field', 'creator_field', 'date_field'); foreach ($required_options as $required_option) { @@ -175,7 +175,7 @@ function render($row) { } } - return theme($this->theme_functions(), + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, diff --git a/lib/Drupal/views/Plugin/views/sort/Broken.php b/lib/Drupal/views/Plugin/views/sort/Broken.php index d90bb9ad802147ddb26042cb5478f18c6a77fc34..db1faaf96650882341fedd60ec0d980e45f1f397 100644 --- a/lib/Drupal/views/Plugin/views/sort/Broken.php +++ b/lib/Drupal/views/Plugin/views/sort/Broken.php @@ -25,8 +25,8 @@ function ui_name($short = FALSE) { } function ensure_my_table() { /* No table to ensure! */ } - function query($group_by = FALSE) { /* No query to run */ } - function options_form(&$form, &$form_state) { + public function query($group_by = FALSE) { /* No query to run */ } + public function buildOptionsForm(&$form, &$form_state) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>', ); diff --git a/lib/Drupal/views/Plugin/views/sort/Date.php b/lib/Drupal/views/Plugin/views/sort/Date.php index 279ddc090b070d8fb7ae37bc972c088da2409f93..7714005b979013c5ad14e48b3c2397a79623db61 100644 --- a/lib/Drupal/views/Plugin/views/sort/Date.php +++ b/lib/Drupal/views/Plugin/views/sort/Date.php @@ -21,16 +21,16 @@ */ class Date extends SortPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['granularity'] = array('default' => 'second'); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['granularity'] = array( '#type' => 'radios', @@ -51,7 +51,7 @@ function options_form(&$form, &$form_state) { /** * Called to add the sort to a query. */ - function query() { + public function query() { $this->ensure_my_table(); switch ($this->options['granularity']) { case 'second': diff --git a/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php b/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php index 824bfcd1dcedccfa44df40136120930e9a2beae1..f434a4e00bec5b910da24b0a37fae57419747ee1 100644 --- a/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php +++ b/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php @@ -29,7 +29,7 @@ function init(&$view, &$options) { /** * Called to add the field to a query. */ - function query() { + public function query() { $this->ensure_my_table(); $params = array( diff --git a/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php b/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php index 9bd46b55e183f45cf83a410718a7db3414ee0989..5be992a54582f63c287ddd4284dcb075ddc53012 100644 --- a/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php +++ b/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php @@ -25,14 +25,14 @@ */ class MenuHierarchy extends SortPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['sort_within_level'] = array('default' => FALSE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['sort_within_level'] = array( '#type' => 'checkbox', '#title' => t('Sort within each hierarchy level'), @@ -41,7 +41,7 @@ function options_form(&$form, &$form_state) { ); } - function query() { + public function query() { $this->ensure_my_table(); $max_depth = isset($this->definition['max depth']) ? $this->definition['max depth'] : MENU_MAX_DEPTH; for ($i = 1; $i <= $max_depth; ++$i) { diff --git a/lib/Drupal/views/Plugin/views/sort/Random.php b/lib/Drupal/views/Plugin/views/sort/Random.php index 076e5ff694b365cb78a378407c08e9ca1b489824..8a5317075dfb7152f9502b2e6d64d0585435f9ce 100644 --- a/lib/Drupal/views/Plugin/views/sort/Random.php +++ b/lib/Drupal/views/Plugin/views/sort/Random.php @@ -18,12 +18,12 @@ */ class Random extends SortPluginBase { - function query() { + public function query() { $this->query->add_orderby('rand'); } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['order']['#access'] = FALSE; } diff --git a/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php b/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php index d73ede63faa76e69c36a5a9709fc4a198c9eaa4c..3b355bdaa702e6840e56f6be0cdbd61c1a578a71 100644 --- a/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php +++ b/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php @@ -31,14 +31,14 @@ function can_expose() { return TRUE; } /** * Called to add the sort to a query. */ - function query() { + public function query() { $this->ensure_my_table(); // Add the field. $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['order'] = array('default' => 'ASC'); $options['exposed'] = array('default' => FALSE, 'bool' => TRUE); @@ -73,8 +73,8 @@ function admin_summary() { /** * Basic options for all sort criteria */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); if ($this->can_expose()) { $this->show_expose_button($form, $form_state); } @@ -138,7 +138,7 @@ function show_expose_button(&$form, &$form_state) { /** * Simple validate handler */ - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { $this->sort_validate($form, $form_state); if (!empty($this->options['exposed'])) { $this->expose_validate($form, $form_state); @@ -149,7 +149,7 @@ function options_validate(&$form, &$form_state) { /** * Simple submit handler */ - function options_submit(&$form, &$form_state) { + public function submitOptionsForm(&$form, &$form_state) { unset($form_state['values']['expose_button']); // don't store this. $this->sort_submit($form, $form_state); if (!empty($this->options['exposed'])) { diff --git a/lib/Drupal/views/Plugin/views/style/DefaultStyle.php b/lib/Drupal/views/Plugin/views/style/DefaultStyle.php index 7e64617905915f076c40b24f1e46839ffc19d6d7..56acebef3d70eae4c15ba06290f27ba30dfb8f51 100644 --- a/lib/Drupal/views/Plugin/views/style/DefaultStyle.php +++ b/lib/Drupal/views/Plugin/views/style/DefaultStyle.php @@ -40,8 +40,8 @@ class DefaultStyle extends StylePluginBase { */ protected $usesRowClass = TRUE; - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); } } diff --git a/lib/Drupal/views/Plugin/views/style/DefaultSummary.php b/lib/Drupal/views/Plugin/views/style/DefaultSummary.php index 93b9d4b21e79156869bd5357af51f68fbaf3e6b3..5cb448fbe9c36c61e295346b51b420c382939421 100644 --- a/lib/Drupal/views/Plugin/views/style/DefaultSummary.php +++ b/lib/Drupal/views/Plugin/views/style/DefaultSummary.php @@ -26,8 +26,8 @@ */ class DefaultSummary extends StylePluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['base_path'] = array('default' => ''); $options['count'] = array('default' => TRUE, 'bool' => TRUE); @@ -37,13 +37,13 @@ function option_definition() { return $options; } - function query() { + public function query() { if (!empty($this->options['override'])) { $this->view->setItemsPerPage(intval($this->options['items_per_page'])); } } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['base_path'] = array( '#type' => 'textfield', '#title' => t('Base path'), @@ -84,7 +84,7 @@ function render() { $rows[] = $row; } - return theme($this->theme_functions(), array( + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, 'rows' => $rows diff --git a/lib/Drupal/views/Plugin/views/style/Grid.php b/lib/Drupal/views/Plugin/views/style/Grid.php index 8c1154c4016fdc0ab6265f8269b63b267d19f176..0cfaa2dd837e65c22d14941730c091eb96b5f702 100644 --- a/lib/Drupal/views/Plugin/views/style/Grid.php +++ b/lib/Drupal/views/Plugin/views/style/Grid.php @@ -42,8 +42,8 @@ class Grid extends StylePluginBase { /** * Set default options */ - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['columns'] = array('default' => '4'); $options['alignment'] = array('default' => 'horizontal'); @@ -56,8 +56,8 @@ function option_definition() { /** * Render the given style. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['columns'] = array( '#type' => 'number', '#title' => t('Number of columns'), diff --git a/lib/Drupal/views/Plugin/views/style/HtmlList.php b/lib/Drupal/views/Plugin/views/style/HtmlList.php index d874212ed0e79f44c996ddc7ef036b21acce12d1..a9ca9fd05cf5575655fd9e5d1427204e0d4b1768 100644 --- a/lib/Drupal/views/Plugin/views/style/HtmlList.php +++ b/lib/Drupal/views/Plugin/views/style/HtmlList.php @@ -42,8 +42,8 @@ class HtmlList extends StylePluginBase { /** * Set default options */ - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['type'] = array('default' => 'ul'); $options['class'] = array('default' => ''); @@ -55,8 +55,8 @@ function option_definition() { /** * Render the given style. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['type'] = array( '#type' => 'radios', '#title' => t('List type'), diff --git a/lib/Drupal/views/Plugin/views/style/Rss.php b/lib/Drupal/views/Plugin/views/style/Rss.php index 6f14d66cac91da82734eabdf9756518722d52e2b..987d9dd79eee2859d4968dd56ca43182c9d1fa24 100644 --- a/lib/Drupal/views/Plugin/views/style/Rss.php +++ b/lib/Drupal/views/Plugin/views/style/Rss.php @@ -62,16 +62,16 @@ function attach_to($display_id, $path, $title) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['description'] = array('default' => '', 'translatable' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['description'] = array( '#type' => 'textfield', @@ -132,7 +132,7 @@ function render() { $rows .= $this->row_plugin->render($row); } - $output = theme($this->theme_functions(), + $output = theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, diff --git a/lib/Drupal/views/Plugin/views/style/StylePluginBase.php b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php index 3454b9ef400fd88b46c6d76d5e7a41402658ce42..8bb02b82e4d0fcc3783c595be19c3436f2284f7d 100644 --- a/lib/Drupal/views/Plugin/views/style/StylePluginBase.php +++ b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php @@ -94,7 +94,7 @@ function init(&$view, &$display, $options = NULL) { $this->display = &$display; // Overlay incoming options on top of defaults - $this->unpack_options($this->options, isset($options) ? $options : $display->handler->getOption('style_options')); + $this->unpackOptions($this->options, isset($options) ? $options : $display->handler->getOption('style_options')); if ($this->usesRowPlugin() && $display->handler->getOption('row_plugin')) { $this->row_plugin = $display->handler->getPlugin('row'); @@ -106,7 +106,7 @@ function init(&$view, &$display, $options = NULL) { } - function destroy() { + public function destroy() { parent::destroy(); if (isset($this->row_plugin)) { @@ -221,8 +221,8 @@ function even_empty() { return !empty($this->definition['even empty']); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['grouping'] = array('default' => array()); if ($this->usesRowClass()) { $options['row_class'] = array('default' => ''); @@ -234,8 +234,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); // Only fields-based views can handle grouping. Style plugins can also exclude // themselves from being groupable by setting their "usesGrouping" property // to FALSE. @@ -330,7 +330,7 @@ function options_form(&$form, &$form_state) { } } - function options_validate(&$form, &$form_state) { + public function validateOptionsForm(&$form, &$form_state) { // Don't run validation on style plugins without the grouping setting. if (isset($form_state['values']['style_options']['grouping'])) { // Don't save grouping if no field is specified. @@ -455,7 +455,7 @@ function render_grouping_sets($sets, $level = 0) { } } - $output .= theme($this->theme_functions(), + $output .= theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, @@ -657,7 +657,7 @@ function get_field_value($index, $field) { return $value; } - function validate() { + public function validate() { $errors = parent::validate(); if ($this->usesRowPlugin()) { @@ -675,7 +675,7 @@ function validate() { return $errors; } - function query() { + public function query() { parent::query(); if (isset($this->row_plugin)) { $this->row_plugin->query(); diff --git a/lib/Drupal/views/Plugin/views/style/Table.php b/lib/Drupal/views/Plugin/views/style/Table.php index a9e9b1dc00beece245b6c67346089fc72be540aa..a5ff7d5b2292c64f62e22ef505d187c596fb7a0e 100644 --- a/lib/Drupal/views/Plugin/views/style/Table.php +++ b/lib/Drupal/views/Plugin/views/style/Table.php @@ -59,8 +59,8 @@ class Table extends StylePluginBase { */ public $order; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['columns'] = array('default' => array()); $options['default'] = array('default' => ''); @@ -195,8 +195,8 @@ function sanitize_columns($columns, $fields = NULL) { /** * Render the given style. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $handlers = $this->display->handler->getHandlers('field'); if (empty($handlers)) { $form['error_markup'] = array( diff --git a/lib/Drupal/views/Plugin/views/style/UnformattedSummary.php b/lib/Drupal/views/Plugin/views/style/UnformattedSummary.php index 46a087032cdec1dadf992a869048c0a46b556ee7..d5ed76f76efe6634db7fd807715113e6d6650c85 100644 --- a/lib/Drupal/views/Plugin/views/style/UnformattedSummary.php +++ b/lib/Drupal/views/Plugin/views/style/UnformattedSummary.php @@ -25,15 +25,15 @@ */ class UnformattedSummary extends DefaultSummary { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['inline'] = array('default' => FALSE, 'bool' => TRUE); $options['separator'] = array('default' => ''); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['inline'] = array( '#type' => 'checkbox', '#default_value' => !empty($this->options['inline']), diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php b/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php index f736ba2921668660a72bc071d97310098d55dc6e..3887311f78566c384d9c71f29e1b912269e7327e 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php @@ -37,7 +37,7 @@ function build_form($form, &$form_state); * An empty array if the view is valid; an array of error strings if it is * not. */ - function validate(array $form, array &$form_state); + public function validate(array $form, array &$form_state); /** * Creates a view from values that have already been validated. diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index 38a6d1480a2ea44bdfd293af8a5200da11fff29c..379a3580ba0c1566d12dd8f8018c5f843e3ed92f 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -627,7 +627,7 @@ protected function addDisplays($view, $display_options, $form, $form_state) { // The page display is usually the main one (from the user's point of // view). Its options should therefore become the overall view defaults, // so that new displays which are added later automatically inherit them. - $this->set_default_options($display_options['page'], $display, $default_display); + $this->setDefaultOptions($display_options['page'], $display, $default_display); // Display: Feed (attached to the page). if (isset($display_options['feed'])) { @@ -642,7 +642,7 @@ protected function addDisplays($view, $display_options, $form, $form_state) { // When there is no page, the block display options should become the // overall view defaults. if (!isset($display_options['page'])) { - $this->set_default_options($display_options['block'], $display, $default_display); + $this->setDefaultOptions($display_options['block'], $display, $default_display); } else { $this->set_override_options($display_options['block'], $display, $default_display); @@ -892,7 +892,7 @@ protected function page_feed_display_options($form, $form_state) { * @param $default_display * The default display, which will store the options when possible. */ - protected function set_default_options($options, $display, $default_display) { + protected function setDefaultOptions($options, $display, $default_display) { foreach ($options as $option => $value) { // If the default display supports this option, set the value there. // Otherwise, set it on the provided display. @@ -912,7 +912,7 @@ protected function set_default_options($options, $display, $default_display) { * This function can be used to set options for a display when it is desired * that the options inherit from the default display whenever possible. This * avoids setting too many options as overrides, which will be harder for the - * user to modify later. For example, if $this->set_default_options() was + * user to modify later. For example, if $this->setDefaultOptions() was * previously called on a page display and then this function is called on a * block display, and if the user entered the same title for both displays in * the views wizard, then the view will wind up with the title stored as the @@ -986,7 +986,7 @@ protected function set_validated_view(array $form, array &$form_state, View $vie * * Instantiates the view from the form submission and validates its values. */ - function validate(array $form, array &$form_state) { + public function validate(array $form, array &$form_state) { $view = $this->instantiate_view($form, $form_state); $errors = $view->validate(); if (!is_array($errors) || empty($errors)) { diff --git a/lib/Drupal/views/Tests/BasicTest.php b/lib/Drupal/views/Tests/BasicTest.php index f89a9a3be53dea29a8c21cfe701f908d48dfa461..0eaa0785b53adfcfc0599018382c21ef465a0e24 100644 --- a/lib/Drupal/views/Tests/BasicTest.php +++ b/lib/Drupal/views/Tests/BasicTest.php @@ -119,8 +119,10 @@ public function testSimpleArgument() { 'breadcrumb' => '', 'default_argument_type' => 'fixed', 'default_argument' => '', - 'validate_type' => 'none', - 'validate_fail' => 'not found', + 'validate' => array( + 'type' => 'none', + 'fail' => 'not found', + ), 'break_phrase' => 0, 'not' => 0, 'id' => 'age', diff --git a/lib/Drupal/views/Tests/Handler/ArgumentNullTest.php b/lib/Drupal/views/Tests/Handler/ArgumentNullTest.php index c94e2f7d4b63f2fd384619af38de39dc3d108e9e..fc17536d141db67e5de1fd650d74bce9e64eb703 100644 --- a/lib/Drupal/views/Tests/Handler/ArgumentNullTest.php +++ b/lib/Drupal/views/Tests/Handler/ArgumentNullTest.php @@ -51,13 +51,13 @@ public function testAreaText() { // Make sure that the argument is not validated yet. unset($view->argument['null']->argument_validated); - $this->assertTrue($view->argument['null']->validate_arg(26)); + $this->assertTrue($view->argument['null']->validateArgument(26)); // test must_not_be option. unset($view->argument['null']->argument_validated); $view->argument['null']->options['must_not_be'] = TRUE; - $this->assertFalse($view->argument['null']->validate_arg(26), 'must_not_be returns FALSE, if there is an argument'); + $this->assertFalse($view->argument['null']->validateArgument(26), 'must_not_be returns FALSE, if there is an argument'); unset($view->argument['null']->argument_validated); - $this->assertTrue($view->argument['null']->validate_arg(NULL), 'must_not_be returns TRUE, if there is no argument'); + $this->assertTrue($view->argument['null']->validateArgument(NULL), 'must_not_be returns TRUE, if there is no argument'); // Test execution. $view = $this->getBasicView(); diff --git a/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php b/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php index a11c2b158e31f759ce4163dda452c955b23830b6..7411412eacaa2d003759c5cfdb01bd8336d3edc4 100644 --- a/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php +++ b/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php @@ -55,7 +55,7 @@ function testArgumentDefaultNoOptions() { $error = array( '%type' => 'Notice', '!message' => 'Undefined index: ' . $argument_type, - '%function' => 'views_handler_argument->options_validate()', + '%function' => 'views_handler_argument->validateOptionsForm()', ); $message = t('%type: !message in %function', $error); $this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message))); diff --git a/lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php b/lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php index a400fd92cf0352db7ac9a07022479d076f498928..9fe68da1a8d1e007106fbfcc7af67ebf4d5b15e3 100644 --- a/lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php +++ b/lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php @@ -28,10 +28,10 @@ function testArgumentValidatePhp() { $view->setDisplay('default'); $view->preExecute(); $view->initHandlers(); - $this->assertTrue($view->argument['null']->validate_arg($string)); + $this->assertTrue($view->argument['null']->validateArgument($string)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; - $this->assertFalse($view->argument['null']->validate_arg($this->randomName())); + $this->assertFalse($view->argument['null']->validateArgument($this->randomName())); } function testArgumentValidateNumeric() { @@ -39,10 +39,10 @@ function testArgumentValidateNumeric() { $view->setDisplay('default'); $view->preExecute(); $view->initHandlers(); - $this->assertFalse($view->argument['null']->validate_arg($this->randomString())); + $this->assertFalse($view->argument['null']->validateArgument($this->randomString())); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; - $this->assertTrue($view->argument['null']->validate_arg(12)); + $this->assertTrue($view->argument['null']->validateArgument(12)); } function view_test_argument_validate_php($string) { diff --git a/lib/Drupal/views/Tests/TranslatableTest.php b/lib/Drupal/views/Tests/TranslatableTest.php index f9183d184fe9df2ed53230b0e6e18470163b1935..822b9df852ecb2065867aa6025b45da55b167635 100644 --- a/lib/Drupal/views/Tests/TranslatableTest.php +++ b/lib/Drupal/views/Tests/TranslatableTest.php @@ -97,7 +97,7 @@ public function testTranslation() { sort($expected_strings); sort($view->localization_plugin->translated_strings); - // @todo The plugin::unpack_options() method is missing some keys of the + // @todo The plugin::unpackOptions() method is missing some keys of the // display, but calls the translate method two times per item. //$this->assertEqual($expected_strings, $view->localization_plugin->translated_strings, 'Make sure that every string got loaded translated'); } @@ -114,7 +114,7 @@ public function testTranslationKey() { foreach ($view->display as $display_id => $display) { $translatables = array(); - $display->handler->unpack_translatables($translatables); + $display->handler->unpackTranslatables($translatables); $this->string_keys = array( 'Master1' => array('title'), diff --git a/lib/Drupal/views/Tests/User/ArgumentValidateTest.php b/lib/Drupal/views/Tests/User/ArgumentValidateTest.php index 41b18d822dd539a3eed07b6f6b3d963e898b206d..9ec4312b7fb1c48561083936bbe1a53a051165ee 100644 --- a/lib/Drupal/views/Tests/User/ArgumentValidateTest.php +++ b/lib/Drupal/views/Tests/User/ArgumentValidateTest.php @@ -35,15 +35,15 @@ function testArgumentValidateUserUid() { $view->setDisplay('default'); $view->preExecute(); $view->initHandlers(); - $this->assertTrue($view->argument['null']->validate_arg($account->uid)); + $this->assertTrue($view->argument['null']->validateArgument($account->uid)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a string variable since type is 'uid' - $this->assertFalse($view->argument['null']->validate_arg($account->name)); + $this->assertFalse($view->argument['null']->validateArgument($account->name)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a valid numeric, but for a user that doesn't exist - $this->assertFalse($view->argument['null']->validate_arg(32)); + $this->assertFalse($view->argument['null']->validateArgument(32)); } function testArgumentValidateUserName() { @@ -53,15 +53,15 @@ function testArgumentValidateUserName() { $view->setDisplay('default'); $view->preExecute(); $view->initHandlers(); - $this->assertTrue($view->argument['null']->validate_arg($account->name)); + $this->assertTrue($view->argument['null']->validateArgument($account->name)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a uid variable since type is 'name' - $this->assertFalse($view->argument['null']->validate_arg($account->uid)); + $this->assertFalse($view->argument['null']->validateArgument($account->uid)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a valid string, but for a user that doesn't exist - $this->assertFalse($view->argument['null']->validate_arg($this->randomName())); + $this->assertFalse($view->argument['null']->validateArgument($this->randomName())); } function testArgumentValidateUserEither() { @@ -71,19 +71,19 @@ function testArgumentValidateUserEither() { $view->setDisplay('default'); $view->preExecute(); $view->initHandlers(); - $this->assertTrue($view->argument['null']->validate_arg($account->name)); + $this->assertTrue($view->argument['null']->validateArgument($account->name)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a uid variable since type is 'name' - $this->assertTrue($view->argument['null']->validate_arg($account->uid)); + $this->assertTrue($view->argument['null']->validateArgument($account->uid)); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a valid string, but for a user that doesn't exist - $this->assertFalse($view->argument['null']->validate_arg($this->randomName())); + $this->assertFalse($view->argument['null']->validateArgument($this->randomName())); // Reset safed argument validation. $view->argument['null']->argument_validated = NULL; // Fail for a valid uid, but for a user that doesn't exist - $this->assertFalse($view->argument['null']->validate_arg(32)); + $this->assertFalse($view->argument['null']->validateArgument(32)); } function view_argument_validate_user($argtype) { diff --git a/lib/Drupal/views/View.php b/lib/Drupal/views/View.php index d1e2067a12e799d196413dd39b7c1b68368db41c..b3a465c137661de1040dbea9e8dad93ffa2c9916 100644 --- a/lib/Drupal/views/View.php +++ b/lib/Drupal/views/View.php @@ -822,7 +822,7 @@ protected function _buildArguments() { // Set the argument, which will also validate that the argument can be set. if (!$argument->set_argument($arg)) { - $status = $argument->validate_fail($arg); + $status = $argument->validateFail($arg); break; } diff --git a/lib/Views/aggregator/Plugin/views/field/Category.php b/lib/Views/aggregator/Plugin/views/field/Category.php index d58bc1d31e345f8470c760a514b21b849ceacd00..f5714a974254378f1966a6c5217f82eed14b1bd1 100644 --- a/lib/Views/aggregator/Plugin/views/field/Category.php +++ b/lib/Views/aggregator/Plugin/views/field/Category.php @@ -26,13 +26,13 @@ class Category extends FieldPluginBase { /** * Constructor to provide additional field to add. */ - function construct() { + public function construct() { parent::construct(); $this->additional_fields['cid'] = 'cid'; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_category'] = array('default' => FALSE, 'bool' => TRUE); return $options; } @@ -40,14 +40,14 @@ function option_definition() { /** * Provide link to category option */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_category'] = array( '#title' => t('Link this field to its aggregator category page'), '#description' => t('This will override any other link you have set.'), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_category']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** diff --git a/lib/Views/aggregator/Plugin/views/field/TitleLink.php b/lib/Views/aggregator/Plugin/views/field/TitleLink.php index 2895c0a85bcfd9180745591b3c2ad7463940817e..8e3e932ebf2adaef532a8ddd9a3990a6ff7f3e81 100644 --- a/lib/Views/aggregator/Plugin/views/field/TitleLink.php +++ b/lib/Views/aggregator/Plugin/views/field/TitleLink.php @@ -23,13 +23,13 @@ */ class TitleLink extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['link'] = 'link'; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['display_as_link'] = array('default' => TRUE, 'bool' => TRUE); @@ -39,13 +39,13 @@ function option_definition() { /** * Provide link to the page being visited. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['display_as_link'] = array( '#title' => t('Display as link'), '#type' => 'checkbox', '#default_value' => !empty($this->options['display_as_link']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Views/aggregator/Plugin/views/row/Rss.php b/lib/Views/aggregator/Plugin/views/row/Rss.php index e1b519cfdf423e7bdea81dde8ad3816773727fa4..4a5b6590faf1093c5d2a67a948b0f9828e29f178 100644 --- a/lib/Views/aggregator/Plugin/views/row/Rss.php +++ b/lib/Views/aggregator/Plugin/views/row/Rss.php @@ -28,15 +28,15 @@ class Rss extends RowPluginBase { var $base_table = 'aggregator_item'; var $base_field = 'iid'; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['item_length'] = array('default' => 'default'); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['item_length'] = array( '#type' => 'select', '#title' => t('Display type'), @@ -82,7 +82,7 @@ function render($row) { } } - return theme($this->theme_functions(), array( + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, 'row' => $item diff --git a/lib/Views/comment/Plugin/views/argument/UserUid.php b/lib/Views/comment/Plugin/views/argument/UserUid.php index 1ffa4ba91ccf29b40bb3b5794c7cc4b8fd78aa5e..9dade8030eefdb7f1ecc5a8bc4c701ae65cef50e 100644 --- a/lib/Views/comment/Plugin/views/argument/UserUid.php +++ b/lib/Views/comment/Plugin/views/argument/UserUid.php @@ -54,7 +54,7 @@ function default_actions($which = NULL) { } } - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); $subselect = db_select('comment', 'c'); diff --git a/lib/Views/comment/Plugin/views/field/Comment.php b/lib/Views/comment/Plugin/views/field/Comment.php index 3d6754437d3ea4b57502f093e10d4586b68c3e52..c76651ae888789e6a6c6e0400327c8cb6b84480b 100644 --- a/lib/Views/comment/Plugin/views/field/Comment.php +++ b/lib/Views/comment/Plugin/views/field/Comment.php @@ -33,8 +33,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_comment'] = array('default' => TRUE, 'bool' => TRUE); $options['link_to_node'] = array('default' => FALSE, 'bool' => TRUE); @@ -44,7 +44,7 @@ function option_definition() { /** * Provide link-to-comment option */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_comment'] = array( '#title' => t('Link this field to its comment'), '#description' => t("Enable to override this field's links."), @@ -56,7 +56,7 @@ function options_form(&$form, &$form_state) { '#type' => 'checkbox', '#default_value' => $this->options['link_to_node'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render_link($data, $values) { diff --git a/lib/Views/comment/Plugin/views/field/LastTimestamp.php b/lib/Views/comment/Plugin/views/field/LastTimestamp.php index dcf880881337f11f84bcc990e8779c89b21444aa..18bb0f61ac4abfe2793626baafc39236b0d5a7e3 100644 --- a/lib/Views/comment/Plugin/views/field/LastTimestamp.php +++ b/lib/Views/comment/Plugin/views/field/LastTimestamp.php @@ -22,7 +22,7 @@ */ class LastTimestamp extends Date { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['comment_count'] = 'comment_count'; } diff --git a/lib/Views/comment/Plugin/views/field/Link.php b/lib/Views/comment/Plugin/views/field/Link.php index 442b9d53fcd55b6f6b91b903ce9c9c5b5f946638..6ba3c8eb1ec7d70e43fe13e14cb688a33c5c5abb 100644 --- a/lib/Views/comment/Plugin/views/field/Link.php +++ b/lib/Views/comment/Plugin/views/field/Link.php @@ -22,14 +22,14 @@ */ class Link extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['text'] = array('default' => '', 'translatable' => TRUE); $options['link_to_node'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['text'] = array( '#type' => 'textfield', '#title' => t('Text to display'), @@ -40,10 +40,10 @@ function options_form(&$form, &$form_state) { '#type' => 'checkbox', '#default_value' => $this->options['link_to_node'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() {} + public function query() {} function render($values) { $comment = $this->get_entity($values); diff --git a/lib/Views/comment/Plugin/views/field/LinkEdit.php b/lib/Views/comment/Plugin/views/field/LinkEdit.php index 85c12acacc8047fde684775b59f602b3ebadaa74..7b8c1f246742f85c88b9a5db005dac43b945ca70 100644 --- a/lib/Views/comment/Plugin/views/field/LinkEdit.php +++ b/lib/Views/comment/Plugin/views/field/LinkEdit.php @@ -21,15 +21,15 @@ */ class LinkEdit extends Link { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['destination'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['destination'] = array( '#type' => 'checkbox', diff --git a/lib/Views/comment/Plugin/views/field/NcsLastCommentName.php b/lib/Views/comment/Plugin/views/field/NcsLastCommentName.php index 461bd2b719a797a913965bc08cf668dcd4935b1d..33135c44659c4d5e83638ecfe4667bab90917b98 100644 --- a/lib/Views/comment/Plugin/views/field/NcsLastCommentName.php +++ b/lib/Views/comment/Plugin/views/field/NcsLastCommentName.php @@ -22,7 +22,7 @@ */ class NcsLastCommentName extends FieldPluginBase { - function query() { + public function query() { // last_comment_name only contains data if the user is anonymous. So we // have to join in a specially related user table. $this->ensure_my_table(); @@ -41,8 +41,8 @@ function query() { $this->uid = $this->query->add_field($this->table_alias, 'last_comment_uid'); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_user'] = array('default' => TRUE, 'bool' => TRUE); diff --git a/lib/Views/comment/Plugin/views/field/NcsLastUpdated.php b/lib/Views/comment/Plugin/views/field/NcsLastUpdated.php index d42bc7903e2e9546cedbed557697ad25dd8a445e..a3dcb3e5b47bc2bb6d1e0afba649d6eea3135c2d 100644 --- a/lib/Views/comment/Plugin/views/field/NcsLastUpdated.php +++ b/lib/Views/comment/Plugin/views/field/NcsLastUpdated.php @@ -22,7 +22,7 @@ */ class NcsLastUpdated extends Date { - function query() { + public function query() { $this->ensure_my_table(); $this->node_table = $this->query->ensure_table('node', $this->relationship); $this->field_alias = $this->query->add_field(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)", $this->table_alias . '_' . $this->field); diff --git a/lib/Views/comment/Plugin/views/field/NodeLink.php b/lib/Views/comment/Plugin/views/field/NodeLink.php index fad4fd2a78a0cb06a65e055fe5c4eb5176073046..c59940305eee92e32595b18d67899916552abe9a 100644 --- a/lib/Views/comment/Plugin/views/field/NodeLink.php +++ b/lib/Views/comment/Plugin/views/field/NodeLink.php @@ -22,13 +22,13 @@ */ class NodeLink extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['teaser'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['teaser'] = array( '#type' => 'checkbox', '#title' => t('Show teaser-style link'), @@ -36,10 +36,10 @@ function options_form(&$form, &$form_state) { '#description' => t('Show the comment link in the form used on standard node teasers, rather than the full node form.'), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() {} + public function query() {} function render($values) { $node = $this->get_entity($values); diff --git a/lib/Views/comment/Plugin/views/field/NodeNewComments.php b/lib/Views/comment/Plugin/views/field/NodeNewComments.php index 6c5aab64beda02fc8cae6b3a83f7731efd40ae58..4777778cea742a388d455dd3f23395106108d289 100644 --- a/lib/Views/comment/Plugin/views/field/NodeNewComments.php +++ b/lib/Views/comment/Plugin/views/field/NodeNewComments.php @@ -22,22 +22,22 @@ */ class NodeNewComments extends Numeric { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['nid'] = 'nid'; $this->additional_fields['type'] = 'type'; $this->additional_fields['comment_count'] = array('table' => 'node_comment_statistics', 'field' => 'comment_count'); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_comment'] = array('default' => TRUE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_comment'] = array( '#title' => t('Link this field to new comments'), '#description' => t("Enable to override this field's links."), @@ -45,10 +45,10 @@ function options_form(&$form, &$form_state) { '#default_value' => $this->options['link_to_comment'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); $this->field_alias = $this->table . '_' . $this->field; diff --git a/lib/Views/comment/Plugin/views/field/Username.php b/lib/Views/comment/Plugin/views/field/Username.php index eefea5bf03d5665c0473ac41bca854e000b82202..a271426b2ba08e47b0e0f2bd104aa15c8830c14b 100644 --- a/lib/Views/comment/Plugin/views/field/Username.php +++ b/lib/Views/comment/Plugin/views/field/Username.php @@ -31,19 +31,19 @@ function init(&$view, &$data) { $this->additional_fields['homepage'] = 'homepage'; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_user'] = array('default' => TRUE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_user'] = array( '#title' => t("Link this field to its user or an author's homepage"), '#type' => 'checkbox', '#default_value' => $this->options['link_to_user'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render_link($data, $values) { diff --git a/lib/Views/comment/Plugin/views/filter/NcsLastUpdated.php b/lib/Views/comment/Plugin/views/filter/NcsLastUpdated.php index b2dce6e7bccb9e8283c5f80575c4287c29547ab9..cd69888818f78548a0dc49b884fc72aaad307103 100644 --- a/lib/Views/comment/Plugin/views/filter/NcsLastUpdated.php +++ b/lib/Views/comment/Plugin/views/filter/NcsLastUpdated.php @@ -22,7 +22,7 @@ */ class NcsLastUpdated extends Date { - function query() { + public function query() { $this->ensure_my_table(); $this->node_table = $this->query->ensure_table('node', $this->relationship); diff --git a/lib/Views/comment/Plugin/views/filter/UserUid.php b/lib/Views/comment/Plugin/views/filter/UserUid.php index fc312f4fa7165c76decc0a5429a90cfd18dfb461..97c4598835dbf126d0c2baa4a44eec467ad07565 100644 --- a/lib/Views/comment/Plugin/views/filter/UserUid.php +++ b/lib/Views/comment/Plugin/views/filter/UserUid.php @@ -23,7 +23,7 @@ */ class UserUid extends FilterPluginBase { - function query() { + public function query() { $this->ensure_my_table(); $subselect = db_select('comment', 'c'); diff --git a/lib/Views/comment/Plugin/views/row/Rss.php b/lib/Views/comment/Plugin/views/row/Rss.php index 1050f99c0d517941cdb8b8cf6ee55aee251208de..323df24c337dbd8b83eb2605a97bf6cd1522e1ff 100644 --- a/lib/Views/comment/Plugin/views/row/Rss.php +++ b/lib/Views/comment/Plugin/views/row/Rss.php @@ -29,8 +29,8 @@ class Rss extends RowPluginBase { var $base_table = 'comment'; var $base_field = 'cid'; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['item_length'] = array('default' => 'default'); $options['links'] = array('default' => FALSE, 'bool' => TRUE); @@ -38,8 +38,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['item_length'] = array( '#type' => 'select', @@ -158,7 +158,7 @@ function render($row) { $item->elements = $comment->rss_elements; $item->cid = $comment->id(); - return theme($this->theme_functions(), array( + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, 'row' => $item diff --git a/lib/Views/comment/Plugin/views/row/View.php b/lib/Views/comment/Plugin/views/row/View.php index 43d0ed62acd4876ca9ddfaa6a458f32ee71e43d8..1a465f99b5138de0e8bfc518898f7d0cd067e4c9 100644 --- a/lib/Views/comment/Plugin/views/row/View.php +++ b/lib/Views/comment/Plugin/views/row/View.php @@ -39,19 +39,19 @@ class View extends RowPluginBase { */ var $nodes = array(); - function summary_title() { + public function summaryTitle() { return t('Settings'); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['links'] = array('default' => TRUE, 'bool' => TRUE); $options['view_mode'] = array('default' => 'full'); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $options = $this->options_form_summary_options(); $form['view_mode'] = array( diff --git a/lib/Views/comment/Plugin/views/sort/NcsLastCommentName.php b/lib/Views/comment/Plugin/views/sort/NcsLastCommentName.php index a60753636b2dc401e260d923b570934687448f0b..b81964771986825668e41b7757a82b0ea0f7973e 100644 --- a/lib/Views/comment/Plugin/views/sort/NcsLastCommentName.php +++ b/lib/Views/comment/Plugin/views/sort/NcsLastCommentName.php @@ -23,7 +23,7 @@ */ class NcsLastCommentName extends SortPluginBase { - function query() { + public function query() { $this->ensure_my_table(); $join = views_get_join(); $join->construct('users', $this->table_alias, 'last_comment_uid', 'uid'); diff --git a/lib/Views/comment/Plugin/views/sort/NcsLastUpdated.php b/lib/Views/comment/Plugin/views/sort/NcsLastUpdated.php index 2e4fa96e232c2905b24cd93e5f708f225e580170..52328e3719fc3395b20ce0c6fd19da00c9b59a18 100644 --- a/lib/Views/comment/Plugin/views/sort/NcsLastUpdated.php +++ b/lib/Views/comment/Plugin/views/sort/NcsLastUpdated.php @@ -22,7 +22,7 @@ */ class NcsLastUpdated extends Date { - function query() { + public function query() { $this->ensure_my_table(); $this->node_table = $this->query->ensure_table('node', $this->relationship); $this->field_alias = $this->query->add_orderby(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)", $this->options['order'], $this->table_alias . '_' . $this->field); diff --git a/lib/Views/comment/Plugin/views/sort/Thread.php b/lib/Views/comment/Plugin/views/sort/Thread.php index 0ffaf85132645eaecb04b8d35ceb91c10383fb15..f98b3cd488a0db60fca7acc8ed9f9da2eed1aa40 100644 --- a/lib/Views/comment/Plugin/views/sort/Thread.php +++ b/lib/Views/comment/Plugin/views/sort/Thread.php @@ -22,7 +22,7 @@ */ class Thread extends SortPluginBase { - function query() { + public function query() { $this->ensure_my_table(); //Read comment_render() in comment.module for an explanation of the diff --git a/lib/Views/contact/Plugin/views/field/ContactLink.php b/lib/Views/contact/Plugin/views/field/ContactLink.php index 01cb3ef32b631373ddadbd1c0b766984a333b3d6..d160aa914f7cc6540151877d703e8f68ac6230b5 100644 --- a/lib/Views/contact/Plugin/views/field/ContactLink.php +++ b/lib/Views/contact/Plugin/views/field/ContactLink.php @@ -22,11 +22,11 @@ */ class ContactLink extends Link { - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['text']['#title'] = t('Link label'); $form['text']['#required'] = TRUE; $form['text']['#default_value'] = empty($this->options['text']) ? t('contact') : $this->options['text']; - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } // An example of field level access control. diff --git a/lib/Views/field/Plugin/views/argument/FieldList.php b/lib/Views/field/Plugin/views/argument/FieldList.php index 02b6c4d63b8916f2d0067934f46f0c93015a5efc..0a45db73e97c5b8cf708080eeb7afcc4bd67d5dd 100644 --- a/lib/Views/field/Plugin/views/argument/FieldList.php +++ b/lib/Views/field/Plugin/views/argument/FieldList.php @@ -36,15 +36,15 @@ function init(&$view, &$options) { $this->allowed_values = options_allowed_values($field); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['summary']['contains']['human'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['summary']['human'] = array( '#title' => t('Display list value as human readable'), diff --git a/lib/Views/field/Plugin/views/argument/ListString.php b/lib/Views/field/Plugin/views/argument/ListString.php index b9dd1b9476b038246c8b88a24b667c3169bb02d8..8ce1e14bff345337657c7b0ea2362f7957ca2c34 100644 --- a/lib/Views/field/Plugin/views/argument/ListString.php +++ b/lib/Views/field/Plugin/views/argument/ListString.php @@ -36,16 +36,16 @@ function init(&$view, &$options) { $this->allowed_values = options_allowed_values($field); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['summary']['contains']['human'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['summary']['human'] = array( '#title' => t('Display list value as human readable'), diff --git a/lib/Views/field/Plugin/views/field/Field.php b/lib/Views/field/Plugin/views/field/Field.php index 60fecec602f8d62603e9b490dadaeb662527fc27..c1d88ec829a7f11877a5e4090d097d3bc991fccf 100644 --- a/lib/Views/field/Plugin/views/field/Field.php +++ b/lib/Views/field/Plugin/views/field/Field.php @@ -138,7 +138,7 @@ function get_base_table() { * By default, all needed data is taken from entities loaded by the query * plugin. Columns are added only if they are used in groupings. */ - function query($use_groupby = FALSE) { + public function query($use_groupby = FALSE) { $this->get_base_table(); $entity_type = $this->definition['entity_tables'][$this->base_table]; @@ -251,10 +251,10 @@ function click_sort($order) { $this->query->add_orderby(NULL, NULL, $order, $this->aliases[$column]); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); - // option_definition runs before init/construct, so no $this->field_info + // defineOptions runs before init/construct, so no $this->field_info $field = field_info_field($this->definition['field_name']); $field_type = field_info_field_types($field['type']); $column_names = array_keys($field['columns']); @@ -321,8 +321,8 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $field = $this->field_info; $formatters = _field_view_formatter_options($field['type']); diff --git a/lib/Views/field/Plugin/views/relationship/EntityReverse.php b/lib/Views/field/Plugin/views/relationship/EntityReverse.php index a39027cdc065ac0355a72ae19a85c59cd769b13c..cede9491e0c512fc39c28907daed4055df8a7a71 100644 --- a/lib/Views/field/Plugin/views/relationship/EntityReverse.php +++ b/lib/Views/field/Plugin/views/relationship/EntityReverse.php @@ -31,7 +31,7 @@ function init(&$view, &$options) { /** * Called to implement a relationship in a query. */ - function query() { + public function query() { $this->ensure_my_table(); // First, relate our base table to the current base table to the // field, using the base table's id field to the field's column. diff --git a/lib/Views/file/Plugin/views/field/File.php b/lib/Views/file/Plugin/views/field/File.php index b9f6147cfe1547ba5ac04233ff99c3387c5de195..9341ad63defe6a2ba11b15f9a29ef02b7db72788 100644 --- a/lib/Views/file/Plugin/views/field/File.php +++ b/lib/Views/file/Plugin/views/field/File.php @@ -32,8 +32,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_file'] = array('default' => FALSE, 'bool' => TRUE); return $options; } @@ -41,14 +41,14 @@ function option_definition() { /** * Provide link to file option */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_file'] = array( '#title' => t('Link this field to download the file'), '#description' => t("Enable to override this field's links."), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_file']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** diff --git a/lib/Views/file/Plugin/views/field/FileMime.php b/lib/Views/file/Plugin/views/field/FileMime.php index 21a3f191393048900a2a4dd653825a84e23d3d9c..ebef8cb75e386d81c0040b7a103a0d0abe4b95fb 100644 --- a/lib/Views/file/Plugin/views/field/FileMime.php +++ b/lib/Views/file/Plugin/views/field/FileMime.php @@ -21,19 +21,19 @@ */ class FileMime extends File { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['filemime_image'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['filemime_image'] = array( '#title' => t('Display an icon representing the file type, instead of the MIME text (such as "image/jpeg")'), '#type' => 'checkbox', '#default_value' => !empty($this->options['filemime_image']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Views/file/Plugin/views/field/Uri.php b/lib/Views/file/Plugin/views/field/Uri.php index 46d489c745430f29b7ef76c8daeed94a3013492c..9a804aa4b5d72cb2b970851135aec52227678e2c 100644 --- a/lib/Views/file/Plugin/views/field/Uri.php +++ b/lib/Views/file/Plugin/views/field/Uri.php @@ -19,20 +19,20 @@ */ class Uri extends File { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['file_download_path'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['file_download_path'] = array( '#title' => t('Display download path instead of file storage URI'), '#description' => t('This will provide the full download URL rather than the internal filestream address.'), '#type' => 'checkbox', '#default_value' => !empty($this->options['file_download_path']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Views/filter/Plugin/views/field/FormatName.php b/lib/Views/filter/Plugin/views/field/FormatName.php index 21cba924f00778d130ff6a00fad24c414522edcb..d02a017886e65e0927d8b556b3288883f1eb16de 100644 --- a/lib/Views/filter/Plugin/views/field/FormatName.php +++ b/lib/Views/filter/Plugin/views/field/FormatName.php @@ -22,13 +22,13 @@ */ class FormatName extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); // Be explicit about the table we are using. $this->additional_fields['name'] = array('table' => 'filter_formats', 'field' => 'name'); } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); } diff --git a/lib/Views/language/Plugin/views/field/Language.php b/lib/Views/language/Plugin/views/field/Language.php index 7b003c11d1c84926058074b4e5a03dfea356bbf6..104ae3f34e24d50a6072332b25da8a727ad37861 100644 --- a/lib/Views/language/Plugin/views/field/Language.php +++ b/lib/Views/language/Plugin/views/field/Language.php @@ -22,15 +22,15 @@ */ class Language extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['native_language'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['native_language'] = array( '#title' => t('Native language'), '#type' => 'checkbox', diff --git a/lib/Views/locale/Plugin/views/argument/Group.php b/lib/Views/locale/Plugin/views/argument/Group.php index ef1b04823759a438d64ff96afe58c7e05bede290..3a640a54c048a4a0aa98d18ced4816f0cf3d8ddf 100644 --- a/lib/Views/locale/Plugin/views/argument/Group.php +++ b/lib/Views/locale/Plugin/views/argument/Group.php @@ -22,7 +22,7 @@ */ class Group extends ArgumentPluginBase { - function construct() { + public function construct() { parent::construct('group'); } diff --git a/lib/Views/locale/Plugin/views/field/LinkEdit.php b/lib/Views/locale/Plugin/views/field/LinkEdit.php index 6f32e5889bea18030b4a5173f69cd10665281c75..7f4bc992bd5a7ec90d98f89acec825c40135aad2 100644 --- a/lib/Views/locale/Plugin/views/field/LinkEdit.php +++ b/lib/Views/locale/Plugin/views/field/LinkEdit.php @@ -22,29 +22,29 @@ */ class LinkEdit extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['lid'] = 'lid'; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['text'] = array('default' => '', 'translatable' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['text'] = array( '#type' => 'textfield', '#title' => t('Text to display'), '#default_value' => $this->options['text'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); } diff --git a/lib/Views/node/Plugin/views/argument/CreatedDay.php b/lib/Views/node/Plugin/views/argument/CreatedDay.php index 59bddd0c6f6c03177e07ea1fe6299ffb93fba1d7..020e025acf4f2eaf7b2573a2adeb27c91d24c44d 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedDay.php +++ b/lib/Views/node/Plugin/views/argument/CreatedDay.php @@ -23,7 +23,7 @@ class CreatedDay extends Date { /** * Constructor implementation */ - function construct() { + public function construct() { parent::construct(); $this->formula = views_date_sql_extract('DAY', "***table***.$this->real_field"); $this->format = 'j'; diff --git a/lib/Views/node/Plugin/views/argument/CreatedFullDate.php b/lib/Views/node/Plugin/views/argument/CreatedFullDate.php index 57134303d09523603cf1e7afb70f5c4156ba1194..ce0755b297ee865426c8a92ea051537c2fe179ac 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedFullDate.php +++ b/lib/Views/node/Plugin/views/argument/CreatedFullDate.php @@ -23,7 +23,7 @@ class CreatedFullDate extends Date { /** * Constructor implementation */ - function construct() { + public function construct() { parent::construct(); $this->format = 'F j, Y'; $this->arg_format = 'Ymd'; diff --git a/lib/Views/node/Plugin/views/argument/CreatedMonth.php b/lib/Views/node/Plugin/views/argument/CreatedMonth.php index 074af7c81be988d67afee1fc35fcad6ce559386d..1c4673cd4a269165184cd16f87230b99b136f151 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedMonth.php +++ b/lib/Views/node/Plugin/views/argument/CreatedMonth.php @@ -23,7 +23,7 @@ class CreatedMonth extends Date { /** * Constructor implementation */ - function construct() { + public function construct() { parent::construct(); $this->formula = views_date_sql_extract('MONTH', "***table***.$this->real_field"); $this->format = 'F'; diff --git a/lib/Views/node/Plugin/views/argument/CreatedWeek.php b/lib/Views/node/Plugin/views/argument/CreatedWeek.php index 9b415dcd2bd21d5cd4fe36df30fcaed1e902e7d1..55b326f4e942748a9106976678c5aa4f5eb356ee 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedWeek.php +++ b/lib/Views/node/Plugin/views/argument/CreatedWeek.php @@ -23,7 +23,7 @@ class CreatedWeek extends Date { /** * Constructor implementation */ - function construct() { + public function construct() { parent::construct(); $this->arg_format = 'w'; $this->formula = views_date_sql_extract('WEEK', "***table***.$this->real_field"); diff --git a/lib/Views/node/Plugin/views/argument/CreatedYear.php b/lib/Views/node/Plugin/views/argument/CreatedYear.php index 2928f2b478d9a5ae0d0e4d491734cf67d243fc34..1d2dd5c3e192f346c128055b0a70d1483dc86e0e 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedYear.php +++ b/lib/Views/node/Plugin/views/argument/CreatedYear.php @@ -23,7 +23,7 @@ class CreatedYear extends Date { /** * Constructor implementation */ - function construct() { + public function construct() { parent::construct(); $this->arg_format = 'Y'; $this->formula = views_date_sql_extract('YEAR', "***table***.$this->real_field"); diff --git a/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php b/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php index 1e9f0d5b142321dfeae07058756e4995f8d98016..5eb5e671b289b20118eb7ec532a3da347e0aa8b0 100644 --- a/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php +++ b/lib/Views/node/Plugin/views/argument/CreatedYearMonth.php @@ -23,7 +23,7 @@ class CreatedYearMonth extends Date { /** * Constructor implementation */ - function construct() { + public function construct() { parent::construct(); $this->format = 'F Y'; $this->arg_format = 'Ym'; diff --git a/lib/Views/node/Plugin/views/argument/Type.php b/lib/Views/node/Plugin/views/argument/Type.php index 5d64bd003f079214487ba616b8ed21768c4a5805..370fa0206f06870e4bc4bea268a6332cdbc747f1 100644 --- a/lib/Views/node/Plugin/views/argument/Type.php +++ b/lib/Views/node/Plugin/views/argument/Type.php @@ -20,7 +20,7 @@ */ class Type extends String { - function construct() { + public function construct() { parent::construct('type'); } diff --git a/lib/Views/node/Plugin/views/argument/UidRevision.php b/lib/Views/node/Plugin/views/argument/UidRevision.php index a51c91f767da3d0483c7ef95b660798a3c5c6fc1..67315483ac0a2f5394cf345526adcc41a8a3bb20 100644 --- a/lib/Views/node/Plugin/views/argument/UidRevision.php +++ b/lib/Views/node/Plugin/views/argument/UidRevision.php @@ -21,7 +21,7 @@ */ class UidRevision extends Uid { - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); $placeholder = $this->placeholder(); $this->query->add_where_expression(0, "$this->table_alias.uid = $placeholder OR ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid = $placeholder AND nr.nid = $this->table_alias.nid) > 0)", array($placeholder => $this->argument)); diff --git a/lib/Views/node/Plugin/views/argument_validator/Node.php b/lib/Views/node/Plugin/views/argument_validator/Node.php index e20d2b071479a1e85b92eaa3101275972f44d420..f85ffb25b257a08ad30d1400784dd78a932b9ff4 100644 --- a/lib/Views/node/Plugin/views/argument_validator/Node.php +++ b/lib/Views/node/Plugin/views/argument_validator/Node.php @@ -22,8 +22,8 @@ */ class Node extends ArgumentValidatorPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['types'] = array('default' => array()); $options['access'] = array('default' => FALSE, 'bool' => TRUE); $options['access_op'] = array('default' => 'view'); @@ -32,7 +32,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $types = node_type_get_types(); $options = array(); foreach ($types as $type => $info) { @@ -75,7 +75,7 @@ function options_form(&$form, &$form_state) { ); } - function options_submit(&$form, &$form_state, &$options = array()) { + public function submitOptionsForm(&$form, &$form_state, &$options = array()) { // filter trash out of the options so we don't store giant unnecessary arrays $options['types'] = array_filter($options['types']); } diff --git a/lib/Views/node/Plugin/views/field/HistoryUserTimestamp.php b/lib/Views/node/Plugin/views/field/HistoryUserTimestamp.php index c7d8d36c5032b490960387895bbbe72011d748fa..980ce01912256bf727b49d57df2257a005e9ccd8 100644 --- a/lib/Views/node/Plugin/views/field/HistoryUserTimestamp.php +++ b/lib/Views/node/Plugin/views/field/HistoryUserTimestamp.php @@ -37,16 +37,16 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['comments'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); if (module_exists('comment')) { $form['comments'] = array( '#type' => 'checkbox', @@ -57,7 +57,7 @@ function options_form(&$form, &$form_state) { } } - function query() { + public function query() { // Only add ourselves to the query if logged in. global $user; if (!$user->uid) { diff --git a/lib/Views/node/Plugin/views/field/Language.php b/lib/Views/node/Plugin/views/field/Language.php index 76ace42b46aff86927b8d8bcea11669dd87a9756..c4dff1bdf8d98d4de7b188d50118ada93a547a11 100644 --- a/lib/Views/node/Plugin/views/field/Language.php +++ b/lib/Views/node/Plugin/views/field/Language.php @@ -22,15 +22,15 @@ */ class Language extends Node { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['native_language'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['native_language'] = array( '#title' => t('Native language'), '#type' => 'checkbox', diff --git a/lib/Views/node/Plugin/views/field/Link.php b/lib/Views/node/Plugin/views/field/Link.php index 59560a2df8fceebb09400afa47f4269a59a1384f..0491889c2a197714d91e2af484b26f71fb306bfa 100644 --- a/lib/Views/node/Plugin/views/field/Link.php +++ b/lib/Views/node/Plugin/views/field/Link.php @@ -22,26 +22,26 @@ */ class Link extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['text'] = array('default' => '', 'translatable' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['text'] = array( '#type' => 'textfield', '#title' => t('Text to display'), '#default_value' => $this->options['text'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); // The path is set by render_link function so don't allow to set it. $form['alter']['path'] = array('#access' => FALSE); $form['alter']['external'] = array('#access' => FALSE); } - function query() {} + public function query() {} function render($values) { if ($entity = $this->get_entity($values)) { diff --git a/lib/Views/node/Plugin/views/field/Node.php b/lib/Views/node/Plugin/views/field/Node.php index 7bea6498de1ca4fbdbaf772814d4a1652acdd8ce..360c2aa069d1f961f730f7edcb80e3ca7b62bf2b 100644 --- a/lib/Views/node/Plugin/views/field/Node.php +++ b/lib/Views/node/Plugin/views/field/Node.php @@ -35,8 +35,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_node'] = array('default' => isset($this->definition['link_to_node default']) ? $this->definition['link_to_node default'] : FALSE, 'bool' => TRUE); return $options; } @@ -44,7 +44,7 @@ function option_definition() { /** * Provide link to node option */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_node'] = array( '#title' => t('Link this field to the original piece of content'), '#description' => t("Enable to override this field's links."), @@ -52,7 +52,7 @@ function options_form(&$form, &$form_state) { '#default_value' => !empty($this->options['link_to_node']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** diff --git a/lib/Views/node/Plugin/views/field/Path.php b/lib/Views/node/Plugin/views/field/Path.php index e22617939e836a6bcee43c408a4d66ef4e32bd06..cdb8af07167f202d71febbc153b3c6130932f4fe 100644 --- a/lib/Views/node/Plugin/views/field/Path.php +++ b/lib/Views/node/Plugin/views/field/Path.php @@ -22,20 +22,20 @@ */ class Path extends FieldPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['absolute'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function construct() { + public function construct() { parent::construct(); $this->additional_fields['nid'] = 'nid'; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['absolute'] = array( '#type' => 'checkbox', '#title' => t('Use absolute link (begins with "http://")'), @@ -45,7 +45,7 @@ function options_form(&$form, &$form_state) { ); } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); } diff --git a/lib/Views/node/Plugin/views/field/Revision.php b/lib/Views/node/Plugin/views/field/Revision.php index 0882f480e3ecc4b25840a3b33ebd296412ac2fb0..284714f538b21b99662c28cdabf2ed2d49d04351 100644 --- a/lib/Views/node/Plugin/views/field/Revision.php +++ b/lib/Views/node/Plugin/views/field/Revision.php @@ -32,8 +32,8 @@ function init(&$view, &$options) { } } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_node_revision'] = array('default' => FALSE, 'bool' => TRUE); return $options; } @@ -41,14 +41,14 @@ function option_definition() { /** * Provide link to revision option. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_node_revision'] = array( '#title' => t('Link this field to its content revision'), '#description' => t('This will override any other link you have set.'), '#type' => 'checkbox', '#default_value' => !empty($this->options['link_to_node_revision']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** diff --git a/lib/Views/node/Plugin/views/field/RevisionLink.php b/lib/Views/node/Plugin/views/field/RevisionLink.php index be10fd1f2e492db99a2b06fbd663f143e17281eb..1fa4dd004641c4c6e231725e1265e241e11629a7 100644 --- a/lib/Views/node/Plugin/views/field/RevisionLink.php +++ b/lib/Views/node/Plugin/views/field/RevisionLink.php @@ -22,7 +22,7 @@ */ class RevisionLink extends Link { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['node_vid'] = array('table' => 'node_revision', 'field' => 'vid'); } diff --git a/lib/Views/node/Plugin/views/field/Type.php b/lib/Views/node/Plugin/views/field/Type.php index a2e57107ddf1aff6d20f9c6dd947f33698af4621..003d916eddbc76809bd918a92bf8f3b6e4906135 100644 --- a/lib/Views/node/Plugin/views/field/Type.php +++ b/lib/Views/node/Plugin/views/field/Type.php @@ -22,8 +22,8 @@ */ class Type extends Node { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['machine_name'] = array('default' => FALSE, 'bool' => TRUE); return $options; @@ -32,8 +32,8 @@ function option_definition() { /** * Provide machine_name option for to node type display. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['machine_name'] = array( '#title' => t('Output machine name'), diff --git a/lib/Views/node/Plugin/views/filter/Access.php b/lib/Views/node/Plugin/views/filter/Access.php index bc5d5f98ddb9e32a7e5e26bf2f4f147fa483dc0d..166095271c3f513d04edab11c704124b8fb816aa 100644 --- a/lib/Views/node/Plugin/views/filter/Access.php +++ b/lib/Views/node/Plugin/views/filter/Access.php @@ -31,7 +31,7 @@ function can_expose() { /** * See _node_access_where_sql() for a non-views query based implementation. */ - function query() { + public function query() { if (!user_access('administer nodes')) { $table = $this->ensure_my_table(); $grants = db_or(); diff --git a/lib/Views/node/Plugin/views/filter/HistoryUserTimestamp.php b/lib/Views/node/Plugin/views/filter/HistoryUserTimestamp.php index b6b6f3c5744cb7b523aa0bd24553756497d50720..685aeff7daf413cf09d3351d1dbd44711dc64ad3 100644 --- a/lib/Views/node/Plugin/views/filter/HistoryUserTimestamp.php +++ b/lib/Views/node/Plugin/views/filter/HistoryUserTimestamp.php @@ -55,7 +55,7 @@ function value_form(&$form, &$form_state) { } } - function query() { + public function query() { global $user; // This can only work if we're logged in. if (!$user || !$user->uid) { diff --git a/lib/Views/node/Plugin/views/filter/Status.php b/lib/Views/node/Plugin/views/filter/Status.php index 5de4898b6bf300e55cc6887d2056134bba165861..ed32a523308dfebfce3af4e4cd04f096a6c09ae3 100644 --- a/lib/Views/node/Plugin/views/filter/Status.php +++ b/lib/Views/node/Plugin/views/filter/Status.php @@ -28,7 +28,7 @@ function operator_form(&$form, &$form_state) { } function can_expose() { return FALSE; } - function query() { + public function query() { $table = $this->ensure_my_table(); $this->query->add_where_expression($this->options['group'], "$table.status = 1 OR ($table.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0 AND ***VIEW_OWN_UNPUBLISHED_NODES*** = 1) OR ***BYPASS_NODE_ACCESS*** = 1"); } diff --git a/lib/Views/node/Plugin/views/filter/UidRevision.php b/lib/Views/node/Plugin/views/filter/UidRevision.php index 0efa1f8de9cc49df36d301630f2392786e2779c5..48f75e395acc3d237dcf4a26d68343efceb43a34 100644 --- a/lib/Views/node/Plugin/views/filter/UidRevision.php +++ b/lib/Views/node/Plugin/views/filter/UidRevision.php @@ -22,7 +22,7 @@ */ class UidRevision extends Name { - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); $placeholder = $this->placeholder(); diff --git a/lib/Views/node/Plugin/views/row/Rss.php b/lib/Views/node/Plugin/views/row/Rss.php index b756c8fc77d6368cab7ac8d5fb67ea652ef7fcf0..d0a58eb4db8adaac02b4e34ebd054cda13cf038b 100644 --- a/lib/Views/node/Plugin/views/row/Rss.php +++ b/lib/Views/node/Plugin/views/row/Rss.php @@ -36,8 +36,8 @@ class Rss extends RowPluginBase { // Stores the nodes loaded with pre_render. var $nodes = array(); - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['item_length'] = array('default' => 'default'); $options['links'] = array('default' => FALSE, 'bool' => TRUE); @@ -45,13 +45,13 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['item_length'] = array( '#type' => 'select', '#title' => t('Display type'), - '#options' => $this->options_form_summary_options(), + '#options' => $this->buildOptionsForm_summary_options(), '#default_value' => $this->options['item_length'], ); $form['links'] = array( @@ -64,7 +64,7 @@ function options_form(&$form, &$form_state) { /** * Return the main options, which are shown in the summary title. */ - function options_form_summary_options() { + public function buildOptionsForm_summary_options() { $entity_info = entity_get_info('node'); $options = array(); if (!empty($entity_info['view modes'])) { @@ -77,8 +77,8 @@ function options_form_summary_options() { return $options; } - function summary_title() { - $options = $this->options_form_summary_options(); + public function summaryTitle() { + $options = $this->buildOptionsForm_summary_options(); return check_plain($options[$this->options['item_length']]); } @@ -172,7 +172,7 @@ function render($row) { $item->elements = $node->rss_elements; $item->nid = $node->nid; - return theme($this->theme_functions(), array( + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, 'row' => $item diff --git a/lib/Views/node/Plugin/views/row/View.php b/lib/Views/node/Plugin/views/row/View.php index a8f68dec2a3c5adc3bbaf82e91aa2cf56c173767..aa70993f828a0858cfb6bf60eddae07873734276 100644 --- a/lib/Views/node/Plugin/views/row/View.php +++ b/lib/Views/node/Plugin/views/row/View.php @@ -49,8 +49,8 @@ function init(&$view, &$display, $options = NULL) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['view_mode'] = array('default' => 'teaser'); $options['links'] = array('default' => TRUE, 'bool' => TRUE); @@ -59,10 +59,10 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); - $options = $this->options_form_summary_options(); + $options = $this->buildOptionsForm_summary_options(); $form['view_mode'] = array( '#type' => 'select', '#options' => $options, @@ -84,7 +84,7 @@ function options_form(&$form, &$form_state) { /** * Return the main options, which are shown in the summary title. */ - function options_form_summary_options() { + public function buildOptionsForm_summary_options() { $entity_info = entity_get_info('node'); $options = array(); if (!empty($entity_info['view modes'])) { @@ -102,8 +102,8 @@ function options_form_summary_options() { return $options; } - function summary_title() { - $options = $this->options_form_summary_options(); + public function summaryTitle() { + $options = $this->buildOptionsForm_summary_options(); return check_plain($options[$this->options['view_mode']]); } diff --git a/lib/Views/search/Plugin/views/argument/Search.php b/lib/Views/search/Plugin/views/argument/Search.php index 41ebad0c96940eaebe640b329289a772d6897e87..e394c6b7bf2b1ef970b83b0adef3e85dd7d82509 100644 --- a/lib/Views/search/Plugin/views/argument/Search.php +++ b/lib/Views/search/Plugin/views/argument/Search.php @@ -39,7 +39,7 @@ function query_parse_search_expression($input) { /** * Add this argument to the query. */ - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $required = FALSE; $this->query_parse_search_expression($this->argument); if (!isset($this->search_query)) { diff --git a/lib/Views/search/Plugin/views/field/Score.php b/lib/Views/search/Plugin/views/field/Score.php index da3901abf4e723ba2d46f805e599196fb13bb837..d8cade30abc50e9ed955bc239b05e0f140d82df5 100644 --- a/lib/Views/search/Plugin/views/field/Score.php +++ b/lib/Views/search/Plugin/views/field/Score.php @@ -22,8 +22,8 @@ */ class Score extends Numeric { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['alternate_sort'] = array('default' => ''); $options['alternate_order'] = array('default' => 'asc'); @@ -31,7 +31,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $style_options = $this->view->display_handler->getOption('style_options'); if (isset($style_options['default']) && $style_options['default'] == $this->options['id']) { $handlers = $this->view->display_handler->getHandlers('field'); @@ -56,10 +56,10 @@ function options_form(&$form, &$form_state) { ); } - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() { + public function query() { // Check to see if the search filter added 'score' to the table. // Our filter stores it as $handler->search_score -- and we also // need to check its relationship to make sure that we're using the same diff --git a/lib/Views/search/Plugin/views/filter/Search.php b/lib/Views/search/Plugin/views/filter/Search.php index a0e5af8543278d618d962f0eae3967242199ade5..15f4a4bfffd261dfa63634942a7891897d30e22b 100644 --- a/lib/Views/search/Plugin/views/filter/Search.php +++ b/lib/Views/search/Plugin/views/filter/Search.php @@ -40,8 +40,8 @@ class Search extends FilterPluginBase { */ var $parsed = FALSE; - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['operator']['default'] = 'optional'; @@ -115,7 +115,7 @@ function query_parse_search_expression($input) { * level of indirection. You will find them in $this->operator * and $this->value respectively. */ - function query() { + public function query() { // Since attachment views don't validate the exposed input, parse the search // expression if required. if (!$this->parsed) { diff --git a/lib/Views/search/Plugin/views/row/View.php b/lib/Views/search/Plugin/views/row/View.php index 2db38a93a15177860e1720f731f63efa8fd2a561..fe3f6839fdd30a7e9f92818b886c727cbd426e0f 100644 --- a/lib/Views/search/Plugin/views/row/View.php +++ b/lib/Views/search/Plugin/views/row/View.php @@ -23,15 +23,15 @@ */ class View extends RowPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['score'] = array('default' => TRUE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['score'] = array( '#type' => 'checkbox', '#title' => t('Display score'), @@ -43,7 +43,7 @@ function options_form(&$form, &$form_state) { * Override the behavior of the render() function. */ function render($row) { - return theme($this->theme_functions(), + return theme($this->themeFunctions(), array( 'view' => $this->view, 'options' => $this->options, diff --git a/lib/Views/search/Plugin/views/sort/Score.php b/lib/Views/search/Plugin/views/sort/Score.php index 27f6d60b608e60bfb4785cf3841c4ceb8e88b148..b27a85c5385c5faa1c8cd0851577c4bf3d23ebea 100644 --- a/lib/Views/search/Plugin/views/sort/Score.php +++ b/lib/Views/search/Plugin/views/sort/Score.php @@ -22,7 +22,7 @@ */ class Score extends SortPluginBase { - function query() { + public function query() { // Check to see if the search filter/argument added 'score' to the table. // Our filter stores it as $handler->search_score -- and we also // need to check its relationship to make sure that we're using the same diff --git a/lib/Views/statistics/Plugin/views/field/AccesslogPath.php b/lib/Views/statistics/Plugin/views/field/AccesslogPath.php index 35960982f21ca75d09d217110fe66b25d1675a8e..8e2ca80dd522973f781dc22616db23646fe5052c 100644 --- a/lib/Views/statistics/Plugin/views/field/AccesslogPath.php +++ b/lib/Views/statistics/Plugin/views/field/AccesslogPath.php @@ -32,8 +32,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['display_as_link'] = array('default' => TRUE, 'bool' => TRUE); @@ -43,13 +43,13 @@ function option_definition() { /** * Provide link to the page being visited. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['display_as_link'] = array( '#title' => t('Display as link'), '#type' => 'checkbox', '#default_value' => !empty($this->options['display_as_link']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render($values) { diff --git a/lib/Views/taxonomy/Plugin/views/argument/IndexTid.php b/lib/Views/taxonomy/Plugin/views/argument/IndexTid.php index 1dfc79144c371e51eb67c1c303800bff5e54cf5b..e58b94dab61f90d4c34ce5e73b9a6f3b2580c41a 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/IndexTid.php +++ b/lib/Views/taxonomy/Plugin/views/argument/IndexTid.php @@ -22,14 +22,14 @@ */ class IndexTid extends ManyToOne { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['set_breadcrumb'] = array('default' => FALSE, 'bool' => TRUE); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['set_breadcrumb'] = array( '#type' => 'checkbox', '#title' => t("Set the breadcrumb for the term parents"), diff --git a/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php index 4ff8bc0d0b1a3ec76dcb81f4f3669431a9f79e35..52db31c3b3d157ced84a597a7de6b29d23615fd3 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php +++ b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php @@ -25,8 +25,8 @@ */ class IndexTidDepth extends ArgumentPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['depth'] = array('default' => 0); $options['break_phrase'] = array('default' => FALSE, 'bool' => TRUE); @@ -36,7 +36,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['depth'] = array( '#type' => 'weight', '#title' => t('Depth'), @@ -69,7 +69,7 @@ function options_form(&$form, &$form_state) { ), ), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function set_breadcrumb(&$breadcrumb) { @@ -98,7 +98,7 @@ function default_actions($which = NULL) { return $actions; } - function query($group_by = FALSE) { + public function query($group_by = FALSE) { $this->ensure_my_table(); if (!empty($this->options['break_phrase'])) { diff --git a/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php index 1188deb1902fae31121da00c7af1bfff7eccba30..bad61818d654ccba34c321298a31c13622e476de 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php +++ b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php @@ -25,9 +25,9 @@ */ class IndexTidDepthModifier extends ArgumentPluginBase { - function options_form(&$form, &$form_state) { } + public function buildOptionsForm(&$form, &$form_state) { } - function query($group_by = FALSE) { } + public function query($group_by = FALSE) { } function pre_query() { // We don't know our argument yet, but it's based upon our position: diff --git a/lib/Views/taxonomy/Plugin/views/argument_default/Tid.php b/lib/Views/taxonomy/Plugin/views/argument_default/Tid.php index d0ebec3f08ad59d23fd87fcdc63e3f698e3c5b71..c81b8a8beebaa0a68bd72e480f4b0bce1717d8be 100644 --- a/lib/Views/taxonomy/Plugin/views/argument_default/Tid.php +++ b/lib/Views/taxonomy/Plugin/views/argument_default/Tid.php @@ -36,8 +36,8 @@ function init(&$view, &$argument, $options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['term_page'] = array('default' => TRUE, 'bool' => TRUE); $options['node'] = array('default' => FALSE, 'bool' => TRUE); @@ -48,7 +48,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['term_page'] = array( '#type' => 'checkbox', '#title' => t('Load default filter from term page'), @@ -106,7 +106,7 @@ function options_form(&$form, &$form_state) { ); } - function options_submit(&$form, &$form_state, &$options = array()) { + public function submitOptionsForm(&$form, &$form_state, &$options = array()) { // Filter unselected items so we don't unnecessarily store giant arrays. $options['vocabularies'] = array_filter($options['vocabularies']); } diff --git a/lib/Views/taxonomy/Plugin/views/argument_validator/Term.php b/lib/Views/taxonomy/Plugin/views/argument_validator/Term.php index 908655ded9e46d2b3365fa404648c6982228fb4b..52adf1f64001f2fbb040c1ca9a71ee1d8920fd73 100644 --- a/lib/Views/taxonomy/Plugin/views/argument_validator/Term.php +++ b/lib/Views/taxonomy/Plugin/views/argument_validator/Term.php @@ -36,8 +36,8 @@ function init(&$view, &$argument, $options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['vocabularies'] = array('default' => array()); $options['type'] = array('default' => 'tid'); $options['transform'] = array('default' => FALSE, 'bool' => TRUE); @@ -45,7 +45,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $vocabularies = taxonomy_vocabulary_get_names(); $options = array(); foreach ($vocabularies as $voc) { @@ -82,7 +82,7 @@ function options_form(&$form, &$form_state) { ); } - function options_submit(&$form, &$form_state, &$options = array()) { + public function submitOptionsForm(&$form, &$form_state, &$options = array()) { // Filter unselected items so we don't unnecessarily store giant arrays. $options['vocabularies'] = array_filter($options['vocabularies']); } diff --git a/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php b/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php index 6ac2f4dc7367d8c20a61de7a3ed3658a7a21c2fc..da9e8ec86d1b74469dda06a091ea83c1bb4408bc 100644 --- a/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php +++ b/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php @@ -22,7 +22,7 @@ */ class LinkEdit extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['tid'] = 'tid'; $this->additional_fields['vid'] = 'vid'; @@ -32,24 +32,24 @@ function construct() { ); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['text'] = array('default' => '', 'translatable' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['text'] = array( '#type' => 'textfield', '#title' => t('Text to display'), '#default_value' => $this->options['text'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); } diff --git a/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php b/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php index ebfd7f764cee11f7aa33e4ad46ea10dd6c1fa299..a48a8c3f9b7184b7a101e2f7cc640bd416c288d0 100644 --- a/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php +++ b/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php @@ -29,7 +29,7 @@ class Taxonomy extends FieldPluginBase { * This constructer assumes the taxonomy_term_data table. If using another * table, we'll need to be more specific. */ - function construct() { + public function construct() { parent::construct(); $this->additional_fields['vid'] = 'vid'; $this->additional_fields['tid'] = 'tid'; @@ -39,8 +39,8 @@ function construct() { ); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_taxonomy'] = array('default' => FALSE, 'bool' => TRUE); $options['convert_spaces'] = array('default' => FALSE, 'bool' => TRUE); return $options; @@ -49,7 +49,7 @@ function option_definition() { /** * Provide link to taxonomy option */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_taxonomy'] = array( '#title' => t('Link this field to its taxonomy term page'), '#description' => t("Enable to override this field's links."), @@ -62,7 +62,7 @@ function options_form(&$form, &$form_state) { '#type' => 'checkbox', '#default_value' => !empty($this->options['convert_spaces']), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** diff --git a/lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php b/lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php index b3818cd3b74f021e269998c90d46fd912e00b2e5..700913a358ce4fe1c117c3efb140ce0117d7bab5 100644 --- a/lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php +++ b/lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php @@ -43,8 +43,8 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_taxonomy'] = array('default' => TRUE, 'bool' => TRUE); $options['limit'] = array('default' => FALSE, 'bool' => TRUE); @@ -56,7 +56,7 @@ function option_definition() { /** * Provide "link to term" option. */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_taxonomy'] = array( '#title' => t('Link this field to its term page'), '#type' => 'checkbox', @@ -88,13 +88,13 @@ function options_form(&$form, &$form_state) { ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** * Add this term to the query */ - function query() { + public function query() { $this->add_additional_fields(); } diff --git a/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php index 9e6985e56ec09db08f1b95af99547b26ec837672..6852355fb5a5b4186c8cb327a27501c2b1cbdb83 100644 --- a/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php +++ b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php @@ -45,8 +45,8 @@ function has_extra_options() { return TRUE; } function get_value_options() { /* don't overwrite the value options */ } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['type'] = array('default' => 'textfield'); $options['limit'] = array('default' => TRUE, 'bool' => TRUE); @@ -215,7 +215,7 @@ function value_form(&$form, &$form_state) { if (empty($form_state['exposed'])) { // Retain the helper option - $this->helper->options_form($form, $form_state); + $this->helper->buildOptionsForm($form, $form_state); } } diff --git a/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php index 55dff0384986d49a1ad487e8e50da82a03e423df..09f3f659807ed9e4a8678b55922c4c79fdbaba64 100644 --- a/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php +++ b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php @@ -30,8 +30,8 @@ function operator_options($which = 'title') { ); } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['depth'] = array('default' => 0); @@ -49,7 +49,7 @@ function extra_options_form(&$form, &$form_state) { ); } - function query() { + public function query() { // If no filter values are present, then do nothing. if (count($this->value) == 0) { return; diff --git a/lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php b/lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php index 76690543c2d1e936acdda8edfb67ef1160e51ce0..f9f988c46f7283a0330cc5b4b1ac6a663219e7c4 100644 --- a/lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php +++ b/lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php @@ -36,13 +36,13 @@ function init(&$view, &$options) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['vocabularies'] = array('default' => array()); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $vocabularies = taxonomy_vocabulary_get_names(); $options = array(); foreach ($vocabularies as $voc) { @@ -56,13 +56,13 @@ function options_form(&$form, &$form_state) { '#default_value' => $this->options['vocabularies'], '#description' => t('Choose which vocabularies you wish to relate. Remember that every term found will create a new record, so this relationship is best used on just one vocabulary that has only one term per node.'), ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } /** * Called to implement a relationship in a query. */ - function query() { + public function query() { $this->ensure_my_table(); $def = $this->definition; diff --git a/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php b/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php index 7c553f1cb393c7230015fafdf70c5dd88c9435d9..5079dde2b6bc56cd9b8955da9eec1b72111e450b 100644 --- a/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php +++ b/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php @@ -22,7 +22,7 @@ */ class NodeTranslationLink extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['nid'] = 'nid'; $this->additional_fields['tnid'] = 'tnid'; @@ -30,7 +30,7 @@ function construct() { $this->additional_fields['langcode'] = 'langcode'; } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); } diff --git a/lib/Views/translation/Plugin/views/filter/NodeTnid.php b/lib/Views/translation/Plugin/views/filter/NodeTnid.php index 59d8e47be97d0ec20b2b75c67c96c31ea862c75e..57db89374267ccc9a16f947728de520915ed560a 100644 --- a/lib/Views/translation/Plugin/views/filter/NodeTnid.php +++ b/lib/Views/translation/Plugin/views/filter/NodeTnid.php @@ -24,8 +24,8 @@ class NodeTnid extends FilterPluginBase { function admin_summary() { } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['operator']['default'] = 1; @@ -49,7 +49,7 @@ function operator_form(&$form, &$form_state) { function can_expose() { return FALSE; } - function query() { + public function query() { $table = $this->ensure_my_table(); // Select for source translations (tnid = nid). Conditionally, also accept either untranslated nodes (tnid = 0). $this->query->add_where_expression($this->options['group'], "$table.tnid = $table.nid" . ($this->operator ? " OR $table.tnid = 0" : '')); diff --git a/lib/Views/translation/Plugin/views/filter/NodeTnidChild.php b/lib/Views/translation/Plugin/views/filter/NodeTnidChild.php index a3131824066ab6ee3c1c326e3cbc6dc5221752be..8c0662d467b7f991cd30fe67865cb11bf6c00012 100644 --- a/lib/Views/translation/Plugin/views/filter/NodeTnidChild.php +++ b/lib/Views/translation/Plugin/views/filter/NodeTnidChild.php @@ -28,7 +28,7 @@ function operator_form(&$form, &$form_state) { } function can_expose() { return FALSE; } - function query() { + public function query() { $table = $this->ensure_my_table(); $this->query->add_where_expression($this->options['group'], "$table.tnid <> $table.nid AND $table.tnid > 0"); } diff --git a/lib/Views/translation/Plugin/views/relationship/Translation.php b/lib/Views/translation/Plugin/views/relationship/Translation.php index 1cb49697a4e9f614d52265127cb9b325dfbb31d3..c1f434b39b4ff50a4317c34739054f6fcd4e8de0 100644 --- a/lib/Views/translation/Plugin/views/relationship/Translation.php +++ b/lib/Views/translation/Plugin/views/relationship/Translation.php @@ -23,8 +23,8 @@ */ class Translation extends RelationshipPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['language'] = array('default' => 'current'); return $options; @@ -33,8 +33,8 @@ function option_definition() { /** * Add a translation selector. */ - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $options = array( 'all' => t('All'), @@ -54,7 +54,7 @@ function options_form(&$form, &$form_state) { /** * Called to implement a relationship in a query. */ - function query() { + public function query() { // Figure out what base table this relationship brings to the party. $table_data = views_fetch_data($this->definition['base']); $base_field = empty($this->definition['base field']) ? $table_data['table']['base']['field'] : $this->definition['base field']; diff --git a/lib/Views/user/Plugin/views/argument_default/User.php b/lib/Views/user/Plugin/views/argument_default/User.php index 5f31360c8d5581834abab51e22db84e77edc963c..c12d6537677c34ef143224e3593ccc0a132b444f 100644 --- a/lib/Views/user/Plugin/views/argument_default/User.php +++ b/lib/Views/user/Plugin/views/argument_default/User.php @@ -22,14 +22,14 @@ */ class User extends ArgumentDefaultPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['user'] = array('default' => '', 'bool' => TRUE, 'translatable' => FALSE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['user'] = array( '#type' => 'checkbox', '#title' => t('Also look for a node and use the node author'), diff --git a/lib/Views/user/Plugin/views/argument_validator/User.php b/lib/Views/user/Plugin/views/argument_validator/User.php index 9ada23b8596554e4ef6a632ae6406bea4cdec516..3ef3ed62d3ab5289d00f404827dd5e45ec42ff30 100644 --- a/lib/Views/user/Plugin/views/argument_validator/User.php +++ b/lib/Views/user/Plugin/views/argument_validator/User.php @@ -26,8 +26,8 @@ */ class User extends ArgumentValidatorPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['type'] = array('default' => 'uid'); $options['restrict_roles'] = array('default' => FALSE, 'bool' => TRUE); $options['roles'] = array('default' => array()); @@ -35,7 +35,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['type'] = array( '#type' => 'radios', '#title' => t('Type of user filter value to allow'), @@ -67,7 +67,7 @@ function options_form(&$form, &$form_state) { ); } - function options_submit(&$form, &$form_state, &$options = array()) { + public function submitOptionsForm(&$form, &$form_state, &$options = array()) { // filter trash out of the options so we don't store giant unnecessary arrays $options['roles'] = array_filter($options['roles']); } diff --git a/lib/Views/user/Plugin/views/field/Link.php b/lib/Views/user/Plugin/views/field/Link.php index 54f9f02c47f1d117ad167e52fe5b716aeb0e384e..6033c2c6847a881b223572853037ff223c870d2b 100644 --- a/lib/Views/user/Plugin/views/field/Link.php +++ b/lib/Views/user/Plugin/views/field/Link.php @@ -22,24 +22,24 @@ */ class Link extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['uid'] = 'uid'; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['text'] = array('default' => '', 'translatable' => TRUE); return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['text'] = array( '#type' => 'textfield', '#title' => t('Text to display'), '#default_value' => $this->options['text'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } // An example of field level access control. @@ -47,7 +47,7 @@ function access() { return user_access('access user profiles'); } - function query() { + public function query() { $this->ensure_my_table(); $this->add_additional_fields(); } diff --git a/lib/Views/user/Plugin/views/field/Mail.php b/lib/Views/user/Plugin/views/field/Mail.php index 34bcfec14ff21e4975ede7d23a0206a6d2d63be2..64ad0f01c76236e059f4a4ba5d5fb8635f825410 100644 --- a/lib/Views/user/Plugin/views/field/Mail.php +++ b/lib/Views/user/Plugin/views/field/Mail.php @@ -22,14 +22,14 @@ */ class Mail extends User { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_user'] = array('default' => 'mailto'); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['link_to_user'] = array( '#title' => t('Link this field'), '#type' => 'radios', diff --git a/lib/Views/user/Plugin/views/field/Name.php b/lib/Views/user/Plugin/views/field/Name.php index 1ddaeaa74d338d915614ebf9412e87c2e9ff9fc6..754058ccc041b9c225183c4fec0a2e7ce2b1e245 100644 --- a/lib/Views/user/Plugin/views/field/Name.php +++ b/lib/Views/user/Plugin/views/field/Name.php @@ -32,8 +32,8 @@ function init(&$view, &$data) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['overwrite_anonymous'] = array('default' => FALSE, 'bool' => TRUE); $options['anonymous_text'] = array('default' => '', 'translatable' => TRUE); @@ -42,7 +42,7 @@ function option_definition() { return $options; } - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['format_username'] = array( '#title' => t('Use formatted username'), '#type' => 'checkbox', @@ -69,7 +69,7 @@ function options_form(&$form, &$form_state) { '#fieldset' => 'more', ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render_link($data, $values) { diff --git a/lib/Views/user/Plugin/views/field/Permissions.php b/lib/Views/user/Plugin/views/field/Permissions.php index c1112afe67a92d20cda09f284f97830ef9746465..08ab1332d4bc8b0bd19b5793c39692f0e87102d3 100644 --- a/lib/Views/user/Plugin/views/field/Permissions.php +++ b/lib/Views/user/Plugin/views/field/Permissions.php @@ -22,12 +22,12 @@ */ class Permissions extends PrerenderList { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid'); } - function query() { + public function query() { $this->add_additional_fields(); $this->field_alias = $this->aliases['uid']; } diff --git a/lib/Views/user/Plugin/views/field/Picture.php b/lib/Views/user/Plugin/views/field/Picture.php index fe441c8e70530cb188f4fca1180bdd0ecf06602c..9242f00552d864601c1bac670f451f9448f3e3b3 100644 --- a/lib/Views/user/Plugin/views/field/Picture.php +++ b/lib/Views/user/Plugin/views/field/Picture.php @@ -22,7 +22,7 @@ */ class Picture extends FieldPluginBase { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['uid'] = 'uid'; $this->additional_fields['name'] = 'name'; @@ -51,15 +51,15 @@ function element_type($none_supported = FALSE, $default_empty = FALSE, $inline = return 'div'; } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_photo_to_profile'] = array('default' => TRUE, 'bool' => TRUE); $options['image_style'] = array('default' => ''); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['link_photo_to_profile'] = array( '#title' => t("Link to user's profile"), '#description' => t("Link the user picture to the user's profile"), diff --git a/lib/Views/user/Plugin/views/field/Roles.php b/lib/Views/user/Plugin/views/field/Roles.php index e50c3f4f44ec260ee3520d3020843c37a3c6aa46..058bb60186d8914f71e29c7380243174317304d4 100644 --- a/lib/Views/user/Plugin/views/field/Roles.php +++ b/lib/Views/user/Plugin/views/field/Roles.php @@ -22,12 +22,12 @@ */ class Roles extends PrerenderList { - function construct() { + public function construct() { parent::construct(); $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid'); } - function query() { + public function query() { $this->add_additional_fields(); $this->field_alias = $this->aliases['uid']; } diff --git a/lib/Views/user/Plugin/views/field/User.php b/lib/Views/user/Plugin/views/field/User.php index 1762285f0f086e695806995d97990080c9798082..fcc11869deae7b333621759e7000e41f251717fc 100644 --- a/lib/Views/user/Plugin/views/field/User.php +++ b/lib/Views/user/Plugin/views/field/User.php @@ -32,8 +32,8 @@ function init(&$view, &$data) { } } - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['link_to_user'] = array('default' => TRUE, 'bool' => TRUE); return $options; } @@ -41,14 +41,14 @@ function option_definition() { /** * Provide link to node option */ - function options_form(&$form, &$form_state) { + public function buildOptionsForm(&$form, &$form_state) { $form['link_to_user'] = array( '#title' => t('Link this field to its user'), '#description' => t("Enable to override this field's links."), '#type' => 'checkbox', '#default_value' => $this->options['link_to_user'], ); - parent::options_form($form, $form_state); + parent::buildOptionsForm($form, $form_state); } function render_link($data, $values) { diff --git a/lib/Views/user/Plugin/views/filter/Current.php b/lib/Views/user/Plugin/views/filter/Current.php index bed0c9dc6d338707b2fdd126de6ef850430a4389..28d9bcba2c5904ba6f96398c4034c5ce9f7cf1f0 100644 --- a/lib/Views/user/Plugin/views/filter/Current.php +++ b/lib/Views/user/Plugin/views/filter/Current.php @@ -22,12 +22,12 @@ */ class Current extends BooleanOperator { - function construct() { + public function construct() { parent::construct(); $this->value_value = t('Is the logged in user'); } - function query() { + public function query() { $this->ensure_my_table(); $field = $this->table_alias . '.' . $this->real_field . ' '; diff --git a/lib/Views/user/Plugin/views/row/View.php b/lib/Views/user/Plugin/views/row/View.php index b5222d75d33c3c027f697766a04628a1f3d5e0bc..b7160088ca434952d013fbcf5c4200ecab70a170 100644 --- a/lib/Views/user/Plugin/views/row/View.php +++ b/lib/Views/user/Plugin/views/row/View.php @@ -33,17 +33,17 @@ class View extends RowPluginBase { // Store the users to be used for pre_render. var $users = array(); - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['view_mode'] = array('default' => 'full'); return $options; } - function options_form(&$form, &$form_state) { - parent::options_form($form, $form_state); + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); - $options = $this->options_form_summary_options(); + $options = $this->buildOptionsForm_summary_options(); $form['view_mode'] = array( '#type' => 'select', '#options' => $options, @@ -56,7 +56,7 @@ function options_form(&$form, &$form_state) { /** * Return the main options, which are shown in the summary title. */ - function options_form_summary_options() { + public function buildOptionsForm_summary_options() { $entity_info = entity_get_info('user'); $options = array(); if (!empty($entity_info['view modes'])) { @@ -73,8 +73,8 @@ function options_form_summary_options() { return $options; } - function summary_title() { - $options = $this->options_form_summary_options(); + public function summaryTitle() { + $options = $this->buildOptionsForm_summary_options(); return check_plain($options[$this->options['view_mode']]); } diff --git a/tests/views_test/lib/Drupal/views_test/Plugin/views/access/DynamicTest.php b/tests/views_test/lib/Drupal/views_test/Plugin/views/access/DynamicTest.php index 563b572377199c60fc680635d62acdd3b8dbb7a2..a1886d4d1fc4687a85845d3dc1c6bd4bbfc794f0 100644 --- a/tests/views_test/lib/Drupal/views_test/Plugin/views/access/DynamicTest.php +++ b/tests/views_test/lib/Drupal/views_test/Plugin/views/access/DynamicTest.php @@ -22,8 +22,8 @@ */ class DynamicTest extends AccessPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['access'] = array('default' => FALSE, 'bool' => TRUE); return $options; diff --git a/tests/views_test/lib/Drupal/views_test/Plugin/views/access/StaticTest.php b/tests/views_test/lib/Drupal/views_test/Plugin/views/access/StaticTest.php index 7b5b424cd2e78aa14e6a129396703db26858b8b5..fb98d2131a6b346285a702a7092f755448fac82c 100644 --- a/tests/views_test/lib/Drupal/views_test/Plugin/views/access/StaticTest.php +++ b/tests/views_test/lib/Drupal/views_test/Plugin/views/access/StaticTest.php @@ -22,8 +22,8 @@ */ class StaticTest extends AccessPluginBase { - function option_definition() { - $options = parent::option_definition(); + protected function defineOptions() { + $options = parent::defineOptions(); $options['access'] = array('default' => FALSE, 'bool' => TRUE); return $options;