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
This commit is contained in:
Sam Minnee 2016-01-06 12:42:07 +13:00
parent ca4752eca3
commit bbc3aaaf9f
145 changed files with 471 additions and 471 deletions

View File

@ -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"

View File

@ -23,4 +23,4 @@ CMSMenu::remove_menu_item('CMSPageReportsController');
CMSMenu::remove_menu_item('CMSPageAddController');
CMSMenu::remove_menu_item('CMSFileAddController');
CMSMenu::remove_menu_item("SiteConfigLeftAndMain");
CMSMenu::remove_menu_item("SiteConfigLeftAndMain");

View File

@ -1,7 +1,7 @@
<?php
/**
* Publish items batch action.
*
*
* @package cms
* @subpackage batchaction
*/
@ -23,7 +23,7 @@ class CMSBatchAction_Publish extends CMSBatchAction {
/**
* Unpublish items batch action.
*
*
* @package cms
* @subpackage batchaction
*/
@ -116,7 +116,7 @@ class CMSBatchAction_Restore extends CMSBatchAction {
/**
* Delete items batch action.
*
*
* @package cms
* @subpackage batchaction
* @deprecated since version 4.0
@ -141,7 +141,7 @@ class CMSBatchAction_Delete extends CMSBatchAction {
if($page->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

View File

@ -83,7 +83,7 @@ class CMSFileAddController extends LeftAndMain {
asort($exts);
$uploadField->Extensions = implode(', ', $exts);
$form = CMSForm::create(
$form = CMSForm::create(
$this,
'EditForm',
new FieldList(

View File

@ -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(
'<p class="message notice message-restricted">%s</p>',
_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');

View File

@ -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 <button> to allow full jQuery UI styling
foreach($actions->dataFields() as $action) $action->setUseButtonTag(true);
$form = CMSForm::create(
$form = CMSForm::create(
$this,
'VersionsForm',
$fields,
@ -295,7 +295,7 @@ class CMSPageHistoryController extends CMSMain {
return $this->customise(array(
"EditForm" => $form
))->renderWith(array(
$this->class . '_EditForm',
$this->class . '_EditForm',
'LeftAndMain_Content'
));
}
@ -320,7 +320,7 @@ class CMSPageHistoryController extends CMSMain {
public function doShowVersion($data, $form) {
$versionID = null;
if(isset($data['Versions']) && is_array($data['Versions'])) {
if(isset($data['Versions']) && is_array($data['Versions'])) {
$versionID = array_shift($data['Versions']);
}
@ -330,7 +330,7 @@ class CMSPageHistoryController extends CMSMain {
return $this->customise(array(
"EditForm" => $this->ShowVersionForm($versionID)
))->renderWith(array(
$this->class . '_EditForm',
$this->class . '_EditForm',
'LeftAndMain_Content'
));
}

View File

@ -1,7 +1,7 @@
<?php
/**
* Base class for filtering the subtree for certain node statuses.
*
*
* The simplest way of building a CMSSiteTreeFilter is to create a pagesToBeShown() method that
* returns an Iterator of maps, each entry containing the 'ID' and 'ParentID' of the pages to be
* included in the tree. The result of a DB::query() can then be returned directly.
@ -9,7 +9,7 @@
* If you wish to make a more complex tree, you can overload includeInTree($page) to return true/
* false depending on whether the given page should be included. Note that you will need to include
* parent helper pages yourself.
*
*
* @package cms
* @subpackage content
*/
@ -23,7 +23,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
/**
* List of filtered items and all their parents
*
*
* @var array
*/
protected $_cache_ids = null;
@ -44,7 +44,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
protected $_cache_expanded = array();
/**
* @var string
* @var string
*/
protected $childrenMethod = null;
@ -55,7 +55,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
/**
* Returns a sorted array of all implementators of CMSSiteTreeFilter, suitable for use in a dropdown.
*
*
* @return array
*/
public static function get_all_filters() {
@ -132,7 +132,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
if($pages = $this->pagesIncluded()) {
// And keep a record of parents we don't need to get
// And keep a record of parents we don't need to get
// parents of themselves, as well as IDs to mark
foreach($pages as $pageArr) {
$parents[$pageArr['ParentID']] = true;
@ -163,7 +163,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
/**
* Applies the default filters to a specified DataList of pages
*
*
* @param DataList $query Unfiltered query
* @return DataList Filtered query
*/
@ -211,7 +211,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
/**
* Maps a list of pages to an array of associative arrays with ID and ParentID keys
*
*
* @param DataList $pages
* @return array
*/
@ -272,7 +272,7 @@ class CMSSiteTreeFilter_PublishedPages extends CMSSiteTreeFilter {
* Works a bit different than the other filters:
* Shows all pages *including* those deleted from stage and live.
* It does not filter out pages still existing in the different stages.
*
*
* @package cms
* @subpackage content
*/
@ -301,7 +301,7 @@ class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter {
/**
* Gets all pages which have changed on stage.
*
*
* @package cms
* @subpackage content
*/
@ -322,7 +322,7 @@ class CMSSiteTreeFilter_ChangedPages extends CMSSiteTreeFilter {
/**
* Filters pages which have a status "Removed from Draft".
*
*
* @package cms
* @subpackage content
*/
@ -334,7 +334,7 @@ class CMSSiteTreeFilter_StatusRemovedFromDraftPages extends CMSSiteTreeFilter {
/**
* Filters out all pages who's status is set to "Removed from draft".
*
*
* @return SS_List
*/
public function getFilteredPages() {
@ -350,7 +350,7 @@ class CMSSiteTreeFilter_StatusRemovedFromDraftPages extends CMSSiteTreeFilter {
/**
* Filters pages which have a status "Draft".
*
*
* @package cms
* @subpackage content
*/
@ -362,7 +362,7 @@ class CMSSiteTreeFilter_StatusDraftPages extends CMSSiteTreeFilter {
/**
* Filters out all pages who's status is set to "Draft".
*
*
* @see {@link SiteTree::getStatusFlags()}
* @return SS_List
*/
@ -379,7 +379,7 @@ class CMSSiteTreeFilter_StatusDraftPages extends CMSSiteTreeFilter {
/**
* Filters pages which have a status "Deleted".
*
*
* @package cms
* @subpackage content
*/
@ -401,7 +401,7 @@ class CMSSiteTreeFilter_StatusDeletedPages extends CMSSiteTreeFilter {
/**
* Filters out all pages who's status is set to "Deleted".
*
*
* @see {@link SiteTree::getStatusFlags()}
* @return SS_List
*/
@ -430,7 +430,7 @@ class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter {
/**
* Retun an array of maps containing the keys, 'ID' and 'ParentID' for each page to be displayed
* in the search.
*
*
* @return SS_List
*/
public function getFilteredPages() {

View File

@ -12,7 +12,7 @@
*
* Subclasses of ContentController are generally instantiated by ModelAsController; this will create
* a controller based on the URLSegment action variable, by looking in the SiteTree table.
*
*
* @todo Can this be used for anything other than SiteTree controllers?
*
* @package cms
@ -90,7 +90,7 @@ class ContentController extends Controller {
// If we've accessed the homepage as /home/, then we should redirect to /.
if($this->dataRecord && $this->dataRecord instanceof SiteTree
&& RootURLController::should_be_on_root($this->dataRecord) && (!isset($this->urlParams['Action']) || !$this->urlParams['Action'] )
&& RootURLController::should_be_on_root($this->dataRecord) && (!isset($this->urlParams['Action']) || !$this->urlParams['Action'] )
&& !$_POST && !$_FILES && !$this->redirectedTo() ) {
$getVars = $_GET;
unset($getVars['url']);
@ -305,7 +305,7 @@ class ContentController extends Controller {
</div>
<div id="switchView" class="bottomTabs">
$viewPageIn
$viewPageIn
$items
</div>
</div>
@ -337,10 +337,10 @@ HTML;
* Inspects the associated {@link dataRecord} for a {@link SiteTree->Locale} value if present,
* and falls back to {@link Translatable::get_current_locale()} or {@link i18n::default_locale()},
* depending if Translatable is enabled.
*
*
* Suitable for insertion into lang= and xml:lang=
* attributes in HTML or XHTML output.
*
*
* @return string
*/
public function ContentLocale() {

View File

@ -2,7 +2,7 @@
/**
* Enhances error handling for a controller with ErrorPage generated output
*
*
* @package cms
* @subpackage controller
*/

View File

@ -1,7 +1,7 @@
<?php
/**
* Extension to include custom page icons
*
*
* @package cms
* @subpackage controller
*/
@ -14,16 +14,16 @@ class LeftAndMainPageIconsExtension extends Extension {
/**
* Include CSS for page icons. We're not using the JSTree 'types' option
* because it causes too much performance overhead just to add some icons.
*
* @return string CSS
*
* @return string CSS
*/
public function generatePageIconsCss() {
$css = '';
$css = '';
$classes = ClassInfo::subclassesFor('SiteTree');
$classes = ClassInfo::subclassesFor('SiteTree');
foreach($classes as $class) {
$obj = singleton($class);
$iconSpec = $obj->stat('icon');
$obj = singleton($class);
$iconSpec = $obj->stat('icon');
if(!$iconSpec) continue;
@ -33,9 +33,9 @@ class LeftAndMainPageIconsExtension extends Extension {
// Legacy support: Add file extension if none exists
if(!pathinfo($iconFile, PATHINFO_EXTENSION)) $iconFile .= '-file.gif';
$iconPathInfo = pathinfo($iconFile);
$iconPathInfo = pathinfo($iconFile);
// Base filename
// Base filename
$baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename'];
$fileExtension = $iconPathInfo['extension'];
@ -52,4 +52,4 @@ class LeftAndMainPageIconsExtension extends Extension {
return $css;
}
}
}

View File

@ -1,6 +1,6 @@
<?php
/**
* Interface that is implemented by controllers that are designed to hand control over to another controller.
* Interface that is implemented by controllers that are designed to hand control over to another controller.
* ModelAsController, which selects up a SiteTree object and passes control over to a suitable subclass of ContentController, is a good
* example of this.
* @package cms

View File

@ -4,11 +4,11 @@
* for CMS authors, usually for {@link SiteTree} objects with "stage" and "live" links.
* Useful both in the CMS and alongside the page template (for logged in authors).
* The class can be used for any {@link DataObject} subclass implementing the {@link CMSPreviewable} interface.
*
*
* New item types can be defined by extending the {@link SilverStripeNavigatorItem} class,
* for example the "cmsworkflow" module defines a new "future state" item with a date selector
* to view embargoed data at a future point in time. So the item doesn't always have to be a simple link.
*
*
* @package cms
* @subpackage content
*/
@ -101,7 +101,7 @@ class SilverStripeNavigator extends ViewableData {
* Navigator items are links that appear in the $SilverStripeNavigator bar.
* To add an item, extend this class - it will be automatically picked up.
* When instanciating items manually, please ensure to call {@link canView()}.
*
*
* @package cms
* @subpackage content
*/
@ -142,7 +142,7 @@ class SilverStripeNavigatorItem extends ViewableData {
* Optional link to a specific view of this record.
* Not all items are simple links, please use {@link getHTML()}
* to represent an item in markup unless you know what you're doing.
*
*
* @return string
*/
public function getLink() {}
@ -157,7 +157,7 @@ class SilverStripeNavigatorItem extends ViewableData {
*/
public function getRecord() {
return $this->record;
}
}
/**
* @return int
@ -169,7 +169,7 @@ class SilverStripeNavigatorItem extends ViewableData {
/**
* As items might convey different record states like a "stage" or "live" table,
* an item can be active (showing the record in this state).
*
*
* @return boolean
*/
public function isActive() {
@ -179,7 +179,7 @@ class SilverStripeNavigatorItem extends ViewableData {
/**
* Filters items based on member permissions or other criteria,
* such as if a state is generally available for the current record.
*
*
* @param Member
* @return Boolean
*/
@ -189,7 +189,7 @@ class SilverStripeNavigatorItem extends ViewableData {
/**
* Counts as "archived" if the current record is a different version from both live and draft.
*
*
* @return boolean
*/
public function isArchived() {
@ -205,7 +205,7 @@ class SilverStripeNavigatorItem extends ViewableData {
));
$this->record->_cached_isArchived = (
(!$currentDraft || ($currentDraft && $this->record->Version != $currentDraft->Version))
(!$currentDraft || ($currentDraft && $this->record->Version != $currentDraft->Version))
&& (!$currentLive || ($currentLive && $this->record->Version != $currentLive->Version))
);
}
@ -280,7 +280,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
public function getLink() {
$date = Versioned::current_archived_date();
return Controller::join_links(
$this->record->PreviewLink(),
$this->record->PreviewLink(),
'?stage=Stage',
$date ? '?archiveDate=' . $date : null
);
@ -288,7 +288,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
public function canView($member = null) {
return (
$this->record->hasExtension('Versioned')
$this->record->hasExtension('Versioned')
&& $this->getDraftPage()
// Don't follow redirects in preview, they break the CMS editing form
&& !($this->record instanceof RedirectorPage)
@ -297,7 +297,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
public function isActive() {
return (
Versioned::current_stage() == 'Stage'
Versioned::current_stage() == 'Stage'
&& !(ClassInfo::exists('SiteTreeFutureState') && SiteTreeFutureState::get_future_datetime())
&& !$this->isArchived()
);
@ -341,7 +341,7 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
public function canView($member = null) {
return (
$this->record->hasExtension('Versioned')
$this->record->hasExtension('Versioned')
&& $this->getLivePage()
// Don't follow redirects in preview, they break the CMS editing form
&& !($this->record instanceof RedirectorPage)
@ -380,7 +380,7 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
return _t('SilverStripeNavigator.ARCHIVED', 'Archived');
}
public function getMessage() {
public function getMessage() {
if($date = Versioned::current_archived_date()) {
$dateObj = DBField::create_field('Datetime', $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>";
@ -393,7 +393,7 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
public function canView($member = null) {
return (
$this->record->hasExtension('Versioned')
$this->record->hasExtension('Versioned')
&& $this->isArchived()
// Don't follow redirects in preview, they break the CMS editing form
&& !($this->record instanceof RedirectorPage)

View File

@ -3,7 +3,7 @@
/**
* Used to edit the SiteTree->URLSegment property, and suggest input based on the serverside rules
* defined through {@link SiteTree->generateURLSegment()} and {@link URLSegmentFilter}.
*
*
* Note: The actual conversion for saving the value takes place in the model layer.
*
* @package cms
@ -12,8 +12,8 @@
class SiteTreeURLSegmentField extends TextField {
/**
* @var string
/**
* @var string
*/
protected $helpText, $urlPrefix, $urlSuffix, $defaultUrl;

View File

@ -41,7 +41,7 @@ class RedirectorPage extends Page {
* Return the the link that should be used for this redirector page, in navigation, etc.
* If the redirectorpage has been appropriately configured, then it will return the redirection
* 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.
* it will return a link to itself, which will then display an error message.
*/
public function Link() {
if($link = $this->redirectionLink()) return $link;
@ -108,8 +108,8 @@ class RedirectorPage extends Page {
// Prefix the URL with "http://" if no prefix is found
if(
$this->ExternalURL
&& !parse_url($this->ExternalURL, PHP_URL_SCHEME)
$this->ExternalURL
&& !parse_url($this->ExternalURL, PHP_URL_SCHEME)
&& !preg_match('#^//#', $this->ExternalURL)
) {
$this->ExternalURL = 'http://' . $this->ExternalURL;
@ -129,17 +129,17 @@ class RedirectorPage extends Page {
array(
new HeaderField('RedirectorDescHeader',_t('RedirectorPage.HEADER', "This page will redirect users to another page")),
new OptionsetField(
"RedirectionType",
_t('RedirectorPage.REDIRECTTO', "Redirect to"),
"RedirectionType",
_t('RedirectorPage.REDIRECTTO', "Redirect to"),
array(
"Internal" => _t('RedirectorPage.REDIRECTTOPAGE', "A page on your website"),
"External" => _t('RedirectorPage.REDIRECTTOEXTERNAL', "Another website"),
),
),
"Internal"
),
new TreeDropdownField(
"LinkToID",
_t('RedirectorPage.YOURPAGE', "Page on your website"),
"LinkToID",
_t('RedirectorPage.YOURPAGE', "Page on your website"),
"SiteTree"
),
new TextField("ExternalURL", _t('RedirectorPage.OTHERURL', "Other website URL"))

View File

@ -3,7 +3,7 @@
* Basic data-object representing all pages within the site tree. All page types that live within the hierarchy should
* inherit from this. In addition, it contains a number of static methods for querying the site tree and working with
* draft and published states.
*
*
* <h2>URLs</h2>
* A page is identified during request handling via its "URLSegment" database column. As pages can be nested, the full
* path of a URL might contain multiple segments. Each segment is stored in its filtered representation (through
@ -44,7 +44,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* class is allowed - no subclasses. Otherwise, the class and all its
* subclasses are allowed.
* To control allowed children on root level (no parent), use {@link $can_be_root}.
*
*
* Note that this setting is cached when used in the CMS, use the "flush" query parameter to clear it.
*
* @config
@ -168,7 +168,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Icon to use in the CMS page tree. This should be the full filename, relative to the webroot.
* Also supports custom CSS rule contents (applied to the correct selector for the tree UI implementation).
*
*
* @see CMSMain::generateTreeStylingCSS()
* @config
* @var string
@ -240,7 +240,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* Determines if the system should avoid orphaned pages
* by deleting all children when the their parent is deleted (TRUE),
* or rather preserve this data even if its not reachable through any navigation path (FALSE).
*
*
* @deprecated 4.0 Use the "SiteTree.enforce_strict_hierarchy" config setting instead
* @param boolean
*/
@ -364,7 +364,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Traverse down the remaining URL segments and grab the relevant SiteTree objects.
foreach($parts as $segment) {
$next = DataObject::get_one('SiteTree', array(
'"SiteTree"."URLSegment"' => $segment,
'"SiteTree"."URLSegment"' => $segment,
'"SiteTree"."ParentID"' => $sitetree->ID
),
$cache
@ -483,7 +483,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Base link used for previewing. Defaults to absolute URL, in order to account for domain changes, e.g. on multi
* site setups. Does not contain hints about the stage, see {@link SilverStripeNavigator} for details.
*
*
* @param string $action See {@link Link()}
* @return string
*/
@ -503,7 +503,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* and returned in its full form.
*
* @uses RootURLController::get_homepage_link()
*
*
* @param string $action See {@link Link()}
* @return string
*/
@ -517,7 +517,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$base = $parent->RelativeLink($this->URLSegment);
} elseif(!$action && $this->URLSegment == RootURLController::get_homepage_link()) {
// Unset base for root-level homepages.
// Note: Homepages with action parameters (or $action === true)
// Note: Homepages with action parameters (or $action === true)
// need to retain their URLSegment.
$base = null;
} else {
@ -600,7 +600,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* Check if the parent of this page has been removed (or made otherwise unavailable), and is still referenced by
* this child. Any such orphaned page may still require access via the CMS, but should not be shown as accessible
* to external users.
*
*
* @return bool
*/
public function isOrphaned() {
@ -752,11 +752,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$pages = array();
while(
$page
&& (!$maxDepth || count($pages) < $maxDepth)
$page
&& (!$maxDepth || count($pages) < $maxDepth)
&& (!$stopAtPageType || $page->ClassName != $stopAtPageType)
) {
if($showHidden || $page->ShowInMenus || ($page->ID == $this->ID)) {
if($showHidden || $page->ShowInMenus || ($page->ID == $this->ID)) {
$pages[] = $page;
}
@ -769,7 +769,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Make this page a child of another page.
*
*
* If the parent page does not exist, resolve it to a valid ID before updating this page's reference.
*
* @param SiteTree|int $item Either the parent object, or the parent ID
@ -814,7 +814,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* This function should return true if the current user can execute this action. It can be overloaded to customise
* the security model for an application.
*
*
* Slightly altered from parent behaviour in {@link DataObject->can()}:
* - Checks for existence of a method named "can<$perm>()" on the object
* - Calls decorators and only returns for FALSE "vetoes"
@ -848,12 +848,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* This function should return true if the current user can add children to this page. It can be overloaded to
* customise the security model for an application.
*
*
* Denies permission if any of the following conditions is true:
* - alternateCanAddChildren() on a extension returns false
* - canEdit() is not granted
* - There are no classes defined in {@link $allowed_children}
*
*
* @uses SiteTreeExtension->canAddChildren()
* @uses canEdit()
* @uses $allowed_children
@ -883,7 +883,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* This function should return true if the current user can view this page. It can be overloaded to customise the
* security model for an application.
*
*
* Denies permission if any of the following conditions is true:
* - canView() on any extension returns false
* - "CanViewType" directive is set to "Inherit" and any parent page return false for canView()
@ -928,8 +928,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// check for specific groups
if($member && is_numeric($member)) $member = DataObject::get_by_id('Member', $member);
if(
$this->CanViewType == 'OnlyTheseUsers'
&& $member
$this->CanViewType == 'OnlyTheseUsers'
&& $member
&& $member->inGroups($this->ViewerGroups())
) return true;
@ -939,12 +939,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* This function should return true if the current user can delete this page. It can be overloaded to customise the
* security model for an application.
*
*
* Denies permission if any of the following conditions is true:
* - canDelete() returns false on any extension
* - canEdit() returns false
* - any descendant page returns false for canDelete()
*
*
* @uses canDelete()
* @uses SiteTreeExtension->canDelete()
* @uses canEdit()
@ -974,14 +974,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
/**
* This function should return true if the current user can create new pages of this class, regardless of class. It
* This function should return true if the current user can create new pages of this class, regardless of class. It
* can be overloaded to customise the security model for an application.
*
* By default, permission to create at the root level is based on the SiteConfig configuration, and permission to
*
* By default, permission to create at the root level is based on the SiteConfig configuration, and permission to
* create beneath a parent is based on the ability to edit that parent page.
*
*
* Use {@link canAddChildren()} to control behaviour of creating children under this page.
*
*
* @uses $can_create
* @uses DataExtension->canCreate()
*
@ -1024,7 +1024,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* This function should return true if the current user can edit this page. It can be overloaded to customise the
* security model for an application.
*
*
* Denies permission if any of the following conditions is true:
* - canEdit() on any extension returns false
* - canView() return false
@ -1032,7 +1032,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* - "CanEditType" directive is set to "LoggedInUsers" and no user is logged in or doesn't have the
* CMS_Access_CMSMAIN permission code
* - "CanEditType" directive is set to "OnlyTheseUsers" and user is not in the given groups
*
*
* @uses canView()
* @uses EditorGroups()
* @uses DataExtension->canEdit()
@ -1069,11 +1069,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* This function should return true if the current user can publish this page. It can be overloaded to customise
* the security model for an application.
*
*
* Denies permission if any of the following conditions is true:
* - canPublish() on any extension returns false
* - canEdit() returns false
*
*
* @uses SiteTreeExtension->canPublish()
*
* @param Member $member
@ -1229,7 +1229,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Get permissions that are inherited
$potentiallyInherited = Versioned::get_by_stage(
"SiteTree",
$stage,
$stage,
array("\"$typeField\" = 'Inherit' AND \"SiteTree\".\"ID\" IN ($idPlaceholders)" => $ids)
);
@ -1270,7 +1270,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Cache the results
if(empty(self::$cache_permissions[$cacheKey])) self::$cache_permissions[$cacheKey] = array();
self::$cache_permissions[$cacheKey] = $combinedStageResult + self::$cache_permissions[$cacheKey];
return $combinedStageResult;
} else {
return array();
@ -1402,9 +1402,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if($this->MetaDescription) {
$tags .= "<meta name=\"description\" content=\"" . Convert::raw2att($this->MetaDescription) . "\" />\n";
}
if($this->ExtraMeta) {
if($this->ExtraMeta) {
$tags .= $this->ExtraMeta . "\n";
}
}
if(Permission::check('CMS_ACCESS_CMSMain')
&& in_array('CMSPreviewable', class_implements($this))
@ -1495,7 +1495,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(!$this->Sort) {
$parentID = ($this->ParentID) ? $this->ParentID : 0;
$this->Sort = DB::prepared_query(
"SELECT MAX(\"Sort\") + 1 FROM \"SiteTree\" WHERE \"ParentID\" = ?",
"SELECT MAX(\"Sort\") + 1 FROM \"SiteTree\" WHERE \"ParentID\" = ?",
array($parentID)
)->value();
}
@ -1596,10 +1596,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
protected function validate() {
$result = parent::validate();
// Allowed children validation
// Allowed children validation
$parent = $this->getParent();
if($parent && $parent->exists()) {
// No need to check for subclasses or instanceof, as allowedChildren() already
// No need to check for subclasses or instanceof, as allowedChildren() already
// deconstructs any inheritance trees already.
$allowed = $parent->allowedChildren();
$subject = ($this instanceof VirtualPage && $this->CopyContentFromID) ? $this->CopyContentFrom() : $this;
@ -1607,8 +1607,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$result->error(
_t(
'SiteTree.PageTypeNotAllowed',
'Page type "{type}" not allowed as child of this parent page',
'SiteTree.PageTypeNotAllowed',
'Page type "{type}" not allowed as child of this parent page',
array('type' => $subject->i18n_singular_name())
),
'ALLOWED_CHILDREN'
@ -1620,8 +1620,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(!$this->stat('can_be_root') && !$this->ParentID) {
$result->error(
_t(
'SiteTree.PageTypNotAllowedOnRoot',
'Page type "{type}" is not allowed on the root level',
'SiteTree.PageTypNotAllowedOnRoot',
'Page type "{type}" is not allowed on the root level',
array('type' => $this->i18n_singular_name())
),
'CAN_BE_ROOT'
@ -1661,7 +1661,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
$votes = array_filter(
(array)$this->extend('augmentValidURLSegment'),
(array)$this->extend('augmentValidURLSegment'),
function($v) {return !is_null($v);}
);
if($votes) {
@ -1682,7 +1682,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* updateURLSegment(&$url, $title). $url will be passed by reference and should be modified. $title will contain
* the title that was originally used as the source of this generated URL. This lets extensions either start from
* scratch, or incrementally modify the generated URL.
*
*
* @param string $title Page title
* @return string Generated url segment
*/
@ -1761,7 +1761,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Returns the pages that depend on this page. This includes virtual pages, pages that link to it, etc.
*
*
* @param bool $includeVirtuals Set to false to exlcude virtual pages.
* @return ArrayList
*/
@ -1887,7 +1887,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
$statusMessage[] = _t(
'SiteTree.APPEARSVIRTUALPAGES',
'SiteTree.APPEARSVIRTUALPAGES',
"This content also appears on the virtual pages in the {title} sections.",
array('title' => $parentList)
);
@ -1982,7 +1982,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$metaFieldDesc
->setRightTitle(
_t(
'SiteTree.METADESCHELP',
'SiteTree.METADESCHELP',
"Search engines use this content for displaying search results (although it will not influence their ranking)."
)
)
@ -1990,7 +1990,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$metaFieldExtra
->setRightTitle(
_t(
'SiteTree.METAEXTRAHELP',
'SiteTree.METAEXTRAHELP',
"HTML tags for additional meta information. For example &lt;meta name=\"customName\" content=\"your custom content here\" /&gt;"
)
)
@ -2017,8 +2017,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
if(file_exists(BASE_PATH . '/install.php')) {
$fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader",
"<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING",
$fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader",
"<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING",
"Warning: You should remove install.php from this SilverStripe install for security reasons.")
. "</p>"), "Title");
}
@ -2040,7 +2040,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Returns fields related to configuration aspects on this record, e.g. access control. See {@link getCMSFields()}
* for content-related fields.
*
*
* @return FieldList
*/
public function getSettingsFields() {
@ -2055,8 +2055,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$rootTab = new TabSet("Root",
$tabBehaviour = new Tab('Settings',
new DropdownField(
"ClassName",
$this->fieldLabel('ClassName'),
"ClassName",
$this->fieldLabel('ClassName'),
$this->getClassDropdown()
),
$parentTypeSelector = new CompositeField(
@ -2071,25 +2071,25 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch'))
),
$viewersOptionsField = new OptionsetField(
"CanViewType",
"CanViewType",
_t('SiteTree.ACCESSHEADER', "Who can view this page?")
),
$viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups"))
->setMultiple(true)
->setSource($groupsMap)
->setAttribute(
'data-placeholder',
'data-placeholder',
_t('SiteTree.GroupPlaceholder', 'Click to select group')
),
$editorsOptionsField = new OptionsetField(
"CanEditType",
"CanEditType",
_t('SiteTree.EDITHEADER', "Who can edit this page?")
),
$editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups"))
->setMultiple(true)
->setSource($groupsMap)
->setAttribute(
'data-placeholder',
'data-placeholder',
_t('SiteTree.GroupPlaceholder', 'Click to select group')
)
)
@ -2216,7 +2216,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Minor options are hidden behind a drop-up and appear as links (although they are still FormActions).
$rootTabSet = new TabSet('ActionMenus');
$moreOptions = new Tab(
'MoreOptions',
'MoreOptions',
_t('SiteTree.MoreOptions', 'More options', 'Expands a view for more buttons')
);
$rootTabSet->push($moreOptions);
@ -2361,7 +2361,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Publish this page.
*
*
* @uses SiteTreeExtension->onBeforePublish()
* @uses SiteTreeExtension->onAfterPublish()
* @return bool True if published
@ -2411,7 +2411,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Unpublish this page - remove it from the live site
*
*
* @uses SiteTreeExtension->onBeforeUnpublish()
* @uses SiteTreeExtension->onAfterUnpublish()
*/
@ -2573,12 +2573,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(!$this->canDelete($member)) {
return false;
}
// If published, check if we can delete from live
if($this->ExistsOnLive && !$this->canDeleteFromLive($member)) {
return false;
}
return true;
}
@ -2755,11 +2755,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* status. Each page can have more than one status flag. Returns a map of a unique key to a (localized) title for
* the flag. The unique key can be reused as a CSS class. Use the 'updateStatusFlags' extension point to customize
* the flags.
*
* Example (simple):
*
* Example (simple):
* "deletedonlive" => "Deleted"
*
* Example (with optional title attribute):
*
* Example (with optional title attribute):
* "deletedonlive" => array('text' => "Deleted", 'title' => 'This page has been deleted')
*
* @param bool $cached Whether to serve the fields from cache; false regenerate them
@ -2907,7 +2907,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Compares current draft with live version, and returns true if no draft version of this page exists but the page
* is still published (eg, after triggering "Delete from draft site" in the CMS).
*
*
* @return bool
*/
public function getIsDeletedFromStage() {
@ -2932,7 +2932,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Compares current draft with live version, and returns true if these versions differ, meaning there have been
* unpublished changes to the draft site.
*
*
* @return bool
*/
public function getIsModifiedOnStage() {
@ -2951,7 +2951,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Compares current draft with live version, and returns true if no live version exists, meaning the page was never
* published.
*
*
* @return bool
*/
public function getIsAddedToStage() {
@ -3017,7 +3017,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
/**
* Return the translated Singular name.
*
*
* @return string
*/
public function i18n_singular_name() {

View File

@ -2,7 +2,7 @@
/**
* Plug-ins for additional functionality in your SiteTree classes.
*
*
* @package cms
* @subpackage model
*/
@ -10,7 +10,7 @@ abstract class SiteTreeExtension extends DataExtension {
/**
* Hook called before the page's {@link SiteTree::doPublish()} action is completed
*
*
* @param SiteTree &$original The current Live SiteTree record prior to publish
*/
public function onBeforePublish(&$original) {
@ -18,7 +18,7 @@ abstract class SiteTreeExtension extends DataExtension {
/**
* Hook called after the page's {@link SiteTree::doPublish()} action is completed
*
*
* @param SiteTree &$original The current Live SiteTree record prior to publish
*/
public function onAfterPublish(&$original) {
@ -39,9 +39,9 @@ abstract class SiteTreeExtension extends DataExtension {
/**
* Hook called to determine if a user may add children to this SiteTree object
*
*
* @see SiteTree::canAddChildren()
*
*
* @param Member $member The member to check permission against, or the currently
* logged in user
* @return boolean|null Return false to deny rights, or null to yield to default
@ -51,9 +51,9 @@ abstract class SiteTreeExtension extends DataExtension {
/**
* Hook called to determine if a user may publish this SiteTree object
*
*
* @see SiteTree::canPublish()
*
*
* @param Member $member The member to check permission against, or the currently
* logged in user
* @return boolean|null Return false to deny rights, or null to yield to default
@ -65,7 +65,7 @@ abstract class SiteTreeExtension extends DataExtension {
* Hook called to modify the $base url of this page, with a given $action,
* before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()}
* on the $base and $action
*
*
* @param string &$base The URL of this page relative to siteroot, not including
* the action
* @param string|boolean &$action The action or subpage called on this page.

View File

@ -12,8 +12,8 @@ class SiteTreeFileExtension extends DataExtension {
public function updateCMSFields(FieldList $fields) {
$fields->insertAfter(
ReadonlyField::create(
'BackLinkCount',
_t('AssetTableField.BACKLINKCOUNT', 'Used on:'),
'BackLinkCount',
_t('AssetTableField.BACKLINKCOUNT', 'Used on:'),
$this->BackLinkTracking()->Count() . ' ' . _t('AssetTableField.PAGES', 'page(s)'))
->addExtraClass('cms-description-toggle')
->setDescription($this->BackLinkHTMLList()),
@ -67,8 +67,8 @@ class SiteTreeFileExtension extends DataExtension {
}
if($filter || $sort || $join || $limit) {
Deprecation::notice('4.0', 'The $filter, $sort, $join and $limit parameters for
SiteTreeFileExtension::BackLinkTracking() have been deprecated.
Deprecation::notice('4.0', 'The $filter, $sort, $join and $limit parameters for
SiteTreeFileExtension::BackLinkTracking() have been deprecated.
Please manipluate the returned list directly.', Deprecation::SCOPE_GLOBAL);
}
@ -90,7 +90,7 @@ class SiteTreeFileExtension extends DataExtension {
/**
* @todo Unnecessary shortcut for AssetTableField, coupled with cms module.
*
*
* @return integer
*/
public function BackLinkTrackingCount() {
@ -130,9 +130,9 @@ class SiteTreeFileExtension extends DataExtension {
/**
* Rewrite links to the $old file to now point to the $new file.
*
*
* @uses SiteTree->rewriteFileURL()
*
*
* @param string $old File path relative to the webroot
* @param string $new File path relative to the webroot
*/

View File

@ -10,7 +10,7 @@ class SiteTreeFolderExtension extends DataExtension {
/**
* Looks for files used in system and create where clause which contains all ID's of files.
*
*
* @returns String where clause which will work as filter.
*/
public function getUnusedFilesListFilter() {
@ -21,7 +21,7 @@ class SiteTreeFolderExtension extends DataExtension {
if($result->numRecords() > 0) {
while($nextResult = $result->next()) {
$where .= $nextResult['FileID'] . ',';
$where .= $nextResult['FileID'] . ',';
}
}

View File

@ -2,7 +2,7 @@
/**
* Virtual Page creates an instance of a page, with the same fields that the original page had, but readonly.
* This allows you can have a page in mulitple places in the site structure, with different children without duplicating the content
* Note: This Only duplicates $db fields and not the $has_one etc..
* Note: This Only duplicates $db fields and not the $has_one etc..
* @package cms
*/
class VirtualPage extends Page {
@ -46,7 +46,7 @@ class VirtualPage extends Page {
"VersionID" => "Int",
);
/**
/**
* Generates the array of fields required for the page type.
*/
public function getVirtualFields() {
@ -71,7 +71,7 @@ class VirtualPage extends Page {
if(!$copyContentFromID) return new SiteTree();
if(!isset($this->components['CopyContentFrom'])) {
$this->components['CopyContentFrom'] = DataObject::get_by_id("SiteTree",
$this->components['CopyContentFrom'] = DataObject::get_by_id("SiteTree",
$copyContentFromID);
// Don't let VirtualPages point to other VirtualPages
@ -91,7 +91,7 @@ class VirtualPage extends Page {
if($val && DataObject::get_by_id('SiteTree', $val) instanceof VirtualPage) $val = 0;
return $this->setField("CopyContentFromID", $val);
}
public function ContentSource() {
return $this->CopyContentFrom();
}
@ -143,7 +143,7 @@ class VirtualPage extends Page {
/**
* Returns true if is page is publishable by anyone at all
* Return false if the source page isn't published yet.
*
*
* Note that isPublishable doesn't affect ete from live, only publish.
*/
public function isPublishable() {
@ -169,8 +169,8 @@ class VirtualPage extends Page {
// Setup the linking to the original page.
$copyContentFromField = new TreeDropdownField(
"CopyContentFromID",
_t('VirtualPage.CHOOSE', "Linked Page"),
"CopyContentFromID",
_t('VirtualPage.CHOOSE', "Linked Page"),
"SiteTree"
);
// filter doesn't let you select children of virtual pages as as source page
@ -191,11 +191,11 @@ class VirtualPage extends Page {
// Create links back to the original object in the CMS
if($this->CopyContentFrom()->exists()) {
$link = "<a class=\"cmsEditlink\" href=\"admin/pages/edit/show/$this->CopyContentFromID\">"
$link = "<a class=\"cmsEditlink\" href=\"admin/pages/edit/show/$this->CopyContentFromID\">"
. _t('VirtualPage.EditLink', 'edit')
. "</a>";
$msgs[] = _t(
'VirtualPage.HEADERWITHLINK',
'VirtualPage.HEADERWITHLINK',
"This is a virtual page copying content from \"{title}\" ({link})",
array(
'title' => $this->CopyContentFrom()->obj('Title'),
@ -210,7 +210,7 @@ class VirtualPage extends Page {
);
}
if(
$this->CopyContentFromID
$this->CopyContentFromID
&& !Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->CopyContentFromID)
) {
$msgs[] = _t(
@ -219,7 +219,7 @@ class VirtualPage extends Page {
);
}
$fields->addFieldToTab("Root.Main",
$fields->addFieldToTab("Root.Main",
new LiteralField(
'VirtualPageMessage',
'<div class="message notice">' . implode('. ', $msgs) . '.</div>'
@ -233,7 +233,7 @@ class VirtualPage extends Page {
public function getSettingsFields() {
$fields = parent::getSettingsFields();
if(!$this->CopyContentFrom()->exists()) {
$fields->addFieldToTab("Root.Settings",
$fields->addFieldToTab("Root.Settings",
new LiteralField(
'VirtualPageWarning',
'<div class="message notice">'
@ -250,7 +250,7 @@ class VirtualPage extends Page {
return $fields;
}
/**
/**
* We have to change it to copy all the content from the original page first.
*/
public function onBeforeWrite() {
@ -303,7 +303,7 @@ class VirtualPage extends Page {
if(!$this->extension_instances['Versioned']->migratingVersion) {
if(
$this->isChanged('CopyContentFromID')
&& $this->CopyContentFromID != 0
&& $this->CopyContentFromID != 0
&& $this instanceof VirtualPage
) {
$this->updateImageTracking();
@ -352,8 +352,8 @@ class VirtualPage extends Page {
if(!$orig->stat('can_be_root') && !$this->ParentID) {
$result->error(
_t(
'VirtualPage.PageTypNotAllowedOnRoot',
'Original page type "{type}" is not allowed on the root level for this virtual page',
'VirtualPage.PageTypNotAllowedOnRoot',
'Original page type "{type}" is not allowed on the root level for this virtual page',
array('type' => $orig->i18n_singular_name())
),
'CAN_BE_ROOT_VIRTUAL'
@ -407,7 +407,7 @@ class VirtualPage extends Page {
* Allow attributes on the master page to pass
* through to the virtual page
*
* @param string $field
* @param string $field
* @return mixed
*/
public function __get($field) {
@ -423,7 +423,7 @@ class VirtualPage extends Page {
/**
* Pass unrecognized method calls on to the original data object
*
* @param string $method
* @param string $method
* @param string $args
* @return mixed
*/
@ -441,8 +441,8 @@ class VirtualPage extends Page {
*/
public function hasField($field) {
return (
array_key_exists($field, $this->record)
|| $this->hasDatabaseField($field)
array_key_exists($field, $this->record)
|| $this->hasDatabaseField($field)
|| array_key_exists($field, $this->db()) // Needed for composite fields
|| parent::hasMethod("get{$field}")
|| $this->CopyContentFrom()->hasField($field)
@ -451,8 +451,8 @@ class VirtualPage extends Page {
/**
* Overwrite to also check for method on the original data object
*
* @param string $method
* @return bool
* @param string $method
* @return bool
*/
public function hasMethod($method) {
if(parent::hasMethod($method)) return true;
@ -533,8 +533,8 @@ class VirtualPage_Controller extends Page_Controller {
/**
* Also check the original object's original controller for the method
*
* @param string $method
* @return bool
* @param string $method
* @return bool
*/
public function hasMethod($method) {
$haveIt = parent::hasMethod($method);
@ -551,7 +551,7 @@ class VirtualPage_Controller extends Page_Controller {
/**
* Pass unrecognized method calls on to the original controller
*
* @param string $method
* @param string $method
* @param string $args
* @return mixed
*

View File

@ -128,8 +128,8 @@ class BrokenLinksReport extends SS_Report {
'Draft' => _t('BrokenLinksReport.CheckSiteDropdownDraft', 'Draft Site')
)),
new DropdownField(
'Reason',
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
'Reason',
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
array(
'' => _t('BrokenLinksReport.Any', 'Any'),
'BROKENFILE' => _t('BrokenLinksReport.ReasonDropdownBROKENFILE', 'Broken file'),

View File

@ -1,13 +1,13 @@
<?php
/**
* Standard basic search form which conducts a fulltext search on all {@link SiteTree}
* objects.
* objects.
*
* If multilingual content is enabled through the {@link Translatable} extension,
* only pages the currently set language on the holder for this searchform are found.
* The language is set through a hidden field in the form, which is prepoluated
* with {@link Translatable::get_current_locale()} when then form is constructed.
*
*
* @see Use ModelController and SearchContext for a more generic search implementation based around DataObject
* @package cms
* @subpackage search
@ -32,7 +32,7 @@ class SearchForm extends Form {
);
/**
*
*
* @param Controller $controller
* @param string $name The name of the form (used in URL addressing)
* @param FieldList $fields Optional, defaults to a single field named "Search". Search logic needs to be customized
@ -66,7 +66,7 @@ class SearchForm extends Form {
/**
* Return a rendered version of this form.
*
*
* This is returned when you access a form as $FormObject rather
* than <% with FormObject %>
*/
@ -84,7 +84,7 @@ class SearchForm extends Form {
/**
* Set the classes to search.
* Currently you can only choose from "SiteTree" and "File", but a future version might improve this.
* Currently you can only choose from "SiteTree" and "File", but a future version might improve this.
*/
public function classesToSearch($classes) {
$illegalClasses = array_diff($classes, array('SiteTree', 'File'));
@ -101,13 +101,13 @@ class SearchForm extends Form {
* @return array
*/
public function getClassesToSearch() {
return $this->classesToSearch;
return $this->classesToSearch;
}
/**
* Return dataObjectSet of the results using $_REQUEST to get info from form.
* Wraps around {@link searchEngine()}.
*
*
* @param int $pageLength DEPRECATED 2.3 Use SearchForm->pageLength
* @param array $data Request data as an associative array. Should contain at least a key 'Search' with all searched keywords.
* @return SS_List
@ -193,7 +193,7 @@ class SearchForm extends Form {
/**
* Get the search query for display in a "You searched for ..." sentence.
*
*
* @param array $data
* @return string
*/
@ -207,7 +207,7 @@ class SearchForm extends Form {
/**
* Set the maximum number of records shown on each page.
*
*
* @param int $length
*/
public function setPageLength($length) {

View File

@ -4,7 +4,7 @@
#right form #deletemarked .middleColumn {
background: none;
}
.dragfile,
.dragfile,
.dragfile img {
float: left;
cursor: move;
@ -38,4 +38,4 @@ form#Form_AddForm .field span.readonly {
/* Same as .checkboxAboveTree */
border-top: 1px solid #CCCCCC;
padding: .5em;
}
}

View File

@ -1,3 +1,3 @@
div#SideReportsHolder {
clear: left;
}
}

View File

@ -41,4 +41,4 @@ included in the template due to a bug since 29/09/08 (r63175), and we can't find
font-size: 80%;
font-style: italic;
}
*/
*/

View File

@ -25,7 +25,7 @@
},
/**
* Function: drop
*
*
* Take selected files and move them to a folder target in the tree.
*/
drop: function(e, ui) {
@ -44,10 +44,10 @@
/**
* Function: getSelected
*
*
* Get the IDs of all selected files in the table.
* Used for drag'n'drop.
*
*
* Returns:
* Array
*/
@ -69,8 +69,8 @@
appendTo: 'body',
helper: function() {
return $(
'<div class="NumFilesIndicator">' +
ss.i18n.sprintf(ss.i18n._t('AssetTableField.MOVING'),container.getSelected().length) +
'<div class="NumFilesIndicator">'
ss.i18n.sprintf(ss.i18n._t('AssetTableField.MOVING'),container.getSelected().length)
'</div>'
);
}
@ -83,10 +83,10 @@
},
/**
* Function: onmousedown
*
*
* Parameters:
* (Event) e
*
*
* Automatically select the checkbox in the same table row
* to signify that this element is moved, and hint that
* all checkboxed elements will be moved along with it.

View File

@ -11,7 +11,7 @@
$(document).ready(function() {
$('#Form_BatchActionsForm').entwine('.ss.tree').register(
// TODO Hardcoding of base URL
'admin/assets/batchactions/delete',
'admin/assets/batchactions/delete',
function(ids) {
var confirmed = confirm(
ss.i18n.sprintf(
@ -55,7 +55,7 @@
msg = ss.i18n._t('AssetAdmin.ConfirmDelete');
} else {
msg = ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE');
}
}
if(!confirm(msg)) return false;
this.getGridField().reload({data: [{name: this.attr('name'), value: this.val()}]});
@ -94,7 +94,7 @@
/**
* Function: onsubmit
*
*
* Parameters:
* (Event) e
*/

View File

@ -44,7 +44,7 @@
* Similar implementation to LeftAndMain.Tree.js.
*/
updateTypeList: function() {
var hints = this.data('hints'),
var hints = this.data('hints'),
parentTree = this.find('#Form_AddForm_ParentID_Holder .TreeDropdownField'),
parentMode = this.find("input[name=ParentModeField]:checked").val(),
metadata = parentTree.data('metadata'),
@ -101,7 +101,7 @@
},
/**
* Update the selection filter with the given blacklist and default selection
*
*
* @param array disallowedChildren
* @param string defaultChildClass
*/
@ -109,7 +109,7 @@
// Limit selection
var allAllowed = null; // troolian
this.find('#Form_AddForm_PageType li').each(function() {
var className = $(this).find('input').val(),
var className = $(this).find('input').val(),
isAllowed = ($.inArray(className, disallowedChildren) === -1);
$(this).setEnabled(isAllowed);

View File

@ -17,7 +17,7 @@
/**
* Class: .cms-edit-form input[name=Title]
*
*
* Input validation on the Title field
*/
$('.cms-edit-form input[name=Title]').entwine({
@ -61,7 +61,7 @@
/**
* Function: updateRelatedFields
*
*
* Update the related fields if appropriate
* (String) title The new title
* (Stirng) origTitle The original title
@ -80,7 +80,7 @@
/**
* Function: updateURLSegment
*
*
* Update the URLSegment
* (String) title
*/
@ -96,7 +96,7 @@
/**
* Function: updateBreadcrumbLabel
*
*
* Update the breadcrumb
* (String) title
*/
@ -110,9 +110,9 @@
/**
* Function: _addActions
*
*
* Utility to add update from title action
*
*
*/
_addActions: function() {
var self = this;
@ -137,7 +137,7 @@
/**
* Class: .cms-edit-form .parentTypeSelector
*
*
* ParentID field combination - mostly toggling between
* the two radiobuttons and setting the hidden "ParentID" field
*/
@ -159,7 +159,7 @@
/**
* Function: _toggleSelection
*
*
* Parameters:
* (Event) e
*/
@ -175,7 +175,7 @@
/**
* Function: _changeParentId
*
*
* Parameters:
* (Event) e
*/
@ -188,7 +188,7 @@
/**
* Class: .cms-edit-form #CanViewType, .cms-edit-form #CanEditType
*
*
* Toggle display of group dropdown in "access" tab,
* based on selection of radiobuttons.
*/
@ -226,20 +226,20 @@
/**
* Class: .cms-edit-form .Actions #Form_EditForm_action_print
*
*
* Open a printable representation of the form in a new window.
* Used for readonly older versions of a specific page.
*/
$('.cms-edit-form .Actions #Form_EditForm_action_print').entwine({
/**
* Function: onclick
*
*
* Parameters:
* (Event) e
*/
onclick: function(e) {
var printURL = $(this[0].form).attr('action').replace(/\?.*$/,'')
+ '/printable/'
var printURL = $(this[0].form).attr('action').replace(/\?.*$/,'')
+ '/printable/'
+ $(':input[name=ID]',this[0].form).val();
if(printURL.substr(0,7) != 'http://') printURL = $('base').attr('href') + printURL;
@ -251,14 +251,14 @@
/**
* Class: .cms-edit-form .Actions #Form_EditForm_action_rollback
*
*
* A "rollback" to a specific version needs user confirmation.
*/
$('.cms-edit-form .Actions #Form_EditForm_action_rollback').entwine({
/**
* Function: onclick
*
*
* Parameters:
* (Event) e
*/
@ -266,7 +266,7 @@
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
if(version) {
message = ss.i18n.sprintf(
ss.i18n._t('CMSMain.RollbackToVersion'),
ss.i18n._t('CMSMain.RollbackToVersion'),
version
);
} else {
@ -282,21 +282,21 @@
/**
* Class: .cms-edit-form .Actions #Form_EditForm_action_archive
*
*
* Informing the user about the archive action while requiring confirmation
*/
$('.cms-edit-form .Actions #Form_EditForm_action_archive').entwine({
/**
* Function: onclick
*
*
* Parameters:
* (Event) e
*/
onclick: function(e) {
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
message = ss.i18n.sprintf(
ss.i18n._t('CMSMain.Archive'),
ss.i18n._t('CMSMain.Archive'),
version
);
if(confirm(message)) {
@ -309,14 +309,14 @@
/**
* Class: .cms-edit-form .Actions #Form_EditForm_action_restore
*
*
* Informing the user about the archive action while requiring confirmation
*/
$('.cms-edit-form .Actions #Form_EditForm_action_restore').entwine({
/**
* Function: onclick
*
*
* Parameters:
* (Event) e
*/
@ -326,7 +326,7 @@
message = '',
toRoot = this.data('toRoot');
message = ss.i18n.sprintf(
ss.i18n._t(toRoot ? 'CMSMain.RestoreToRoot' : 'CMSMain.Restore'),
ss.i18n._t(toRoot ? 'CMSMain.RestoreToRoot' : 'CMSMain.Restore'),
version
);
if(confirm(message)) {
@ -339,21 +339,21 @@
/**
* Class: .cms-edit-form .Actions #Form_EditForm_action_delete
*
*
* Informing the user about the delete from draft action while requiring confirmation
*/
$('.cms-edit-form .Actions #Form_EditForm_action_delete').entwine({
/**
* Function: onclick
*
*
* Parameters:
* (Event) e
*/
onclick: function(e) {
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
message = ss.i18n.sprintf(
ss.i18n._t('CMSMain.DeleteFromDraft'),
ss.i18n._t('CMSMain.DeleteFromDraft'),
version
);
if(confirm(message)) {
@ -372,14 +372,14 @@
/**
* Function: onclick
*
*
* Parameters:
* (Event) e
*/
onclick: function(e) {
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
message = ss.i18n.sprintf(
ss.i18n._t('CMSMain.Unpublish'),
ss.i18n._t('CMSMain.Unpublish'),
version
);
if(confirm(message)) {

View File

@ -1,8 +1,8 @@
(function($) {
/**
* File: CMSPageHistoryController.js
*
* Handles related interactions between the version selection form on the
*
* Handles related interactions between the version selection form on the
* left hand side of the panel and the version displaying on the right
* hand side.
*/
@ -32,7 +32,7 @@
* display based on whether we have two or 1 option selected
*
* Todo:
* Handle coupling to admin url
* Handle coupling to admin url
*/
onsubmit: function(e, d) {
e.preventDefault();
@ -116,7 +116,7 @@
* Selects or deselects the row (if in compare mode). Will trigger
* an update of the edit form if either selected (in single mode)
* or if this is the second row selected (in compare mode)
*/
*/
onclick: function(e) {
var compare, selected;
@ -153,9 +153,9 @@
},
/**
* Function: _unselect()
* Function: _unselect()
*
* Unselects the row from the form selection.
* Unselects the row from the form selection.
*/
_unselect: function() {
this.removeClass('active');

View File

@ -23,7 +23,7 @@
},
redraw: function() {
var field = this.find(':text'),
var field = this.find(':text'),
url = decodeURI(field.data('prefix') + field.val()),
previewUrl = url;
@ -87,7 +87,7 @@
/**
* Return a value matching the criteria.
*
*
* @param (String)
* @param (Function)
*/

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "إلغاء",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Storno",
"URLSEGMENT.UpdateURL": "Aktualizovat URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Abbrechen",
"URLSEGMENT.UpdateURL": "URL aktualisieren"
});
}
}

View File

@ -42,4 +42,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Άκυρο"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Cancel",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Rezigni",
"URLSEGMENT.UpdateURL": "Ĝisdatigi je URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Cancelar",
"URLSEGMENT.UpdateURL": "Actualizar URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "لغو",
"URLSEGMENT.UpdateURL": "به روز رسانی URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Peruuta",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Annuler",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Mégsem",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Batal",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Hætta við",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Annulla",
"URLSEGMENT.UpdateURL": "Aggiornare l'URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "キャンセル",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "취소",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Atšaukti",
"URLSEGMENT.UpdateURL": "Atnaujinti URL dalį"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Whakakore",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Avbryt",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Annuleren",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Anuluj",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Renunţare",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Отмена",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Zrušiť",
"URLSEGMENT.UpdateURL": "Aktualizovať URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Prekliči",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Одустани",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Odustani",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "موافق",
"URLSEGMENT.Cancel": "إلغاء",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Storno",
"URLSEGMENT.UpdateURL": "Aktualizovat URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Abbrechen",
"URLSEGMENT.UpdateURL": "URL aktualisieren"
}
}

View File

@ -36,4 +36,4 @@
"URLSEGMENT.Edit": "Επεξεργασία",
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Άκυρο"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Cancel",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "Akcepti",
"URLSEGMENT.Cancel": "Rezigni",
"URLSEGMENT.UpdateURL": "Ĝisdatigi je URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "Ok",
"URLSEGMENT.Cancel": "Cancelar",
"URLSEGMENT.UpdateURL": "Actualizar URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "تایید",
"URLSEGMENT.Cancel": "لغو",
"URLSEGMENT.UpdateURL": "به روز رسانی URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Peruuta",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "Ok",
"URLSEGMENT.Cancel": "Annuler",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Mégsem",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Batal",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "Allt í lagi",
"URLSEGMENT.Cancel": "Hætta við",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Annulla",
"URLSEGMENT.UpdateURL": "Aggiornare l'URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "キャンセル",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "취소",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "Gerai",
"URLSEGMENT.Cancel": "Atšaukti",
"URLSEGMENT.UpdateURL": "Atnaujinti URL dalį"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "ĀE",
"URLSEGMENT.Cancel": "Whakakore",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Avbryt",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Annuleren",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Anuluj",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Renunţare",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "ОК",
"URLSEGMENT.Cancel": "Отмена",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Zrušiť",
"URLSEGMENT.UpdateURL": "Aktualizovať URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Prekliči",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "У реду",
"URLSEGMENT.Cancel": "Одустани",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "U redu",
"URLSEGMENT.Cancel": "Odustani",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "OK",
"URLSEGMENT.Cancel": "Avbryt",
"URLSEGMENT.UpdateURL": "Uppdatera URL"
}
}

View File

@ -42,4 +42,4 @@
"URLSEGMENT.OK": "确定",
"URLSEGMENT.Cancel": "取消",
"URLSEGMENT.UpdateURL": "Update URL"
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "Avbryt",
"URLSEGMENT.UpdateURL": "Uppdatera URL"
});
}
}

View File

@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
"URLSEGMENT.Cancel": "取消",
"URLSEGMENT.UpdateURL": "Update URL"
});
}
}

View File

@ -2,7 +2,7 @@
.cms-content-fields {
.cms-edit-form.AssetAdmin {
width: 100%;
overflow-y:auto; //adds scrolling only to the datagrid
overflow-y:auto; //adds scrolling only to the datagrid
}
/**
@ -60,5 +60,5 @@
}
}
}
}
}

View File

@ -1,7 +1,7 @@
/**
* Style custom to the CMSMain admin interface. CMSMain extends the built in
* SilverStripe admin section styles. As much as possible we want to use those
* built in styles. If anything in this file can be implemented in a generic
* Style custom to the CMSMain admin interface. CMSMain extends the built in
* SilverStripe admin section styles. As much as possible we want to use those
* built in styles. If anything in this file can be implemented in a generic
* way then it should be include in the admin scss files.
*
* @package cms
@ -123,4 +123,4 @@
#Form_EditForm #Title .update {
margin-left: 7px;
}
}

View File

@ -1,9 +1,9 @@
/**
* This file is the central collection of included modules, links to custom SCSS files,
* and any global SCSS variable definitions.
*
*
* DO NOT ADD stylesheet rules to this file directly!
*
*
* Note: By prefixing files with an underscore, they won't create individual CSS files.
*/

View File

@ -5,7 +5,7 @@
* Shows the pages to an administrator, who can then
* decide which pages to remove by ticking a checkbox
* and manually executing the removal.
*
*
* Caution: Pages also count as orphans if they don't
* have parents in this stage, even if the parent has a representation
* in the other stage:
@ -16,7 +16,7 @@
* before and after orphan removal.
*
* @author Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
*
*
* @package cms
* @subpackage tasks
*/
@ -87,13 +87,13 @@ in the other stage:<br />
$latestAuthor = DataObject::get_by_id('Member', $latestVersion->AuthorID);
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
$stageRecord = Versioned::get_one_by_stage(
$this->orphanedSearchClass,
$this->orphanedSearchClass,
'Stage',
array("\"$orphanBaseClass\".\"ID\"" => $orphan->ID)
);
$liveRecord = Versioned::get_one_by_stage(
$this->orphanedSearchClass,
'Live',
$this->orphanedSearchClass,
'Live',
array("\"$orphanBaseClass\".\"ID\"" => $orphan->ID)
);
$label = sprintf(
@ -125,11 +125,11 @@ in the other stage:<br />
)
));
$fields->push(new OptionSetField(
'OrphanOperation',
'OrphanOperation',
_t('RemoveOrphanedPagesTask.CHOOSEOPERATION', 'Choose operation:'),
array(
'rebase' => _t(
'RemoveOrphanedPagesTask.OPERATION_REBASE',
'RemoveOrphanedPagesTask.OPERATION_REBASE',
sprintf(
'Rebase selected to a new holder page "%s" and unpublish. None of these pages will show up for website visitors.',
$this->rebaseHolderTitle()
@ -143,7 +143,7 @@ in the other stage:<br />
'Warning',
sprintf('<p class="message">%s</p>',
_t(
'RemoveOrphanedPagesTask.DELETEWARNING',
'RemoveOrphanedPagesTask.DELETEWARNING',
'Warning: These operations are not reversible. Please handle with care.'
)
)
@ -216,8 +216,8 @@ in the other stage:<br />
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
foreach($orphanIDs as $id) {
$stageRecord = Versioned::get_one_by_stage(
$this->orphanedSearchClass,
'Stage',
$this->orphanedSearchClass,
'Stage',
array("\"$orphanBaseClass\".\"ID\"" => $id)
);
if($stageRecord) {
@ -227,8 +227,8 @@ in the other stage:<br />
unset($stageRecord);
}
$liveRecord = Versioned::get_one_by_stage(
$this->orphanedSearchClass,
'Live',
$this->orphanedSearchClass,
'Live',
array("\"$orphanBaseClass\".\"ID\"" => $id)
);
if($liveRecord) {
@ -258,7 +258,7 @@ in the other stage:<br />
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
foreach($orphanIDs as $id) {
$stageRecord = Versioned::get_one_by_stage(
$this->orphanedSearchClass,
$this->orphanedSearchClass,
'Stage',
array("\"$orphanBaseClass\".\"ID\"" => $id)
);
@ -273,7 +273,7 @@ in the other stage:<br />
//unset($stageRecord);
}
$liveRecord = Versioned::get_one_by_stage(
$this->orphanedSearchClass,
$this->orphanedSearchClass,
'Live',
array("\"$orphanBaseClass\".\"ID\"" => $id)
);
@ -298,7 +298,7 @@ in the other stage:<br />
/**
* Gets all orphans from "Stage" and "Live" stages.
*
*
* @param string $class
* @param array $filter
* @param string $sort

View File

@ -18,14 +18,14 @@ class SiteTreeMaintenanceTask extends Controller {
$page->write();
if($urlSegment != $page->URLSegment) {
echo _t(
'SiteTree.LINKSCHANGEDTO',
" changed {url1} -> {url2}",
'SiteTree.LINKSCHANGEDTO',
" changed {url1} -> {url2}",
array('url1' => $urlSegment, 'url2' => $page->URLSegment)
);
}
else {
echo _t(
'SiteTree.LINKSALREADYUNIQUE',
'SiteTree.LINKSALREADYUNIQUE',
" {url} is already unique",
array('url' => $urlSegment)
);

View File

@ -11,4 +11,4 @@
$Form
</div>
</body>
</html>
</html>

View File

@ -1,3 +1,3 @@
<div class="message $Classes">
<p>$Content</p>
</div>
</div>

View File

@ -20,4 +20,4 @@
</tr>
<% end_loop %>
</tbody>
</table>
</table>

View File

@ -27,4 +27,4 @@
</div>
<% end_if %>
</form>
</form>

View File

@ -25,4 +25,4 @@
</div>
</div>
</div>
</div>

View File

@ -22,4 +22,4 @@
$ListViewForm
</div>
<% end_if %>
</div>
</div>

View File

@ -3,4 +3,4 @@
<div class="cms-panel-content cms-helper-hide-actions center">
$VersionsForm
</div>
</div>
</div>

View File

@ -38,4 +38,4 @@
</div>
</div>
</div>

View File

@ -18,4 +18,4 @@
&nbsp; &nbsp; <%t ContentController.Email "Email" %>: $Username<br />
&nbsp; &nbsp; <%t ContentController.Password "Password" %>: $Password<br />
</p>
<% end_if %>
<% end_if %>

View File

@ -23,4 +23,4 @@
<% end_with %>
<% include TableListField %>
</body>
</html>
</html>

View File

@ -1,4 +1,4 @@
&nbsp; &nbsp;
&nbsp; &nbsp;
<a id="SilverStripeNavigatorLink" href="#">
<% _t('SilverStripeNavigatorLink.ShareLink','Share link') %>
</a>

View File

@ -1,3 +1,3 @@
<% _t('ViewArchivedEmail_ss.HAVEASKED','You have asked to view the content of our site on',30,'Followed by a date') %> $ArchiveDate.Date
<% _t('ViewArchivedEmail_ss.CANACCESS','You can access the archived site at this link:') %> $ArchiveURL
<% _t('ViewArchivedEmail_ss.CANACCESS','You can access the archived site at this link:') %> $ArchiveURL

View File

@ -15,4 +15,4 @@
<% _t('URLSegmentField.Cancel', 'Cancel') %>
</button>
<% if $HelpText %><p class="help">$HelpText</p><% end_if %>
</div>
</div>

View File

@ -30,4 +30,4 @@ saucelabs:
capabilities:
platform: "Windows 2008"
browser: "firefox"
version: "15"
version: "15"

View File

@ -47,7 +47,7 @@ class FeatureContext extends \SilverStripe\Framework\Test\Behaviour\FeatureConte
$obj->publish('Stage', 'Live');
});
$factory->define($class, $blueprint);
}
}
}
}

View File

@ -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) )"(?<type>[^"]+)" "(?<id>[^"]+)" (:?which )?redirects to (?:(an|a|the) )"(?<targetType>[^"]+)" "(?<targetId>[^"]+)"$/
*/
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'),

View File

@ -26,7 +26,7 @@ class ThemeContext extends BehatContext {
/**
* Create a test theme
*
*
* @Given /^a theme "(?<theme>[^"]+)"/
*/
public function stepCreateTheme($theme) {
@ -39,7 +39,7 @@ class ThemeContext extends BehatContext {
/**
* Create a template within a test theme
*
*
* @Given /^a template "(?<template>[^"]+)" in theme "(?<theme>[^"]+)" with content "(?<content>[^"]+)"/
*/
public function stepCreateTemplate($template, $theme, $content) {
@ -76,7 +76,7 @@ class ThemeContext extends BehatContext {
/**
* Clean up any theme manipulation
*
*
* @AfterScenario
*/
public function cleanThemesAfterScenario() {

View File

@ -118,7 +118,7 @@ class CMSMainTest extends FunctionalTest {
$this->assertArrayHasKey($page2->ID, $responseData['modified']);
}
// Get the latest version of the redirector page
// Get the latest version of the redirector page
$pageID = $this->idFromFixture('RedirectorPage', 'page5');
$latestID = DB::prepared_query('select max("Version") from "RedirectorPage_versions" where "RecordID" = ?', array($pageID))->value();
$dsCount = DB::prepared_query('select count("Version") from "RedirectorPage_versions" where "RecordID" = ? and "Version"= ?', array($pageID, $latestID))->value();

View File

@ -21,7 +21,7 @@ class CMSPageHistoryControllerTest extends FunctionalTest {
$this->page = new Page();
$this->page->URLSegment = "test";
$this->page->Content = "new content";
$this->page->write();
$this->page->write();
$this->versionUnpublishedCheck = $this->page->Version;
$this->page->Content = "some further content";

View File

@ -7,4 +7,4 @@ Page:
Sort: 2
page3:
Title: Page 3
Sort: 3
Sort: 3

View File

@ -91,8 +91,8 @@ class CMSSiteTreeFilterTest extends SapphireTest {
$deletedPageID = $deletedPage->ID;
$deletedPage->delete();
$deletedPage = Versioned::get_one_by_stage(
'SiteTree',
'Live',
'SiteTree',
'Live',
array('"SiteTree_Live"."ID"' => $deletedPageID)
);
@ -108,8 +108,8 @@ class CMSSiteTreeFilterTest extends SapphireTest {
$draftPage = $this->objFromFixture('Page', 'page4');
$draftPage->publish('Stage', 'Stage');
$draftPage = Versioned::get_one_by_stage(
'SiteTree',
'Stage',
'SiteTree',
'Stage',
sprintf('"SiteTree"."ID" = %d', $draftPage->ID)
);
@ -144,8 +144,8 @@ class CMSSiteTreeFilterTest extends SapphireTest {
$removedDraftPage->doPublish();
$removedDraftPage->deleteFromStage('Stage');
$removedDraftPage = Versioned::get_one_by_stage(
'SiteTree',
'Live',
'SiteTree',
'Live',
sprintf('"SiteTree"."ID" = %d', $removedDraftPage->ID)
);

View File

@ -13,9 +13,9 @@ Page:
page6:
Title: Page 6
page7:
Title: Page 7
Title: Page 7
page7a:
Parent: =>Page.page7
Parent: =>Page.page7
Title: Page 7a
page2a:
Parent: =>Page.page2
@ -28,4 +28,4 @@ Page:
Title: Page 3a
page3b:
Parent: =>Page.page3
Title: Page 3b
Title: Page 3b

View File

@ -34,7 +34,7 @@ class ContentControllerPermissionsTest extends FunctionalTest {
// should redirect to login
$this->assertEquals($response->getStatusCode(), 302, 'Redirects to login page when not logged in for draft stage');
$this->assertContains(
Config::inst()->get('Security', 'login_url'),
Config::inst()->get('Security', 'login_url'),
$response->getHeader('Location')
);

View File

@ -6,9 +6,9 @@ class ContentControllerSearchExtensionTest extends SapphireTest {
$page->URLSegment = 'whatever';
$page->Content = 'oh really?';
$page->write();
$page->publish('Stage', 'Live');
$page->publish('Stage', 'Live');
$controller = new ContentController($page);
$form = $controller->SearchForm();
$form = $controller->SearchForm();
if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch());
}

View File

@ -4,13 +4,13 @@
* @subpackage tests
*/
class ContentControllerTest extends FunctionalTest {
protected static $fixture_file = 'ContentControllerTest.yml';
protected static $use_draft_site = true;
protected static $disable_themes = true;
/**
* Test that nested pages, basic actions, and nested/non-nested URL switching works properly
*/
@ -93,7 +93,7 @@ class ContentControllerTest extends FunctionalTest {
}
public function testViewDraft(){
// test when user does not have permission, should get login form
$this->logInWithPermission('EDITOR');
try {
@ -103,21 +103,21 @@ class ContentControllerTest extends FunctionalTest {
}
$this->assertEquals('403', $response->getstatusCode());
// test when user does have permission, should show page title and header ok.
$this->logInWithPermission('ADMIN');
$this->assertEquals('200', $this->get('/contact/?stage=Stage')->getstatusCode());
}
public function testLinkShortcodes() {
$linkedPage = new SiteTree();
$linkedPage->URLSegment = 'linked-page';
$linkedPage->write();
$linkedPage->publish('Stage', 'Live');
$page = new SiteTree();
$page->URLSegment = 'linking-page';
$page->Content = sprintf('<a href="[sitetree_link,id=%s]">Testlink</a>', $linkedPage->ID);
@ -129,7 +129,7 @@ class ContentControllerTest extends FunctionalTest {
$this->get($page->RelativeLink())->getBody(),
'"sitetree_link" shortcodes get parsed properly'
);
}
}
/**
@ -138,7 +138,7 @@ class ContentControllerTest extends FunctionalTest {
* @covers ContentController::getViewer()
**/
public function testGetViewer() {
$self = $this;
$this->useTestTheme(dirname(__FILE__), 'controllertest', function() use ($self) {

View File

@ -3,14 +3,14 @@ Group:
Title: Editors
admins:
Title: Administrators
Permission:
admins:
Code: VIEW_DRAFT_CONTENT
Group: =>Group.admins
editors:
Group: =>Group.editors
Member:
editor:
FirstName: Test
@ -43,4 +43,4 @@ ContentControllerTest_Page:
URLSegment: contact
CanViewType: OnlyTheseUsers
EditorGroups: =>Group.admins

View File

@ -14,8 +14,8 @@ class ModelAsControllerTest extends FunctionalTest {
protected $orig = array();
/**
* New tests require nested urls to be enabled, but the site might not
* support nested URLs.
* New tests require nested urls to be enabled, but the site might not
* support nested URLs.
* This setup will enable nested-urls for this test and resets the state
* after the tests have been performed.
*/
@ -27,8 +27,8 @@ class ModelAsControllerTest extends FunctionalTest {
}
/**
* New tests require nested urls to be enabled, but the site might not
* support nested URLs.
* New tests require nested urls to be enabled, but the site might not
* support nested URLs.
* This setup will enable nested-urls for this test and resets the state
* after the tests have been performed.
*/
@ -81,14 +81,14 @@ class ModelAsControllerTest extends FunctionalTest {
* all pages will be found by their old segments.
*
* NOTE: This test requires nested_urls
*
*
* Original: level1/level2/level3
* Republished as: newlevel1/newlevel2/newlevel3
*/
public function testRedirectsNestedRenamedPages(){
$this->generateNestedPagesFixture();
// check a first level URLSegment
// check a first level URLSegment
$response = $this->get('level1/action');
$this->assertEquals($response->getStatusCode(),301);
$this->assertEquals(
@ -96,7 +96,7 @@ class ModelAsControllerTest extends FunctionalTest {
$response->getHeader('Location')
);
// check second level URLSegment
// check second level URLSegment
$response = $this->get('newlevel1/level2');
$this->assertEquals($response->getStatusCode(),301 );
$this->assertEquals(
@ -104,7 +104,7 @@ class ModelAsControllerTest extends FunctionalTest {
$response->getHeader('Location')
);
// check third level URLSegment
// check third level URLSegment
$response = $this->get('newlevel1/newlevel2/level3');
$this->assertEquals($response->getStatusCode(), 301);
$this->assertEquals(
@ -199,7 +199,7 @@ class ModelAsControllerTest extends FunctionalTest {
$response = $this->get('newlevel1/otherparent');
$this->assertEquals(
$response->getStatusCode(),
$response->getStatusCode(),
404,
'Requesting an unrelated page on a renamed parent should be interpreted as a missing action, not a redirect'
);
@ -208,12 +208,12 @@ class ModelAsControllerTest extends FunctionalTest {
/**
*
* NOTE: This test requires nested_urls
*
*
*/
public function testRedirectsNestedRenamedPagesWithGetParameters() {
$this->generateNestedPagesFixture();
// check third level URLSegment
// check third level URLSegment
$response = $this->get('newlevel1/newlevel2/level3/?foo=bar&test=test');
$this->assertEquals($response->getStatusCode(), 301);
$this->assertEquals(
@ -225,7 +225,7 @@ class ModelAsControllerTest extends FunctionalTest {
/**
*
* NOTE: This test requires nested_urls
*
*
*/
public function testDoesntRedirectToNestedRenamedPageWhenNewExists() {
$this->generateNestedPagesFixture();
@ -239,14 +239,14 @@ class ModelAsControllerTest extends FunctionalTest {
$response = $this->get('level1');
$this->assertEquals(
$response->getStatusCode(),
$response->getStatusCode(),
200
);
$response = $this->get('level1/newlevel2');
$this->assertEquals(
$response->getStatusCode(),
404,
$response->getStatusCode(),
404,
'The old newlevel2/ URLSegment is checked as an action on the new page, which shouldnt exist.'
);
}
@ -254,7 +254,7 @@ class ModelAsControllerTest extends FunctionalTest {
/**
*
* NOTE: This test requires nested_urls
*
*
*/
public function testFindOldPage(){
$page = new Page();

View File

@ -15,4 +15,4 @@ Page:
page3:
Title: Third Page
URLSegment: page3
HomepageForDomain: only.com
HomepageForDomain: only.com

View File

@ -1 +1 @@
ContentControllerTestPageWithoutController
ContentControllerTestPageWithoutController

View File

@ -1 +1 @@
ContentControllerTestPage_test
ContentControllerTestPage_test

View File

@ -1 +1 @@
Controller
Controller

View File

@ -1 +1 @@
Page
Page

View File

@ -1 +1 @@
$Layout
$Layout

View File

@ -8,4 +8,4 @@ ErrorPage:
Title: Permission Failure
URLSegment: permission-denied
Content: You do not have permission to view this page
ErrorCode: 403
ErrorCode: 403

View File

@ -3,8 +3,8 @@ File:
file1:
Filename: assets/testscript-test-file.pdf
Page:
Page:
page1:
Title: page1
URLSegment: page1
Content: <p><img src="assets/testscript-test-file.pdf" /></p>
Content: <p><img src="assets/testscript-test-file.pdf" /></p>

View File

@ -31,7 +31,7 @@ RedirectorPage:
Title: Reflexive
RedirectionType: Internal
LinkTo: =>RedirectorPage.reflexive
URLSegment: reflexive
URLSegment: reflexive
transitive:
Title: Transitive
RedirectionType: Internal

View File

@ -8,7 +8,7 @@
* - action_deletefromlive
* - action_rollback
* - action_revert
*
*
* @package cms
* @subpackage tests
*/

View File

@ -30,4 +30,4 @@ Member:
Groups: =>Group.cmsreadonly
cmsnodeleteeditor:
Email: cmsnodeleteeditor@test.com
Groups: =>Group.cmsnodelete
Groups: =>Group.cmsnodelete

View File

@ -1,4 +1,4 @@
Page:
Page:
page1:
ID: 1
Title: page1
@ -13,5 +13,5 @@ Page:
URLSegment: page3
Content: '<p><a href="[sitetree_link,id=1]">Testing page 1 link</a></p>'
LinkTracking: =>Page.page1

View File

@ -107,7 +107,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
// Confirm no broken link
$this->assertEquals(0, (int)$linkSrc->HasBrokenLink);
$this->assertEquals(0, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
$this->assertEquals(0, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
WHERE \"ID\" = $linkSrc->ID")->value());
// Delete page from draft
@ -119,7 +119,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
$linkSrc = $this->objFromFixture('Page', 'content');
$this->assertEquals(1, (int)$linkSrc->HasBrokenLink);
$this->assertEquals(0, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
$this->assertEquals(0, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
WHERE \"ID\" = $linkSrc->ID")->value());
// Delete from live
@ -131,7 +131,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
$linkSrc = $this->objFromFixture('Page', 'content');
$this->assertEquals(1, (int)$linkSrc->HasBrokenLink);
$this->assertEquals(1, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
$this->assertEquals(1, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
WHERE \"ID\" = $linkSrc->ID")->value());
}
@ -147,12 +147,12 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
$linkSrc->Content = "<p><a href=\"[sitetree_link,id=$linkDest->ID]\">about us</a></p>";
$linkSrc->write();
// Publish the source of the link, while the dest is still unpublished.
// Publish the source of the link, while the dest is still unpublished.
$linkSrc->doPublish();
// Verify that the link isn't broken on draft but is broken on published
$this->assertEquals(0, (int)$linkSrc->HasBrokenLink);
$this->assertEquals(1, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
$this->assertEquals(1, DB::query("SELECT \"HasBrokenLink\" FROM \"SiteTree_Live\"
WHERE \"ID\" = $linkSrc->ID")->value());
}

View File

@ -24,4 +24,4 @@ File:
ErrorPage:
404:
Title: Page not Found
ErrorCode: 404
ErrorCode: 404

View File

@ -2,7 +2,7 @@
/**
* @package cms
* @subpackage tests
*
*
* @todo Test canAddChildren()
* @todo Test canCreate()
*/
@ -47,7 +47,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
}
$this->assertEquals($response->getStatusCode(), '302');
$this->assertContains(
Config::inst()->get('Security', 'login_url'),
Config::inst()->get('Security', 'login_url'),
$response->getHeader('Location')
);

View File

@ -85,4 +85,4 @@ Page:
URLSegment: deleteTestChildPage
draftOnlyPage:
CanViewType: Anyone
URLSegment: draft-only
URLSegment: draft-only

View File

@ -413,7 +413,7 @@ class SiteTreeTest extends SapphireTest {
Versioned::reading_stage('Stage');
Config::inst()->update('SiteTree', 'enforce_strict_hierarchy', true);
}
public function testDeleteFromLiveOperatesRecursivelyStrict() {
$this->logInWithPermission('ADMIN');
@ -1196,7 +1196,7 @@ class SiteTreeTest_Conflicted_Controller extends Page_Controller implements Test
return parent::hasActionTemplate($template);
}
}
}
class SiteTreeTest_NullHtmlCleaner extends HTMLCleaner {
@ -1214,7 +1214,7 @@ class SiteTreeTest_ClassA extends Page implements TestOnly {
class SiteTreeTest_ClassB extends Page implements TestOnly {
// Also allowed subclasses
private static $allowed_children = array('SiteTreeTest_ClassC');
private static $allowed_children = array('SiteTreeTest_ClassC');
}
class SiteTreeTest_ClassC extends Page implements TestOnly {

View File

@ -275,7 +275,7 @@ class VirtualPageTest extends FunctionalTest {
$this->assertEquals($vp->ID, DB::query("SELECT \"RecordID\" FROM \"SiteTree_versions\"
WHERE \"RecordID\" = $vp->ID AND \"Title\" = 'T1'")->value());
$this->assertEquals($vp->ID, DB::query("SELECT \"RecordID\" FROM \"SiteTree_versions\"
$this->assertEquals($vp->ID, DB::query("SELECT \"RecordID\" FROM \"SiteTree_versions\"
WHERE \"RecordID\" = $vp->ID AND \"Title\" = 'T2'")->value());
$this->assertEquals($vp->ID, DB::query("SELECT \"RecordID\" FROM \"SiteTree_versions\"
WHERE \"RecordID\" = $vp->ID AND \"Version\" = $vp->Version")->value());
@ -286,12 +286,12 @@ class VirtualPageTest extends FunctionalTest {
// version
$liveVersion = DB::query("SELECT \"Version\" FROM \"SiteTree_Live\" WHERE \"ID\" = $vp->ID")->value();
$this->assertEquals("T0", DB::query("SELECT \"Title\" FROM \"SiteTree_Live\"
$this->assertEquals("T0", DB::query("SELECT \"Title\" FROM \"SiteTree_Live\"
WHERE \"ID\" = $vp->ID")->value());
// SiteTree_Live.Version should reference a legal entry in SiteTree_versions for the
// virtual page
$this->assertEquals("T0", DB::query("SELECT \"Title\" FROM \"SiteTree_versions\"
$this->assertEquals("T0", DB::query("SELECT \"Title\" FROM \"SiteTree_versions\"
WHERE \"RecordID\" = $vp->ID AND \"Version\" = $liveVersion")->value());
}
@ -422,12 +422,12 @@ class VirtualPageTest extends FunctionalTest {
$virtual->copyFrom($original);
// Using getField() to avoid side effects from an overloaded __get()
$this->assertEquals(
'original',
'original',
$virtual->getField('MyInitiallyCopiedField'),
'Fields listed in $initially_copied_fields are copied on first copyFrom() invocation'
);
$this->assertEquals(
'original',
'original',
$virtual->getField('MyVirtualField'),
'Fields not listed in $initially_copied_fields are copied in copyFrom()'
);
@ -440,7 +440,7 @@ class VirtualPageTest extends FunctionalTest {
$original->write();
$virtual->copyFrom($original);
$this->assertEquals(
'original',
'original',
$virtual->MyInitiallyCopiedField,
'Fields listed in $initially_copied_fields are not copied on subsequent copyFrom() invocations'
);
@ -466,8 +466,8 @@ class VirtualPageTest extends FunctionalTest {
$virtual->Title = 'changed 1';
$virtual->writeWithoutVersion();
$this->assertEquals(
$virtual->Version,
$virtualVersion,
$virtual->Version,
$virtualVersion,
'writeWithoutVersion() on VirtualPage doesnt increment version'
);
@ -477,8 +477,8 @@ class VirtualPageTest extends FunctionalTest {
DataObject::flush_and_destroy_cache();
$virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false);
$this->assertEquals(
$virtual->Version,
$virtualVersion,
$virtual->Version,
$virtualVersion,
'writeWithoutVersion() on original page doesnt increment version on related VirtualPage'
);
@ -487,8 +487,8 @@ class VirtualPageTest extends FunctionalTest {
DataObject::flush_and_destroy_cache();
$virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false);
$this->assertGreaterThan(
$virtualVersion,
$virtual->Version,
$virtualVersion,
$virtual->Version,
'write() on original page does increment version on related VirtualPage'
);
}
@ -500,7 +500,7 @@ class VirtualPageTest extends FunctionalTest {
$notRootPage = new VirtualPageTest_NotRoot();
// we don't want the original on root, but rather the VirtualPage pointing to it
$notRootPage->ParentID = $page->ID;
$notRootPage->ParentID = $page->ID;
$notRootPage->write();
$virtual = new VirtualPage();
@ -517,7 +517,7 @@ class VirtualPageTest extends FunctionalTest {
} catch(ValidationException $e) {
$this->assertContains('is not allowed on the root level', $e->getMessage());
$isDetected = true;
}
}
if(!$isDetected) $this->fail('Fails validation with $can_be_root=false');
}
@ -645,7 +645,7 @@ class VirtualPageTest extends FunctionalTest {
} catch(ValidationException $e) {
$this->assertContains('not allowed as child of this parent page', $e->getMessage());
$isDetected = true;
}
}
if(!$isDetected) $this->fail("Shouldn't be allowed to write a VirtualPage that links to a disallowed child");
}
@ -682,7 +682,7 @@ class VirtualPageTest_ClassA extends Page implements TestOnly {
}
class VirtualPageTest_ClassB extends Page implements TestOnly {
private static $allowed_children = array('VirtualPageTest_ClassC');
private static $allowed_children = array('VirtualPageTest_ClassC');
}
class VirtualPageTest_ClassC extends Page implements TestOnly {

View File

@ -14,4 +14,4 @@ VirtualPage:
vp2:
CopyContentFrom: =>Page.master
Parent: =>Page.holder

View File

@ -2,4 +2,4 @@ SiteTree:
after:
Title: after
before:
Title: before
Title: before

View File

@ -2,10 +2,10 @@
/**
* @package cms
* @subpackage testing
*
*
* @todo Fix unpublished pages check in testPublishedPagesMatchedByTitle()
* @todo All tests run on unpublished pages at the moment, due to the searchform not distinguishing between them
*
*
* Because this manipulates the test database in severe ways, I've renamed the test to force it to run last...
*/
class ZZZSearchFormTest extends FunctionalTest {

View File

@ -40,4 +40,4 @@ File:
ShowInSearch: 1
dontShowInSearchFile:
Title: dontShowInSearchFile
ShowInSearch: 0
ShowInSearch: 0

View File

@ -58,7 +58,7 @@ class MigrateSiteTreeLinkingTaskTest extends SapphireTest {
'HTML URLSegment links are rewritten.'
);
$this->assertEquals (
$aboutContent,
$aboutContent,
DataObject::get_by_id('SiteTree', $aboutID)->Content
);
$this->assertEquals (

View File

@ -14,7 +14,7 @@
* parent2
* child2_1_published_orphaned // is orphaned because parent is not published
* </code>
*
*
* <h2>Cleaned up tree</h2>
* <code>
* parent1_published
@ -24,9 +24,9 @@
* child2_1_published_orphaned
* parent2
* </code>
*
*
* @author Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
*
*
* @package cms
* @subpackage tests
*/

View File

@ -29,4 +29,4 @@ Page:
Title: Parent2
child2_1_published_orphaned:
Title: Child2.1
Parent: =>Page.parent2
Parent: =>Page.parent2