Commit 04490645 authored by alexpott's avatar alexpott
Browse files

Issue #2002900 by diarmy: Rename Views method get_default_argument() to getDefaultArgument().

parent d757edec
......@@ -41,7 +41,7 @@ public function test_plugin_argument_default_current_user() {
$view = views_get_view('test_plugin_argument_default_current_user');
$view->initHandlers();
$this->assertEqual($view->argument['null']->get_default_argument(), $account->uid, 'Uid of the current user is used.');
$this->assertEqual($view->argument['null']->getDefaultArgument(), $account->uid, 'Uid of the current user is used.');
// Switch back.
$user = $admin;
drupal_save_session(TRUE);
......
......@@ -741,7 +741,7 @@ function hasDefaultArgument() {
/**
* Get a default argument, if available.
*/
function get_default_argument() {
public function getDefaultArgument() {
$plugin = $this->getPlugin('argument_default');
if ($plugin) {
return $plugin->get_argument();
......@@ -1015,7 +1015,7 @@ function get_value() {
// processing the arguments.
$argument = clone $this;
if (!isset($arg) && $argument->hasDefaultArgument()) {
$arg = $argument->get_default_argument();
$arg = $argument->getDefaultArgument();
// remember that this argument was computed, not passed on the URL.
$this->is_default = TRUE;
......
......@@ -57,7 +57,7 @@ public function defaultArgumentForm(&$form, &$form_state) {
* Set the empty argument value to the current date,
* formatted appropriately for this argument.
*/
function get_default_argument($raw = FALSE) {
public function getDefaultArgument($raw = FALSE) {
if (!$raw && $this->options['default_argument_type'] == 'date') {
return date($this->argFormat, REQUEST_TIME);
}
......@@ -74,7 +74,7 @@ function get_default_argument($raw = FALSE) {
}
if (empty($node)) {
return parent::get_default_argument();
return parent::getDefaultArgument();
}
elseif ($this->options['default_argument_type'] == 'node_created') {
return date($this->argFormat, $node->created);
......@@ -84,7 +84,7 @@ function get_default_argument($raw = FALSE) {
}
}
return parent::get_default_argument($raw);
return parent::getDefaultArgument($raw);
}
/**
......
......@@ -65,7 +65,7 @@ public function testArgumentDefaultPlugin() {
$this->assertTrue($plugin instanceof ArgumentDefaultTestPlugin, 'The correct argument default plugin is used.');
// Check that the value of the default argument is as expected.
$this->assertEqual($view->argument[$id]->get_default_argument(), 'John', 'The correct argument default value is returned.');
$this->assertEqual($view->argument[$id]->getDefaultArgument(), 'John', 'The correct argument default value is returned.');
// Don't pass in a value for the default argument and make sure the query
// just returns John.
$this->executeView($view);
......@@ -118,7 +118,7 @@ function testArgumentDefaultFixed() {
$view->display_handler->overrideOption('arguments', $options);
$view->initHandlers();
$this->assertEqual($view->argument['null']->get_default_argument(), $random, 'Fixed argument should be used by default.');
$this->assertEqual($view->argument['null']->getDefaultArgument(), $random, 'Fixed argument should be used by default.');
// Make sure that a normal argument provided is used
$random_string = $this->randomName();
......
......@@ -857,7 +857,7 @@ protected function _buildArguments() {
if (isset($arg) || $argument->hasDefaultArgument()) {
if (!isset($arg)) {
$arg = $argument->get_default_argument();
$arg = $argument->getDefaultArgument();
// make sure default args get put back.
if (isset($arg)) {
$this->args[$position] = $arg;
......
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