Skip to content
This repository
Browse code

MINOR Fixes to method arguments in cms classes for E_STRICT support.

  • Loading branch information...
commit 0ea94510143d3b2f54b52e49fce8538b00c4aced 1 parent 8166c26
Sean Harvey authored March 27, 2012 halkyon committed March 27, 2012
6  code/controllers/CMSSettingsController.php
@@ -9,7 +9,7 @@ class CMSSettingsController extends CMSMain {
9 9
 		/**
10 10
 	 * @return Form
11 11
 	 */
12  
-	function getEditForm($id = null) {
  12
+	function getEditForm($id = null, $fields = null) {
13 13
 		$siteConfig = SiteConfig::current_site_config();
14 14
 		$fields = $siteConfig->getCMSFields();
15 15
 
@@ -54,7 +54,7 @@ function PreviewLink() {
54 54
 		return false;
55 55
 	}
56 56
 
57  
-	function Breadcrumbs() {
  57
+	function Breadcrumbs($unlinked = false) {
58 58
 		return new ArrayList(array(
59 59
 			new ArrayData(array(
60 60
 				'Title' => $this->SectionTitle(),
@@ -63,4 +63,4 @@ function Breadcrumbs() {
63 63
 		));
64 64
 	}
65 65
 	
66  
-}
  66
+}
4  code/controllers/ContentController.php
@@ -133,7 +133,7 @@ public function init() {
133 133
 	 *
134 134
 	 * @return SS_HTTPResponse
135 135
 	 */
136  
-	public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
  136
+	public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
137 137
 		$child  = null;
138 138
 		$action = $request->param('Action');
139 139
 		$this->setModel($model);
@@ -526,4 +526,4 @@ function deleteinstallfiles() {
526 526
 			"Content" => $content,
527 527
 		);
528 528
 	}
529  
-}
  529
+}
2  code/controllers/RootURLController.php
@@ -101,7 +101,7 @@ public static function reset() {
101 101
 	 * @param SS_HTTPRequest $request
102 102
 	 * @return SS_HTTPResponse
103 103
 	 */
104  
-	public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
  104
+	public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
105 105
 		self::$is_at_root = true;
106 106
 		$this->setModel($model);
107 107
 		
8  code/controllers/SilverStripeNavigator.php
@@ -193,7 +193,7 @@ function isActive() {
193 193
 		return (Controller::curr() instanceof CMSMain);
194 194
 	}
195 195
 	
196  
-	function canView() {
  196
+	function canView($member = null) {
197 197
 		// Don't show in CMS
198 198
 		return !(Controller::curr() instanceof CMSMain);
199 199
 	}
@@ -223,7 +223,7 @@ function getLink() {
223 223
 		return Controller::join_links($this->record->AbsoluteLink(), '?stage=Stage');
224 224
 	}
225 225
 	
226  
-	function canView() {
  226
+	function canView($member = null) {
227 227
 		return ($this->record->hasExtension('Versioned') && $this->getDraftPage());
228 228
 	}
229 229
 	
@@ -267,7 +267,7 @@ function getLink() {
267 267
 		return Controller::join_links($this->record->AbsoluteLink(), '?stage=Live');
268 268
 	}
269 269
 	
270  
-	function canView() {
  270
+	function canView($member = null) {
271 271
 		return ($this->record->hasExtension('Versioned') && $this->getLivePage());
272 272
 	}
273 273
 	
@@ -309,7 +309,7 @@ function getLink() {
309 309
 		return $this->record->AbsoluteLink() . '?archiveDate=' . $date;
310 310
 	}
311 311
 	
312  
-	function canView() {
  312
+	function canView($member = null) {
313 313
 		return ($this->record->hasExtension('Versioned') && $this->isArchived());
314 314
 	}
315 315
 	
4  code/model/ErrorPage.php
@@ -127,8 +127,8 @@ function requireDefaultRecords() {
127 127
 		}
128 128
 	}
129 129
 
130  
-	function getCMSFields() {
131  
-		$fields = parent::getCMSFields();
  130
+	function getCMSFields($params = null) {
  131
+		$fields = parent::getCMSFields($params);
132 132
 		
133 133
 		$fields->addFieldToTab(
134 134
 			"Root.Main", 
4  code/model/RedirectorPage.php
@@ -115,7 +115,7 @@ function onBeforeWrite() {
115 115
 		}
116 116
 	}
117 117
 
118  
-	function getCMSFields() {
  118
+	function getCMSFields($params = null) {
119 119
 		Requirements::javascript(SAPPHIRE_DIR . "/javascript/RedirectorPage.js");
120 120
 		
121 121
 		$fields = parent::getCMSFields();
@@ -180,4 +180,4 @@ function Content() {
180 180
 			_t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') .
181 181
 			"</p>";
182 182
 	}
183  
-}
  183
+}
2  code/model/SiteConfig.php
@@ -41,7 +41,7 @@ public static function disable_theme($theme) {
41 41
 	 *
42 42
 	 * @return FieldList
43 43
 	 */
44  
-	function getCMSFields() {
  44
+	function getCMSFields($params = null) {
45 45
 		Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
46 46
 
47 47
 		$groupsMap = DataList::create('Group')->map('ID', 'Breadcrumbs')->toArray();
5  code/model/SiteTree.php
@@ -1013,9 +1013,6 @@ static function prepopuplate_permission_cache($permission = 'CanEditType', $ids,
1013 1013
 	static function prepopulate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
1014 1014
 		if(!$batchCallback) $batchCallback = "SiteTree::can_{$permission}_multiple";
1015 1015
 		
1016  
-		//PHP 5.1 requires an array rather than a string for the call_user_func function
1017  
-		$batchCallback=explode('::', $batchCallback);
1018  
-		
1019 1016
 		if(is_callable($batchCallback)) {
1020 1017
 			call_user_func($batchCallback, $ids, Member::currentUserID(), false);
1021 1018
 		} else {
@@ -1754,7 +1751,7 @@ function VirtualPages() {
1754 1751
 	 *
1755 1752
 	 * @return FieldList The fields to be displayed in the CMS.
1756 1753
 	 */
1757  
-	function getCMSFields() {
  1754
+	function getCMSFields($params = null) {
1758 1755
 		require_once("forms/Form.php");
1759 1756
 		// Status / message
1760 1757
 		// Create a status message for multiple parents
4  code/model/SiteTreeFileExtension.php
@@ -5,7 +5,7 @@
5 5
  */
6 6
 class SiteTreeFileExtension extends DataExtension {
7 7
 	
8  
-	function extraStatics() {
  8
+	function extraStatics($class = null, $extension = null) {
9 9
 		return array(
10 10
 			'belongs_many_many' => array(
11 11
 				"BackLinkTracking" => "SiteTree",
@@ -95,4 +95,4 @@ function updateLinks($old, $new) {
95 95
 		if(class_exists('Subsite')) Subsite::disable_subsite_filter(false);
96 96
 	}
97 97
 	
98  
-}
  98
+}
11  code/model/SiteTreeFolderExtension.php
... ...
@@ -1,13 +1,6 @@
1 1
 <?php
2 2
 class SiteTreeFolderExtension extends DataExtension {
3  
-	
4  
-	function updateCMSFields(&$fields) {
5  
-		// TODO commenting out unused files tab till bugs are fixed
6  
-		// $fields->push(new Tab("UnusedFiles", _t('Folder.UNUSEDFILESTAB', "Unused files"),
7  
-		// 	new Folder_UnusedAssetsField($this)
8  
-		// ));
9  
-	}
10  
-	
  3
+
11 4
 	/**
12 5
      * Looks for files used in system and create where clause which contains all ID's of files.
13 6
      * 
@@ -52,4 +45,4 @@ public function getUnusedFilesListFilter() {
52 45
 		}
53 46
 		return $where;
54 47
 	}
55  
-}
  48
+}
8  code/reports/Report.php
@@ -378,11 +378,11 @@ function setSortColumnMethod($sortColMethod) {
378 378
 		$this->sortColMethod = $sortColMethod;
379 379
 	}
380 380
 
381  
-	function limit($limit) {
  381
+	function limit($limit, $offset = 0) {
382 382
 		$this->limit = $limit;
383 383
 	}
384 384
 	
385  
-	function unlimitedRowCount() {
  385
+	function unlimitedRowCount($column = null) {
386 386
 		$source = $this->obj->{$this->method}($this->params, null, null);
387 387
 		return $source ? $source->Count() : 0;
388 388
 	}
@@ -511,8 +511,8 @@ function description() {
511 511
 		return $this->baseReport->description();
512 512
 	}
513 513
 
514  
-	function canView() {
515  
-		return $this->baseReport->canView();
  514
+	function canView($member = null) {
  515
+		return $this->baseReport->canView($member);
516 516
 	}
517 517
 	
518 518
 }
6  code/widgets/Widget.php
@@ -34,7 +34,7 @@ class Widget extends DataObject {
34 34
 	static $cmsTitle = "Name of this widget";
35 35
 	static $description = "Description of what this widget does.";
36 36
 	
37  
-	function getCMSFields() {
  37
+	function getCMSFields($params = null) {
38 38
 		$fields = new FieldList();
39 39
 		$this->extend('updateCMSFields', $fields);
40 40
 		return $fields;
@@ -226,7 +226,7 @@ function editablesegment() {
226 226
  * @subpackage widgets
227 227
  */
228 228
 class Widget_TreeDropdownField extends TreeDropdownField {
229  
-	function FieldHolder() {}
230  
-	function Field() {}
  229
+	function FieldHolder($properties = array()) {}
  230
+	function Field($properties = array()) {}
231 231
 }
232 232
 
4  tests/model/SiteTreeBacklinksTest.php
@@ -243,7 +243,7 @@ function testLinkTrackingOnExtraContentFields() {
243 243
 }
244 244
 
245 245
 class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly {
246  
-	function extraStatics() {
  246
+	function extraStatics($class = null, $extension = null) {
247 247
 		return array(
248 248
 			'db' => array(
249 249
 				'ExtraContent' => 'HTMLText',
@@ -251,7 +251,7 @@ function extraStatics() {
251 251
 		);
252 252
 	}
253 253
 	
254  
-	function updateCMSFields(&$fields) {
  254
+	function updateCMSFields(FieldList $fields) {
255 255
 		$fields->addFieldToTab("Root.Content", new HTMLEditorField("ExtraContent"));
256 256
 	}
257 257
 }
4  tests/model/VirtualPageTest.php
@@ -607,7 +607,7 @@ class VirtualPageTest_VirtualPageSub extends VirtualPage implements TestOnly {
607 607
 }
608 608
 
609 609
 class VirtualPageTest_PageExtension extends DataExtension implements TestOnly {
610  
-	function extraStatics() {
  610
+	function extraStatics($class = null, $extension = null) {
611 611
 		return array(
612 612
 			'db' => array(
613 613
 				// These fields are just on an extension to simulate shared properties between Page and VirtualPage.
@@ -617,4 +617,4 @@ function extraStatics() {
617 617
 			)
618 618
 		);
619 619
 	}
620  
-}
  620
+}
4  tests/widgets/WidgetAreaEditorTest.php
@@ -460,7 +460,7 @@ class WidgetAreaEditorTest_TestWidget extends Widget implements TestOnly {
460 460
 	static $db = array(
461 461
 		'Title' => 'Varchar'
462 462
 	);
463  
-	public function getCMSFields() {
  463
+	public function getCMSFields($params = null) {
464 464
 		$fields = new FieldList();
465 465
 		$fields->push(new TextField('Title'));
466 466
 		return $fields;
@@ -468,4 +468,4 @@ public function getCMSFields() {
468 468
 	function Title() {
469 469
 		return $this->Title ? $this->Title : self::$title;
470 470
 	}
471  
-}
  471
+}

0 notes on commit 0ea9451

Please sign in to comment.
Something went wrong with that request. Please try again.