From bbc3aaaf9f2c507dec25a9010eb6f31330c69549 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 6 Jan 2016 12:42:07 +1300 Subject: [PATCH] MINOR: Remove training whitespace. The main benefit of this is so that authors who make use of .editorconfig don't end up with whitespace changes in their PRs. Spaces vs. tabs has been left alone, although that could do with a tidy-up in SS4 after the switch to PSR-1/2. The command used was this: for match in '*.ss' '*.css' '*.scss' '*.html' '*.yml' '*.php' '*.js' '*.csv' '*.inc' '*.php5'; do find . -path ./thirdparty -prune -o -type f -name "$match" -exec sed -i '' 's/[[:space:]]\+$//' {} \+ find . -path ./thirdparty -prune -o -type f -name "$match" | xargs perl -pi -e 's/ +$//' done --- .travis.yml | 2 +- _config.php | 2 +- code/batchactions/CMSBatchActions.php | 10 +- code/controllers/CMSFileAddController.php | 2 +- code/controllers/CMSPageAddController.php | 16 +- code/controllers/CMSPageHistoryController.php | 24 +-- code/controllers/CMSSiteTreeFilter.php | 34 ++--- code/controllers/ContentController.php | 10 +- .../ErrorPageControllerExtension.php | 2 +- .../LeftAndMainPageIconsExtension.php | 20 +-- code/controllers/NestedController.php | 2 +- code/controllers/SilverStripeNavigator.php | 30 ++-- code/forms/SiteTreeURLSegmentField.php | 6 +- code/model/RedirectorPage.php | 16 +- code/model/SiteTree.php | 138 +++++++++--------- code/model/SiteTreeExtension.php | 16 +- code/model/SiteTreeFileExtension.php | 14 +- code/model/SiteTreeFolderExtension.php | 4 +- code/model/VirtualPage.php | 50 +++---- code/reports/BrokenLinksReport.php | 4 +- code/search/SearchForm.php | 18 +-- css/_old/AssetAdmin.css | 4 +- css/_old/CMSMain.css | 2 +- css/_old/CommentAdmin.css | 2 +- javascript/AssetAdmin.DragDrop.js | 14 +- javascript/AssetAdmin.js | 6 +- javascript/CMSMain.AddForm.js | 6 +- javascript/CMSMain.EditForm.js | 56 +++---- javascript/CMSPageHistoryController.js | 12 +- javascript/SiteTreeURLSegmentField.js | 4 +- javascript/lang/ar.js | 2 +- javascript/lang/cs.js | 2 +- javascript/lang/de.js | 2 +- javascript/lang/el.js | 2 +- javascript/lang/en.js | 2 +- javascript/lang/eo.js | 2 +- javascript/lang/es.js | 2 +- javascript/lang/fa_IR.js | 2 +- javascript/lang/fi.js | 2 +- javascript/lang/fr.js | 2 +- javascript/lang/hu.js | 2 +- javascript/lang/id.js | 2 +- javascript/lang/is.js | 2 +- javascript/lang/it.js | 2 +- javascript/lang/ja.js | 2 +- javascript/lang/ko.js | 2 +- javascript/lang/lt.js | 2 +- javascript/lang/mi.js | 2 +- javascript/lang/nb.js | 2 +- javascript/lang/nl.js | 2 +- javascript/lang/pl.js | 2 +- javascript/lang/ro.js | 2 +- javascript/lang/ru.js | 2 +- javascript/lang/sk.js | 2 +- javascript/lang/sl.js | 2 +- javascript/lang/sr.js | 2 +- javascript/lang/sr_RS@latin.js | 2 +- javascript/lang/src/ar.js | 2 +- javascript/lang/src/cs.js | 2 +- javascript/lang/src/de.js | 2 +- javascript/lang/src/el.js | 2 +- javascript/lang/src/en.js | 2 +- javascript/lang/src/eo.js | 2 +- javascript/lang/src/es.js | 2 +- javascript/lang/src/fa_IR.js | 2 +- javascript/lang/src/fi.js | 2 +- javascript/lang/src/fr.js | 2 +- javascript/lang/src/hu.js | 2 +- javascript/lang/src/id.js | 2 +- javascript/lang/src/is.js | 2 +- javascript/lang/src/it.js | 2 +- javascript/lang/src/ja.js | 2 +- javascript/lang/src/ko.js | 2 +- javascript/lang/src/lt.js | 2 +- javascript/lang/src/mi.js | 2 +- javascript/lang/src/nb.js | 2 +- javascript/lang/src/nl.js | 2 +- javascript/lang/src/pl.js | 2 +- javascript/lang/src/ro.js | 2 +- javascript/lang/src/ru.js | 2 +- javascript/lang/src/sk.js | 2 +- javascript/lang/src/sl.js | 2 +- javascript/lang/src/sr.js | 2 +- javascript/lang/src/sr_RS@latin.js | 2 +- javascript/lang/src/sv.js | 2 +- javascript/lang/src/zh.js | 2 +- javascript/lang/sv.js | 2 +- javascript/lang/zh.js | 2 +- scss/_AssetAdmin.scss | 4 +- scss/_CMSMain.scss | 8 +- scss/screen.scss | 4 +- tasks/RemoveOrphanedPagesTask.php | 30 ++-- tasks/SiteTreeMaintenanceTask.php | 6 +- templates/BlankPage.ss | 2 +- templates/CMSMain_notice.ss | 2 +- .../CMSPageHistoryController_versions.ss | 2 +- templates/Includes/AssetAdmin_EditForm.ss | 2 +- .../Includes/AssetAdmin_UploadContent.ss | 2 +- templates/Includes/CMSMain_ListView.ss | 2 +- .../CMSPageHistoryController_Tools.ss | 2 +- .../Includes/CMSPagesController_Content.ss | 2 +- .../Includes/Install_deleteinstallfiles.ss | 2 +- templates/SSReportTableField_printable.ss | 2 +- templates/SilverStripeNavigatorLink.ss | 2 +- templates/email/ViewArchivedEmail.ss | 2 +- templates/forms/SiteTreeURLSegmentField.ss | 2 +- tests/behat/behat.yml | 2 +- .../features/bootstrap/FeatureContext.php | 2 +- .../Cms/Test/Behaviour/FixtureContext.php | 16 +- .../Cms/Test/Behaviour/ThemeContext.php | 6 +- tests/controller/CMSMainTest.php | 2 +- .../CMSPageHistoryControllerTest.php | 2 +- .../CMSPageHistoryControllerTest.yml | 2 +- tests/controller/CMSSiteTreeFilterTest.php | 12 +- tests/controller/CMSSiteTreeFilterTest.yml | 6 +- .../ContentControllerPermissionsTest.php | 2 +- .../ContentControllerSearchExtensionTest.php | 4 +- tests/controller/ContentControllerTest.php | 24 +-- tests/controller/ContentControllerTest.yml | 6 +- tests/controller/ModelAsControllerTest.php | 32 ++-- tests/controller/RootURLControllerTest.yml | 2 +- ...tentControllerTestPageWithoutController.ss | 2 +- .../ContentControllerTestPage_test.ss | 2 +- .../themes/controllertest/Controller.ss | 2 +- .../themes/controllertest/Layout/Page.ss | 2 +- .../controller/themes/controllertest/Page.ss | 2 +- tests/model/ErrorPageTest.yml | 2 +- tests/model/FileLinkTrackingTest.yml | 4 +- tests/model/RedirectorPageTest.yml | 2 +- tests/model/SiteTreeActionsTest.php | 2 +- tests/model/SiteTreeActionsTest.yml | 2 +- tests/model/SiteTreeBacklinksTest.yml | 4 +- tests/model/SiteTreeBrokenLinksTest.php | 10 +- tests/model/SiteTreeBrokenLinksTest.yml | 2 +- tests/model/SiteTreePermissionsTest.php | 4 +- tests/model/SiteTreePermissionsTest.yml | 2 +- tests/model/SiteTreeTest.php | 6 +- tests/model/VirtualPageTest.php | 32 ++-- tests/model/VirtualPageTest.yml | 2 +- tests/reports/CmsReportsTest.yml | 2 +- tests/search/SearchFormTest.php | 4 +- tests/search/SearchFormTest.yml | 2 +- .../tasks/MigrateSiteTreeLinkingTaskTest.php | 2 +- tests/tasks/RemoveOrphanedPagesTaskTest.php | 6 +- tests/tasks/RemoveOrphanedPagesTaskTest.yml | 2 +- 145 files changed, 471 insertions(+), 471 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17c8f02b..4396c444 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ before_script: - php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST - php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST -script: +script: - "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit cms/tests; fi" - "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi" diff --git a/_config.php b/_config.php index 24634c9a..f7b8da81 100644 --- a/_config.php +++ b/_config.php @@ -23,4 +23,4 @@ CMSMenu::remove_menu_item('CMSPageReportsController'); CMSMenu::remove_menu_item('CMSPageAddController'); CMSMenu::remove_menu_item('CMSFileAddController'); -CMSMenu::remove_menu_item("SiteConfigLeftAndMain"); \ No newline at end of file +CMSMenu::remove_menu_item("SiteConfigLeftAndMain"); diff --git a/code/batchactions/CMSBatchActions.php b/code/batchactions/CMSBatchActions.php index df185a5d..9f10e2b6 100644 --- a/code/batchactions/CMSBatchActions.php +++ b/code/batchactions/CMSBatchActions.php @@ -1,7 +1,7 @@ canDelete()) $page->delete(); else $status['error'][$page->ID] = true; - // check to see if the record exists on the live site, + // check to see if the record exists on the live site, // if it doesn't remove the tree node $liveRecord = Versioned::get_one_by_stage( 'SiteTree', 'Live', array( '"SiteTree"."ID"' => $id @@ -166,7 +166,7 @@ class CMSBatchAction_Delete extends CMSBatchAction { /** * Unpublish (delete from live site) items batch action. - * + * * @package cms * @subpackage batchaction * @deprecated since version 4.0 diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php index c3fb382e..59df9fc5 100644 --- a/code/controllers/CMSFileAddController.php +++ b/code/controllers/CMSFileAddController.php @@ -83,7 +83,7 @@ class CMSFileAddController extends LeftAndMain { asort($exts); $uploadField->Extensions = implode(', ', $exts); - $form = CMSForm::create( + $form = CMSForm::create( $this, 'EditForm', new FieldList( diff --git a/code/controllers/CMSPageAddController.php b/code/controllers/CMSPageAddController.php index 1beb6276..19e2441b 100644 --- a/code/controllers/CMSPageAddController.php +++ b/code/controllers/CMSPageAddController.php @@ -50,7 +50,7 @@ class CMSPageAddController extends CMSPageEditController { new SelectionGroup_Item( 'child', $parentField = new TreeDropdownField( - "ParentID", + "ParentID", "", 'SiteTree', 'ID', @@ -61,8 +61,8 @@ class CMSPageAddController extends CMSPageEditController { ) ), $typeField = new OptionsetField( - "PageType", - sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')), + "PageType", + sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')), $pageTypes, 'Page' ), @@ -71,7 +71,7 @@ class CMSPageAddController extends CMSPageEditController { sprintf( '

%s

', _t( - 'CMSMain.AddPageRestriction', + 'CMSMain.AddPageRestriction', 'Note: Some page types are not allowed for this selection' ) ) @@ -79,7 +79,7 @@ class CMSPageAddController extends CMSPageEditController { ); $parentField->setSearchFunction(function ($sourceObject, $labelField, $search) { return DataObject::get( - $sourceObject, + $sourceObject, sprintf( "\"MenuTitle\" LIKE '%%%s%%' OR \"Title\" LIKE '%%%s%%'", Convert::raw2sql($search), @@ -88,7 +88,7 @@ class CMSPageAddController extends CMSPageEditController { ); }); - // TODO Re-enable search once it allows for HTML title display, + // TODO Re-enable search once it allows for HTML title display, // see http://open.silverstripe.org/ticket/7455 // $parentField->setShowSearch(true); @@ -114,7 +114,7 @@ class CMSPageAddController extends CMSPageEditController { $this->extend('updatePageOptions', $fields); - $form = CMSForm::create( + $form = CMSForm::create( $this, "AddForm", $fields, $actions )->setHTMLID('Form_AddForm'); $form->setAttribute('data-hints', $this->SiteTreeHints()); @@ -163,7 +163,7 @@ class CMSPageAddController extends CMSPageEditController { $editController->setCurrentPageID($record->ID); Session::set( - "FormInfo.Form_EditForm.formError.message", + "FormInfo.Form_EditForm.formError.message", _t('CMSMain.PageAdded', 'Successfully created page') ); Session::set("FormInfo.Form_EditForm.formError.type", 'good'); diff --git a/code/controllers/CMSPageHistoryController.php b/code/controllers/CMSPageHistoryController.php index eb03eadc..e8a1344b 100644 --- a/code/controllers/CMSPageHistoryController.php +++ b/code/controllers/CMSPageHistoryController.php @@ -63,7 +63,7 @@ class CMSPageHistoryController extends CMSMain { */ public function compare($request) { $form = $this->CompareVersionsForm( - $request->param('VersionID'), + $request->param('VersionID'), $request->param('OtherVersionID') ); @@ -90,11 +90,11 @@ class CMSPageHistoryController extends CMSMain { } /** - * Returns the read only version of the edit form. Detaches all {@link FormAction} + * Returns the read only version of the edit form. Detaches all {@link FormAction} * instances attached since only action relates to revert. * * Permission checking is done at the {@link CMSMain::getEditForm()} level. - * + * * @param int $id ID of the record to show * @param array $fields optional * @param int $versionID @@ -156,7 +156,7 @@ class CMSPageHistoryController extends CMSMain { } } - $fields->addFieldToTab('Root.Main', + $fields->addFieldToTab('Root.Main', new LiteralField('CurrentlyViewingMessage', $this->customise(array( 'Content' => $message, 'Classes' => 'notice' @@ -181,11 +181,11 @@ class CMSPageHistoryController extends CMSMain { /** - * Version select form. Main interface between selecting versions to view + * Version select form. Main interface between selecting versions to view * and comparing multiple versions. - * + * * Because we can reload the page directly to a compare view (history/compare/1/2/3) - * this form has to adapt to those parameters as well. + * this form has to adapt to those parameters as well. * * @return Form */ @@ -246,14 +246,14 @@ class CMSPageHistoryController extends CMSMain { 'doCompare', _t('CMSPageHistoryController.COMPAREVERSIONS','Compare Versions') ), new FormAction( - 'doShowVersion', _t('CMSPageHistoryController.SHOWVERSION','Show Version') + 'doShowVersion', _t('CMSPageHistoryController.SHOWVERSION','Show Version') ) ); // Use <% if $HelpText %>

$HelpText

<% end_if %> - \ No newline at end of file + diff --git a/tests/behat/behat.yml b/tests/behat/behat.yml index 9f3f6c9a..a5f11a82 100644 --- a/tests/behat/behat.yml +++ b/tests/behat/behat.yml @@ -30,4 +30,4 @@ saucelabs: capabilities: platform: "Windows 2008" browser: "firefox" - version: "15" \ No newline at end of file + version: "15" diff --git a/tests/behat/features/bootstrap/FeatureContext.php b/tests/behat/features/bootstrap/FeatureContext.php index 41a22526..83bae940 100644 --- a/tests/behat/features/bootstrap/FeatureContext.php +++ b/tests/behat/features/bootstrap/FeatureContext.php @@ -47,7 +47,7 @@ class FeatureContext extends \SilverStripe\Framework\Test\Behaviour\FeatureConte $obj->publish('Stage', 'Live'); }); $factory->define($class, $blueprint); - } + } } } diff --git a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php index bd816ae7..55c9e0cb 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php @@ -23,8 +23,8 @@ class FixtureContext extends \SilverStripe\BehatExtension\Context\FixtureContext /** * Find or create a redirector page and link to another existing page. - * Example: Given a "page" "My Redirect" which redirects to a "page" "Page 1" - * + * Example: Given a "page" "My Redirect" which redirects to a "page" "Page 1" + * * @Given /^(?:(an|a|the) )"(?[^"]+)" "(?[^"]+)" (:?which )?redirects to (?:(an|a|the) )"(?[^"]+)" "(?[^"]+)"$/ */ public function stepCreateRedirectorPage($type, $id, $targetType, $targetId) { @@ -46,17 +46,17 @@ class FixtureContext extends \SilverStripe\BehatExtension\Context\FixtureContext } /** - * + * * Check if the user can edit a page - * - * Example: Then pages should be editable by "Admin" + * + * Example: Then pages should be editable by "Admin" * Then pages should not be editable by "Admin" - * + * * @Then /^pages should( not? |\s*)be editable by "([^"]*)"$/ */ - public function pagesShouldBeEditableBy($negative, $member){ + public function pagesShouldBeEditableBy($negative, $member){ $page = \Page::get()->First(); - + return array( new Step\Given('I am not logged in'), new Step\Given('I am logged in with "' . $member . '" permissions'), diff --git a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php index 004586a7..a034954e 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php @@ -26,7 +26,7 @@ class ThemeContext extends BehatContext { /** * Create a test theme - * + * * @Given /^a theme "(?[^"]+)"/ */ public function stepCreateTheme($theme) { @@ -39,7 +39,7 @@ class ThemeContext extends BehatContext { /** * Create a template within a test theme - * + * * @Given /^a template "(?