mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Fixes to method arguments in cms classes for E_STRICT support.
This commit is contained in:
parent
8166c26a8f
commit
0ea9451014
@ -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 @@ class CMSSettingsController extends CMSMain {
|
||||
return false;
|
||||
}
|
||||
|
||||
function Breadcrumbs() {
|
||||
function Breadcrumbs($unlinked = false) {
|
||||
return new ArrayList(array(
|
||||
new ArrayData(array(
|
||||
'Title' => $this->SectionTitle(),
|
||||
@ -63,4 +63,4 @@ class CMSSettingsController extends CMSMain {
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ class ContentController extends Controller {
|
||||
*
|
||||
* @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 @@ HTML
|
||||
"Content" => $content,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ class RootURLController extends Controller {
|
||||
* @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);
|
||||
|
||||
|
@ -193,7 +193,7 @@ class SilverStripeNavigatorItem_CMSLink extends SilverStripeNavigatorItem {
|
||||
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 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
|
||||
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 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
|
||||
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 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
|
||||
return $this->record->AbsoluteLink() . '?archiveDate=' . $date;
|
||||
}
|
||||
|
||||
function canView() {
|
||||
function canView($member = null) {
|
||||
return ($this->record->hasExtension('Versioned') && $this->isArchived());
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,8 @@ class ErrorPage extends Page {
|
||||
}
|
||||
}
|
||||
|
||||
function getCMSFields() {
|
||||
$fields = parent::getCMSFields();
|
||||
function getCMSFields($params = null) {
|
||||
$fields = parent::getCMSFields($params);
|
||||
|
||||
$fields->addFieldToTab(
|
||||
"Root.Main",
|
||||
|
@ -115,7 +115,7 @@ class RedirectorPage extends Page {
|
||||
}
|
||||
}
|
||||
|
||||
function getCMSFields() {
|
||||
function getCMSFields($params = null) {
|
||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/RedirectorPage.js");
|
||||
|
||||
$fields = parent::getCMSFields();
|
||||
@ -180,4 +180,4 @@ class RedirectorPage_Controller extends Page_Controller {
|
||||
_t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') .
|
||||
"</p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class SiteConfig extends DataObject implements PermissionProvider {
|
||||
*
|
||||
* @return FieldList
|
||||
*/
|
||||
function getCMSFields() {
|
||||
function getCMSFields($params = null) {
|
||||
Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
|
||||
|
||||
$groupsMap = DataList::create('Group')->map('ID', 'Breadcrumbs')->toArray();
|
||||
|
@ -1013,9 +1013,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
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 {
|
||||
@ -1754,7 +1751,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
*
|
||||
* @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
|
||||
|
@ -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 @@ class SiteTreeFileExtension extends DataExtension {
|
||||
if(class_exists('Subsite')) Subsite::disable_subsite_filter(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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 @@ class SiteTreeFolderExtension extends DataExtension {
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -378,11 +378,11 @@ class SS_Report_FakeQuery extends SQLQuery {
|
||||
$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 @@ abstract class SS_ReportWrapper extends SS_Report {
|
||||
return $this->baseReport->description();
|
||||
}
|
||||
|
||||
function canView() {
|
||||
return $this->baseReport->canView();
|
||||
function canView($member = null) {
|
||||
return $this->baseReport->canView($member);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 @@ class Widget_Controller extends Controller {
|
||||
* @subpackage widgets
|
||||
*/
|
||||
class Widget_TreeDropdownField extends TreeDropdownField {
|
||||
function FieldHolder() {}
|
||||
function Field() {}
|
||||
function FieldHolder($properties = array()) {}
|
||||
function Field($properties = array()) {}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ class SiteTreeBacklinksTest extends SapphireTest {
|
||||
}
|
||||
|
||||
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 @@ class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly {
|
||||
);
|
||||
}
|
||||
|
||||
function updateCMSFields(&$fields) {
|
||||
function updateCMSFields(FieldList $fields) {
|
||||
$fields->addFieldToTab("Root.Content", new HTMLEditorField("ExtraContent"));
|
||||
}
|
||||
}
|
||||
|
@ -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 @@ class VirtualPageTest_PageExtension extends DataExtension implements TestOnly {
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 @@ class WidgetAreaEditorTest_TestWidget extends Widget implements TestOnly {
|
||||
function Title() {
|
||||
return $this->Title ? $this->Title : self::$title;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user