Skip to content
Permalink
Browse files

Method visibility according to coding conventions

  • Loading branch information...
chillu committed Sep 19, 2012
1 parent 4af60df commit df4423906010921cc3e39e68848a79297ac885e8
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
@@ -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);
}
}
@@ -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(
@@ -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(
@@ -15,7 +15,7 @@ class CMSPageAddController extends CMSPageEditController {
/**
* @return Form
*/
function AddForm() {
public function AddForm() {
$record = $this->currentPage();
$pageTypes = array();
@@ -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;
@@ -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);
@@ -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;
}
@@ -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(

0 comments on commit df44239

Please sign in to comment.
You can’t perform that action at this time.