From 73badf2bf819f59294b3c09d87f23bd895bbd32b Mon Sep 17 00:00:00 2001 From: muskie9 Date: Mon, 25 Jul 2016 18:11:45 -0500 Subject: [PATCH] REFACTOR various class names and method call names --- code/Location.php | 12 ++++++------ code/Locator.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/Location.php b/code/Location.php index 6d715be..41dcbcd 100644 --- a/code/Location.php +++ b/code/Location.php @@ -71,7 +71,7 @@ public function getCoords() // custom labels for fields public function fieldLabels($includerelations = true) { - $labels = parent::fieldLabels(); + $labels = parent::fieldLabels($includerelations); $labels['Title'] = 'Name'; $labels['Suburb'] = 'City'; @@ -99,7 +99,7 @@ public function getCMSFields() EmailField::create('Email', 'Email'), TextField::create('Website') ->setAttribute('placeholder', 'http://'), - DropDownField::create('CategoryID', 'Category', LocationCategory::get()->map('ID', 'Title')) + DropdownField::create('CategoryID', 'Category', LocationCategory::get()->map('ID', 'Title')) ->setEmptyString('-- select --'), CheckboxField::create('ShowInLocator', 'Show in results') ->setDescription('Location will be included in results list'), @@ -142,22 +142,22 @@ public function EmailAddress() * * @return bool */ - public function canView($member = false) + public function canView($member = null) { return true; } - public function canEdit($member = false) + public function canEdit($member = null) { return Permission::check('Location_EDIT'); } - public function canDelete($member = false) + public function canDelete($member = null) { return Permission::check('Location_DELETE'); } - public function canCreate($member = false) + public function canCreate($member = null) { return Permission::check('Location_CREATE'); } diff --git a/code/Locator.php b/code/Locator.php index c23e884..61b0d31 100644 --- a/code/Locator.php +++ b/code/Locator.php @@ -212,7 +212,7 @@ public function LocationSearch() $locatorCategories = Locator::getPageCategories($this->ID); - if (LocationCategory::get()->Count() > 0 && $locatorCategories && $locatorCategories->Count() != 1) { + if (LocationCategory::get()->count() > 0 && $locatorCategories && $locatorCategories->count() != 1) { $categories = LocationCategory::get(); if ($categories->count() > 0) {