Skip to content
Browse files

Merge pull request #206 from chillu/pulls/public-function

Method visibility according to coding conventions
  • Loading branch information...
2 parents 4af60df + df44239 commit 90a154c8882db570487e2716f956b339e69e165f @simonwelsh simonwelsh committed Sep 20, 2012
Showing with 550 additions and 550 deletions.
  1. +11 −11 code/batchactions/CMSBatchActions.php
  2. +2 −2 code/controllers/AssetAdmin.php
  3. +19 −19 code/controllers/CMSMain.php
  4. +1 −1 code/controllers/CMSPageAddController.php
  5. +8 −8 code/controllers/CMSPageHistoryController.php
  6. +1 −1 code/controllers/CMSPageSettingsController.php
  7. +1 −1 code/controllers/CMSPagesController.php
  8. +4 −4 code/controllers/CMSSettingsController.php
  9. +8 −8 code/controllers/CMSSiteTreeFilter.php
  10. +6 −6 code/controllers/ContentController.php
  11. +2 −2 code/controllers/ModelAsController.php
  12. +3 −3 code/controllers/ReportAdmin.php
  13. +5 −5 code/controllers/RootURLController.php
  14. +35 −35 code/controllers/SilverStripeNavigator.php
  15. +5 −5 code/controllers/StaticExporter.php
  16. +2 −2 code/forms/FileList.php
  17. +9 −9 code/forms/SiteTreeURLSegmentField.php
  18. +2 −2 code/model/CurrentPageIdentifier.php
  19. +9 −9 code/model/ErrorPage.php
  20. +10 −10 code/model/RedirectorPage.php
  21. +9 −9 code/model/SiteConfig.php
  22. +64 −64 code/model/SiteTree.php
  23. +6 −6 code/model/SiteTreeExtension.php
  24. +5 −5 code/model/SiteTreeFileExtension.php
  25. +21 −21 code/model/VirtualPage.php
  26. +4 −4 code/reports/BrokenLinksReport.php
  27. +29 −29 code/reports/Report.php
  28. +36 −36 code/reports/SideReport.php
  29. +2 −2 code/search/ContentControllerSearchExtension.php
  30. +3 −3 code/search/SearchForm.php
  31. +5 −5 code/staticpublisher/FilesystemPublisher.php
  32. +3 −3 code/staticpublisher/RsyncMultiHostPublisher.php
  33. +11 −11 code/staticpublisher/StaticPublisher.php
  34. +1 −1 javascript/SilverStripeNavigator.js
  35. +1 −1 tasks/FilesystemSyncTask.php
  36. +4 −4 tasks/RebuildStaticCacheTask.php
  37. +7 −7 tasks/RemoveOrphanedPagesTask.php
  38. +1 −1 tasks/SiteTreeMaintenanceTask.php
  39. +1 −1 tasks/UpgradeSiteTreePermissionSchemaTask.php
  40. +12 −12 tests/controller/CMSMainTest.php
  41. +5 −5 tests/controller/CMSPageHistoryControllerTest.php
  42. +5 −5 tests/controller/CMSSiteTreeFilterTest.php
  43. +1 −1 tests/controller/ContentControllerSearchExtensionTest.php
  44. +7 −7 tests/controller/ModelAsControllerTest.php
  45. +3 −3 tests/controller/SilverStripeNavigatorTest.php
  46. +4 −4 tests/model/ErrorPageTest.php
  47. +6 −6 tests/model/FileLinkTrackingTest.php
  48. +4 −4 tests/model/RedirectorPageTest.php
  49. +1 −1 tests/model/SiteConfigTest.php
  50. +10 −10 tests/model/SiteTreeActionsTest.php
  51. +11 −11 tests/model/SiteTreeBacklinksTest.php
  52. +11 −11 tests/model/SiteTreeBrokenLinksTest.php
  53. +19 −19 tests/model/SiteTreePermissionsTest.php
  54. +34 −34 tests/model/SiteTreeTest.php
  55. +20 −20 tests/model/VirtualPageTest.php
  56. +15 −15 tests/reports/ReportTest.php
  57. +2 −2 tests/reports/SideReportTest.php
  58. +1 −1 tests/search/CMSMainSearchFormTest.php
  59. +12 −12 tests/search/SearchFormTest.php
  60. +7 −7 tests/staticpublisher/FilesystemPublisherTest.php
  61. +2 −2 tests/tasks/RemoveOrphanedPagesTaskTest.php
  62. +2 −2 thirdparty/multifile/multifile.js
View
22 code/batchactions/CMSBatchActions.php
@@ -6,17 +6,17 @@
* @subpackage batchaction
*/
class CMSBatchAction_Publish extends CMSBatchAction {
- function getActionTitle() {
+ public function getActionTitle() {
return _t('CMSBatchActions.PUBLISH_PAGES', 'Publish');
}
- function run(SS_List $pages) {
+ public function run(SS_List $pages) {
return $this->batchaction($pages, 'doPublish',
_t('CMSBatchActions.PUBLISHED_PAGES', 'Published %d pages, %d failures')
);
}
- function applicablePages($ids) {
+ public function applicablePages($ids) {
return $this->applicablePagesHelper($ids, 'canPublish', true, false);
}
}
@@ -28,11 +28,11 @@ function applicablePages($ids) {
* @subpackage batchaction
*/
class CMSBatchAction_Unpublish extends CMSBatchAction {
- function getActionTitle() {
+ public function getActionTitle() {
return _t('CMSBatchActions.UNPUBLISH_PAGES', 'Un-publish');
}
- function run(SS_List $pages) {
+ public function run(SS_List $pages) {
return $this->batchaction($pages, 'doUnpublish',
_t('CMSBatchActions.UNPUBLISHED_PAGES', 'Un-published %d pages')
);
@@ -46,11 +46,11 @@ function run(SS_List $pages) {
* @subpackage batchaction
*/
class CMSBatchAction_Delete extends CMSBatchAction {
- function getActionTitle() {
+ public function getActionTitle() {
return _t('CMSBatchActions.DELETE_DRAFT_PAGES', 'Delete from draft site');
}
- function run(SS_List $pages) {
+ public function run(SS_List $pages) {
$status = array(
'modified'=>array(),
'deleted'=>array(),
@@ -81,7 +81,7 @@ function run(SS_List $pages) {
return $this->response(_t('CMSBatchActions.DELETED_DRAFT_PAGES', 'Deleted %d pages from draft site, %d failures'), $status);
}
- function applicablePages($ids) {
+ public function applicablePages($ids) {
return $this->applicablePagesHelper($ids, 'canDelete', true, false);
}
}
@@ -93,12 +93,12 @@ function applicablePages($ids) {
* @subpackage batchaction
*/
class CMSBatchAction_DeleteFromLive extends CMSBatchAction {
- function getActionTitle() {
+ public function getActionTitle() {
return _t('CMSBatchActions.DELETE_PAGES', 'Delete from published site');
}
- function run(SS_List $pages) {
+ public function run(SS_List $pages) {
$status = array(
'modified'=>array(),
'deleted'=>array()
@@ -126,7 +126,7 @@ function run(SS_List $pages) {
return $this->response(_t('CMSBatchActions.DELETED_PAGES', 'Deleted %d pages from published site, %d failures'), $status);
}
- function applicablePages($ids) {
+ public function applicablePages($ids) {
return $this->applicablePagesHelper($ids, 'canDelete', false, true);
}
}
View
4 code/controllers/AssetAdmin.php
@@ -484,7 +484,7 @@ public function currentPage() {
}
}
- function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
+ public function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
if (!$childrenMethod) $childrenMethod = 'ChildFolders';
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $numChildrenMethod, $filterFunction, $minNodeCount);
}
@@ -638,7 +638,7 @@ public function Breadcrumbs($unlinked = false) {
return $items;
}
- function providePermissions() {
+ public function providePermissions() {
$title = _t("AssetAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return array(
"CMS_ACCESS_AssetAdmin" => array(
View
38 code/controllers/CMSMain.php
@@ -81,7 +81,7 @@ public function init() {
CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
}
- function index($request) {
+ public function index($request) {
// In case we're not showing a specific record, explicitly remove any session state,
// to avoid it being highlighted in the tree, and causing an edit form to show.
if(!$request->param('Action')) $this->setCurrentPageId(null);
@@ -104,15 +104,15 @@ public function getResponseNegotiator() {
*
* @return boolean
*/
- function ShowSwitchView() {
+ public function ShowSwitchView() {
return true;
}
/**
* Overloads the LeftAndMain::ShowView. Allows to pass a page as a parameter, so we are able
* to switch view also for archived versions.
*/
- function SwitchView($page = null) {
+ public function SwitchView($page = null) {
if(!$page) {
$page = $this->currentPage();
}
@@ -202,7 +202,7 @@ protected function LinkWithSearch($link) {
return $link;
}
- function LinkPageAdd($extraArguments = null) {
+ public function LinkPageAdd($extraArguments = null) {
$link = singleton("CMSPageAddController")->Link();
$this->extend('updateLinkPageAdd', $link);
if($extraArguments) $link = Controller::join_links ($link, $extraArguments);
@@ -245,7 +245,7 @@ public function ExtraTreeTools() {
return $html;
}
- function SearchForm() {
+ public function SearchForm() {
// get all page types in a dropdown-compatible format
$pageTypeClasses = SiteTree::page_type_classes();
$pageTypes = array();
@@ -313,7 +313,7 @@ function SearchForm() {
return $form;
}
- function doSearch($data, $form) {
+ public function doSearch($data, $form) {
return $this->getsubtree($this->request);
}
@@ -993,13 +993,13 @@ public function delete($data, $form) {
return $this->getResponseNegotiator()->respond($this->request);
}
- function publish($data, $form) {
+ public function publish($data, $form) {
$data['publish'] = '1';
return $this->save($data, $form);
}
- function unpublish($data, $form) {
+ public function unpublish($data, $form) {
$className = $this->stat('tree_class');
$record = DataObject::get_by_id($className, $data['ID']);
@@ -1019,7 +1019,7 @@ function unpublish($data, $form) {
/**
* @return array
*/
- function rollback() {
+ public function rollback() {
return $this->doRollback(array(
'ID' => $this->currentPageID(),
'Version' => $this->request->param('VersionID')
@@ -1034,7 +1034,7 @@ function rollback() {
*
* @return html
*/
- function doRollback($data, $form) {
+ public function doRollback($data, $form) {
$this->extend('onBeforeRollback', $data['ID']);
$id = (isset($data['ID'])) ? (int) $data['ID'] : null;
@@ -1074,11 +1074,11 @@ function doRollback($data, $form) {
/**
* Batch Actions Handler
*/
- function batchactions() {
+ public function batchactions() {
return new CMSBatchActionHandler($this, 'batchactions');
}
- function BatchActionParameters() {
+ public function BatchActionParameters() {
$batchActions = CMSBatchActionHandler::$batch_actions;
$forms = array();
@@ -1101,11 +1101,11 @@ function BatchActionParameters() {
/**
* Returns a list of batch actions
*/
- function BatchActionList() {
+ public function BatchActionList() {
return $this->batchactions()->batchActionList();
}
- function buildbrokenlinks($request) {
+ public function buildbrokenlinks($request) {
// Protect against CSRF on destructive action
if(!SecurityToken::inst()->checkRequest($request)) return $this->httpError(400);
@@ -1141,7 +1141,7 @@ function buildbrokenlinks($request) {
}
}
- function publishall($request) {
+ public function publishall($request) {
if(!Permission::check('ADMIN')) return Security::permissionFailure($this);
increase_time_limit_to();
@@ -1198,7 +1198,7 @@ function publishall($request) {
/**
* Restore a completely deleted page from the SiteTree_versions table.
*/
- function restore($data, $form) {
+ public function restore($data, $form) {
if(!isset($data['ID']) || !is_numeric($data['ID'])) {
return new SS_HTTPResponse("Please pass an ID in the form content", 400);
}
@@ -1221,7 +1221,7 @@ function restore($data, $form) {
return $this->getResponseNegotiator()->respond($this->request);
}
- function duplicate($request) {
+ public function duplicate($request) {
// Protect against CSRF on destructive action
if(!SecurityToken::inst()->checkRequest($request)) return $this->httpError(400);
@@ -1247,7 +1247,7 @@ function duplicate($request) {
}
}
- function duplicatewithchildren($request) {
+ public function duplicatewithchildren($request) {
// Protect against CSRF on destructive action
if(!SecurityToken::inst()->checkRequest($request)) return $this->httpError(400);
@@ -1288,7 +1288,7 @@ public function CMSVersion() {
);
}
- function providePermissions() {
+ public function providePermissions() {
$title = _t("CMSPagesController.MENUTITLE", LeftAndMain::menu_title_for_class('CMSPagesController'));
return array(
"CMS_ACCESS_CMSMain" => array(
View
2 code/controllers/CMSPageAddController.php
@@ -15,7 +15,7 @@ class CMSPageAddController extends CMSPageEditController {
/**
* @return Form
*/
- function AddForm() {
+ public function AddForm() {
$record = $this->currentPage();
$pageTypes = array();
View
16 code/controllers/CMSPageHistoryController.php
@@ -39,7 +39,7 @@ public function getResponseNegotiator() {
/**
* @return array
*/
- function show($request) {
+ public function show($request) {
$form = $this->ShowVersionForm($request->param('VersionID'));
$negotiator = $this->getResponseNegotiator();
@@ -57,7 +57,7 @@ function show($request) {
/**
* @return array
*/
- function compare($request) {
+ public function compare($request) {
$form = $this->CompareVersionsForm(
$request->param('VersionID'),
$request->param('OtherVersionID')
@@ -88,7 +88,7 @@ function compare($request) {
*
* @return Form
*/
- function getEditForm($id = null, $fields = null, $versionID = null, $compareID = null) {
+ public function getEditForm($id = null, $fields = null, $versionID = null, $compareID = null) {
if(!$id) $id = $this->currentPageID();
$record = $this->getRecord($id, $versionID);
@@ -178,7 +178,7 @@ function getEditForm($id = null, $fields = null, $versionID = null, $compareID =
*
* @return Form
*/
- function VersionsForm() {
+ public function VersionsForm() {
$id = $this->currentPageID();
$page = $this->getRecord($id);
$versionsHtml = '';
@@ -269,7 +269,7 @@ function VersionsForm() {
*
* @return html
*/
- function doCompare($data, $form) {
+ public function doCompare($data, $form) {
$versions = $data['Versions'];
if(count($versions) < 2) return null;
@@ -306,7 +306,7 @@ function doCompare($data, $form) {
*
* @return html
*/
- function doShowVersion($data, $form) {
+ public function doShowVersion($data, $form) {
$versionID = null;
if(isset($data['Versions']) && is_array($data['Versions'])) {
@@ -334,7 +334,7 @@ function doShowVersion($data, $form) {
/**
* @return Form
*/
- function ShowVersionForm($versionID = null) {
+ public function ShowVersionForm($versionID = null) {
if(!$versionID) return null;
$id = $this->currentPageID();
@@ -346,7 +346,7 @@ function ShowVersionForm($versionID = null) {
/**
* @return Form
*/
- function CompareVersionsForm($versionID, $otherVersionID) {
+ public function CompareVersionsForm($versionID, $otherVersionID) {
if($versionID > $otherVersionID) {
$toVersion = $versionID;
$fromVersion = $otherVersionID;
View
2 code/controllers/CMSPageSettingsController.php
@@ -11,7 +11,7 @@ class CMSPageSettingsController extends CMSMain {
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
static $session_namespace = 'CMSMain';
- function getEditForm($id = null, $fields = null) {
+ public function getEditForm($id = null, $fields = null) {
$record = $this->getRecord($id ? $id : $this->currentPageID());
return parent::getEditForm($record, ($record) ? $record->getSettingsFields() : null);
View
2 code/controllers/CMSPagesController.php
@@ -12,7 +12,7 @@ class CMSPagesController extends CMSMain {
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
static $session_namespace = 'CMSMain';
- function LinkPreview() {
+ public function LinkPreview() {
return false;
}
View
8 code/controllers/CMSSettingsController.php
@@ -19,7 +19,7 @@ public function getResponseNegotiator() {
/**
* @return Form
*/
- function getEditForm($id = null, $fields = null) {
+ public function getEditForm($id = null, $fields = null) {
$siteConfig = SiteConfig::current_site_config();
$fields = $siteConfig->getCMSFields();
@@ -51,7 +51,7 @@ function getEditForm($id = null, $fields = null) {
* @param Form $form
* @return String
*/
- function save_siteconfig($data, $form) {
+ public function save_siteconfig($data, $form) {
$siteConfig = SiteConfig::current_site_config();
$form->saveInto($siteConfig);
$siteConfig->write();
@@ -60,11 +60,11 @@ function save_siteconfig($data, $form) {
return $this->getResponseNegotiator()->respond($this->request);
}
- function LinkPreview() {
+ public function LinkPreview() {
return false;
}
- function Breadcrumbs($unlinked = false) {
+ public function Breadcrumbs($unlinked = false) {
$defaultTitle = self::menu_title_for_class(get_class($this));
return new ArrayList(array(
new ArrayData(array(
View
16 code/controllers/CMSSiteTreeFilter.php
@@ -36,7 +36,7 @@
*/
protected $childrenMethod = null;
- function __construct($params = null) {
+ public function __construct($params = null) {
if($params) $this->params = $params;
parent::__construct();
@@ -46,14 +46,14 @@ function __construct($params = null) {
* @return String Method on {@link Hierarchy} objects
* which is used to traverse into children relationships.
*/
- function getChildrenMethod() {
+ public function getChildrenMethod() {
return $this->childrenMethod;
}
/**
* @return Array Map of Page IDs to their respective ParentID values.
*/
- function pagesIncluded() {}
+ public function pagesIncluded() {}
/**
* Populate the IDs of the pages returned by pagesIncluded(), also including
@@ -116,11 +116,11 @@ class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter {
protected $childrenMethod = "AllHistoricalChildren";
- static function title() {
+ static public function title() {
return _t('CMSSiteTreeFilter_DeletedPages.Title', "All pages, including deleted");
}
- function pagesIncluded() {
+ public function pagesIncluded() {
$ids = array();
// TODO Not very memory efficient, but usually not very many deleted pages exist
$pages = Versioned::get_including_deleted('SiteTree');
@@ -139,11 +139,11 @@ function pagesIncluded() {
*/
class CMSSiteTreeFilter_ChangedPages extends CMSSiteTreeFilter {
- static function title() {
+ static public function title() {
return _t('CMSSiteTreeFilter_ChangedPages.Title', "Changed pages");
}
- function pagesIncluded() {
+ public function pagesIncluded() {
$ids = array();
$q = new SQLQuery();
$q->setSelect(array('"SiteTree"."ID"','"SiteTree"."ParentID"'))
@@ -165,7 +165,7 @@ function pagesIncluded() {
*/
class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter {
- static function title() {
+ static public function title() {
return _t('CMSSiteTreeFilter_Search.Title', "All pages");
}
View
12 code/controllers/ContentController.php
@@ -217,7 +217,7 @@ public function httpError($code, $message = null) {
*
* @return string
*/
- function project() {
+ public function project() {
global $project;
return $project;
}
@@ -333,7 +333,7 @@ public function SilverStripeNavigator() {
}
}
- function SiteConfig() {
+ public function SiteConfig() {
if(method_exists($this->dataRecord, 'getSiteConfig')) {
return $this->dataRecord->getSiteConfig();
} else {
@@ -347,7 +347,7 @@ function SiteConfig() {
* @deprecated 2.5 Use ContentLocale() instead and write attribute names suitable to XHTML/HTML
* templates directly in the template.
*/
- function LangAttributes() {
+ public function LangAttributes() {
Deprecation::notice('2.5', 'Use ContentLocale() instead and write attribute names suitable to XHTML/HTML instead.');
$locale = $this->ContentLocale();
return "xml:lang=\"$locale\" lang=\"$locale\"";
@@ -364,7 +364,7 @@ function LangAttributes() {
*
* @return string
*/
- function ContentLocale() {
+ public function ContentLocale() {
if($this->dataRecord && $this->dataRecord->hasExtension('Translatable')) {
$locale = $this->dataRecord->Locale;
} elseif(class_exists('Translatable') && Object::has_extension('SiteTree', 'Translatable')) {
@@ -379,7 +379,7 @@ function ContentLocale() {
/**
* This action is called by the installation system
*/
- function successfullyinstalled() {
+ public function successfullyinstalled() {
// The manifest should be built by now, so it's safe to publish the 404 page
$fourohfour = Versioned::get_one_by_stage('ErrorPage', 'Stage', '"ErrorCode" = 404');
if($fourohfour) {
@@ -406,7 +406,7 @@ function successfullyinstalled() {
);
}
- function deleteinstallfiles() {
+ public function deleteinstallfiles() {
if(!Permission::check("ADMIN")) return Security::permissionFailure($this);
$title = new Varchar("Title");
View
4 code/controllers/ModelAsController.php
@@ -16,7 +16,7 @@ class ModelAsController extends Controller implements NestedController {
* @param string $action
* @return ContentController
*/
- public static function controller_for(SiteTree $sitetree, $action = null) {
+ static public function controller_for(SiteTree $sitetree, $action = null) {
if($sitetree->class == 'SiteTree') $controller = "ContentController";
else $controller = "{$sitetree->class}_Controller";
@@ -148,7 +148,7 @@ public function getNestedController() {
* @param int $parentID The ID of the parent of the page the URLSegment belongs to.
* @return SiteTree
*/
- static function find_old_page($URLSegment,$parentID = 0, $ignoreNestedURLs = false) {
+ static public function find_old_page($URLSegment,$parentID = 0, $ignoreNestedURLs = false) {
$URLSegment = Convert::raw2sql(rawurlencode($URLSegment));
$useParentIDFilter = SiteTree::nested_urls() && $parentID;
View
6 code/controllers/ReportAdmin.php
@@ -63,7 +63,7 @@ public function init() {
* @param Member $member
* @return boolean
*/
- function canView($member = null) {
+ public function canView($member = null) {
if(!$member && $member !== FALSE) $member = Member::currentUser();
if(!parent::canView($member)) return false;
@@ -101,7 +101,7 @@ public function Reports() {
*
* @return boolean
*/
- public static function has_reports() {
+ static public function has_reports() {
return sizeof(SS_Report::get_reports()) > 0;
}
@@ -137,7 +137,7 @@ public function Link($action = null) {
return $link;
}
- function providePermissions() {
+ public function providePermissions() {
$title = _t("ReportAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return array(
"CMS_ACCESS_ReportAdmin" => array(
View
10 code/controllers/RootURLController.php
@@ -26,7 +26,7 @@ class RootURLController extends Controller {
*
* @return string
*/
- public static function get_homepage_link() {
+ static public function get_homepage_link() {
if(!self::$cached_homepage_link) {
// TODO Move to 'homepagefordomain' module
if(class_exists('HomepageForDomainExtension')) {
@@ -63,7 +63,7 @@ class_exists('Translatable')
*
* @param string $urlsegment the URL segment for your home page
*/
- public static function set_default_homepage_link($urlsegment = "home") {
+ static public function set_default_homepage_link($urlsegment = "home") {
self::$default_homepage_link = $urlsegment;
}
@@ -72,7 +72,7 @@ public static function set_default_homepage_link($urlsegment = "home") {
*
* @return string
*/
- public static function get_default_homepage_link() {
+ static public function get_default_homepage_link() {
return self::$default_homepage_link;
}
@@ -83,7 +83,7 @@ public static function get_default_homepage_link() {
* @param SiteTree $page
* @return bool
*/
- public static function should_be_on_root(SiteTree $page) {
+ static public function should_be_on_root(SiteTree $page) {
if(!self::$is_at_root && self::get_homepage_link() == trim($page->RelativeLink(true), '/')) {
return !(
class_exists('Translatable') && $page->hasExtension('Translatable') && $page->Locale && $page->Locale != Translatable::default_locale()
@@ -96,7 +96,7 @@ class_exists('Translatable') && $page->hasExtension('Translatable') && $page->Lo
/**
* Resets the cached homepage link value - useful for testing.
*/
- public static function reset() {
+ static public function reset() {
self::$cached_homepage_link = null;
}
View
70 code/controllers/SilverStripeNavigator.php
@@ -22,7 +22,7 @@ class SilverStripeNavigator extends ViewableData {
/**
* @param DataObject
*/
- function __construct($record) {
+ public function __construct($record) {
if(!in_array('CMSPreviewable', class_implements($record))) {
throw new InvalidArgumentException('SilverStripeNavigator: Record of type %s doesn\'t implement CMSPreviewable', get_class($record));
}
@@ -33,7 +33,7 @@ function __construct($record) {
/**
* @return SS_List of SilverStripeNavigatorItem
*/
- function getItems() {
+ public function getItems() {
$items = array();
$classes = ClassInfo::subclassesFor('SilverStripeNavigatorItem');
@@ -65,15 +65,15 @@ function getItems() {
/**
* @return DataObject
*/
- function getRecord() {
+ public function getRecord() {
return $this->record;
}
/**
* @param DataObject $record
* @return Array template data
*/
- static function get_for_record($record) {
+ static public function get_for_record($record) {
$html = '';
$message = '';
$navigator = new SilverStripeNavigator($record);
@@ -110,21 +110,21 @@ class SilverStripeNavigatorItem extends ViewableData {
/**
* @param DataObject
*/
- function __construct($record) {
+ public function __construct($record) {
$this->record = $record;
}
/**
* @return String HTML, mostly a link - but can be more complex as well.
* For example, a "future state" item might show a date selector.
*/
- function getHTML() {}
+ public function getHTML() {}
/**
* @return String
* Text displayed in watermark
*/
- function getWatermark() {}
+ public function getWatermark() {}
/**
* Optional link to a specific view of this record.
@@ -133,24 +133,24 @@ function getWatermark() {}
*
* @return String
*/
- function getLink() {}
+ public function getLink() {}
/**
* @return String
*/
- function getMessage() {}
+ public function getMessage() {}
/**
* @return DataObject
*/
- function getRecord() {
+ public function getRecord() {
return $this->record;
}
/**
* @return Int
*/
- function getPriority() {
+ public function getPriority() {
return $this->stat('priority');
}
@@ -160,7 +160,7 @@ function getPriority() {
*
* @return boolean
*/
- function isActive() {
+ public function isActive() {
return false;
}
@@ -171,7 +171,7 @@ function isActive() {
* @param Member
* @return Boolean
*/
- function canView($member = null) {
+ public function canView($member = null) {
return true;
}
}
@@ -183,23 +183,23 @@ function canView($member = null) {
class SilverStripeNavigatorItem_CMSLink extends SilverStripeNavigatorItem {
static $priority = 10;
- function getHTML() {
+ public function getHTML() {
return sprintf(
'<a href="%s">%s</a>',
$this->record->CMSEditLink(),
_t('ContentController.CMS', 'CMS')
);
}
- function getLink() {
+ public function getLink() {
return $this->record->CMSEditLink();
}
- function isActive() {
+ public function isActive() {
return (Controller::curr() instanceof CMSMain);
}
- function canView($member = null) {
+ public function canView($member = null) {
// Don't show in CMS
return !(Controller::curr() instanceof CMSMain);
}
@@ -213,31 +213,31 @@ function canView($member = null) {
class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
static $priority = 20;
- function getHTML() {
+ public function getHTML() {
$draftPage = $this->getDraftPage();
if($draftPage) {
$this->recordLink = Controller::join_links($draftPage->AbsoluteLink(), "?stage=Stage");
return "<a href=\"$this->recordLink\">". _t('ContentController.DRAFTSITE', 'Draft Site') ."</a>";
}
}
- function getWatermark() {
+ public function getWatermark() {
return _t('ContentController.DRAFTSITE');
}
- function getMessage() {
+ public function getMessage() {
return "<div id=\"SilverStripeNavigatorMessage\" title=\"". _t('ContentControl.NOTEWONTBESHOWN', 'Note: this message will not be shown to your visitors') ."\">". _t('ContentController.DRAFTSITE', 'Draft Site') ."</div>";
}
- function getLink() {
+ public function getLink() {
return Controller::join_links($this->record->AbsoluteLink(), '?stage=Stage');
}
- function canView($member = null) {
+ public function canView($member = null) {
return ($this->record->hasExtension('Versioned') && $this->getDraftPage());
}
- function isActive() {
+ public function isActive() {
return (
Versioned::current_stage() == 'Stage'
&& !(ClassInfo::exists('SiteTreeFutureState') && SiteTreeFutureState::get_future_datetime())
@@ -261,31 +261,31 @@ protected function getDraftPage() {
class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
static $priority = 30;
- function getHTML() {
+ public function getHTML() {
$livePage = $this->getLivePage();
if($livePage) {
$this->recordLink = Controller::join_links($livePage->AbsoluteLink(), "?stage=Live");
return "<a href=\"$this->recordLink\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</a>";
}
}
- function getWatermark() {
+ public function getWatermark() {
return _t('ContentController.PUBLISHEDSITE');
}
- function getMessage() {
+ public function getMessage() {
return "<div id=\"SilverStripeNavigatorMessage\" title=\"". _t('ContentControl.NOTEWONTBESHOWN', 'Note: this message will not be shown to your visitors') ."\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</div>";
}
- function getLink() {
+ public function getLink() {
return Controller::join_links($this->record->AbsoluteLink(), '?stage=Live');
}
- function canView($member = null) {
+ public function canView($member = null) {
return ($this->record->hasExtension('Versioned') && $this->getLivePage());
}
- function isActive() {
+ public function isActive() {
return (!Versioned::current_stage() || Versioned::current_stage() == 'Live');
}
@@ -306,28 +306,28 @@ protected function getLivePage() {
class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
static $priority = 40;
- function getHTML() {
+ public function getHTML() {
$this->recordLink = $this->record->AbsoluteLink();
return "<a class=\"ss-ui-button\" href=\"$this->recordLink?archiveDate={$this->record->LastEdited}\" target=\"_blank\">". _t('ContentController.ARCHIVEDSITE', 'Preview version') ."</a>";
}
- function getMessage() {
+ public function getMessage() {
if($date = Versioned::current_archived_date()) {
$dateObj = Datetime::create();
$dateObj->setValue($date);
return "<div id=\"SilverStripeNavigatorMessage\" title=\"". _t('ContentControl.NOTEWONTBESHOWN', 'Note: this message will not be shown to your visitors') ."\">". _t('ContentController.ARCHIVEDSITEFROM', 'Archived site from') ."<br>" . $dateObj->Nice() . "</div>";
}
}
- function getLink() {
+ public function getLink() {
return $this->record->AbsoluteLink() . '?archiveDate=' . $this->record->LastEdited;
}
- function canView($member = null) {
+ public function canView($member = null) {
return ($this->record->hasExtension('Versioned') && $this->isArchived());
}
- function isActive() {
+ public function isActive() {
return (Versioned::current_archived_date());
}
@@ -336,7 +336,7 @@ function isActive() {
*
* @return boolean
*/
- function isArchived() {
+ public function isArchived() {
if(!$this->record->hasExtension('Versioned')) return false;
$baseTable = ClassInfo::baseDataClass($this->record->class);
View
10 code/controllers/StaticExporter.php
@@ -27,24 +27,24 @@ class StaticExporter extends Controller {
'export',
);
- function init() {
+ public function init() {
parent::init();
$canAccess = (Director::isDev() || Director::is_cli() || Permission::check("ADMIN"));
if(!$canAccess) return Security::permissionFailure($this);
}
- function Link($action = null) {
+ public function Link($action = null) {
return "StaticExporter/$action";
}
- function index() {
+ public function index() {
echo "<h1>"._t('StaticExporter.NAME','Static exporter')."</h1>";
echo $this->StaticExportForm()->forTemplate();
}
- function StaticExportForm() {
+ public function StaticExportForm() {
return new Form($this, 'StaticExportForm', new FieldList(
// new TextField('folder', _t('StaticExporter.FOLDEREXPORT','Folder to export to')),
new TextField('baseurl', _t('StaticExporter.BASEURL','Base URL'))
@@ -53,7 +53,7 @@ function StaticExportForm() {
));
}
- function export() {
+ public function export() {
// specify custom baseurl for publishing to other webroot
if(isset($_REQUEST['baseurl'])) {
$base = $_REQUEST['baseurl'];
View
4 code/forms/FileList.php
@@ -7,13 +7,13 @@
class FileList extends TableListField {
// bdc: added sort by Title as default behaviour
protected $folder;
- function __construct($name, $folder) {
+ public function __construct($name, $folder) {
$this->folder = $folder;
parent::__construct($name, "File", array("Title" => "Title", "LinkedURL" => "URL"), "", "Title");
$this->Markable = true;
}
- function sourceItems() {
+ public function sourceItems() {
return DataObject::get("File", "\"ParentID\" = '" . $this->folder->ID . "' AND \"ClassName\" <> 'Folder'", '"Title"');
}
}
View
18 code/forms/SiteTreeURLSegmentField.php
@@ -21,16 +21,16 @@ class SiteTreeURLSegmentField extends TextField {
'suggest'
);
- function Value() {
+ public function Value() {
return rawurldecode($this->value);
}
- function Field($properties = array()) {
+ public function Field($properties = array()) {
Requirements::javascript(CMS_DIR . '/javascript/SiteTreeURLSegmentField.js');
return parent::Field($properties);
}
- function suggest($request) {
+ public function suggest($request) {
if(!$request->getVar('value')) return $this->httpError(405);
$page = $this->getPage();
@@ -49,42 +49,42 @@ function suggest($request) {
/**
* @return SiteTree
*/
- function getPage() {
+ public function getPage() {
$idField = $this->getForm()->Fields()->dataFieldByName('ID');
return ($idField && $idField->Value()) ? DataObject::get_by_id('SiteTree', $idField->Value()) : singleton('SiteTree');
}
/**
* @param string the secondary text to show
*/
- function setHelpText($string){
+ public function setHelpText($string){
$this->helpText = $string;
}
/**
* @return string the secondary text to show in the template
*/
- function getHelpText(){
+ public function getHelpText(){
return $this->helpText;
}
/**
* @param the url that prefixes the page url segment field
*/
- function setURLPrefix($url){
+ public function setURLPrefix($url){
$this->urlPrefix = $url;
}
/**
* @return the url prefixes the page url segment field to show in template
*/
- function getURLPrefix(){
+ public function getURLPrefix(){
return $this->urlPrefix;
}
- function Type() {
+ public function Type() {
return 'text urlsegment';
}
View
4 code/model/CurrentPageIdentifier.php
@@ -9,13 +9,13 @@
* Get the current page ID.
* @return int
*/
- function currentPageID();
+ public function currentPageID();
/**
* Check if the given DataObject is the current page.
* @param DataObject $page The page to check.
* @return boolean
*/
- function isCurrentPage(DataObject $page);
+ public function isCurrentPage(DataObject $page);
}
View
18 code/model/ErrorPage.php
@@ -36,7 +36,7 @@ public function canAddChildren($member = null) { return false; }
* @param int $statusCode
* @return SS_HTTPResponse
*/
- public static function response_for($statusCode) {
+ static public function response_for($statusCode) {
// first attempt to dynamically generate the error page
if($errorPage = DataObject::get_one('ErrorPage', "\"ErrorCode\" = $statusCode")) {
return ModelAsController::controller_for($errorPage)->handleRequest(new SS_HTTPRequest('GET', ''), DataModel::inst());
@@ -64,7 +64,7 @@ class_exists('Translatable') ? Translatable::get_current_locale() : null
* ErrorPage with a 404 and 500 error code. If there
* is not, one is created when the DB is built.
*/
- function requireDefaultRecords() {
+ public function requireDefaultRecords() {
parent::requireDefaultRecords();
if ($this->class == 'ErrorPage' && SiteTree::get_create_default_pages()) {
@@ -131,7 +131,7 @@ function requireDefaultRecords() {
}
}
- function getCMSFields() {
+ public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab(
@@ -179,7 +179,7 @@ function getCMSFields() {
* @param string $toStage Place to copy to. Must be a stage name.
* @param boolean $createNewVersion Set this to true to create a new version number. By default, the existing version number will be copied over.
*/
- function doPublish() {
+ public function doPublish() {
parent::doPublish();
// Run the page (reset the theme, it might've been disabled by LeftAndMain::init())
@@ -221,7 +221,7 @@ function doPublish() {
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
- function fieldLabels($includerelations = true) {
+ public function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['ErrorCode'] = _t('ErrorPage.CODE', "Error code");
@@ -236,7 +236,7 @@ function fieldLabels($includerelations = true) {
* @param String $locale A locale, e.g. 'de_DE' (Optional)
* @return String
*/
- static function get_filepath_for_errorcode($statusCode, $locale = null) {
+ static public function get_filepath_for_errorcode($statusCode, $locale = null) {
if (singleton('ErrorPage')->hasMethod('alternateFilepathForErrorcode')) {
return singleton('ErrorPage')-> alternateFilepathForErrorcode($statusCode, $locale);
}
@@ -253,14 +253,14 @@ static function get_filepath_for_errorcode($statusCode, $locale = null) {
*
* @param string $path
*/
- static function set_static_filepath($path) {
+ static public function set_static_filepath($path) {
self::$static_filepath = $path;
}
/**
* @return string
*/
- static function get_static_filepath() {
+ static public function get_static_filepath() {
return self::$static_filepath;
}
}
@@ -270,7 +270,7 @@ static function get_static_filepath() {
* @package cms
*/
class ErrorPage_Controller extends Page_Controller {
- function init() {
+ public function init() {
parent::init();
$action = $this->request->param('Action');
View
20 code/model/RedirectorPage.php
@@ -30,7 +30,7 @@ class RedirectorPage extends Page {
* returns the target page.
* @return SiteTree
*/
- function ContentSource() {
+ public function ContentSource() {
if($this->RedirectionType == 'Internal') {
return $this->LinkTo();
} else {
@@ -44,7 +44,7 @@ function ContentSource() {
* destination, to prevent unnecessary 30x redirections. However, if it's misconfigured, then
* it will return a link to itself, which will then display an error message.
*/
- function Link() {
+ public function Link() {
if($link = $this->redirectionLink()) return $link;
else return $this->regularLink();
}
@@ -53,15 +53,15 @@ function Link() {
* Return the normal link directly to this page. Once you visit this link, a 30x redirection
* will take you to your final destination.
*/
- function regularLink($action = null) {
+ public function regularLink($action = null) {
return parent::Link($action);
}
/**
* Return the link that we should redirect to.
* Only return a value if there is a legal redirection destination.
*/
- function redirectionLink() {
+ public function redirectionLink() {
if($this->RedirectionType == 'External') {
if($this->ExternalURL) {
return $this->ExternalURL;
@@ -90,7 +90,7 @@ function redirectionLink() {
}
}
- function syncLinkTracking() {
+ public function syncLinkTracking() {
if ($this->RedirectionType == 'Internal') {
if($this->LinkToID) {
$this->HasBrokenLink = DataObject::get_by_id('SiteTree', $this->LinkToID) ? false : true;
@@ -104,7 +104,7 @@ function syncLinkTracking() {
}
}
- function onBeforeWrite() {
+ public function onBeforeWrite() {
parent::onBeforeWrite();
// Prefix the URL with "http://" if no prefix is found
@@ -113,7 +113,7 @@ function onBeforeWrite() {
}
}
- function getCMSFields() {
+ public function getCMSFields() {
Requirements::javascript(CMS_DIR . '/javascript/RedirectorPage.js');
$fields = parent::getCMSFields();
@@ -151,7 +151,7 @@ function getCMSFields() {
}
// Don't cache RedirectorPages
- function subPagesToCache() {
+ public function subPagesToCache() {
return array();
}
}
@@ -163,7 +163,7 @@ function subPagesToCache() {
*/
class RedirectorPage_Controller extends Page_Controller {
- function init() {
+ public function init() {
parent::init();
if($link = $this->redirectionLink()) {
@@ -175,7 +175,7 @@ function init() {
/**
* If we ever get this far, it means that the redirection failed.
*/
- function Content() {
+ public function Content() {
return "<p class=\"message-setupWithoutRedirect\">" .
_t('RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') .
"</p>";
View
18 code/model/SiteConfig.php
@@ -24,11 +24,11 @@ class SiteConfig extends DataObject implements PermissionProvider {
protected static $disabled_themes = array();
- public static function disable_theme($theme) {
+ static public function disable_theme($theme) {
self::$disabled_themes[$theme] = $theme;
}
- function populateDefaults()
+ public function populateDefaults()
{
$this->Title = _t('SiteConfig.SITENAMEDEFAULT', "Your Site Name");
$this->Tagline = _t('SiteConfig.TAGLINEDEFAULT', "your tagline here");
@@ -43,7 +43,7 @@ function populateDefaults()
*
* @return FieldList
*/
- function getCMSFields() {
+ public function getCMSFields() {
Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
$groupsMap = Group::get()->map('ID', 'Breadcrumbs')->toArray();
@@ -130,7 +130,7 @@ public function getAvailableThemes($baseDir = null) {
*
* @return Fieldset
*/
- function getCMSActions() {
+ public function getCMSActions() {
if (Permission::check('ADMIN') || Permission::check('EDIT_SITECONFIG')) {
$actions = new FieldList(
FormAction::create('save_siteconfig', _t('CMSMain.SAVE','Save'))
@@ -148,7 +148,7 @@ function getCMSActions() {
/**
* @return String
*/
- function CMSEditLink() {
+ public function CMSEditLink() {
return singleton('CMSSettingsController')->Link();
}
@@ -158,7 +158,7 @@ function CMSEditLink() {
*
* @return SiteConfig
*/
- static function current_site_config() {
+ static public function current_site_config() {
if ($siteConfig = DataObject::get_one('SiteConfig')) return $siteConfig;
return self::make_site_config();
@@ -167,7 +167,7 @@ static function current_site_config() {
/**
* Setup a default SiteConfig record if none exists
*/
- function requireDefaultRecords() {
+ public function requireDefaultRecords() {
parent::requireDefaultRecords();
$siteConfig = DataObject::get_one('SiteConfig');
if(!$siteConfig) {
@@ -182,7 +182,7 @@ function requireDefaultRecords() {
* @param string $locale
* @return SiteConfig
*/
- static function make_site_config() {
+ static public function make_site_config() {
$config = SiteConfig::create();
$config->write();
return $config;
@@ -236,7 +236,7 @@ public function canEdit($member = null) {
return false;
}
- function providePermissions() {
+ public function providePermissions() {
return array(
'EDIT_SITECONFIG' => array(
'name' => _t('SiteConfig.EDIT_PERMISSION', 'Manage site configuration'),
View
128 code/model/SiteTree.php
@@ -210,14 +210,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
*
* @param boolean
*/
- public static function set_enforce_strict_hierarchy($to) {
+ static public function set_enforce_strict_hierarchy($to) {
self::$enforce_strict_hierarchy = $to;
}
/**
* @return boolean
*/
- public static function get_enforce_strict_hierarchy() {
+ static public function get_enforce_strict_hierarchy() {
return self::$enforce_strict_hierarchy;
}
@@ -226,15 +226,15 @@ public static function get_enforce_strict_hierarchy() {
*
* @return bool
*/
- public static function nested_urls() {
+ static public function nested_urls() {
return self::$nested_urls;
}
- public static function enable_nested_urls() {
+ static public function enable_nested_urls() {
self::$nested_urls = true;
}
- public static function disable_nested_urls() {
+ static public function disable_nested_urls() {
self::$nested_urls = false;
}
@@ -243,7 +243,7 @@ public static function disable_nested_urls() {
*
* @param bool $option
*/
- public static function set_create_default_pages($option = true) {
+ static public function set_create_default_pages($option = true) {
self::$create_default_pages = $option;
}
@@ -252,7 +252,7 @@ public static function set_create_default_pages($option = true) {
*
* @return bool
*/
- public static function get_create_default_pages() {
+ static public function get_create_default_pages() {
return self::$create_default_pages;
}
@@ -269,7 +269,7 @@ public static function get_create_default_pages() {
* @param bool $cache
* @return SiteTree
*/
- public static function get_by_link($link, $cache = true) {
+ static public function get_by_link($link, $cache = true) {
if(trim($link, '/')) {
$link = trim(Director::makeRelative($link), '/');
} else {
@@ -333,7 +333,7 @@ public static function get_by_link($link, $cache = true) {
*
* @return array
*/
- public static function page_type_classes() {
+ static public function page_type_classes() {
$classes = ClassInfo::getValidSubClasses();
$baseClassIndex = array_search('SiteTree', $classes);
@@ -370,7 +370,7 @@ public static function page_type_classes() {
*
* @return string
*/
- public static function link_shortcode_handler($arguments, $content = null, $parser = null) {
+ static public function link_shortcode_handler($arguments, $content = null, $parser = null) {
if(!isset($arguments['id']) || !is_numeric($arguments['id'])) return;
if (
@@ -472,7 +472,7 @@ public function getAbsoluteLiveLink($includeStageEqualsLive = true) {
/**
* @return String
*/
- function CMSEditLink() {
+ public function CMSEditLink() {
return Controller::join_links(singleton('CMSPageEditController')->Link('show'), $this->ID);
}
@@ -686,7 +686,7 @@ public function getParent() {
* @param string $seperator Seperating string
* @return string The resulting string
*/
- function NestedTitle($level = 2, $separator = " - ") {
+ public function NestedTitle($level = 2, $separator = " - ") {
$item = $this;
while($item && $level > 0) {
$parts[] = $item->Title;
@@ -713,7 +713,7 @@ function NestedTitle($level = 2, $separator = " - ") {
* Defaults to the currently logged in user.
* @return boolean True if the the member is allowed to do the given action.
*/
- function can($perm, $member = null) {
+ public function can($perm, $member = null) {
if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
$member = Member::currentUserID();
}
@@ -827,7 +827,7 @@ public function canView($member = null) {
* @param Member $member
* @return boolean
*/
- function canViewStage($stage, $member = null) {
+ public function canViewStage($stage, $member = null) {
if(!$member) $member = Member::currentUser();
if(
@@ -990,7 +990,7 @@ public function canDeleteFromLive($member = null) {
/**
* Stub method to get the site config, provided so it's easy to override
*/
- function getSiteConfig() {
+ public function getSiteConfig() {
if($this->hasMethod('alternateSiteConfig')) {
$altConfig = $this->alternateSiteConfig();
@@ -1003,7 +1003,7 @@ function getSiteConfig() {
/**
* @deprecated 3.0 Use prepopulate_permission_cache() instead (without the extraneous "p" in "prepopulate")
*/
- static function prepopuplate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
+ static public function prepopuplate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
Deprecation::notice("3.0", "Use prepopulate_permission_cache instead.");
self::prepopulate_permission_cache($permission, $ids, $batchCallback);
}
@@ -1017,7 +1017,7 @@ static function prepopuplate_permission_cache($permission = 'CanEditType', $ids,
* @param $batchCallBack The function/static method to call to calculate permissions. Defaults
* to 'SiteTree::can_(permission)_multiple'
*/
- static function prepopulate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
+ static public function prepopulate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
if(!$batchCallback) $batchCallback = "SiteTree::can_{$permission}_multiple";
if(is_callable($batchCallback)) {
@@ -1046,7 +1046,7 @@ static function prepopulate_permission_cache($permission = 'CanEditType', $ids,
* @param Boolean $useCached
* @return Array An map of {@link SiteTree} ID keys, to boolean values
*/
- static function batch_permission_check($ids, $memberID, $typeField, $groupJoinTable, $siteConfigMethod, $globalPermission = 'CMS_ACCESS_CMSMain', $useCached = true) {
+ static public function batch_permission_check($ids, $memberID, $typeField, $groupJoinTable, $siteConfigMethod, $globalPermission = 'CMS_ACCESS_CMSMain', $useCached = true) {
// Sanitise the IDs
$ids = array_filter($ids, 'is_numeric');
@@ -1164,7 +1164,7 @@ static function batch_permission_check($ids, $memberID, $typeField, $groupJoinTa
* @return A map where the IDs are keys and the values are booleans stating whether the given
* page can be edited.
*/
- static function can_edit_multiple($ids, $memberID, $useCached = true) {
+ static public function can_edit_multiple($ids, $memberID, $useCached = true) {
return self::batch_permission_check($ids, $memberID, 'CanEditType', 'SiteTree_EditorGroups', 'canEdit', 'CMS_ACCESS_CMSMain', $useCached);
}
@@ -1173,7 +1173,7 @@ static function can_edit_multiple($ids, $memberID, $useCached = true) {
* @param An array of IDs of the SiteTree pages to look up.
* @param useCached Return values from the permission cache if they exist.
*/
- static function can_delete_multiple($ids, $memberID, $useCached = true) {
+ static public function can_delete_multiple($ids, $memberID, $useCached = true) {
$deletable = array();
$result = array_fill_keys($ids, false);
$cacheKey = "delete-$memberID";
@@ -1321,7 +1321,7 @@ public function ContentSource() {
* records when the database is built, but make sure you call
* parent::requireDefaultRecords().
*/
- function requireDefaultRecords() {
+ public function requireDefaultRecords() {
parent::requireDefaultRecords();
// default pages
@@ -1420,7 +1420,7 @@ protected function onBeforeWrite() {
}
}
- function syncLinkTracking() {
+ public function syncLinkTracking() {
// Build a list of HTMLText fields
$allFields = $this->db();
$htmlFields = array();
@@ -1446,7 +1446,7 @@ function syncLinkTracking() {
$this->extend('augmentSyncLinkTracking');
}
- function onAfterWrite() {
+ public function onAfterWrite() {
// Need to flush cache to avoid outdated versionnumber references
$this->flushCache();
@@ -1466,7 +1466,7 @@ function onAfterWrite() {
parent::onAfterWrite();
}
- function onBeforeDelete() {
+ public function onBeforeDelete() {
parent::onBeforeDelete();
// If deleting this page, delete all its children.
@@ -1478,7 +1478,7 @@ function onBeforeDelete() {
}
- function onAfterDelete() {
+ public function onAfterDelete() {
// Need to flush cache to avoid outdated versionnumber references
$this->flushCache();
@@ -1492,12 +1492,12 @@ function onAfterDelete() {
parent::onAfterDelete();
}
- function flushCache($persistent = true) {
+ public function flushCache($persistent = true) {
parent::flushCache($persistent);
$this->_cache_statusFlags = null;
}
- function validate() {
+ public function validate() {
$result = parent::validate();
// Allowed children validation
@@ -1594,7 +1594,7 @@ public function validURLSegment() {
* @param string $title Page title.
* @return string Generated url segment
*/
- function generateURLSegment($title){
+ public function generateURLSegment($title){
$filter = URLSegmentFilter::create();
$t = $filter->filter($title);
@@ -1610,7 +1610,7 @@ function generateURLSegment($title){
/**
* @return string
*/
- function getStageURLSegment() {
+ public function getStageURLSegment() {
$stageRecord = Versioned::get_one_by_stage(
'SiteTree',
'Stage',
@@ -1622,7 +1622,7 @@ function getStageURLSegment() {
/**
* @return string
*/
- function getLiveURLSegment() {
+ public function getLiveURLSegment() {
$liveRecord = Versioned::get_one_by_stage(
'SiteTree',
'Live',
@@ -1635,7 +1635,7 @@ function getLiveURLSegment() {
* Rewrite a file URL on this page, after its been renamed.
* Triggers the onRenameLinkedAsset action on extensions.
*/
- function rewriteFileURL($old, $new) {
+ public function rewriteFileURL($old, $new) {
$fields = $this->inheritedDatabaseFields();
// Update the content without actually creating a new version
foreach(array("SiteTree_Live", "SiteTree") as $table) {
@@ -1671,7 +1671,7 @@ function rewriteFileURL($old, $new) {
*
* @param $includeVirtuals Set to false to exlcude virtual pages.
*/
- function DependentPages($includeVirtuals = true) {
+ public function DependentPages($includeVirtuals = true) {
if(class_exists('Subsite')) {
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
Subsite::disable_subsite_filter(true);
@@ -1712,7 +1712,7 @@ function DependentPages($includeVirtuals = true) {
*
* @param $includeVirtuals Set to false to exlcude virtual pages.
*/
- function DependentPagesCount($includeVirtuals = true) {
+ public function DependentPagesCount($includeVirtuals = true) {
$links = DB::query("SELECT COUNT(*) FROM \"SiteTree_LinkTracking\"
INNER JOIN \"SiteTree\" ON \"SiteTree\".\"ID\" = \"SiteTree_LinkTracking\".\"SiteTreeID\"
WHERE \"ChildID\" = $this->ID ")->value();
@@ -1734,7 +1734,7 @@ function DependentPagesCount($includeVirtuals = true) {
/**
* Return all virtual pages that link to this page
*/
- function VirtualPages() {
+ public function VirtualPages() {
if(!$this->ID) return null;
if(class_exists('Subsite')) {
return Subsite::get_from_all_subsites('VirtualPage', "\"CopyContentFromID\" = " . (int)$this->ID);
@@ -1757,7 +1757,7 @@ function VirtualPages() {
*
* @return FieldList The fields to be displayed in the CMS.
*/
- function getCMSFields() {
+ public function getCMSFields() {
require_once("forms/Form.php");
// Status / message
// Create a status message for multiple parents