Commit db385738 authored by alexpott's avatar alexpott

Issue #2003044 by dwieeb: Rename Views method get_plugin() to getPlugin().

parent 55f5d78e
...@@ -324,7 +324,7 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -324,7 +324,7 @@ public function buildOptionsForm(&$form, &$form_state) {
// If we decide this validator is ok, add it to the list. // If we decide this validator is ok, add it to the list.
if ($valid) { if ($valid) {
$plugin = $this->get_plugin('argument_validator', $id); $plugin = $this->getPlugin('argument_validator', $id);
if ($plugin) { if ($plugin) {
if ($plugin->access() || $this->options['validate']['type'] == $id) { if ($plugin->access() || $this->options['validate']['type'] == $id) {
$form['validate']['options'][$id] = array( $form['validate']['options'][$id] = array(
...@@ -373,20 +373,20 @@ public function validateOptionsForm(&$form, &$form_state) { ...@@ -373,20 +373,20 @@ public function validateOptionsForm(&$form, &$form_state) {
// Let the plugins do validation. // Let the plugins do validation.
$default_id = $form_state['values']['options']['default_argument_type']; $default_id = $form_state['values']['options']['default_argument_type'];
$plugin = $this->get_plugin('argument_default', $default_id); $plugin = $this->getPlugin('argument_default', $default_id);
if ($plugin) { if ($plugin) {
$plugin->validateOptionsForm($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 plugin
$summary_id = $form_state['values']['options']['summary']['format']; $summary_id = $form_state['values']['options']['summary']['format'];
$plugin = $this->get_plugin('style', $summary_id); $plugin = $this->getPlugin('style', $summary_id);
if ($plugin) { if ($plugin) {
$plugin->validateOptionsForm($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']; $validate_id = $form_state['values']['options']['validate']['type'];
$plugin = $this->get_plugin('argument_validator', $validate_id); $plugin = $this->getPlugin('argument_validator', $validate_id);
if ($plugin) { if ($plugin) {
$plugin->validateOptionsForm($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]);
} }
...@@ -400,7 +400,7 @@ public function submitOptionsForm(&$form, &$form_state) { ...@@ -400,7 +400,7 @@ public function submitOptionsForm(&$form, &$form_state) {
// Let the plugins make submit modifications if necessary. // Let the plugins make submit modifications if necessary.
$default_id = $form_state['values']['options']['default_argument_type']; $default_id = $form_state['values']['options']['default_argument_type'];
$plugin = $this->get_plugin('argument_default', $default_id); $plugin = $this->getPlugin('argument_default', $default_id);
if ($plugin) { if ($plugin) {
$options = &$form_state['values']['options']['argument_default'][$default_id]; $options = &$form_state['values']['options']['argument_default'][$default_id];
$plugin->submitOptionsForm($form['argument_default'][$default_id], $form_state, $options); $plugin->submitOptionsForm($form['argument_default'][$default_id], $form_state, $options);
...@@ -410,7 +410,7 @@ public function submitOptionsForm(&$form, &$form_state) { ...@@ -410,7 +410,7 @@ public function submitOptionsForm(&$form, &$form_state) {
// summary plugin // summary plugin
$summary_id = $form_state['values']['options']['summary']['format']; $summary_id = $form_state['values']['options']['summary']['format'];
$plugin = $this->get_plugin('style', $summary_id); $plugin = $this->getPlugin('style', $summary_id);
if ($plugin) { if ($plugin) {
$options = &$form_state['values']['options']['summary']['options'][$summary_id]; $options = &$form_state['values']['options']['summary']['options'][$summary_id];
$plugin->submitOptionsForm($form['summary']['options'][$summary_id], $form_state, $options); $plugin->submitOptionsForm($form['summary']['options'][$summary_id], $form_state, $options);
...@@ -419,7 +419,7 @@ public function submitOptionsForm(&$form, &$form_state) { ...@@ -419,7 +419,7 @@ public function submitOptionsForm(&$form, &$form_state) {
} }
$validate_id = $form_state['values']['options']['validate']['type']; $validate_id = $form_state['values']['options']['validate']['type'];
$plugin = $this->get_plugin('argument_validator', $validate_id); $plugin = $this->getPlugin('argument_validator', $validate_id);
if ($plugin) { if ($plugin) {
$options = &$form_state['values']['options']['validate']['options'][$validate_id]; $options = &$form_state['values']['options']['validate']['options'][$validate_id];
$plugin->submitOptionsForm($form['validate']['options'][$validate_id], $form_state, $options); $plugin->submitOptionsForm($form['validate']['options'][$validate_id], $form_state, $options);
...@@ -529,7 +529,7 @@ function default_argument_form(&$form, &$form_state) { ...@@ -529,7 +529,7 @@ function default_argument_form(&$form, &$form_state) {
if (!empty($info['no_ui'])) { if (!empty($info['no_ui'])) {
continue; continue;
} }
$plugin = $this->get_plugin('argument_default', $id); $plugin = $this->getPlugin('argument_default', $id);
if ($plugin) { if ($plugin) {
if ($plugin->access() || $this->options['default_argument_type'] == $id) { if ($plugin->access() || $this->options['default_argument_type'] == $id) {
$form['argument_default']['#argument_option'] = 'default'; $form['argument_default']['#argument_option'] = 'default';
...@@ -617,7 +617,7 @@ public function defaultSummaryForm(&$form, &$form_state) { ...@@ -617,7 +617,7 @@ public function defaultSummaryForm(&$form, &$form_state) {
); );
foreach ($summary_plugins as $id => $info) { foreach ($summary_plugins as $id => $info) {
$plugin = $this->get_plugin('style', $id); $plugin = $this->getPlugin('style', $id);
if (!$plugin->usesOptions()) { if (!$plugin->usesOptions()) {
continue; continue;
} }
...@@ -742,7 +742,7 @@ function hasDefaultArgument() { ...@@ -742,7 +742,7 @@ function hasDefaultArgument() {
* Get a default argument, if available. * Get a default argument, if available.
*/ */
function get_default_argument() { function get_default_argument() {
$plugin = $this->get_plugin('argument_default'); $plugin = $this->getPlugin('argument_default');
if ($plugin) { if ($plugin) {
return $plugin->get_argument(); return $plugin->get_argument();
} }
...@@ -756,7 +756,7 @@ function get_default_argument() { ...@@ -756,7 +756,7 @@ function get_default_argument() {
*/ */
function process_summary_arguments(&$args) { function process_summary_arguments(&$args) {
if ($this->options['validate']['type'] != 'none') { if ($this->options['validate']['type'] != 'none') {
if (isset($this->validator) || $this->validator = $this->get_plugin('argument_validator')) { if (isset($this->validator) || $this->validator = $this->getPlugin('argument_validator')) {
$this->validator->process_summary_arguments($args); $this->validator->process_summary_arguments($args);
} }
} }
...@@ -949,7 +949,7 @@ public function validateArgument($arg) { ...@@ -949,7 +949,7 @@ public function validateArgument($arg) {
return $this->argument_validated = TRUE; return $this->argument_validated = TRUE;
} }
$plugin = $this->get_plugin('argument_validator'); $plugin = $this->getPlugin('argument_validator');
return $this->argument_validated = $plugin->validate_argument($arg); return $this->argument_validated = $plugin->validate_argument($arg);
} }
...@@ -1031,7 +1031,7 @@ function get_value() { ...@@ -1031,7 +1031,7 @@ function get_value() {
/** /**
* Get the display or row plugin, if it exists. * Get the display or row plugin, if it exists.
*/ */
function get_plugin($type = 'argument_default', $name = NULL) { public function getPlugin($type = 'argument_default', $name = NULL) {
$options = array(); $options = array();
switch ($type) { switch ($type) {
case 'argument_default': case 'argument_default':
......
...@@ -61,7 +61,7 @@ public function testArgumentDefaultPlugin() { ...@@ -61,7 +61,7 @@ public function testArgumentDefaultPlugin() {
); );
$id = $view->addItem('default', 'argument', 'views_test_data', 'name', $options); $id = $view->addItem('default', 'argument', 'views_test_data', 'name', $options);
$view->initHandlers(); $view->initHandlers();
$plugin = $view->argument[$id]->get_plugin('argument_default'); $plugin = $view->argument[$id]->getPlugin('argument_default');
$this->assertTrue($plugin instanceof ArgumentDefaultTestPlugin, 'The correct argument default plugin is used.'); $this->assertTrue($plugin instanceof ArgumentDefaultTestPlugin, 'The correct argument default plugin is used.');
// Check that the value of the default argument is as expected. // Check that the value of the default argument is as expected.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment