Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #80 from halkyon/e_strict_support

Fixes to method arguments in cms classes for E_STRICT support
  • Loading branch information...
commit 651441225ff4bd5920ce496e1d9ecdb05efe91ad 2 parents a4f56b9 + 0ea9451
@chillu chillu authored
View
6 code/controllers/CMSSettingsController.php
@@ -9,7 +9,7 @@ class CMSSettingsController extends CMSMain {
/**
* @return Form
*/
- function getEditForm($id = null) {
+ function getEditForm($id = null, $fields = null) {
$siteConfig = SiteConfig::current_site_config();
$fields = $siteConfig->getCMSFields();
@@ -54,7 +54,7 @@ function PreviewLink() {
return false;
}
- function Breadcrumbs() {
+ function Breadcrumbs($unlinked = false) {
return new ArrayList(array(
new ArrayData(array(
'Title' => $this->SectionTitle(),
@@ -63,4 +63,4 @@ function Breadcrumbs() {
));
}
-}
+}
View
4 code/controllers/ContentController.php
@@ -133,7 +133,7 @@ public function init() {
*
* @return SS_HTTPResponse
*/
- public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
+ public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
$child = null;
$action = $request->param('Action');
$this->setModel($model);
@@ -526,4 +526,4 @@ function deleteinstallfiles() {
"Content" => $content,
);
}
-}
+}
View
2  code/controllers/RootURLController.php
@@ -104,7 +104,7 @@ public static function reset() {
* @param SS_HTTPRequest $request
* @return SS_HTTPResponse
*/
- public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
+ public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
self::$is_at_root = true;
$this->setModel($model);
View
8 code/controllers/SilverStripeNavigator.php
@@ -193,7 +193,7 @@ function isActive() {
return (Controller::curr() instanceof CMSMain);
}
- function canView() {
+ function canView($member = null) {
// Don't show in CMS
return !(Controller::curr() instanceof CMSMain);
}
@@ -223,7 +223,7 @@ function getLink() {
return Controller::join_links($this->record->AbsoluteLink(), '?stage=Stage');
}
- function canView() {
+ function canView($member = null) {
return ($this->record->hasExtension('Versioned') && $this->getDraftPage());
}
@@ -267,7 +267,7 @@ function getLink() {
return Controller::join_links($this->record->AbsoluteLink(), '?stage=Live');
}
- function canView() {
+ function canView($member = null) {
return ($this->record->hasExtension('Versioned') && $this->getLivePage());
}
@@ -309,7 +309,7 @@ function getLink() {
return $this->record->AbsoluteLink() . '?archiveDate=' . $date;
}
- function canView() {
+ function canView($member = null) {
return ($this->record->hasExtension('Versioned') && $this->isArchived());
}
View
4 code/model/ErrorPage.php
@@ -127,8 +127,8 @@ function requireDefaultRecords() {
}
}
- function getCMSFields() {
- $fields = parent::getCMSFields();
+ function getCMSFields($params = null) {
+ $fields = parent::getCMSFields($params);
$fields->addFieldToTab(
"Root.Main",
View
4 code/model/RedirectorPage.php
@@ -115,7 +115,7 @@ function onBeforeWrite() {
}
}
- function getCMSFields() {
+ function getCMSFields($params = null) {
Requirements::javascript(SAPPHIRE_DIR . "/javascript/RedirectorPage.js");
$fields = parent::getCMSFields();
@@ -180,4 +180,4 @@ function Content() {
_t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') .
"</p>";
}
-}
+}
View
2  code/model/SiteConfig.php
@@ -41,7 +41,7 @@ public static function disable_theme($theme) {
*
* @return FieldList
*/
- function getCMSFields() {
+ function getCMSFields($params = null) {
Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
$groupsMap = DataList::create('Group')->map('ID', 'Breadcrumbs')->toArray();
View
5 code/model/SiteTree.php
@@ -1007,9 +1007,6 @@ static function prepopuplate_permission_cache($permission = 'CanEditType', $ids,
static function prepopulate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
if(!$batchCallback) $batchCallback = "SiteTree::can_{$permission}_multiple";
- //PHP 5.1 requires an array rather than a string for the call_user_func function
- $batchCallback=explode('::', $batchCallback);
-
if(is_callable($batchCallback)) {
call_user_func($batchCallback, $ids, Member::currentUserID(), false);
} else {
@@ -1748,7 +1745,7 @@ function VirtualPages() {
*
* @return FieldList The fields to be displayed in the CMS.
*/
- function getCMSFields() {
+ function getCMSFields($params = null) {
require_once("forms/Form.php");
// Status / message
// Create a status message for multiple parents
View
4 code/model/SiteTreeFileExtension.php
@@ -5,7 +5,7 @@
*/
class SiteTreeFileExtension extends DataExtension {
- function extraStatics() {
+ function extraStatics($class = null, $extension = null) {
return array(
'belongs_many_many' => array(
"BackLinkTracking" => "SiteTree",
@@ -95,4 +95,4 @@ function updateLinks($old, $new) {
if(class_exists('Subsite')) Subsite::disable_subsite_filter(false);
}
-}
+}
View
11 code/model/SiteTreeFolderExtension.php
@@ -1,13 +1,6 @@
<?php
class SiteTreeFolderExtension extends DataExtension {
-
- function updateCMSFields(&$fields) {
- // TODO commenting out unused files tab till bugs are fixed
- // $fields->push(new Tab("UnusedFiles", _t('Folder.UNUSEDFILESTAB', "Unused files"),
- // new Folder_UnusedAssetsField($this)
- // ));
- }
-
+
/**
* Looks for files used in system and create where clause which contains all ID's of files.
*
@@ -52,4 +45,4 @@ public function getUnusedFilesListFilter() {
}
return $where;
}
-}
+}
View
8 code/reports/Report.php
@@ -378,11 +378,11 @@ function setSortColumnMethod($sortColMethod) {
$this->sortColMethod = $sortColMethod;
}
- function limit($limit) {
+ function limit($limit, $offset = 0) {
$this->limit = $limit;
}
- function unlimitedRowCount() {
+ function unlimitedRowCount($column = null) {
$source = $this->obj->{$this->method}($this->params, null, null);
return $source ? $source->Count() : 0;
}
@@ -511,8 +511,8 @@ function description() {
return $this->baseReport->description();
}
- function canView() {
- return $this->baseReport->canView();
+ function canView($member = null) {
+ return $this->baseReport->canView($member);
}
}
View
6 code/widgets/Widget.php
@@ -34,7 +34,7 @@ class Widget extends DataObject {
static $cmsTitle = "Name of this widget";
static $description = "Description of what this widget does.";
- function getCMSFields() {
+ function getCMSFields($params = null) {
$fields = new FieldList();
$this->extend('updateCMSFields', $fields);
return $fields;
@@ -226,7 +226,7 @@ function editablesegment() {
* @subpackage widgets
*/
class Widget_TreeDropdownField extends TreeDropdownField {
- function FieldHolder() {}
- function Field() {}
+ function FieldHolder($properties = array()) {}
+ function Field($properties = array()) {}
}
View
4 tests/model/SiteTreeBacklinksTest.php
@@ -243,7 +243,7 @@ function testLinkTrackingOnExtraContentFields() {
}
class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly {
- function extraStatics() {
+ function extraStatics($class = null, $extension = null) {
return array(
'db' => array(
'ExtraContent' => 'HTMLText',
@@ -251,7 +251,7 @@ function extraStatics() {
);
}
- function updateCMSFields(&$fields) {
+ function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab("Root.Content", new HTMLEditorField("ExtraContent"));
}
}
View
4 tests/model/VirtualPageTest.php
@@ -607,7 +607,7 @@ class VirtualPageTest_VirtualPageSub extends VirtualPage implements TestOnly {
}
class VirtualPageTest_PageExtension extends DataExtension implements TestOnly {
- function extraStatics() {
+ function extraStatics($class = null, $extension = null) {
return array(
'db' => array(
// These fields are just on an extension to simulate shared properties between Page and VirtualPage.
@@ -617,4 +617,4 @@ function extraStatics() {
)
);
}
-}
+}
View
4 tests/widgets/WidgetAreaEditorTest.php
@@ -460,7 +460,7 @@ class WidgetAreaEditorTest_TestWidget extends Widget implements TestOnly {
static $db = array(
'Title' => 'Varchar'
);
- public function getCMSFields() {
+ public function getCMSFields($params = null) {
$fields = new FieldList();
$fields->push(new TextField('Title'));
return $fields;
@@ -468,4 +468,4 @@ public function getCMSFields() {
function Title() {
return $this->Title ? $this->Title : self::$title;
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.