Commit 821dc67d authored by alexpott's avatar alexpott
Browse files

Issue #2002442 by baldwinlouie, sillygwailo, jibran: Rename Views method...

Issue #2002442 by baldwinlouie, sillygwailo, jibran: Rename Views method default_actions() to defaultActions().
parent 167810ff
...@@ -37,17 +37,17 @@ function title() { ...@@ -37,17 +37,17 @@ function title() {
return check_plain($title); return check_plain($title);
} }
function default_actions($which = NULL) { protected function defaultActions($which = NULL) {
// Disallow summary views on this argument. // Disallow summary views on this argument.
if (!$which) { if (!$which) {
$actions = parent::default_actions(); $actions = parent::defaultActions();
unset($actions['summary asc']); unset($actions['summary asc']);
unset($actions['summary desc']); unset($actions['summary desc']);
return $actions; return $actions;
} }
if ($which != 'summary asc' && $which != 'summary desc') { if ($which != 'summary asc' && $which != 'summary desc') {
return parent::default_actions($which); return parent::defaultActions($which);
} }
} }
......
...@@ -78,16 +78,16 @@ public function setBreadcrumb(&$breadcrumb) { ...@@ -78,16 +78,16 @@ public function setBreadcrumb(&$breadcrumb) {
} }
/** /**
* Override default_actions() to remove summary actions. * Override defaultActions() to remove summary actions.
*/ */
function default_actions($which = NULL) { protected function defaultActions($which = NULL) {
if ($which) { if ($which) {
if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) { if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) {
return parent::default_actions($which); return parent::defaultActions($which);
} }
return; return;
} }
$actions = parent::default_actions(); $actions = parent::defaultActions();
unset($actions['summary asc']); unset($actions['summary asc']);
unset($actions['summary desc']); unset($actions['summary desc']);
unset($actions['summary asc by count']); unset($actions['summary asc by count']);
......
...@@ -92,7 +92,7 @@ public function setBreadcrumb(&$breadcrumb) { } ...@@ -92,7 +92,7 @@ public function setBreadcrumb(&$breadcrumb) { }
* @return TRUE/FALSE * @return TRUE/FALSE
*/ */
public function usesBreadcrumb() { public function usesBreadcrumb() {
$info = $this->default_actions($this->options['default_action']); $info = $this->defaultActions($this->options['default_action']);
return !empty($info['breadcrumb']); return !empty($info['breadcrumb']);
} }
...@@ -117,8 +117,8 @@ public function exceptionTitle() { ...@@ -117,8 +117,8 @@ public function exceptionTitle() {
* @return TRUE/FALSE * @return TRUE/FALSE
*/ */
public function needsStylePlugin() { public function needsStylePlugin() {
$info = $this->default_actions($this->options['default_action']); $info = $this->defaultActions($this->options['default_action']);
$validate_info = $this->default_actions($this->options['validate']['fail']); $validate_info = $this->defaultActions($this->options['validate']['fail']);
return !empty($info['style plugin']) || !empty($validate_info['style plugin']); return !empty($info['style plugin']) || !empty($validate_info['style plugin']);
} }
...@@ -223,7 +223,7 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -223,7 +223,7 @@ public function buildOptionsForm(&$form, &$form_state) {
); );
$options = array(); $options = array();
$defaults = $this->default_actions(); $defaults = $this->defaultActions();
$validate_options = array(); $validate_options = array();
foreach ($defaults as $id => $info) { foreach ($defaults as $id => $info) {
$options[$id] = $info['title']; $options[$id] = $info['title'];
...@@ -440,7 +440,7 @@ public function submitOptionsForm(&$form, &$form_state) { ...@@ -440,7 +440,7 @@ public function submitOptionsForm(&$form, &$form_state) {
* *
* Override this method to provide additional (or fewer) default behaviors. * Override this method to provide additional (or fewer) default behaviors.
*/ */
function default_actions($which = NULL) { protected function defaultActions($which = NULL) {
$defaults = array( $defaults = array(
'ignore' => array( 'ignore' => array(
'title' => t('Display all results for the specified field'), 'title' => t('Display all results for the specified field'),
...@@ -653,7 +653,7 @@ public function defaultSummaryForm(&$form, &$form_state) { ...@@ -653,7 +653,7 @@ public function defaultSummaryForm(&$form, &$form_state) {
*/ */
function default_action($info = NULL) { function default_action($info = NULL) {
if (!isset($info)) { if (!isset($info)) {
$info = $this->default_actions($this->options['default_action']); $info = $this->defaultActions($this->options['default_action']);
} }
if (!$info) { if (!$info) {
...@@ -672,7 +672,7 @@ function default_action($info = NULL) { ...@@ -672,7 +672,7 @@ function default_action($info = NULL) {
* How to act if validation failes * How to act if validation failes
*/ */
public function validateFail() { public function validateFail() {
$info = $this->default_actions($this->options['validate']['fail']); $info = $this->defaultActions($this->options['validate']['fail']);
return $this->default_action($info); return $this->default_action($info);
} }
/** /**
...@@ -734,7 +734,7 @@ function default_default() { ...@@ -734,7 +734,7 @@ function default_default() {
* Determine if the argument is set to provide a default argument. * Determine if the argument is set to provide a default argument.
*/ */
function hasDefaultArgument() { function hasDefaultArgument() {
$info = $this->default_actions($this->options['default_action']); $info = $this->defaultActions($this->options['default_action']);
return !empty($info['has default argument']); return !empty($info['has default argument']);
} }
...@@ -961,7 +961,7 @@ public function validateArgument($arg) { ...@@ -961,7 +961,7 @@ public function validateArgument($arg) {
* then validation cannot actually fail. * then validation cannot actually fail.
*/ */
function validate_argument($arg) { function validate_argument($arg) {
$validate_info = $this->default_actions($this->options['validate']['fail']); $validate_info = $this->defaultActions($this->options['validate']['fail']);
if (empty($validate_info['hard fail'])) { if (empty($validate_info['hard fail'])) {
return TRUE; return TRUE;
} }
...@@ -970,7 +970,7 @@ function validate_argument($arg) { ...@@ -970,7 +970,7 @@ function validate_argument($arg) {
// If the validator has changed the validate fail condition to a // If the validator has changed the validate fail condition to a
// soft fail, deal with that: // soft fail, deal with that:
$validate_info = $this->default_actions($this->options['validate']['fail']); $validate_info = $this->defaultActions($this->options['validate']['fail']);
if (empty($validate_info['hard fail'])) { if (empty($validate_info['hard fail'])) {
return TRUE; return TRUE;
} }
......
...@@ -42,17 +42,17 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -42,17 +42,17 @@ public function buildOptionsForm(&$form, &$form_state) {
} }
/** /**
* Override default_actions() to remove actions that don't * Override defaultActions() to remove actions that don't
* make sense for a null argument. * make sense for a null argument.
*/ */
function default_actions($which = NULL) { protected function defaultActions($which = NULL) {
if ($which) { if ($which) {
if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) { if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) {
return parent::default_actions($which); return parent::defaultActions($which);
} }
return; return;
} }
$actions = parent::default_actions(); $actions = parent::defaultActions();
unset($actions['summary asc']); unset($actions['summary asc']);
unset($actions['summary desc']); unset($actions['summary desc']);
return $actions; return $actions;
......
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