mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
ca4752eca3
commit
bbc3aaaf9f
@ -41,7 +41,7 @@ before_script:
|
|||||||
- php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST
|
- php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST
|
||||||
- php ~/travis-support/travis_setup_php54_webserver.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\" = \"\" ]; then vendor/bin/phpunit cms/tests; fi"
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi"
|
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi"
|
||||||
|
|
||||||
|
@ -23,4 +23,4 @@ CMSMenu::remove_menu_item('CMSPageReportsController');
|
|||||||
CMSMenu::remove_menu_item('CMSPageAddController');
|
CMSMenu::remove_menu_item('CMSPageAddController');
|
||||||
CMSMenu::remove_menu_item('CMSFileAddController');
|
CMSMenu::remove_menu_item('CMSFileAddController');
|
||||||
|
|
||||||
CMSMenu::remove_menu_item("SiteConfigLeftAndMain");
|
CMSMenu::remove_menu_item("SiteConfigLeftAndMain");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Publish items batch action.
|
* Publish items batch action.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage batchaction
|
* @subpackage batchaction
|
||||||
*/
|
*/
|
||||||
@ -23,7 +23,7 @@ class CMSBatchAction_Publish extends CMSBatchAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unpublish items batch action.
|
* Unpublish items batch action.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage batchaction
|
* @subpackage batchaction
|
||||||
*/
|
*/
|
||||||
@ -116,7 +116,7 @@ class CMSBatchAction_Restore extends CMSBatchAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete items batch action.
|
* Delete items batch action.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage batchaction
|
* @subpackage batchaction
|
||||||
* @deprecated since version 4.0
|
* @deprecated since version 4.0
|
||||||
@ -141,7 +141,7 @@ class CMSBatchAction_Delete extends CMSBatchAction {
|
|||||||
if($page->canDelete()) $page->delete();
|
if($page->canDelete()) $page->delete();
|
||||||
else $status['error'][$page->ID] = true;
|
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
|
// if it doesn't remove the tree node
|
||||||
$liveRecord = Versioned::get_one_by_stage( 'SiteTree', 'Live', array(
|
$liveRecord = Versioned::get_one_by_stage( 'SiteTree', 'Live', array(
|
||||||
'"SiteTree"."ID"' => $id
|
'"SiteTree"."ID"' => $id
|
||||||
@ -166,7 +166,7 @@ class CMSBatchAction_Delete extends CMSBatchAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unpublish (delete from live site) items batch action.
|
* Unpublish (delete from live site) items batch action.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage batchaction
|
* @subpackage batchaction
|
||||||
* @deprecated since version 4.0
|
* @deprecated since version 4.0
|
||||||
|
@ -83,7 +83,7 @@ class CMSFileAddController extends LeftAndMain {
|
|||||||
asort($exts);
|
asort($exts);
|
||||||
$uploadField->Extensions = implode(', ', $exts);
|
$uploadField->Extensions = implode(', ', $exts);
|
||||||
|
|
||||||
$form = CMSForm::create(
|
$form = CMSForm::create(
|
||||||
$this,
|
$this,
|
||||||
'EditForm',
|
'EditForm',
|
||||||
new FieldList(
|
new FieldList(
|
||||||
|
@ -50,7 +50,7 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
new SelectionGroup_Item(
|
new SelectionGroup_Item(
|
||||||
'child',
|
'child',
|
||||||
$parentField = new TreeDropdownField(
|
$parentField = new TreeDropdownField(
|
||||||
"ParentID",
|
"ParentID",
|
||||||
"",
|
"",
|
||||||
'SiteTree',
|
'SiteTree',
|
||||||
'ID',
|
'ID',
|
||||||
@ -61,8 +61,8 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
$typeField = new OptionsetField(
|
$typeField = new OptionsetField(
|
||||||
"PageType",
|
"PageType",
|
||||||
sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')),
|
sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')),
|
||||||
$pageTypes,
|
$pageTypes,
|
||||||
'Page'
|
'Page'
|
||||||
),
|
),
|
||||||
@ -71,7 +71,7 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
sprintf(
|
sprintf(
|
||||||
'<p class="message notice message-restricted">%s</p>',
|
'<p class="message notice message-restricted">%s</p>',
|
||||||
_t(
|
_t(
|
||||||
'CMSMain.AddPageRestriction',
|
'CMSMain.AddPageRestriction',
|
||||||
'Note: Some page types are not allowed for this selection'
|
'Note: Some page types are not allowed for this selection'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -79,7 +79,7 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
);
|
);
|
||||||
$parentField->setSearchFunction(function ($sourceObject, $labelField, $search) {
|
$parentField->setSearchFunction(function ($sourceObject, $labelField, $search) {
|
||||||
return DataObject::get(
|
return DataObject::get(
|
||||||
$sourceObject,
|
$sourceObject,
|
||||||
sprintf(
|
sprintf(
|
||||||
"\"MenuTitle\" LIKE '%%%s%%' OR \"Title\" LIKE '%%%s%%'",
|
"\"MenuTitle\" LIKE '%%%s%%' OR \"Title\" LIKE '%%%s%%'",
|
||||||
Convert::raw2sql($search),
|
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
|
// see http://open.silverstripe.org/ticket/7455
|
||||||
// $parentField->setShowSearch(true);
|
// $parentField->setShowSearch(true);
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
|
|
||||||
$this->extend('updatePageOptions', $fields);
|
$this->extend('updatePageOptions', $fields);
|
||||||
|
|
||||||
$form = CMSForm::create(
|
$form = CMSForm::create(
|
||||||
$this, "AddForm", $fields, $actions
|
$this, "AddForm", $fields, $actions
|
||||||
)->setHTMLID('Form_AddForm');
|
)->setHTMLID('Form_AddForm');
|
||||||
$form->setAttribute('data-hints', $this->SiteTreeHints());
|
$form->setAttribute('data-hints', $this->SiteTreeHints());
|
||||||
@ -163,7 +163,7 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
$editController->setCurrentPageID($record->ID);
|
$editController->setCurrentPageID($record->ID);
|
||||||
|
|
||||||
Session::set(
|
Session::set(
|
||||||
"FormInfo.Form_EditForm.formError.message",
|
"FormInfo.Form_EditForm.formError.message",
|
||||||
_t('CMSMain.PageAdded', 'Successfully created page')
|
_t('CMSMain.PageAdded', 'Successfully created page')
|
||||||
);
|
);
|
||||||
Session::set("FormInfo.Form_EditForm.formError.type", 'good');
|
Session::set("FormInfo.Form_EditForm.formError.type", 'good');
|
||||||
|
@ -63,7 +63,7 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
*/
|
*/
|
||||||
public function compare($request) {
|
public function compare($request) {
|
||||||
$form = $this->CompareVersionsForm(
|
$form = $this->CompareVersionsForm(
|
||||||
$request->param('VersionID'),
|
$request->param('VersionID'),
|
||||||
$request->param('OtherVersionID')
|
$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.
|
* instances attached since only action relates to revert.
|
||||||
*
|
*
|
||||||
* Permission checking is done at the {@link CMSMain::getEditForm()} level.
|
* Permission checking is done at the {@link CMSMain::getEditForm()} level.
|
||||||
*
|
*
|
||||||
* @param int $id ID of the record to show
|
* @param int $id ID of the record to show
|
||||||
* @param array $fields optional
|
* @param array $fields optional
|
||||||
* @param int $versionID
|
* @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(
|
new LiteralField('CurrentlyViewingMessage', $this->customise(array(
|
||||||
'Content' => $message,
|
'Content' => $message,
|
||||||
'Classes' => 'notice'
|
'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.
|
* and comparing multiple versions.
|
||||||
*
|
*
|
||||||
* Because we can reload the page directly to a compare view (history/compare/1/2/3)
|
* 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
|
* @return Form
|
||||||
*/
|
*/
|
||||||
@ -246,14 +246,14 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
'doCompare', _t('CMSPageHistoryController.COMPAREVERSIONS','Compare Versions')
|
'doCompare', _t('CMSPageHistoryController.COMPAREVERSIONS','Compare Versions')
|
||||||
),
|
),
|
||||||
new FormAction(
|
new FormAction(
|
||||||
'doShowVersion', _t('CMSPageHistoryController.SHOWVERSION','Show Version')
|
'doShowVersion', _t('CMSPageHistoryController.SHOWVERSION','Show Version')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Use <button> to allow full jQuery UI styling
|
// Use <button> to allow full jQuery UI styling
|
||||||
foreach($actions->dataFields() as $action) $action->setUseButtonTag(true);
|
foreach($actions->dataFields() as $action) $action->setUseButtonTag(true);
|
||||||
|
|
||||||
$form = CMSForm::create(
|
$form = CMSForm::create(
|
||||||
$this,
|
$this,
|
||||||
'VersionsForm',
|
'VersionsForm',
|
||||||
$fields,
|
$fields,
|
||||||
@ -295,7 +295,7 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
return $this->customise(array(
|
return $this->customise(array(
|
||||||
"EditForm" => $form
|
"EditForm" => $form
|
||||||
))->renderWith(array(
|
))->renderWith(array(
|
||||||
$this->class . '_EditForm',
|
$this->class . '_EditForm',
|
||||||
'LeftAndMain_Content'
|
'LeftAndMain_Content'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -320,7 +320,7 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
public function doShowVersion($data, $form) {
|
public function doShowVersion($data, $form) {
|
||||||
$versionID = null;
|
$versionID = null;
|
||||||
|
|
||||||
if(isset($data['Versions']) && is_array($data['Versions'])) {
|
if(isset($data['Versions']) && is_array($data['Versions'])) {
|
||||||
$versionID = array_shift($data['Versions']);
|
$versionID = array_shift($data['Versions']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
return $this->customise(array(
|
return $this->customise(array(
|
||||||
"EditForm" => $this->ShowVersionForm($versionID)
|
"EditForm" => $this->ShowVersionForm($versionID)
|
||||||
))->renderWith(array(
|
))->renderWith(array(
|
||||||
$this->class . '_EditForm',
|
$this->class . '_EditForm',
|
||||||
'LeftAndMain_Content'
|
'LeftAndMain_Content'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Base class for filtering the subtree for certain node statuses.
|
* Base class for filtering the subtree for certain node statuses.
|
||||||
*
|
*
|
||||||
* The simplest way of building a CMSSiteTreeFilter is to create a pagesToBeShown() method that
|
* 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
|
* 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.
|
* 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/
|
* 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
|
* false depending on whether the given page should be included. Note that you will need to include
|
||||||
* parent helper pages yourself.
|
* parent helper pages yourself.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -23,7 +23,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* List of filtered items and all their parents
|
* List of filtered items and all their parents
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $_cache_ids = null;
|
protected $_cache_ids = null;
|
||||||
@ -44,7 +44,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
|
|||||||
protected $_cache_expanded = array();
|
protected $_cache_expanded = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $childrenMethod = null;
|
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.
|
* Returns a sorted array of all implementators of CMSSiteTreeFilter, suitable for use in a dropdown.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function get_all_filters() {
|
public static function get_all_filters() {
|
||||||
@ -132,7 +132,7 @@ abstract class CMSSiteTreeFilter extends Object implements LeftAndMain_SearchFil
|
|||||||
|
|
||||||
if($pages = $this->pagesIncluded()) {
|
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
|
// parents of themselves, as well as IDs to mark
|
||||||
foreach($pages as $pageArr) {
|
foreach($pages as $pageArr) {
|
||||||
$parents[$pageArr['ParentID']] = true;
|
$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
|
* Applies the default filters to a specified DataList of pages
|
||||||
*
|
*
|
||||||
* @param DataList $query Unfiltered query
|
* @param DataList $query Unfiltered query
|
||||||
* @return DataList Filtered 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
|
* Maps a list of pages to an array of associative arrays with ID and ParentID keys
|
||||||
*
|
*
|
||||||
* @param DataList $pages
|
* @param DataList $pages
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -272,7 +272,7 @@ class CMSSiteTreeFilter_PublishedPages extends CMSSiteTreeFilter {
|
|||||||
* Works a bit different than the other filters:
|
* Works a bit different than the other filters:
|
||||||
* Shows all pages *including* those deleted from stage and live.
|
* Shows all pages *including* those deleted from stage and live.
|
||||||
* It does not filter out pages still existing in the different stages.
|
* It does not filter out pages still existing in the different stages.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -301,7 +301,7 @@ class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all pages which have changed on stage.
|
* Gets all pages which have changed on stage.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -322,7 +322,7 @@ class CMSSiteTreeFilter_ChangedPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters pages which have a status "Removed from Draft".
|
* Filters pages which have a status "Removed from Draft".
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -334,7 +334,7 @@ class CMSSiteTreeFilter_StatusRemovedFromDraftPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters out all pages who's status is set to "Removed from draft".
|
* Filters out all pages who's status is set to "Removed from draft".
|
||||||
*
|
*
|
||||||
* @return SS_List
|
* @return SS_List
|
||||||
*/
|
*/
|
||||||
public function getFilteredPages() {
|
public function getFilteredPages() {
|
||||||
@ -350,7 +350,7 @@ class CMSSiteTreeFilter_StatusRemovedFromDraftPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters pages which have a status "Draft".
|
* Filters pages which have a status "Draft".
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -362,7 +362,7 @@ class CMSSiteTreeFilter_StatusDraftPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters out all pages who's status is set to "Draft".
|
* Filters out all pages who's status is set to "Draft".
|
||||||
*
|
*
|
||||||
* @see {@link SiteTree::getStatusFlags()}
|
* @see {@link SiteTree::getStatusFlags()}
|
||||||
* @return SS_List
|
* @return SS_List
|
||||||
*/
|
*/
|
||||||
@ -379,7 +379,7 @@ class CMSSiteTreeFilter_StatusDraftPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters pages which have a status "Deleted".
|
* Filters pages which have a status "Deleted".
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -401,7 +401,7 @@ class CMSSiteTreeFilter_StatusDeletedPages extends CMSSiteTreeFilter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters out all pages who's status is set to "Deleted".
|
* Filters out all pages who's status is set to "Deleted".
|
||||||
*
|
*
|
||||||
* @see {@link SiteTree::getStatusFlags()}
|
* @see {@link SiteTree::getStatusFlags()}
|
||||||
* @return SS_List
|
* @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
|
* Retun an array of maps containing the keys, 'ID' and 'ParentID' for each page to be displayed
|
||||||
* in the search.
|
* in the search.
|
||||||
*
|
*
|
||||||
* @return SS_List
|
* @return SS_List
|
||||||
*/
|
*/
|
||||||
public function getFilteredPages() {
|
public function getFilteredPages() {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
* Subclasses of ContentController are generally instantiated by ModelAsController; this will create
|
* 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.
|
* 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?
|
* @todo Can this be used for anything other than SiteTree controllers?
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
@ -90,7 +90,7 @@ class ContentController extends Controller {
|
|||||||
|
|
||||||
// If we've accessed the homepage as /home/, then we should redirect to /.
|
// If we've accessed the homepage as /home/, then we should redirect to /.
|
||||||
if($this->dataRecord && $this->dataRecord instanceof SiteTree
|
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() ) {
|
&& !$_POST && !$_FILES && !$this->redirectedTo() ) {
|
||||||
$getVars = $_GET;
|
$getVars = $_GET;
|
||||||
unset($getVars['url']);
|
unset($getVars['url']);
|
||||||
@ -305,7 +305,7 @@ class ContentController extends Controller {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="switchView" class="bottomTabs">
|
<div id="switchView" class="bottomTabs">
|
||||||
$viewPageIn
|
$viewPageIn
|
||||||
$items
|
$items
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -337,10 +337,10 @@ HTML;
|
|||||||
* Inspects the associated {@link dataRecord} for a {@link SiteTree->Locale} value if present,
|
* 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()},
|
* and falls back to {@link Translatable::get_current_locale()} or {@link i18n::default_locale()},
|
||||||
* depending if Translatable is enabled.
|
* depending if Translatable is enabled.
|
||||||
*
|
*
|
||||||
* Suitable for insertion into lang= and xml:lang=
|
* Suitable for insertion into lang= and xml:lang=
|
||||||
* attributes in HTML or XHTML output.
|
* attributes in HTML or XHTML output.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function ContentLocale() {
|
public function ContentLocale() {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enhances error handling for a controller with ErrorPage generated output
|
* Enhances error handling for a controller with ErrorPage generated output
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage controller
|
* @subpackage controller
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Extension to include custom page icons
|
* Extension to include custom page icons
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage controller
|
* @subpackage controller
|
||||||
*/
|
*/
|
||||||
@ -14,16 +14,16 @@ class LeftAndMainPageIconsExtension extends Extension {
|
|||||||
/**
|
/**
|
||||||
* Include CSS for page icons. We're not using the JSTree 'types' option
|
* 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.
|
* because it causes too much performance overhead just to add some icons.
|
||||||
*
|
*
|
||||||
* @return string CSS
|
* @return string CSS
|
||||||
*/
|
*/
|
||||||
public function generatePageIconsCss() {
|
public function generatePageIconsCss() {
|
||||||
$css = '';
|
$css = '';
|
||||||
|
|
||||||
$classes = ClassInfo::subclassesFor('SiteTree');
|
$classes = ClassInfo::subclassesFor('SiteTree');
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
$obj = singleton($class);
|
$obj = singleton($class);
|
||||||
$iconSpec = $obj->stat('icon');
|
$iconSpec = $obj->stat('icon');
|
||||||
|
|
||||||
if(!$iconSpec) continue;
|
if(!$iconSpec) continue;
|
||||||
|
|
||||||
@ -33,9 +33,9 @@ class LeftAndMainPageIconsExtension extends Extension {
|
|||||||
// Legacy support: Add file extension if none exists
|
// Legacy support: Add file extension if none exists
|
||||||
if(!pathinfo($iconFile, PATHINFO_EXTENSION)) $iconFile .= '-file.gif';
|
if(!pathinfo($iconFile, PATHINFO_EXTENSION)) $iconFile .= '-file.gif';
|
||||||
|
|
||||||
$iconPathInfo = pathinfo($iconFile);
|
$iconPathInfo = pathinfo($iconFile);
|
||||||
|
|
||||||
// Base filename
|
// Base filename
|
||||||
$baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename'];
|
$baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename'];
|
||||||
$fileExtension = $iconPathInfo['extension'];
|
$fileExtension = $iconPathInfo['extension'];
|
||||||
|
|
||||||
@ -52,4 +52,4 @@ class LeftAndMainPageIconsExtension extends Extension {
|
|||||||
return $css;
|
return $css;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?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
|
* ModelAsController, which selects up a SiteTree object and passes control over to a suitable subclass of ContentController, is a good
|
||||||
* example of this.
|
* example of this.
|
||||||
* @package cms
|
* @package cms
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
* for CMS authors, usually for {@link SiteTree} objects with "stage" and "live" links.
|
* 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).
|
* 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.
|
* 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,
|
* 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
|
* 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.
|
* to view embargoed data at a future point in time. So the item doesn't always have to be a simple link.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -101,7 +101,7 @@ class SilverStripeNavigator extends ViewableData {
|
|||||||
* Navigator items are links that appear in the $SilverStripeNavigator bar.
|
* Navigator items are links that appear in the $SilverStripeNavigator bar.
|
||||||
* To add an item, extend this class - it will be automatically picked up.
|
* To add an item, extend this class - it will be automatically picked up.
|
||||||
* When instanciating items manually, please ensure to call {@link canView()}.
|
* When instanciating items manually, please ensure to call {@link canView()}.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
@ -142,7 +142,7 @@ class SilverStripeNavigatorItem extends ViewableData {
|
|||||||
* Optional link to a specific view of this record.
|
* Optional link to a specific view of this record.
|
||||||
* Not all items are simple links, please use {@link getHTML()}
|
* Not all items are simple links, please use {@link getHTML()}
|
||||||
* to represent an item in markup unless you know what you're doing.
|
* to represent an item in markup unless you know what you're doing.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getLink() {}
|
public function getLink() {}
|
||||||
@ -157,7 +157,7 @@ class SilverStripeNavigatorItem extends ViewableData {
|
|||||||
*/
|
*/
|
||||||
public function getRecord() {
|
public function getRecord() {
|
||||||
return $this->record;
|
return $this->record;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
@ -169,7 +169,7 @@ class SilverStripeNavigatorItem extends ViewableData {
|
|||||||
/**
|
/**
|
||||||
* As items might convey different record states like a "stage" or "live" table,
|
* As items might convey different record states like a "stage" or "live" table,
|
||||||
* an item can be active (showing the record in this state).
|
* an item can be active (showing the record in this state).
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isActive() {
|
public function isActive() {
|
||||||
@ -179,7 +179,7 @@ class SilverStripeNavigatorItem extends ViewableData {
|
|||||||
/**
|
/**
|
||||||
* Filters items based on member permissions or other criteria,
|
* Filters items based on member permissions or other criteria,
|
||||||
* such as if a state is generally available for the current record.
|
* such as if a state is generally available for the current record.
|
||||||
*
|
*
|
||||||
* @param Member
|
* @param Member
|
||||||
* @return Boolean
|
* @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.
|
* Counts as "archived" if the current record is a different version from both live and draft.
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isArchived() {
|
public function isArchived() {
|
||||||
@ -205,7 +205,7 @@ class SilverStripeNavigatorItem extends ViewableData {
|
|||||||
));
|
));
|
||||||
|
|
||||||
$this->record->_cached_isArchived = (
|
$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))
|
&& (!$currentLive || ($currentLive && $this->record->Version != $currentLive->Version))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
|
|||||||
public function getLink() {
|
public function getLink() {
|
||||||
$date = Versioned::current_archived_date();
|
$date = Versioned::current_archived_date();
|
||||||
return Controller::join_links(
|
return Controller::join_links(
|
||||||
$this->record->PreviewLink(),
|
$this->record->PreviewLink(),
|
||||||
'?stage=Stage',
|
'?stage=Stage',
|
||||||
$date ? '?archiveDate=' . $date : null
|
$date ? '?archiveDate=' . $date : null
|
||||||
);
|
);
|
||||||
@ -288,7 +288,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
|
|||||||
|
|
||||||
public function canView($member = null) {
|
public function canView($member = null) {
|
||||||
return (
|
return (
|
||||||
$this->record->hasExtension('Versioned')
|
$this->record->hasExtension('Versioned')
|
||||||
&& $this->getDraftPage()
|
&& $this->getDraftPage()
|
||||||
// Don't follow redirects in preview, they break the CMS editing form
|
// Don't follow redirects in preview, they break the CMS editing form
|
||||||
&& !($this->record instanceof RedirectorPage)
|
&& !($this->record instanceof RedirectorPage)
|
||||||
@ -297,7 +297,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
|
|||||||
|
|
||||||
public function isActive() {
|
public function isActive() {
|
||||||
return (
|
return (
|
||||||
Versioned::current_stage() == 'Stage'
|
Versioned::current_stage() == 'Stage'
|
||||||
&& !(ClassInfo::exists('SiteTreeFutureState') && SiteTreeFutureState::get_future_datetime())
|
&& !(ClassInfo::exists('SiteTreeFutureState') && SiteTreeFutureState::get_future_datetime())
|
||||||
&& !$this->isArchived()
|
&& !$this->isArchived()
|
||||||
);
|
);
|
||||||
@ -341,7 +341,7 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
|
|||||||
|
|
||||||
public function canView($member = null) {
|
public function canView($member = null) {
|
||||||
return (
|
return (
|
||||||
$this->record->hasExtension('Versioned')
|
$this->record->hasExtension('Versioned')
|
||||||
&& $this->getLivePage()
|
&& $this->getLivePage()
|
||||||
// Don't follow redirects in preview, they break the CMS editing form
|
// Don't follow redirects in preview, they break the CMS editing form
|
||||||
&& !($this->record instanceof RedirectorPage)
|
&& !($this->record instanceof RedirectorPage)
|
||||||
@ -380,7 +380,7 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
|
|||||||
return _t('SilverStripeNavigator.ARCHIVED', 'Archived');
|
return _t('SilverStripeNavigator.ARCHIVED', 'Archived');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMessage() {
|
public function getMessage() {
|
||||||
if($date = Versioned::current_archived_date()) {
|
if($date = Versioned::current_archived_date()) {
|
||||||
$dateObj = DBField::create_field('Datetime', $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>";
|
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) {
|
public function canView($member = null) {
|
||||||
return (
|
return (
|
||||||
$this->record->hasExtension('Versioned')
|
$this->record->hasExtension('Versioned')
|
||||||
&& $this->isArchived()
|
&& $this->isArchived()
|
||||||
// Don't follow redirects in preview, they break the CMS editing form
|
// Don't follow redirects in preview, they break the CMS editing form
|
||||||
&& !($this->record instanceof RedirectorPage)
|
&& !($this->record instanceof RedirectorPage)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* Used to edit the SiteTree->URLSegment property, and suggest input based on the serverside rules
|
* Used to edit the SiteTree->URLSegment property, and suggest input based on the serverside rules
|
||||||
* defined through {@link SiteTree->generateURLSegment()} and {@link URLSegmentFilter}.
|
* defined through {@link SiteTree->generateURLSegment()} and {@link URLSegmentFilter}.
|
||||||
*
|
*
|
||||||
* Note: The actual conversion for saving the value takes place in the model layer.
|
* Note: The actual conversion for saving the value takes place in the model layer.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
class SiteTreeURLSegmentField extends TextField {
|
class SiteTreeURLSegmentField extends TextField {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $helpText, $urlPrefix, $urlSuffix, $defaultUrl;
|
protected $helpText, $urlPrefix, $urlSuffix, $defaultUrl;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class RedirectorPage extends Page {
|
|||||||
* Return the the link that should be used for this redirector page, in navigation, etc.
|
* 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
|
* 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
|
* 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() {
|
public function Link() {
|
||||||
if($link = $this->redirectionLink()) return $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
|
// Prefix the URL with "http://" if no prefix is found
|
||||||
if(
|
if(
|
||||||
$this->ExternalURL
|
$this->ExternalURL
|
||||||
&& !parse_url($this->ExternalURL, PHP_URL_SCHEME)
|
&& !parse_url($this->ExternalURL, PHP_URL_SCHEME)
|
||||||
&& !preg_match('#^//#', $this->ExternalURL)
|
&& !preg_match('#^//#', $this->ExternalURL)
|
||||||
) {
|
) {
|
||||||
$this->ExternalURL = 'http://' . $this->ExternalURL;
|
$this->ExternalURL = 'http://' . $this->ExternalURL;
|
||||||
@ -129,17 +129,17 @@ class RedirectorPage extends Page {
|
|||||||
array(
|
array(
|
||||||
new HeaderField('RedirectorDescHeader',_t('RedirectorPage.HEADER', "This page will redirect users to another page")),
|
new HeaderField('RedirectorDescHeader',_t('RedirectorPage.HEADER', "This page will redirect users to another page")),
|
||||||
new OptionsetField(
|
new OptionsetField(
|
||||||
"RedirectionType",
|
"RedirectionType",
|
||||||
_t('RedirectorPage.REDIRECTTO', "Redirect to"),
|
_t('RedirectorPage.REDIRECTTO', "Redirect to"),
|
||||||
array(
|
array(
|
||||||
"Internal" => _t('RedirectorPage.REDIRECTTOPAGE', "A page on your website"),
|
"Internal" => _t('RedirectorPage.REDIRECTTOPAGE', "A page on your website"),
|
||||||
"External" => _t('RedirectorPage.REDIRECTTOEXTERNAL', "Another website"),
|
"External" => _t('RedirectorPage.REDIRECTTOEXTERNAL', "Another website"),
|
||||||
),
|
),
|
||||||
"Internal"
|
"Internal"
|
||||||
),
|
),
|
||||||
new TreeDropdownField(
|
new TreeDropdownField(
|
||||||
"LinkToID",
|
"LinkToID",
|
||||||
_t('RedirectorPage.YOURPAGE', "Page on your website"),
|
_t('RedirectorPage.YOURPAGE', "Page on your website"),
|
||||||
"SiteTree"
|
"SiteTree"
|
||||||
),
|
),
|
||||||
new TextField("ExternalURL", _t('RedirectorPage.OTHERURL', "Other website URL"))
|
new TextField("ExternalURL", _t('RedirectorPage.OTHERURL', "Other website URL"))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Basic data-object representing all pages within the site tree. All page types that live within the hierarchy should
|
* 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
|
* inherit from this. In addition, it contains a number of static methods for querying the site tree and working with
|
||||||
* draft and published states.
|
* draft and published states.
|
||||||
*
|
*
|
||||||
* <h2>URLs</h2>
|
* <h2>URLs</h2>
|
||||||
* A page is identified during request handling via its "URLSegment" database column. As pages can be nested, the full
|
* 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
|
* 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
|
* class is allowed - no subclasses. Otherwise, the class and all its
|
||||||
* subclasses are allowed.
|
* subclasses are allowed.
|
||||||
* To control allowed children on root level (no parent), use {@link $can_be_root}.
|
* 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.
|
* Note that this setting is cached when used in the CMS, use the "flush" query parameter to clear it.
|
||||||
*
|
*
|
||||||
* @config
|
* @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.
|
* 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).
|
* Also supports custom CSS rule contents (applied to the correct selector for the tree UI implementation).
|
||||||
*
|
*
|
||||||
* @see CMSMain::generateTreeStylingCSS()
|
* @see CMSMain::generateTreeStylingCSS()
|
||||||
* @config
|
* @config
|
||||||
* @var string
|
* @var string
|
||||||
@ -240,7 +240,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
* Determines if the system should avoid orphaned pages
|
* Determines if the system should avoid orphaned pages
|
||||||
* by deleting all children when the their parent is deleted (TRUE),
|
* 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).
|
* 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
|
* @deprecated 4.0 Use the "SiteTree.enforce_strict_hierarchy" config setting instead
|
||||||
* @param boolean
|
* @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.
|
// Traverse down the remaining URL segments and grab the relevant SiteTree objects.
|
||||||
foreach($parts as $segment) {
|
foreach($parts as $segment) {
|
||||||
$next = DataObject::get_one('SiteTree', array(
|
$next = DataObject::get_one('SiteTree', array(
|
||||||
'"SiteTree"."URLSegment"' => $segment,
|
'"SiteTree"."URLSegment"' => $segment,
|
||||||
'"SiteTree"."ParentID"' => $sitetree->ID
|
'"SiteTree"."ParentID"' => $sitetree->ID
|
||||||
),
|
),
|
||||||
$cache
|
$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
|
* 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.
|
* site setups. Does not contain hints about the stage, see {@link SilverStripeNavigator} for details.
|
||||||
*
|
*
|
||||||
* @param string $action See {@link Link()}
|
* @param string $action See {@link Link()}
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@ -503,7 +503,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
* and returned in its full form.
|
* and returned in its full form.
|
||||||
*
|
*
|
||||||
* @uses RootURLController::get_homepage_link()
|
* @uses RootURLController::get_homepage_link()
|
||||||
*
|
*
|
||||||
* @param string $action See {@link Link()}
|
* @param string $action See {@link Link()}
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@ -517,7 +517,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$base = $parent->RelativeLink($this->URLSegment);
|
$base = $parent->RelativeLink($this->URLSegment);
|
||||||
} elseif(!$action && $this->URLSegment == RootURLController::get_homepage_link()) {
|
} elseif(!$action && $this->URLSegment == RootURLController::get_homepage_link()) {
|
||||||
// Unset base for root-level homepages.
|
// 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.
|
// need to retain their URLSegment.
|
||||||
$base = null;
|
$base = null;
|
||||||
} else {
|
} 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
|
* 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
|
* this child. Any such orphaned page may still require access via the CMS, but should not be shown as accessible
|
||||||
* to external users.
|
* to external users.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isOrphaned() {
|
public function isOrphaned() {
|
||||||
@ -752,11 +752,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$pages = array();
|
$pages = array();
|
||||||
|
|
||||||
while(
|
while(
|
||||||
$page
|
$page
|
||||||
&& (!$maxDepth || count($pages) < $maxDepth)
|
&& (!$maxDepth || count($pages) < $maxDepth)
|
||||||
&& (!$stopAtPageType || $page->ClassName != $stopAtPageType)
|
&& (!$stopAtPageType || $page->ClassName != $stopAtPageType)
|
||||||
) {
|
) {
|
||||||
if($showHidden || $page->ShowInMenus || ($page->ID == $this->ID)) {
|
if($showHidden || $page->ShowInMenus || ($page->ID == $this->ID)) {
|
||||||
$pages[] = $page;
|
$pages[] = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make this page a child of another page.
|
* 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.
|
* 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
|
* @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
|
* 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.
|
* the security model for an application.
|
||||||
*
|
*
|
||||||
* Slightly altered from parent behaviour in {@link DataObject->can()}:
|
* Slightly altered from parent behaviour in {@link DataObject->can()}:
|
||||||
* - Checks for existence of a method named "can<$perm>()" on the object
|
* - Checks for existence of a method named "can<$perm>()" on the object
|
||||||
* - Calls decorators and only returns for FALSE "vetoes"
|
* - 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
|
* 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.
|
* customise the security model for an application.
|
||||||
*
|
*
|
||||||
* Denies permission if any of the following conditions is true:
|
* Denies permission if any of the following conditions is true:
|
||||||
* - alternateCanAddChildren() on a extension returns false
|
* - alternateCanAddChildren() on a extension returns false
|
||||||
* - canEdit() is not granted
|
* - canEdit() is not granted
|
||||||
* - There are no classes defined in {@link $allowed_children}
|
* - There are no classes defined in {@link $allowed_children}
|
||||||
*
|
*
|
||||||
* @uses SiteTreeExtension->canAddChildren()
|
* @uses SiteTreeExtension->canAddChildren()
|
||||||
* @uses canEdit()
|
* @uses canEdit()
|
||||||
* @uses $allowed_children
|
* @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
|
* 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.
|
* security model for an application.
|
||||||
*
|
*
|
||||||
* Denies permission if any of the following conditions is true:
|
* Denies permission if any of the following conditions is true:
|
||||||
* - canView() on any extension returns false
|
* - canView() on any extension returns false
|
||||||
* - "CanViewType" directive is set to "Inherit" and any parent page return false for canView()
|
* - "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
|
// check for specific groups
|
||||||
if($member && is_numeric($member)) $member = DataObject::get_by_id('Member', $member);
|
if($member && is_numeric($member)) $member = DataObject::get_by_id('Member', $member);
|
||||||
if(
|
if(
|
||||||
$this->CanViewType == 'OnlyTheseUsers'
|
$this->CanViewType == 'OnlyTheseUsers'
|
||||||
&& $member
|
&& $member
|
||||||
&& $member->inGroups($this->ViewerGroups())
|
&& $member->inGroups($this->ViewerGroups())
|
||||||
) return true;
|
) 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
|
* 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.
|
* security model for an application.
|
||||||
*
|
*
|
||||||
* Denies permission if any of the following conditions is true:
|
* Denies permission if any of the following conditions is true:
|
||||||
* - canDelete() returns false on any extension
|
* - canDelete() returns false on any extension
|
||||||
* - canEdit() returns false
|
* - canEdit() returns false
|
||||||
* - any descendant page returns false for canDelete()
|
* - any descendant page returns false for canDelete()
|
||||||
*
|
*
|
||||||
* @uses canDelete()
|
* @uses canDelete()
|
||||||
* @uses SiteTreeExtension->canDelete()
|
* @uses SiteTreeExtension->canDelete()
|
||||||
* @uses canEdit()
|
* @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.
|
* 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.
|
* 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.
|
* Use {@link canAddChildren()} to control behaviour of creating children under this page.
|
||||||
*
|
*
|
||||||
* @uses $can_create
|
* @uses $can_create
|
||||||
* @uses DataExtension->canCreate()
|
* @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
|
* 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.
|
* security model for an application.
|
||||||
*
|
*
|
||||||
* Denies permission if any of the following conditions is true:
|
* Denies permission if any of the following conditions is true:
|
||||||
* - canEdit() on any extension returns false
|
* - canEdit() on any extension returns false
|
||||||
* - canView() return 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
|
* - "CanEditType" directive is set to "LoggedInUsers" and no user is logged in or doesn't have the
|
||||||
* CMS_Access_CMSMAIN permission code
|
* CMS_Access_CMSMAIN permission code
|
||||||
* - "CanEditType" directive is set to "OnlyTheseUsers" and user is not in the given groups
|
* - "CanEditType" directive is set to "OnlyTheseUsers" and user is not in the given groups
|
||||||
*
|
*
|
||||||
* @uses canView()
|
* @uses canView()
|
||||||
* @uses EditorGroups()
|
* @uses EditorGroups()
|
||||||
* @uses DataExtension->canEdit()
|
* @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
|
* 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.
|
* the security model for an application.
|
||||||
*
|
*
|
||||||
* Denies permission if any of the following conditions is true:
|
* Denies permission if any of the following conditions is true:
|
||||||
* - canPublish() on any extension returns false
|
* - canPublish() on any extension returns false
|
||||||
* - canEdit() returns false
|
* - canEdit() returns false
|
||||||
*
|
*
|
||||||
* @uses SiteTreeExtension->canPublish()
|
* @uses SiteTreeExtension->canPublish()
|
||||||
*
|
*
|
||||||
* @param Member $member
|
* @param Member $member
|
||||||
@ -1229,7 +1229,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
// Get permissions that are inherited
|
// Get permissions that are inherited
|
||||||
$potentiallyInherited = Versioned::get_by_stage(
|
$potentiallyInherited = Versioned::get_by_stage(
|
||||||
"SiteTree",
|
"SiteTree",
|
||||||
$stage,
|
$stage,
|
||||||
array("\"$typeField\" = 'Inherit' AND \"SiteTree\".\"ID\" IN ($idPlaceholders)" => $ids)
|
array("\"$typeField\" = 'Inherit' AND \"SiteTree\".\"ID\" IN ($idPlaceholders)" => $ids)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1270,7 +1270,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
// Cache the results
|
// Cache the results
|
||||||
if(empty(self::$cache_permissions[$cacheKey])) self::$cache_permissions[$cacheKey] = array();
|
if(empty(self::$cache_permissions[$cacheKey])) self::$cache_permissions[$cacheKey] = array();
|
||||||
self::$cache_permissions[$cacheKey] = $combinedStageResult + self::$cache_permissions[$cacheKey];
|
self::$cache_permissions[$cacheKey] = $combinedStageResult + self::$cache_permissions[$cacheKey];
|
||||||
|
|
||||||
return $combinedStageResult;
|
return $combinedStageResult;
|
||||||
} else {
|
} else {
|
||||||
return array();
|
return array();
|
||||||
@ -1402,9 +1402,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
if($this->MetaDescription) {
|
if($this->MetaDescription) {
|
||||||
$tags .= "<meta name=\"description\" content=\"" . Convert::raw2att($this->MetaDescription) . "\" />\n";
|
$tags .= "<meta name=\"description\" content=\"" . Convert::raw2att($this->MetaDescription) . "\" />\n";
|
||||||
}
|
}
|
||||||
if($this->ExtraMeta) {
|
if($this->ExtraMeta) {
|
||||||
$tags .= $this->ExtraMeta . "\n";
|
$tags .= $this->ExtraMeta . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Permission::check('CMS_ACCESS_CMSMain')
|
if(Permission::check('CMS_ACCESS_CMSMain')
|
||||||
&& in_array('CMSPreviewable', class_implements($this))
|
&& in_array('CMSPreviewable', class_implements($this))
|
||||||
@ -1495,7 +1495,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
if(!$this->Sort) {
|
if(!$this->Sort) {
|
||||||
$parentID = ($this->ParentID) ? $this->ParentID : 0;
|
$parentID = ($this->ParentID) ? $this->ParentID : 0;
|
||||||
$this->Sort = DB::prepared_query(
|
$this->Sort = DB::prepared_query(
|
||||||
"SELECT MAX(\"Sort\") + 1 FROM \"SiteTree\" WHERE \"ParentID\" = ?",
|
"SELECT MAX(\"Sort\") + 1 FROM \"SiteTree\" WHERE \"ParentID\" = ?",
|
||||||
array($parentID)
|
array($parentID)
|
||||||
)->value();
|
)->value();
|
||||||
}
|
}
|
||||||
@ -1596,10 +1596,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
protected function validate() {
|
protected function validate() {
|
||||||
$result = parent::validate();
|
$result = parent::validate();
|
||||||
|
|
||||||
// Allowed children validation
|
// Allowed children validation
|
||||||
$parent = $this->getParent();
|
$parent = $this->getParent();
|
||||||
if($parent && $parent->exists()) {
|
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.
|
// deconstructs any inheritance trees already.
|
||||||
$allowed = $parent->allowedChildren();
|
$allowed = $parent->allowedChildren();
|
||||||
$subject = ($this instanceof VirtualPage && $this->CopyContentFromID) ? $this->CopyContentFrom() : $this;
|
$subject = ($this instanceof VirtualPage && $this->CopyContentFromID) ? $this->CopyContentFrom() : $this;
|
||||||
@ -1607,8 +1607,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
|
|
||||||
$result->error(
|
$result->error(
|
||||||
_t(
|
_t(
|
||||||
'SiteTree.PageTypeNotAllowed',
|
'SiteTree.PageTypeNotAllowed',
|
||||||
'Page type "{type}" not allowed as child of this parent page',
|
'Page type "{type}" not allowed as child of this parent page',
|
||||||
array('type' => $subject->i18n_singular_name())
|
array('type' => $subject->i18n_singular_name())
|
||||||
),
|
),
|
||||||
'ALLOWED_CHILDREN'
|
'ALLOWED_CHILDREN'
|
||||||
@ -1620,8 +1620,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
if(!$this->stat('can_be_root') && !$this->ParentID) {
|
if(!$this->stat('can_be_root') && !$this->ParentID) {
|
||||||
$result->error(
|
$result->error(
|
||||||
_t(
|
_t(
|
||||||
'SiteTree.PageTypNotAllowedOnRoot',
|
'SiteTree.PageTypNotAllowedOnRoot',
|
||||||
'Page type "{type}" is not allowed on the root level',
|
'Page type "{type}" is not allowed on the root level',
|
||||||
array('type' => $this->i18n_singular_name())
|
array('type' => $this->i18n_singular_name())
|
||||||
),
|
),
|
||||||
'CAN_BE_ROOT'
|
'CAN_BE_ROOT'
|
||||||
@ -1661,7 +1661,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
}
|
}
|
||||||
|
|
||||||
$votes = array_filter(
|
$votes = array_filter(
|
||||||
(array)$this->extend('augmentValidURLSegment'),
|
(array)$this->extend('augmentValidURLSegment'),
|
||||||
function($v) {return !is_null($v);}
|
function($v) {return !is_null($v);}
|
||||||
);
|
);
|
||||||
if($votes) {
|
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
|
* 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
|
* 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.
|
* scratch, or incrementally modify the generated URL.
|
||||||
*
|
*
|
||||||
* @param string $title Page title
|
* @param string $title Page title
|
||||||
* @return string Generated url segment
|
* @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.
|
* 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.
|
* @param bool $includeVirtuals Set to false to exlcude virtual pages.
|
||||||
* @return ArrayList
|
* @return ArrayList
|
||||||
*/
|
*/
|
||||||
@ -1887,7 +1887,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
}
|
}
|
||||||
|
|
||||||
$statusMessage[] = _t(
|
$statusMessage[] = _t(
|
||||||
'SiteTree.APPEARSVIRTUALPAGES',
|
'SiteTree.APPEARSVIRTUALPAGES',
|
||||||
"This content also appears on the virtual pages in the {title} sections.",
|
"This content also appears on the virtual pages in the {title} sections.",
|
||||||
array('title' => $parentList)
|
array('title' => $parentList)
|
||||||
);
|
);
|
||||||
@ -1982,7 +1982,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$metaFieldDesc
|
$metaFieldDesc
|
||||||
->setRightTitle(
|
->setRightTitle(
|
||||||
_t(
|
_t(
|
||||||
'SiteTree.METADESCHELP',
|
'SiteTree.METADESCHELP',
|
||||||
"Search engines use this content for displaying search results (although it will not influence their ranking)."
|
"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
|
$metaFieldExtra
|
||||||
->setRightTitle(
|
->setRightTitle(
|
||||||
_t(
|
_t(
|
||||||
'SiteTree.METAEXTRAHELP',
|
'SiteTree.METAEXTRAHELP',
|
||||||
"HTML tags for additional meta information. For example <meta name=\"customName\" content=\"your custom content here\" />"
|
"HTML tags for additional meta information. For example <meta name=\"customName\" content=\"your custom content here\" />"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -2017,8 +2017,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists(BASE_PATH . '/install.php')) {
|
if(file_exists(BASE_PATH . '/install.php')) {
|
||||||
$fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader",
|
$fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader",
|
||||||
"<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING",
|
"<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING",
|
||||||
"Warning: You should remove install.php from this SilverStripe install for security reasons.")
|
"Warning: You should remove install.php from this SilverStripe install for security reasons.")
|
||||||
. "</p>"), "Title");
|
. "</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()}
|
* Returns fields related to configuration aspects on this record, e.g. access control. See {@link getCMSFields()}
|
||||||
* for content-related fields.
|
* for content-related fields.
|
||||||
*
|
*
|
||||||
* @return FieldList
|
* @return FieldList
|
||||||
*/
|
*/
|
||||||
public function getSettingsFields() {
|
public function getSettingsFields() {
|
||||||
@ -2055,8 +2055,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$rootTab = new TabSet("Root",
|
$rootTab = new TabSet("Root",
|
||||||
$tabBehaviour = new Tab('Settings',
|
$tabBehaviour = new Tab('Settings',
|
||||||
new DropdownField(
|
new DropdownField(
|
||||||
"ClassName",
|
"ClassName",
|
||||||
$this->fieldLabel('ClassName'),
|
$this->fieldLabel('ClassName'),
|
||||||
$this->getClassDropdown()
|
$this->getClassDropdown()
|
||||||
),
|
),
|
||||||
$parentTypeSelector = new CompositeField(
|
$parentTypeSelector = new CompositeField(
|
||||||
@ -2071,25 +2071,25 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch'))
|
new CheckboxField("ShowInSearch", $this->fieldLabel('ShowInSearch'))
|
||||||
),
|
),
|
||||||
$viewersOptionsField = new OptionsetField(
|
$viewersOptionsField = new OptionsetField(
|
||||||
"CanViewType",
|
"CanViewType",
|
||||||
_t('SiteTree.ACCESSHEADER', "Who can view this page?")
|
_t('SiteTree.ACCESSHEADER', "Who can view this page?")
|
||||||
),
|
),
|
||||||
$viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups"))
|
$viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups"))
|
||||||
->setMultiple(true)
|
->setMultiple(true)
|
||||||
->setSource($groupsMap)
|
->setSource($groupsMap)
|
||||||
->setAttribute(
|
->setAttribute(
|
||||||
'data-placeholder',
|
'data-placeholder',
|
||||||
_t('SiteTree.GroupPlaceholder', 'Click to select group')
|
_t('SiteTree.GroupPlaceholder', 'Click to select group')
|
||||||
),
|
),
|
||||||
$editorsOptionsField = new OptionsetField(
|
$editorsOptionsField = new OptionsetField(
|
||||||
"CanEditType",
|
"CanEditType",
|
||||||
_t('SiteTree.EDITHEADER', "Who can edit this page?")
|
_t('SiteTree.EDITHEADER', "Who can edit this page?")
|
||||||
),
|
),
|
||||||
$editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups"))
|
$editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups"))
|
||||||
->setMultiple(true)
|
->setMultiple(true)
|
||||||
->setSource($groupsMap)
|
->setSource($groupsMap)
|
||||||
->setAttribute(
|
->setAttribute(
|
||||||
'data-placeholder',
|
'data-placeholder',
|
||||||
_t('SiteTree.GroupPlaceholder', 'Click to select group')
|
_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).
|
// Minor options are hidden behind a drop-up and appear as links (although they are still FormActions).
|
||||||
$rootTabSet = new TabSet('ActionMenus');
|
$rootTabSet = new TabSet('ActionMenus');
|
||||||
$moreOptions = new Tab(
|
$moreOptions = new Tab(
|
||||||
'MoreOptions',
|
'MoreOptions',
|
||||||
_t('SiteTree.MoreOptions', 'More options', 'Expands a view for more buttons')
|
_t('SiteTree.MoreOptions', 'More options', 'Expands a view for more buttons')
|
||||||
);
|
);
|
||||||
$rootTabSet->push($moreOptions);
|
$rootTabSet->push($moreOptions);
|
||||||
@ -2361,7 +2361,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Publish this page.
|
* Publish this page.
|
||||||
*
|
*
|
||||||
* @uses SiteTreeExtension->onBeforePublish()
|
* @uses SiteTreeExtension->onBeforePublish()
|
||||||
* @uses SiteTreeExtension->onAfterPublish()
|
* @uses SiteTreeExtension->onAfterPublish()
|
||||||
* @return bool True if published
|
* @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
|
* Unpublish this page - remove it from the live site
|
||||||
*
|
*
|
||||||
* @uses SiteTreeExtension->onBeforeUnpublish()
|
* @uses SiteTreeExtension->onBeforeUnpublish()
|
||||||
* @uses SiteTreeExtension->onAfterUnpublish()
|
* @uses SiteTreeExtension->onAfterUnpublish()
|
||||||
*/
|
*/
|
||||||
@ -2573,12 +2573,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
if(!$this->canDelete($member)) {
|
if(!$this->canDelete($member)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If published, check if we can delete from live
|
// If published, check if we can delete from live
|
||||||
if($this->ExistsOnLive && !$this->canDeleteFromLive($member)) {
|
if($this->ExistsOnLive && !$this->canDeleteFromLive($member)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
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
|
* 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 flag. The unique key can be reused as a CSS class. Use the 'updateStatusFlags' extension point to customize
|
||||||
* the flags.
|
* the flags.
|
||||||
*
|
*
|
||||||
* Example (simple):
|
* Example (simple):
|
||||||
* "deletedonlive" => "Deleted"
|
* "deletedonlive" => "Deleted"
|
||||||
*
|
*
|
||||||
* Example (with optional title attribute):
|
* Example (with optional title attribute):
|
||||||
* "deletedonlive" => array('text' => "Deleted", 'title' => 'This page has been deleted')
|
* "deletedonlive" => array('text' => "Deleted", 'title' => 'This page has been deleted')
|
||||||
*
|
*
|
||||||
* @param bool $cached Whether to serve the fields from cache; false regenerate them
|
* @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
|
* 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).
|
* is still published (eg, after triggering "Delete from draft site" in the CMS).
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getIsDeletedFromStage() {
|
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
|
* Compares current draft with live version, and returns true if these versions differ, meaning there have been
|
||||||
* unpublished changes to the draft site.
|
* unpublished changes to the draft site.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getIsModifiedOnStage() {
|
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
|
* Compares current draft with live version, and returns true if no live version exists, meaning the page was never
|
||||||
* published.
|
* published.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getIsAddedToStage() {
|
public function getIsAddedToStage() {
|
||||||
@ -3017,7 +3017,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the translated Singular name.
|
* Return the translated Singular name.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function i18n_singular_name() {
|
public function i18n_singular_name() {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Plug-ins for additional functionality in your SiteTree classes.
|
* Plug-ins for additional functionality in your SiteTree classes.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage model
|
* @subpackage model
|
||||||
*/
|
*/
|
||||||
@ -10,7 +10,7 @@ abstract class SiteTreeExtension extends DataExtension {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook called before the page's {@link SiteTree::doPublish()} action is completed
|
* Hook called before the page's {@link SiteTree::doPublish()} action is completed
|
||||||
*
|
*
|
||||||
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
||||||
*/
|
*/
|
||||||
public function onBeforePublish(&$original) {
|
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
|
* Hook called after the page's {@link SiteTree::doPublish()} action is completed
|
||||||
*
|
*
|
||||||
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
||||||
*/
|
*/
|
||||||
public function onAfterPublish(&$original) {
|
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
|
* Hook called to determine if a user may add children to this SiteTree object
|
||||||
*
|
*
|
||||||
* @see SiteTree::canAddChildren()
|
* @see SiteTree::canAddChildren()
|
||||||
*
|
*
|
||||||
* @param Member $member The member to check permission against, or the currently
|
* @param Member $member The member to check permission against, or the currently
|
||||||
* logged in user
|
* logged in user
|
||||||
* @return boolean|null Return false to deny rights, or null to yield to default
|
* @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
|
* Hook called to determine if a user may publish this SiteTree object
|
||||||
*
|
*
|
||||||
* @see SiteTree::canPublish()
|
* @see SiteTree::canPublish()
|
||||||
*
|
*
|
||||||
* @param Member $member The member to check permission against, or the currently
|
* @param Member $member The member to check permission against, or the currently
|
||||||
* logged in user
|
* logged in user
|
||||||
* @return boolean|null Return false to deny rights, or null to yield to default
|
* @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,
|
* Hook called to modify the $base url of this page, with a given $action,
|
||||||
* before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()}
|
* before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()}
|
||||||
* on the $base and $action
|
* on the $base and $action
|
||||||
*
|
*
|
||||||
* @param string &$base The URL of this page relative to siteroot, not including
|
* @param string &$base The URL of this page relative to siteroot, not including
|
||||||
* the action
|
* the action
|
||||||
* @param string|boolean &$action The action or subpage called on this page.
|
* @param string|boolean &$action The action or subpage called on this page.
|
||||||
|
@ -12,8 +12,8 @@ class SiteTreeFileExtension extends DataExtension {
|
|||||||
public function updateCMSFields(FieldList $fields) {
|
public function updateCMSFields(FieldList $fields) {
|
||||||
$fields->insertAfter(
|
$fields->insertAfter(
|
||||||
ReadonlyField::create(
|
ReadonlyField::create(
|
||||||
'BackLinkCount',
|
'BackLinkCount',
|
||||||
_t('AssetTableField.BACKLINKCOUNT', 'Used on:'),
|
_t('AssetTableField.BACKLINKCOUNT', 'Used on:'),
|
||||||
$this->BackLinkTracking()->Count() . ' ' . _t('AssetTableField.PAGES', 'page(s)'))
|
$this->BackLinkTracking()->Count() . ' ' . _t('AssetTableField.PAGES', 'page(s)'))
|
||||||
->addExtraClass('cms-description-toggle')
|
->addExtraClass('cms-description-toggle')
|
||||||
->setDescription($this->BackLinkHTMLList()),
|
->setDescription($this->BackLinkHTMLList()),
|
||||||
@ -67,8 +67,8 @@ class SiteTreeFileExtension extends DataExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($filter || $sort || $join || $limit) {
|
if($filter || $sort || $join || $limit) {
|
||||||
Deprecation::notice('4.0', 'The $filter, $sort, $join and $limit parameters for
|
Deprecation::notice('4.0', 'The $filter, $sort, $join and $limit parameters for
|
||||||
SiteTreeFileExtension::BackLinkTracking() have been deprecated.
|
SiteTreeFileExtension::BackLinkTracking() have been deprecated.
|
||||||
Please manipluate the returned list directly.', Deprecation::SCOPE_GLOBAL);
|
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.
|
* @todo Unnecessary shortcut for AssetTableField, coupled with cms module.
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function BackLinkTrackingCount() {
|
public function BackLinkTrackingCount() {
|
||||||
@ -130,9 +130,9 @@ class SiteTreeFileExtension extends DataExtension {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Rewrite links to the $old file to now point to the $new file.
|
* Rewrite links to the $old file to now point to the $new file.
|
||||||
*
|
*
|
||||||
* @uses SiteTree->rewriteFileURL()
|
* @uses SiteTree->rewriteFileURL()
|
||||||
*
|
*
|
||||||
* @param string $old File path relative to the webroot
|
* @param string $old File path relative to the webroot
|
||||||
* @param string $new File path relative to the webroot
|
* @param string $new File path relative to the webroot
|
||||||
*/
|
*/
|
||||||
|
@ -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.
|
* 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.
|
* @returns String where clause which will work as filter.
|
||||||
*/
|
*/
|
||||||
public function getUnusedFilesListFilter() {
|
public function getUnusedFilesListFilter() {
|
||||||
@ -21,7 +21,7 @@ class SiteTreeFolderExtension extends DataExtension {
|
|||||||
|
|
||||||
if($result->numRecords() > 0) {
|
if($result->numRecords() > 0) {
|
||||||
while($nextResult = $result->next()) {
|
while($nextResult = $result->next()) {
|
||||||
$where .= $nextResult['FileID'] . ',';
|
$where .= $nextResult['FileID'] . ',';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Virtual Page creates an instance of a page, with the same fields that the original page had, but readonly.
|
* 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
|
* 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
|
* @package cms
|
||||||
*/
|
*/
|
||||||
class VirtualPage extends Page {
|
class VirtualPage extends Page {
|
||||||
@ -46,7 +46,7 @@ class VirtualPage extends Page {
|
|||||||
"VersionID" => "Int",
|
"VersionID" => "Int",
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the array of fields required for the page type.
|
* Generates the array of fields required for the page type.
|
||||||
*/
|
*/
|
||||||
public function getVirtualFields() {
|
public function getVirtualFields() {
|
||||||
@ -71,7 +71,7 @@ class VirtualPage extends Page {
|
|||||||
if(!$copyContentFromID) return new SiteTree();
|
if(!$copyContentFromID) return new SiteTree();
|
||||||
|
|
||||||
if(!isset($this->components['CopyContentFrom'])) {
|
if(!isset($this->components['CopyContentFrom'])) {
|
||||||
$this->components['CopyContentFrom'] = DataObject::get_by_id("SiteTree",
|
$this->components['CopyContentFrom'] = DataObject::get_by_id("SiteTree",
|
||||||
$copyContentFromID);
|
$copyContentFromID);
|
||||||
|
|
||||||
// Don't let VirtualPages point to other VirtualPages
|
// 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;
|
if($val && DataObject::get_by_id('SiteTree', $val) instanceof VirtualPage) $val = 0;
|
||||||
return $this->setField("CopyContentFromID", $val);
|
return $this->setField("CopyContentFromID", $val);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ContentSource() {
|
public function ContentSource() {
|
||||||
return $this->CopyContentFrom();
|
return $this->CopyContentFrom();
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ class VirtualPage extends Page {
|
|||||||
/**
|
/**
|
||||||
* Returns true if is page is publishable by anyone at all
|
* Returns true if is page is publishable by anyone at all
|
||||||
* Return false if the source page isn't published yet.
|
* Return false if the source page isn't published yet.
|
||||||
*
|
*
|
||||||
* Note that isPublishable doesn't affect ete from live, only publish.
|
* Note that isPublishable doesn't affect ete from live, only publish.
|
||||||
*/
|
*/
|
||||||
public function isPublishable() {
|
public function isPublishable() {
|
||||||
@ -169,8 +169,8 @@ class VirtualPage extends Page {
|
|||||||
|
|
||||||
// Setup the linking to the original page.
|
// Setup the linking to the original page.
|
||||||
$copyContentFromField = new TreeDropdownField(
|
$copyContentFromField = new TreeDropdownField(
|
||||||
"CopyContentFromID",
|
"CopyContentFromID",
|
||||||
_t('VirtualPage.CHOOSE', "Linked Page"),
|
_t('VirtualPage.CHOOSE', "Linked Page"),
|
||||||
"SiteTree"
|
"SiteTree"
|
||||||
);
|
);
|
||||||
// filter doesn't let you select children of virtual pages as as source page
|
// 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
|
// Create links back to the original object in the CMS
|
||||||
if($this->CopyContentFrom()->exists()) {
|
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')
|
. _t('VirtualPage.EditLink', 'edit')
|
||||||
. "</a>";
|
. "</a>";
|
||||||
$msgs[] = _t(
|
$msgs[] = _t(
|
||||||
'VirtualPage.HEADERWITHLINK',
|
'VirtualPage.HEADERWITHLINK',
|
||||||
"This is a virtual page copying content from \"{title}\" ({link})",
|
"This is a virtual page copying content from \"{title}\" ({link})",
|
||||||
array(
|
array(
|
||||||
'title' => $this->CopyContentFrom()->obj('Title'),
|
'title' => $this->CopyContentFrom()->obj('Title'),
|
||||||
@ -210,7 +210,7 @@ class VirtualPage extends Page {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(
|
if(
|
||||||
$this->CopyContentFromID
|
$this->CopyContentFromID
|
||||||
&& !Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->CopyContentFromID)
|
&& !Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->CopyContentFromID)
|
||||||
) {
|
) {
|
||||||
$msgs[] = _t(
|
$msgs[] = _t(
|
||||||
@ -219,7 +219,7 @@ class VirtualPage extends Page {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields->addFieldToTab("Root.Main",
|
$fields->addFieldToTab("Root.Main",
|
||||||
new LiteralField(
|
new LiteralField(
|
||||||
'VirtualPageMessage',
|
'VirtualPageMessage',
|
||||||
'<div class="message notice">' . implode('. ', $msgs) . '.</div>'
|
'<div class="message notice">' . implode('. ', $msgs) . '.</div>'
|
||||||
@ -233,7 +233,7 @@ class VirtualPage extends Page {
|
|||||||
public function getSettingsFields() {
|
public function getSettingsFields() {
|
||||||
$fields = parent::getSettingsFields();
|
$fields = parent::getSettingsFields();
|
||||||
if(!$this->CopyContentFrom()->exists()) {
|
if(!$this->CopyContentFrom()->exists()) {
|
||||||
$fields->addFieldToTab("Root.Settings",
|
$fields->addFieldToTab("Root.Settings",
|
||||||
new LiteralField(
|
new LiteralField(
|
||||||
'VirtualPageWarning',
|
'VirtualPageWarning',
|
||||||
'<div class="message notice">'
|
'<div class="message notice">'
|
||||||
@ -250,7 +250,7 @@ class VirtualPage extends Page {
|
|||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have to change it to copy all the content from the original page first.
|
* We have to change it to copy all the content from the original page first.
|
||||||
*/
|
*/
|
||||||
public function onBeforeWrite() {
|
public function onBeforeWrite() {
|
||||||
@ -303,7 +303,7 @@ class VirtualPage extends Page {
|
|||||||
if(!$this->extension_instances['Versioned']->migratingVersion) {
|
if(!$this->extension_instances['Versioned']->migratingVersion) {
|
||||||
if(
|
if(
|
||||||
$this->isChanged('CopyContentFromID')
|
$this->isChanged('CopyContentFromID')
|
||||||
&& $this->CopyContentFromID != 0
|
&& $this->CopyContentFromID != 0
|
||||||
&& $this instanceof VirtualPage
|
&& $this instanceof VirtualPage
|
||||||
) {
|
) {
|
||||||
$this->updateImageTracking();
|
$this->updateImageTracking();
|
||||||
@ -352,8 +352,8 @@ class VirtualPage extends Page {
|
|||||||
if(!$orig->stat('can_be_root') && !$this->ParentID) {
|
if(!$orig->stat('can_be_root') && !$this->ParentID) {
|
||||||
$result->error(
|
$result->error(
|
||||||
_t(
|
_t(
|
||||||
'VirtualPage.PageTypNotAllowedOnRoot',
|
'VirtualPage.PageTypNotAllowedOnRoot',
|
||||||
'Original page type "{type}" is not allowed on the root level for this virtual page',
|
'Original page type "{type}" is not allowed on the root level for this virtual page',
|
||||||
array('type' => $orig->i18n_singular_name())
|
array('type' => $orig->i18n_singular_name())
|
||||||
),
|
),
|
||||||
'CAN_BE_ROOT_VIRTUAL'
|
'CAN_BE_ROOT_VIRTUAL'
|
||||||
@ -407,7 +407,7 @@ class VirtualPage extends Page {
|
|||||||
* Allow attributes on the master page to pass
|
* Allow attributes on the master page to pass
|
||||||
* through to the virtual page
|
* through to the virtual page
|
||||||
*
|
*
|
||||||
* @param string $field
|
* @param string $field
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function __get($field) {
|
public function __get($field) {
|
||||||
@ -423,7 +423,7 @@ class VirtualPage extends Page {
|
|||||||
/**
|
/**
|
||||||
* Pass unrecognized method calls on to the original data object
|
* Pass unrecognized method calls on to the original data object
|
||||||
*
|
*
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @param string $args
|
* @param string $args
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@ -441,8 +441,8 @@ class VirtualPage extends Page {
|
|||||||
*/
|
*/
|
||||||
public function hasField($field) {
|
public function hasField($field) {
|
||||||
return (
|
return (
|
||||||
array_key_exists($field, $this->record)
|
array_key_exists($field, $this->record)
|
||||||
|| $this->hasDatabaseField($field)
|
|| $this->hasDatabaseField($field)
|
||||||
|| array_key_exists($field, $this->db()) // Needed for composite fields
|
|| array_key_exists($field, $this->db()) // Needed for composite fields
|
||||||
|| parent::hasMethod("get{$field}")
|
|| parent::hasMethod("get{$field}")
|
||||||
|| $this->CopyContentFrom()->hasField($field)
|
|| $this->CopyContentFrom()->hasField($field)
|
||||||
@ -451,8 +451,8 @@ class VirtualPage extends Page {
|
|||||||
/**
|
/**
|
||||||
* Overwrite to also check for method on the original data object
|
* Overwrite to also check for method on the original data object
|
||||||
*
|
*
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasMethod($method) {
|
public function hasMethod($method) {
|
||||||
if(parent::hasMethod($method)) return true;
|
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
|
* Also check the original object's original controller for the method
|
||||||
*
|
*
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasMethod($method) {
|
public function hasMethod($method) {
|
||||||
$haveIt = parent::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
|
* Pass unrecognized method calls on to the original controller
|
||||||
*
|
*
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @param string $args
|
* @param string $args
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
|
@ -128,8 +128,8 @@ class BrokenLinksReport extends SS_Report {
|
|||||||
'Draft' => _t('BrokenLinksReport.CheckSiteDropdownDraft', 'Draft Site')
|
'Draft' => _t('BrokenLinksReport.CheckSiteDropdownDraft', 'Draft Site')
|
||||||
)),
|
)),
|
||||||
new DropdownField(
|
new DropdownField(
|
||||||
'Reason',
|
'Reason',
|
||||||
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
||||||
array(
|
array(
|
||||||
'' => _t('BrokenLinksReport.Any', 'Any'),
|
'' => _t('BrokenLinksReport.Any', 'Any'),
|
||||||
'BROKENFILE' => _t('BrokenLinksReport.ReasonDropdownBROKENFILE', 'Broken file'),
|
'BROKENFILE' => _t('BrokenLinksReport.ReasonDropdownBROKENFILE', 'Broken file'),
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Standard basic search form which conducts a fulltext search on all {@link SiteTree}
|
* 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,
|
* If multilingual content is enabled through the {@link Translatable} extension,
|
||||||
* only pages the currently set language on the holder for this searchform are found.
|
* 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
|
* 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.
|
* 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
|
* @see Use ModelController and SearchContext for a more generic search implementation based around DataObject
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage search
|
* @subpackage search
|
||||||
@ -32,7 +32,7 @@ class SearchForm extends Form {
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param Controller $controller
|
* @param Controller $controller
|
||||||
* @param string $name The name of the form (used in URL addressing)
|
* @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
|
* @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.
|
* Return a rendered version of this form.
|
||||||
*
|
*
|
||||||
* This is returned when you access a form as $FormObject rather
|
* This is returned when you access a form as $FormObject rather
|
||||||
* than <% with FormObject %>
|
* than <% with FormObject %>
|
||||||
*/
|
*/
|
||||||
@ -84,7 +84,7 @@ class SearchForm extends Form {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the classes to search.
|
* 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) {
|
public function classesToSearch($classes) {
|
||||||
$illegalClasses = array_diff($classes, array('SiteTree', 'File'));
|
$illegalClasses = array_diff($classes, array('SiteTree', 'File'));
|
||||||
@ -101,13 +101,13 @@ class SearchForm extends Form {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getClassesToSearch() {
|
public function getClassesToSearch() {
|
||||||
return $this->classesToSearch;
|
return $this->classesToSearch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return dataObjectSet of the results using $_REQUEST to get info from form.
|
* Return dataObjectSet of the results using $_REQUEST to get info from form.
|
||||||
* Wraps around {@link searchEngine()}.
|
* Wraps around {@link searchEngine()}.
|
||||||
*
|
*
|
||||||
* @param int $pageLength DEPRECATED 2.3 Use SearchForm->pageLength
|
* @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.
|
* @param array $data Request data as an associative array. Should contain at least a key 'Search' with all searched keywords.
|
||||||
* @return SS_List
|
* @return SS_List
|
||||||
@ -193,7 +193,7 @@ class SearchForm extends Form {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the search query for display in a "You searched for ..." sentence.
|
* Get the search query for display in a "You searched for ..." sentence.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@ -207,7 +207,7 @@ class SearchForm extends Form {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the maximum number of records shown on each page.
|
* Set the maximum number of records shown on each page.
|
||||||
*
|
*
|
||||||
* @param int $length
|
* @param int $length
|
||||||
*/
|
*/
|
||||||
public function setPageLength($length) {
|
public function setPageLength($length) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#right form #deletemarked .middleColumn {
|
#right form #deletemarked .middleColumn {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
.dragfile,
|
.dragfile,
|
||||||
.dragfile img {
|
.dragfile img {
|
||||||
float: left;
|
float: left;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
@ -38,4 +38,4 @@ form#Form_AddForm .field span.readonly {
|
|||||||
/* Same as .checkboxAboveTree */
|
/* Same as .checkboxAboveTree */
|
||||||
border-top: 1px solid #CCCCCC;
|
border-top: 1px solid #CCCCCC;
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
div#SideReportsHolder {
|
div#SideReportsHolder {
|
||||||
clear: left;
|
clear: left;
|
||||||
}
|
}
|
||||||
|
@ -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-size: 80%;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Function: drop
|
* Function: drop
|
||||||
*
|
*
|
||||||
* Take selected files and move them to a folder target in the tree.
|
* Take selected files and move them to a folder target in the tree.
|
||||||
*/
|
*/
|
||||||
drop: function(e, ui) {
|
drop: function(e, ui) {
|
||||||
@ -44,10 +44,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: getSelected
|
* Function: getSelected
|
||||||
*
|
*
|
||||||
* Get the IDs of all selected files in the table.
|
* Get the IDs of all selected files in the table.
|
||||||
* Used for drag'n'drop.
|
* Used for drag'n'drop.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* Array
|
* Array
|
||||||
*/
|
*/
|
||||||
@ -69,8 +69,8 @@
|
|||||||
appendTo: 'body',
|
appendTo: 'body',
|
||||||
helper: function() {
|
helper: function() {
|
||||||
return $(
|
return $(
|
||||||
'<div class="NumFilesIndicator">' +
|
'<div class="NumFilesIndicator">'
|
||||||
ss.i18n.sprintf(ss.i18n._t('AssetTableField.MOVING'),container.getSelected().length) +
|
ss.i18n.sprintf(ss.i18n._t('AssetTableField.MOVING'),container.getSelected().length)
|
||||||
'</div>'
|
'</div>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -83,10 +83,10 @@
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Function: onmousedown
|
* Function: onmousedown
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*
|
*
|
||||||
* Automatically select the checkbox in the same table row
|
* Automatically select the checkbox in the same table row
|
||||||
* to signify that this element is moved, and hint that
|
* to signify that this element is moved, and hint that
|
||||||
* all checkboxed elements will be moved along with it.
|
* all checkboxed elements will be moved along with it.
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#Form_BatchActionsForm').entwine('.ss.tree').register(
|
$('#Form_BatchActionsForm').entwine('.ss.tree').register(
|
||||||
// TODO Hardcoding of base URL
|
// TODO Hardcoding of base URL
|
||||||
'admin/assets/batchactions/delete',
|
'admin/assets/batchactions/delete',
|
||||||
function(ids) {
|
function(ids) {
|
||||||
var confirmed = confirm(
|
var confirmed = confirm(
|
||||||
ss.i18n.sprintf(
|
ss.i18n.sprintf(
|
||||||
@ -55,7 +55,7 @@
|
|||||||
msg = ss.i18n._t('AssetAdmin.ConfirmDelete');
|
msg = ss.i18n._t('AssetAdmin.ConfirmDelete');
|
||||||
} else {
|
} else {
|
||||||
msg = ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE');
|
msg = ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE');
|
||||||
}
|
}
|
||||||
if(!confirm(msg)) return false;
|
if(!confirm(msg)) return false;
|
||||||
|
|
||||||
this.getGridField().reload({data: [{name: this.attr('name'), value: this.val()}]});
|
this.getGridField().reload({data: [{name: this.attr('name'), value: this.val()}]});
|
||||||
@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: onsubmit
|
* Function: onsubmit
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
* Similar implementation to LeftAndMain.Tree.js.
|
* Similar implementation to LeftAndMain.Tree.js.
|
||||||
*/
|
*/
|
||||||
updateTypeList: function() {
|
updateTypeList: function() {
|
||||||
var hints = this.data('hints'),
|
var hints = this.data('hints'),
|
||||||
parentTree = this.find('#Form_AddForm_ParentID_Holder .TreeDropdownField'),
|
parentTree = this.find('#Form_AddForm_ParentID_Holder .TreeDropdownField'),
|
||||||
parentMode = this.find("input[name=ParentModeField]:checked").val(),
|
parentMode = this.find("input[name=ParentModeField]:checked").val(),
|
||||||
metadata = parentTree.data('metadata'),
|
metadata = parentTree.data('metadata'),
|
||||||
@ -101,7 +101,7 @@
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Update the selection filter with the given blacklist and default selection
|
* Update the selection filter with the given blacklist and default selection
|
||||||
*
|
*
|
||||||
* @param array disallowedChildren
|
* @param array disallowedChildren
|
||||||
* @param string defaultChildClass
|
* @param string defaultChildClass
|
||||||
*/
|
*/
|
||||||
@ -109,7 +109,7 @@
|
|||||||
// Limit selection
|
// Limit selection
|
||||||
var allAllowed = null; // troolian
|
var allAllowed = null; // troolian
|
||||||
this.find('#Form_AddForm_PageType li').each(function() {
|
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);
|
isAllowed = ($.inArray(className, disallowedChildren) === -1);
|
||||||
|
|
||||||
$(this).setEnabled(isAllowed);
|
$(this).setEnabled(isAllowed);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form input[name=Title]
|
* Class: .cms-edit-form input[name=Title]
|
||||||
*
|
*
|
||||||
* Input validation on the Title field
|
* Input validation on the Title field
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form input[name=Title]').entwine({
|
$('.cms-edit-form input[name=Title]').entwine({
|
||||||
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: updateRelatedFields
|
* Function: updateRelatedFields
|
||||||
*
|
*
|
||||||
* Update the related fields if appropriate
|
* Update the related fields if appropriate
|
||||||
* (String) title The new title
|
* (String) title The new title
|
||||||
* (Stirng) origTitle The original title
|
* (Stirng) origTitle The original title
|
||||||
@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: updateURLSegment
|
* Function: updateURLSegment
|
||||||
*
|
*
|
||||||
* Update the URLSegment
|
* Update the URLSegment
|
||||||
* (String) title
|
* (String) title
|
||||||
*/
|
*/
|
||||||
@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: updateBreadcrumbLabel
|
* Function: updateBreadcrumbLabel
|
||||||
*
|
*
|
||||||
* Update the breadcrumb
|
* Update the breadcrumb
|
||||||
* (String) title
|
* (String) title
|
||||||
*/
|
*/
|
||||||
@ -110,9 +110,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: _addActions
|
* Function: _addActions
|
||||||
*
|
*
|
||||||
* Utility to add update from title action
|
* Utility to add update from title action
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
_addActions: function() {
|
_addActions: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form .parentTypeSelector
|
* Class: .cms-edit-form .parentTypeSelector
|
||||||
*
|
*
|
||||||
* ParentID field combination - mostly toggling between
|
* ParentID field combination - mostly toggling between
|
||||||
* the two radiobuttons and setting the hidden "ParentID" field
|
* the two radiobuttons and setting the hidden "ParentID" field
|
||||||
*/
|
*/
|
||||||
@ -159,7 +159,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: _toggleSelection
|
* Function: _toggleSelection
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
@ -175,7 +175,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: _changeParentId
|
* Function: _changeParentId
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form #CanViewType, .cms-edit-form #CanEditType
|
* Class: .cms-edit-form #CanViewType, .cms-edit-form #CanEditType
|
||||||
*
|
*
|
||||||
* Toggle display of group dropdown in "access" tab,
|
* Toggle display of group dropdown in "access" tab,
|
||||||
* based on selection of radiobuttons.
|
* based on selection of radiobuttons.
|
||||||
*/
|
*/
|
||||||
@ -226,20 +226,20 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_print
|
* Class: .cms-edit-form .Actions #Form_EditForm_action_print
|
||||||
*
|
*
|
||||||
* Open a printable representation of the form in a new window.
|
* Open a printable representation of the form in a new window.
|
||||||
* Used for readonly older versions of a specific page.
|
* Used for readonly older versions of a specific page.
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form .Actions #Form_EditForm_action_print').entwine({
|
$('.cms-edit-form .Actions #Form_EditForm_action_print').entwine({
|
||||||
/**
|
/**
|
||||||
* Function: onclick
|
* Function: onclick
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var printURL = $(this[0].form).attr('action').replace(/\?.*$/,'')
|
var printURL = $(this[0].form).attr('action').replace(/\?.*$/,'')
|
||||||
+ '/printable/'
|
+ '/printable/'
|
||||||
+ $(':input[name=ID]',this[0].form).val();
|
+ $(':input[name=ID]',this[0].form).val();
|
||||||
if(printURL.substr(0,7) != 'http://') printURL = $('base').attr('href') + printURL;
|
if(printURL.substr(0,7) != 'http://') printURL = $('base').attr('href') + printURL;
|
||||||
|
|
||||||
@ -251,14 +251,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_rollback
|
* Class: .cms-edit-form .Actions #Form_EditForm_action_rollback
|
||||||
*
|
*
|
||||||
* A "rollback" to a specific version needs user confirmation.
|
* A "rollback" to a specific version needs user confirmation.
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form .Actions #Form_EditForm_action_rollback').entwine({
|
$('.cms-edit-form .Actions #Form_EditForm_action_rollback').entwine({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: onclick
|
* Function: onclick
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
@ -266,7 +266,7 @@
|
|||||||
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
||||||
if(version) {
|
if(version) {
|
||||||
message = ss.i18n.sprintf(
|
message = ss.i18n.sprintf(
|
||||||
ss.i18n._t('CMSMain.RollbackToVersion'),
|
ss.i18n._t('CMSMain.RollbackToVersion'),
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -282,21 +282,21 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_archive
|
* Class: .cms-edit-form .Actions #Form_EditForm_action_archive
|
||||||
*
|
*
|
||||||
* Informing the user about the archive action while requiring confirmation
|
* Informing the user about the archive action while requiring confirmation
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form .Actions #Form_EditForm_action_archive').entwine({
|
$('.cms-edit-form .Actions #Form_EditForm_action_archive').entwine({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: onclick
|
* Function: onclick
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
||||||
message = ss.i18n.sprintf(
|
message = ss.i18n.sprintf(
|
||||||
ss.i18n._t('CMSMain.Archive'),
|
ss.i18n._t('CMSMain.Archive'),
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
if(confirm(message)) {
|
if(confirm(message)) {
|
||||||
@ -309,14 +309,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_restore
|
* Class: .cms-edit-form .Actions #Form_EditForm_action_restore
|
||||||
*
|
*
|
||||||
* Informing the user about the archive action while requiring confirmation
|
* Informing the user about the archive action while requiring confirmation
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form .Actions #Form_EditForm_action_restore').entwine({
|
$('.cms-edit-form .Actions #Form_EditForm_action_restore').entwine({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: onclick
|
* Function: onclick
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
@ -326,7 +326,7 @@
|
|||||||
message = '',
|
message = '',
|
||||||
toRoot = this.data('toRoot');
|
toRoot = this.data('toRoot');
|
||||||
message = ss.i18n.sprintf(
|
message = ss.i18n.sprintf(
|
||||||
ss.i18n._t(toRoot ? 'CMSMain.RestoreToRoot' : 'CMSMain.Restore'),
|
ss.i18n._t(toRoot ? 'CMSMain.RestoreToRoot' : 'CMSMain.Restore'),
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
if(confirm(message)) {
|
if(confirm(message)) {
|
||||||
@ -339,21 +339,21 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_delete
|
* Class: .cms-edit-form .Actions #Form_EditForm_action_delete
|
||||||
*
|
*
|
||||||
* Informing the user about the delete from draft action while requiring confirmation
|
* Informing the user about the delete from draft action while requiring confirmation
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form .Actions #Form_EditForm_action_delete').entwine({
|
$('.cms-edit-form .Actions #Form_EditForm_action_delete').entwine({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: onclick
|
* Function: onclick
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
||||||
message = ss.i18n.sprintf(
|
message = ss.i18n.sprintf(
|
||||||
ss.i18n._t('CMSMain.DeleteFromDraft'),
|
ss.i18n._t('CMSMain.DeleteFromDraft'),
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
if(confirm(message)) {
|
if(confirm(message)) {
|
||||||
@ -372,14 +372,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: onclick
|
* Function: onclick
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Event) e
|
* (Event) e
|
||||||
*/
|
*/
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
var form = this.parents('form:first'), version = form.find(':input[name=Version]').val(), message = '';
|
||||||
message = ss.i18n.sprintf(
|
message = ss.i18n.sprintf(
|
||||||
ss.i18n._t('CMSMain.Unpublish'),
|
ss.i18n._t('CMSMain.Unpublish'),
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
if(confirm(message)) {
|
if(confirm(message)) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
(function($) {
|
(function($) {
|
||||||
/**
|
/**
|
||||||
* File: CMSPageHistoryController.js
|
* 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
|
* left hand side of the panel and the version displaying on the right
|
||||||
* hand side.
|
* hand side.
|
||||||
*/
|
*/
|
||||||
@ -32,7 +32,7 @@
|
|||||||
* display based on whether we have two or 1 option selected
|
* display based on whether we have two or 1 option selected
|
||||||
*
|
*
|
||||||
* Todo:
|
* Todo:
|
||||||
* Handle coupling to admin url
|
* Handle coupling to admin url
|
||||||
*/
|
*/
|
||||||
onsubmit: function(e, d) {
|
onsubmit: function(e, d) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -116,7 +116,7 @@
|
|||||||
* Selects or deselects the row (if in compare mode). Will trigger
|
* Selects or deselects the row (if in compare mode). Will trigger
|
||||||
* an update of the edit form if either selected (in single mode)
|
* an update of the edit form if either selected (in single mode)
|
||||||
* or if this is the second row selected (in compare mode)
|
* or if this is the second row selected (in compare mode)
|
||||||
*/
|
*/
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var compare, selected;
|
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() {
|
_unselect: function() {
|
||||||
this.removeClass('active');
|
this.removeClass('active');
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
var field = this.find(':text'),
|
var field = this.find(':text'),
|
||||||
url = decodeURI(field.data('prefix') + field.val()),
|
url = decodeURI(field.data('prefix') + field.val()),
|
||||||
previewUrl = url;
|
previewUrl = url;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a value matching the criteria.
|
* Return a value matching the criteria.
|
||||||
*
|
*
|
||||||
* @param (String)
|
* @param (String)
|
||||||
* @param (Function)
|
* @param (Function)
|
||||||
*/
|
*/
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "إلغاء",
|
"URLSEGMENT.Cancel": "إلغاء",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Storno",
|
"URLSEGMENT.Cancel": "Storno",
|
||||||
"URLSEGMENT.UpdateURL": "Aktualizovat URL"
|
"URLSEGMENT.UpdateURL": "Aktualizovat URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Abbrechen",
|
"URLSEGMENT.Cancel": "Abbrechen",
|
||||||
"URLSEGMENT.UpdateURL": "URL aktualisieren"
|
"URLSEGMENT.UpdateURL": "URL aktualisieren"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Άκυρο"
|
"URLSEGMENT.Cancel": "Άκυρο"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Cancel",
|
"URLSEGMENT.Cancel": "Cancel",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Rezigni",
|
"URLSEGMENT.Cancel": "Rezigni",
|
||||||
"URLSEGMENT.UpdateURL": "Ĝisdatigi je URL"
|
"URLSEGMENT.UpdateURL": "Ĝisdatigi je URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Cancelar",
|
"URLSEGMENT.Cancel": "Cancelar",
|
||||||
"URLSEGMENT.UpdateURL": "Actualizar URL"
|
"URLSEGMENT.UpdateURL": "Actualizar URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "لغو",
|
"URLSEGMENT.Cancel": "لغو",
|
||||||
"URLSEGMENT.UpdateURL": "به روز رسانی URL"
|
"URLSEGMENT.UpdateURL": "به روز رسانی URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Peruuta",
|
"URLSEGMENT.Cancel": "Peruuta",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Annuler",
|
"URLSEGMENT.Cancel": "Annuler",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Mégsem",
|
"URLSEGMENT.Cancel": "Mégsem",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Batal",
|
"URLSEGMENT.Cancel": "Batal",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Hætta við",
|
"URLSEGMENT.Cancel": "Hætta við",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Annulla",
|
"URLSEGMENT.Cancel": "Annulla",
|
||||||
"URLSEGMENT.UpdateURL": "Aggiornare l'URL"
|
"URLSEGMENT.UpdateURL": "Aggiornare l'URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "キャンセル",
|
"URLSEGMENT.Cancel": "キャンセル",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "취소",
|
"URLSEGMENT.Cancel": "취소",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Atšaukti",
|
"URLSEGMENT.Cancel": "Atšaukti",
|
||||||
"URLSEGMENT.UpdateURL": "Atnaujinti URL dalį"
|
"URLSEGMENT.UpdateURL": "Atnaujinti URL dalį"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Whakakore",
|
"URLSEGMENT.Cancel": "Whakakore",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Avbryt",
|
"URLSEGMENT.Cancel": "Avbryt",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Annuleren",
|
"URLSEGMENT.Cancel": "Annuleren",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Anuluj",
|
"URLSEGMENT.Cancel": "Anuluj",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Renunţare",
|
"URLSEGMENT.Cancel": "Renunţare",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Отмена",
|
"URLSEGMENT.Cancel": "Отмена",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Zrušiť",
|
"URLSEGMENT.Cancel": "Zrušiť",
|
||||||
"URLSEGMENT.UpdateURL": "Aktualizovať URL"
|
"URLSEGMENT.UpdateURL": "Aktualizovať URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Prekliči",
|
"URLSEGMENT.Cancel": "Prekliči",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Одустани",
|
"URLSEGMENT.Cancel": "Одустани",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Odustani",
|
"URLSEGMENT.Cancel": "Odustani",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "موافق",
|
"URLSEGMENT.OK": "موافق",
|
||||||
"URLSEGMENT.Cancel": "إلغاء",
|
"URLSEGMENT.Cancel": "إلغاء",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Storno",
|
"URLSEGMENT.Cancel": "Storno",
|
||||||
"URLSEGMENT.UpdateURL": "Aktualizovat URL"
|
"URLSEGMENT.UpdateURL": "Aktualizovat URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Abbrechen",
|
"URLSEGMENT.Cancel": "Abbrechen",
|
||||||
"URLSEGMENT.UpdateURL": "URL aktualisieren"
|
"URLSEGMENT.UpdateURL": "URL aktualisieren"
|
||||||
}
|
}
|
||||||
|
@ -36,4 +36,4 @@
|
|||||||
"URLSEGMENT.Edit": "Επεξεργασία",
|
"URLSEGMENT.Edit": "Επεξεργασία",
|
||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Άκυρο"
|
"URLSEGMENT.Cancel": "Άκυρο"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Cancel",
|
"URLSEGMENT.Cancel": "Cancel",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "Akcepti",
|
"URLSEGMENT.OK": "Akcepti",
|
||||||
"URLSEGMENT.Cancel": "Rezigni",
|
"URLSEGMENT.Cancel": "Rezigni",
|
||||||
"URLSEGMENT.UpdateURL": "Ĝisdatigi je URL"
|
"URLSEGMENT.UpdateURL": "Ĝisdatigi je URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "Ok",
|
"URLSEGMENT.OK": "Ok",
|
||||||
"URLSEGMENT.Cancel": "Cancelar",
|
"URLSEGMENT.Cancel": "Cancelar",
|
||||||
"URLSEGMENT.UpdateURL": "Actualizar URL"
|
"URLSEGMENT.UpdateURL": "Actualizar URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "تایید",
|
"URLSEGMENT.OK": "تایید",
|
||||||
"URLSEGMENT.Cancel": "لغو",
|
"URLSEGMENT.Cancel": "لغو",
|
||||||
"URLSEGMENT.UpdateURL": "به روز رسانی URL"
|
"URLSEGMENT.UpdateURL": "به روز رسانی URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Peruuta",
|
"URLSEGMENT.Cancel": "Peruuta",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "Ok",
|
"URLSEGMENT.OK": "Ok",
|
||||||
"URLSEGMENT.Cancel": "Annuler",
|
"URLSEGMENT.Cancel": "Annuler",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Mégsem",
|
"URLSEGMENT.Cancel": "Mégsem",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Batal",
|
"URLSEGMENT.Cancel": "Batal",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "Allt í lagi",
|
"URLSEGMENT.OK": "Allt í lagi",
|
||||||
"URLSEGMENT.Cancel": "Hætta við",
|
"URLSEGMENT.Cancel": "Hætta við",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Annulla",
|
"URLSEGMENT.Cancel": "Annulla",
|
||||||
"URLSEGMENT.UpdateURL": "Aggiornare l'URL"
|
"URLSEGMENT.UpdateURL": "Aggiornare l'URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "キャンセル",
|
"URLSEGMENT.Cancel": "キャンセル",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "취소",
|
"URLSEGMENT.Cancel": "취소",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "Gerai",
|
"URLSEGMENT.OK": "Gerai",
|
||||||
"URLSEGMENT.Cancel": "Atšaukti",
|
"URLSEGMENT.Cancel": "Atšaukti",
|
||||||
"URLSEGMENT.UpdateURL": "Atnaujinti URL dalį"
|
"URLSEGMENT.UpdateURL": "Atnaujinti URL dalį"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "ĀE",
|
"URLSEGMENT.OK": "ĀE",
|
||||||
"URLSEGMENT.Cancel": "Whakakore",
|
"URLSEGMENT.Cancel": "Whakakore",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Avbryt",
|
"URLSEGMENT.Cancel": "Avbryt",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Annuleren",
|
"URLSEGMENT.Cancel": "Annuleren",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Anuluj",
|
"URLSEGMENT.Cancel": "Anuluj",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Renunţare",
|
"URLSEGMENT.Cancel": "Renunţare",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "ОК",
|
"URLSEGMENT.OK": "ОК",
|
||||||
"URLSEGMENT.Cancel": "Отмена",
|
"URLSEGMENT.Cancel": "Отмена",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Zrušiť",
|
"URLSEGMENT.Cancel": "Zrušiť",
|
||||||
"URLSEGMENT.UpdateURL": "Aktualizovať URL"
|
"URLSEGMENT.UpdateURL": "Aktualizovať URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Prekliči",
|
"URLSEGMENT.Cancel": "Prekliči",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "У реду",
|
"URLSEGMENT.OK": "У реду",
|
||||||
"URLSEGMENT.Cancel": "Одустани",
|
"URLSEGMENT.Cancel": "Одустани",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "U redu",
|
"URLSEGMENT.OK": "U redu",
|
||||||
"URLSEGMENT.Cancel": "Odustani",
|
"URLSEGMENT.Cancel": "Odustani",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "OK",
|
"URLSEGMENT.OK": "OK",
|
||||||
"URLSEGMENT.Cancel": "Avbryt",
|
"URLSEGMENT.Cancel": "Avbryt",
|
||||||
"URLSEGMENT.UpdateURL": "Uppdatera URL"
|
"URLSEGMENT.UpdateURL": "Uppdatera URL"
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@
|
|||||||
"URLSEGMENT.OK": "确定",
|
"URLSEGMENT.OK": "确定",
|
||||||
"URLSEGMENT.Cancel": "取消",
|
"URLSEGMENT.Cancel": "取消",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "Avbryt",
|
"URLSEGMENT.Cancel": "Avbryt",
|
||||||
"URLSEGMENT.UpdateURL": "Uppdatera URL"
|
"URLSEGMENT.UpdateURL": "Uppdatera URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,4 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
"URLSEGMENT.Cancel": "取消",
|
"URLSEGMENT.Cancel": "取消",
|
||||||
"URLSEGMENT.UpdateURL": "Update URL"
|
"URLSEGMENT.UpdateURL": "Update URL"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
.cms-content-fields {
|
.cms-content-fields {
|
||||||
.cms-edit-form.AssetAdmin {
|
.cms-edit-form.AssetAdmin {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-y:auto; //adds scrolling only to the datagrid
|
overflow-y:auto; //adds scrolling only to the datagrid
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,5 +60,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Style custom to the CMSMain admin interface. CMSMain extends the built in
|
* 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
|
* 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
|
* 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.
|
* way then it should be include in the admin scss files.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
@ -123,4 +123,4 @@
|
|||||||
|
|
||||||
#Form_EditForm #Title .update {
|
#Form_EditForm #Title .update {
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* This file is the central collection of included modules, links to custom SCSS files,
|
* This file is the central collection of included modules, links to custom SCSS files,
|
||||||
* and any global SCSS variable definitions.
|
* and any global SCSS variable definitions.
|
||||||
*
|
*
|
||||||
* DO NOT ADD stylesheet rules to this file directly!
|
* DO NOT ADD stylesheet rules to this file directly!
|
||||||
*
|
*
|
||||||
* Note: By prefixing files with an underscore, they won't create individual CSS files.
|
* Note: By prefixing files with an underscore, they won't create individual CSS files.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Shows the pages to an administrator, who can then
|
* Shows the pages to an administrator, who can then
|
||||||
* decide which pages to remove by ticking a checkbox
|
* decide which pages to remove by ticking a checkbox
|
||||||
* and manually executing the removal.
|
* and manually executing the removal.
|
||||||
*
|
*
|
||||||
* Caution: Pages also count as orphans if they don't
|
* Caution: Pages also count as orphans if they don't
|
||||||
* have parents in this stage, even if the parent has a representation
|
* have parents in this stage, even if the parent has a representation
|
||||||
* in the other stage:
|
* in the other stage:
|
||||||
@ -16,7 +16,7 @@
|
|||||||
* before and after orphan removal.
|
* before and after orphan removal.
|
||||||
*
|
*
|
||||||
* @author Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
|
* @author Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage tasks
|
* @subpackage tasks
|
||||||
*/
|
*/
|
||||||
@ -87,13 +87,13 @@ in the other stage:<br />
|
|||||||
$latestAuthor = DataObject::get_by_id('Member', $latestVersion->AuthorID);
|
$latestAuthor = DataObject::get_by_id('Member', $latestVersion->AuthorID);
|
||||||
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
|
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
|
||||||
$stageRecord = Versioned::get_one_by_stage(
|
$stageRecord = Versioned::get_one_by_stage(
|
||||||
$this->orphanedSearchClass,
|
$this->orphanedSearchClass,
|
||||||
'Stage',
|
'Stage',
|
||||||
array("\"$orphanBaseClass\".\"ID\"" => $orphan->ID)
|
array("\"$orphanBaseClass\".\"ID\"" => $orphan->ID)
|
||||||
);
|
);
|
||||||
$liveRecord = Versioned::get_one_by_stage(
|
$liveRecord = Versioned::get_one_by_stage(
|
||||||
$this->orphanedSearchClass,
|
$this->orphanedSearchClass,
|
||||||
'Live',
|
'Live',
|
||||||
array("\"$orphanBaseClass\".\"ID\"" => $orphan->ID)
|
array("\"$orphanBaseClass\".\"ID\"" => $orphan->ID)
|
||||||
);
|
);
|
||||||
$label = sprintf(
|
$label = sprintf(
|
||||||
@ -125,11 +125,11 @@ in the other stage:<br />
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
$fields->push(new OptionSetField(
|
$fields->push(new OptionSetField(
|
||||||
'OrphanOperation',
|
'OrphanOperation',
|
||||||
_t('RemoveOrphanedPagesTask.CHOOSEOPERATION', 'Choose operation:'),
|
_t('RemoveOrphanedPagesTask.CHOOSEOPERATION', 'Choose operation:'),
|
||||||
array(
|
array(
|
||||||
'rebase' => _t(
|
'rebase' => _t(
|
||||||
'RemoveOrphanedPagesTask.OPERATION_REBASE',
|
'RemoveOrphanedPagesTask.OPERATION_REBASE',
|
||||||
sprintf(
|
sprintf(
|
||||||
'Rebase selected to a new holder page "%s" and unpublish. None of these pages will show up for website visitors.',
|
'Rebase selected to a new holder page "%s" and unpublish. None of these pages will show up for website visitors.',
|
||||||
$this->rebaseHolderTitle()
|
$this->rebaseHolderTitle()
|
||||||
@ -143,7 +143,7 @@ in the other stage:<br />
|
|||||||
'Warning',
|
'Warning',
|
||||||
sprintf('<p class="message">%s</p>',
|
sprintf('<p class="message">%s</p>',
|
||||||
_t(
|
_t(
|
||||||
'RemoveOrphanedPagesTask.DELETEWARNING',
|
'RemoveOrphanedPagesTask.DELETEWARNING',
|
||||||
'Warning: These operations are not reversible. Please handle with care.'
|
'Warning: These operations are not reversible. Please handle with care.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -216,8 +216,8 @@ in the other stage:<br />
|
|||||||
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
|
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
|
||||||
foreach($orphanIDs as $id) {
|
foreach($orphanIDs as $id) {
|
||||||
$stageRecord = Versioned::get_one_by_stage(
|
$stageRecord = Versioned::get_one_by_stage(
|
||||||
$this->orphanedSearchClass,
|
$this->orphanedSearchClass,
|
||||||
'Stage',
|
'Stage',
|
||||||
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
||||||
);
|
);
|
||||||
if($stageRecord) {
|
if($stageRecord) {
|
||||||
@ -227,8 +227,8 @@ in the other stage:<br />
|
|||||||
unset($stageRecord);
|
unset($stageRecord);
|
||||||
}
|
}
|
||||||
$liveRecord = Versioned::get_one_by_stage(
|
$liveRecord = Versioned::get_one_by_stage(
|
||||||
$this->orphanedSearchClass,
|
$this->orphanedSearchClass,
|
||||||
'Live',
|
'Live',
|
||||||
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
||||||
);
|
);
|
||||||
if($liveRecord) {
|
if($liveRecord) {
|
||||||
@ -258,7 +258,7 @@ in the other stage:<br />
|
|||||||
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
|
$orphanBaseClass = ClassInfo::baseDataClass($this->orphanedSearchClass);
|
||||||
foreach($orphanIDs as $id) {
|
foreach($orphanIDs as $id) {
|
||||||
$stageRecord = Versioned::get_one_by_stage(
|
$stageRecord = Versioned::get_one_by_stage(
|
||||||
$this->orphanedSearchClass,
|
$this->orphanedSearchClass,
|
||||||
'Stage',
|
'Stage',
|
||||||
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
||||||
);
|
);
|
||||||
@ -273,7 +273,7 @@ in the other stage:<br />
|
|||||||
//unset($stageRecord);
|
//unset($stageRecord);
|
||||||
}
|
}
|
||||||
$liveRecord = Versioned::get_one_by_stage(
|
$liveRecord = Versioned::get_one_by_stage(
|
||||||
$this->orphanedSearchClass,
|
$this->orphanedSearchClass,
|
||||||
'Live',
|
'Live',
|
||||||
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
array("\"$orphanBaseClass\".\"ID\"" => $id)
|
||||||
);
|
);
|
||||||
@ -298,7 +298,7 @@ in the other stage:<br />
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all orphans from "Stage" and "Live" stages.
|
* Gets all orphans from "Stage" and "Live" stages.
|
||||||
*
|
*
|
||||||
* @param string $class
|
* @param string $class
|
||||||
* @param array $filter
|
* @param array $filter
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
|
@ -18,14 +18,14 @@ class SiteTreeMaintenanceTask extends Controller {
|
|||||||
$page->write();
|
$page->write();
|
||||||
if($urlSegment != $page->URLSegment) {
|
if($urlSegment != $page->URLSegment) {
|
||||||
echo _t(
|
echo _t(
|
||||||
'SiteTree.LINKSCHANGEDTO',
|
'SiteTree.LINKSCHANGEDTO',
|
||||||
" changed {url1} -> {url2}",
|
" changed {url1} -> {url2}",
|
||||||
array('url1' => $urlSegment, 'url2' => $page->URLSegment)
|
array('url1' => $urlSegment, 'url2' => $page->URLSegment)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo _t(
|
echo _t(
|
||||||
'SiteTree.LINKSALREADYUNIQUE',
|
'SiteTree.LINKSALREADYUNIQUE',
|
||||||
" {url} is already unique",
|
" {url} is already unique",
|
||||||
array('url' => $urlSegment)
|
array('url' => $urlSegment)
|
||||||
);
|
);
|
||||||
|
@ -11,4 +11,4 @@
|
|||||||
$Form
|
$Form
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<div class="message $Classes">
|
<div class="message $Classes">
|
||||||
<p>$Content</p>
|
<p>$Content</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,4 +20,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end_loop %>
|
<% end_loop %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -27,4 +27,4 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -25,4 +25,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,4 +22,4 @@
|
|||||||
$ListViewForm
|
$ListViewForm
|
||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
<div class="cms-panel-content cms-helper-hide-actions center">
|
<div class="cms-panel-content cms-helper-hide-actions center">
|
||||||
$VersionsForm
|
$VersionsForm
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,4 +38,4 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,4 +18,4 @@
|
|||||||
<%t ContentController.Email "Email" %>: $Username<br />
|
<%t ContentController.Email "Email" %>: $Username<br />
|
||||||
<%t ContentController.Password "Password" %>: $Password<br />
|
<%t ContentController.Password "Password" %>: $Password<br />
|
||||||
</p>
|
</p>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
|
@ -23,4 +23,4 @@
|
|||||||
<% end_with %>
|
<% end_with %>
|
||||||
<% include TableListField %>
|
<% include TableListField %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
<a id="SilverStripeNavigatorLink" href="#">
|
<a id="SilverStripeNavigatorLink" href="#">
|
||||||
<% _t('SilverStripeNavigatorLink.ShareLink','Share link') %>
|
<% _t('SilverStripeNavigatorLink.ShareLink','Share link') %>
|
||||||
</a>
|
</a>
|
||||||
|
@ -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.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
|
||||||
|
@ -15,4 +15,4 @@
|
|||||||
<% _t('URLSegmentField.Cancel', 'Cancel') %>
|
<% _t('URLSegmentField.Cancel', 'Cancel') %>
|
||||||
</button>
|
</button>
|
||||||
<% if $HelpText %><p class="help">$HelpText</p><% end_if %>
|
<% if $HelpText %><p class="help">$HelpText</p><% end_if %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,4 +30,4 @@ saucelabs:
|
|||||||
capabilities:
|
capabilities:
|
||||||
platform: "Windows 2008"
|
platform: "Windows 2008"
|
||||||
browser: "firefox"
|
browser: "firefox"
|
||||||
version: "15"
|
version: "15"
|
||||||
|
@ -47,7 +47,7 @@ class FeatureContext extends \SilverStripe\Framework\Test\Behaviour\FeatureConte
|
|||||||
$obj->publish('Stage', 'Live');
|
$obj->publish('Stage', 'Live');
|
||||||
});
|
});
|
||||||
$factory->define($class, $blueprint);
|
$factory->define($class, $blueprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@ class FixtureContext extends \SilverStripe\BehatExtension\Context\FixtureContext
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find or create a redirector page and link to another existing page.
|
* 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>[^"]+)"$/
|
* @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" (:?which )?redirects to (?:(an|a|the) )"(?<targetType>[^"]+)" "(?<targetId>[^"]+)"$/
|
||||||
*/
|
*/
|
||||||
public function stepCreateRedirectorPage($type, $id, $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
|
* 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 be editable by "Admin"
|
||||||
*
|
*
|
||||||
* @Then /^pages should( not? |\s*)be editable by "([^"]*)"$/
|
* @Then /^pages should( not? |\s*)be editable by "([^"]*)"$/
|
||||||
*/
|
*/
|
||||||
public function pagesShouldBeEditableBy($negative, $member){
|
public function pagesShouldBeEditableBy($negative, $member){
|
||||||
$page = \Page::get()->First();
|
$page = \Page::get()->First();
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
new Step\Given('I am not logged in'),
|
new Step\Given('I am not logged in'),
|
||||||
new Step\Given('I am logged in with "' . $member . '" permissions'),
|
new Step\Given('I am logged in with "' . $member . '" permissions'),
|
||||||
|
@ -26,7 +26,7 @@ class ThemeContext extends BehatContext {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a test theme
|
* Create a test theme
|
||||||
*
|
*
|
||||||
* @Given /^a theme "(?<theme>[^"]+)"/
|
* @Given /^a theme "(?<theme>[^"]+)"/
|
||||||
*/
|
*/
|
||||||
public function stepCreateTheme($theme) {
|
public function stepCreateTheme($theme) {
|
||||||
@ -39,7 +39,7 @@ class ThemeContext extends BehatContext {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a template within a test theme
|
* Create a template within a test theme
|
||||||
*
|
*
|
||||||
* @Given /^a template "(?<template>[^"]+)" in theme "(?<theme>[^"]+)" with content "(?<content>[^"]+)"/
|
* @Given /^a template "(?<template>[^"]+)" in theme "(?<theme>[^"]+)" with content "(?<content>[^"]+)"/
|
||||||
*/
|
*/
|
||||||
public function stepCreateTemplate($template, $theme, $content) {
|
public function stepCreateTemplate($template, $theme, $content) {
|
||||||
@ -76,7 +76,7 @@ class ThemeContext extends BehatContext {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up any theme manipulation
|
* Clean up any theme manipulation
|
||||||
*
|
*
|
||||||
* @AfterScenario
|
* @AfterScenario
|
||||||
*/
|
*/
|
||||||
public function cleanThemesAfterScenario() {
|
public function cleanThemesAfterScenario() {
|
||||||
|
@ -118,7 +118,7 @@ class CMSMainTest extends FunctionalTest {
|
|||||||
$this->assertArrayHasKey($page2->ID, $responseData['modified']);
|
$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');
|
$pageID = $this->idFromFixture('RedirectorPage', 'page5');
|
||||||
$latestID = DB::prepared_query('select max("Version") from "RedirectorPage_versions" where "RecordID" = ?', array($pageID))->value();
|
$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();
|
$dsCount = DB::prepared_query('select count("Version") from "RedirectorPage_versions" where "RecordID" = ? and "Version"= ?', array($pageID, $latestID))->value();
|
||||||
|
@ -21,7 +21,7 @@ class CMSPageHistoryControllerTest extends FunctionalTest {
|
|||||||
$this->page = new Page();
|
$this->page = new Page();
|
||||||
$this->page->URLSegment = "test";
|
$this->page->URLSegment = "test";
|
||||||
$this->page->Content = "new content";
|
$this->page->Content = "new content";
|
||||||
$this->page->write();
|
$this->page->write();
|
||||||
$this->versionUnpublishedCheck = $this->page->Version;
|
$this->versionUnpublishedCheck = $this->page->Version;
|
||||||
|
|
||||||
$this->page->Content = "some further content";
|
$this->page->Content = "some further content";
|
||||||
|
@ -7,4 +7,4 @@ Page:
|
|||||||
Sort: 2
|
Sort: 2
|
||||||
page3:
|
page3:
|
||||||
Title: Page 3
|
Title: Page 3
|
||||||
Sort: 3
|
Sort: 3
|
||||||
|
@ -91,8 +91,8 @@ class CMSSiteTreeFilterTest extends SapphireTest {
|
|||||||
$deletedPageID = $deletedPage->ID;
|
$deletedPageID = $deletedPage->ID;
|
||||||
$deletedPage->delete();
|
$deletedPage->delete();
|
||||||
$deletedPage = Versioned::get_one_by_stage(
|
$deletedPage = Versioned::get_one_by_stage(
|
||||||
'SiteTree',
|
'SiteTree',
|
||||||
'Live',
|
'Live',
|
||||||
array('"SiteTree_Live"."ID"' => $deletedPageID)
|
array('"SiteTree_Live"."ID"' => $deletedPageID)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -108,8 +108,8 @@ class CMSSiteTreeFilterTest extends SapphireTest {
|
|||||||
$draftPage = $this->objFromFixture('Page', 'page4');
|
$draftPage = $this->objFromFixture('Page', 'page4');
|
||||||
$draftPage->publish('Stage', 'Stage');
|
$draftPage->publish('Stage', 'Stage');
|
||||||
$draftPage = Versioned::get_one_by_stage(
|
$draftPage = Versioned::get_one_by_stage(
|
||||||
'SiteTree',
|
'SiteTree',
|
||||||
'Stage',
|
'Stage',
|
||||||
sprintf('"SiteTree"."ID" = %d', $draftPage->ID)
|
sprintf('"SiteTree"."ID" = %d', $draftPage->ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -144,8 +144,8 @@ class CMSSiteTreeFilterTest extends SapphireTest {
|
|||||||
$removedDraftPage->doPublish();
|
$removedDraftPage->doPublish();
|
||||||
$removedDraftPage->deleteFromStage('Stage');
|
$removedDraftPage->deleteFromStage('Stage');
|
||||||
$removedDraftPage = Versioned::get_one_by_stage(
|
$removedDraftPage = Versioned::get_one_by_stage(
|
||||||
'SiteTree',
|
'SiteTree',
|
||||||
'Live',
|
'Live',
|
||||||
sprintf('"SiteTree"."ID" = %d', $removedDraftPage->ID)
|
sprintf('"SiteTree"."ID" = %d', $removedDraftPage->ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ Page:
|
|||||||
page6:
|
page6:
|
||||||
Title: Page 6
|
Title: Page 6
|
||||||
page7:
|
page7:
|
||||||
Title: Page 7
|
Title: Page 7
|
||||||
page7a:
|
page7a:
|
||||||
Parent: =>Page.page7
|
Parent: =>Page.page7
|
||||||
Title: Page 7a
|
Title: Page 7a
|
||||||
page2a:
|
page2a:
|
||||||
Parent: =>Page.page2
|
Parent: =>Page.page2
|
||||||
@ -28,4 +28,4 @@ Page:
|
|||||||
Title: Page 3a
|
Title: Page 3a
|
||||||
page3b:
|
page3b:
|
||||||
Parent: =>Page.page3
|
Parent: =>Page.page3
|
||||||
Title: Page 3b
|
Title: Page 3b
|
||||||
|
@ -34,7 +34,7 @@ class ContentControllerPermissionsTest extends FunctionalTest {
|
|||||||
// should redirect to login
|
// should redirect to login
|
||||||
$this->assertEquals($response->getStatusCode(), 302, 'Redirects to login page when not logged in for draft stage');
|
$this->assertEquals($response->getStatusCode(), 302, 'Redirects to login page when not logged in for draft stage');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
Config::inst()->get('Security', 'login_url'),
|
Config::inst()->get('Security', 'login_url'),
|
||||||
$response->getHeader('Location')
|
$response->getHeader('Location')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ class ContentControllerSearchExtensionTest extends SapphireTest {
|
|||||||
$page->URLSegment = 'whatever';
|
$page->URLSegment = 'whatever';
|
||||||
$page->Content = 'oh really?';
|
$page->Content = 'oh really?';
|
||||||
$page->write();
|
$page->write();
|
||||||
$page->publish('Stage', 'Live');
|
$page->publish('Stage', 'Live');
|
||||||
$controller = new ContentController($page);
|
$controller = new ContentController($page);
|
||||||
$form = $controller->SearchForm();
|
$form = $controller->SearchForm();
|
||||||
|
|
||||||
if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch());
|
if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch());
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*/
|
*/
|
||||||
class ContentControllerTest extends FunctionalTest {
|
class ContentControllerTest extends FunctionalTest {
|
||||||
|
|
||||||
protected static $fixture_file = 'ContentControllerTest.yml';
|
protected static $fixture_file = 'ContentControllerTest.yml';
|
||||||
|
|
||||||
protected static $use_draft_site = true;
|
protected static $use_draft_site = true;
|
||||||
|
|
||||||
protected static $disable_themes = true;
|
protected static $disable_themes = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that nested pages, basic actions, and nested/non-nested URL switching works properly
|
* 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(){
|
public function testViewDraft(){
|
||||||
|
|
||||||
// test when user does not have permission, should get login form
|
// test when user does not have permission, should get login form
|
||||||
$this->logInWithPermission('EDITOR');
|
$this->logInWithPermission('EDITOR');
|
||||||
try {
|
try {
|
||||||
@ -103,21 +103,21 @@ class ContentControllerTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->assertEquals('403', $response->getstatusCode());
|
$this->assertEquals('403', $response->getstatusCode());
|
||||||
|
|
||||||
|
|
||||||
// test when user does have permission, should show page title and header ok.
|
// test when user does have permission, should show page title and header ok.
|
||||||
$this->logInWithPermission('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
$this->assertEquals('200', $this->get('/contact/?stage=Stage')->getstatusCode());
|
$this->assertEquals('200', $this->get('/contact/?stage=Stage')->getstatusCode());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLinkShortcodes() {
|
public function testLinkShortcodes() {
|
||||||
$linkedPage = new SiteTree();
|
$linkedPage = new SiteTree();
|
||||||
$linkedPage->URLSegment = 'linked-page';
|
$linkedPage->URLSegment = 'linked-page';
|
||||||
$linkedPage->write();
|
$linkedPage->write();
|
||||||
$linkedPage->publish('Stage', 'Live');
|
$linkedPage->publish('Stage', 'Live');
|
||||||
|
|
||||||
$page = new SiteTree();
|
$page = new SiteTree();
|
||||||
$page->URLSegment = 'linking-page';
|
$page->URLSegment = 'linking-page';
|
||||||
$page->Content = sprintf('<a href="[sitetree_link,id=%s]">Testlink</a>', $linkedPage->ID);
|
$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(),
|
$this->get($page->RelativeLink())->getBody(),
|
||||||
'"sitetree_link" shortcodes get parsed properly'
|
'"sitetree_link" shortcodes get parsed properly'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -138,7 +138,7 @@ class ContentControllerTest extends FunctionalTest {
|
|||||||
* @covers ContentController::getViewer()
|
* @covers ContentController::getViewer()
|
||||||
**/
|
**/
|
||||||
public function testGetViewer() {
|
public function testGetViewer() {
|
||||||
|
|
||||||
$self = $this;
|
$self = $this;
|
||||||
$this->useTestTheme(dirname(__FILE__), 'controllertest', function() use ($self) {
|
$this->useTestTheme(dirname(__FILE__), 'controllertest', function() use ($self) {
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@ Group:
|
|||||||
Title: Editors
|
Title: Editors
|
||||||
admins:
|
admins:
|
||||||
Title: Administrators
|
Title: Administrators
|
||||||
|
|
||||||
Permission:
|
Permission:
|
||||||
admins:
|
admins:
|
||||||
Code: VIEW_DRAFT_CONTENT
|
Code: VIEW_DRAFT_CONTENT
|
||||||
Group: =>Group.admins
|
Group: =>Group.admins
|
||||||
editors:
|
editors:
|
||||||
Group: =>Group.editors
|
Group: =>Group.editors
|
||||||
|
|
||||||
Member:
|
Member:
|
||||||
editor:
|
editor:
|
||||||
FirstName: Test
|
FirstName: Test
|
||||||
@ -43,4 +43,4 @@ ContentControllerTest_Page:
|
|||||||
URLSegment: contact
|
URLSegment: contact
|
||||||
CanViewType: OnlyTheseUsers
|
CanViewType: OnlyTheseUsers
|
||||||
EditorGroups: =>Group.admins
|
EditorGroups: =>Group.admins
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
protected $orig = array();
|
protected $orig = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New tests require nested urls to be enabled, but the site might not
|
* New tests require nested urls to be enabled, but the site might not
|
||||||
* support nested URLs.
|
* support nested URLs.
|
||||||
* This setup will enable nested-urls for this test and resets the state
|
* This setup will enable nested-urls for this test and resets the state
|
||||||
* after the tests have been performed.
|
* 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
|
* New tests require nested urls to be enabled, but the site might not
|
||||||
* support nested URLs.
|
* support nested URLs.
|
||||||
* This setup will enable nested-urls for this test and resets the state
|
* This setup will enable nested-urls for this test and resets the state
|
||||||
* after the tests have been performed.
|
* after the tests have been performed.
|
||||||
*/
|
*/
|
||||||
@ -81,14 +81,14 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
* all pages will be found by their old segments.
|
* all pages will be found by their old segments.
|
||||||
*
|
*
|
||||||
* NOTE: This test requires nested_urls
|
* NOTE: This test requires nested_urls
|
||||||
*
|
*
|
||||||
* Original: level1/level2/level3
|
* Original: level1/level2/level3
|
||||||
* Republished as: newlevel1/newlevel2/newlevel3
|
* Republished as: newlevel1/newlevel2/newlevel3
|
||||||
*/
|
*/
|
||||||
public function testRedirectsNestedRenamedPages(){
|
public function testRedirectsNestedRenamedPages(){
|
||||||
$this->generateNestedPagesFixture();
|
$this->generateNestedPagesFixture();
|
||||||
|
|
||||||
// check a first level URLSegment
|
// check a first level URLSegment
|
||||||
$response = $this->get('level1/action');
|
$response = $this->get('level1/action');
|
||||||
$this->assertEquals($response->getStatusCode(),301);
|
$this->assertEquals($response->getStatusCode(),301);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
@ -96,7 +96,7 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
$response->getHeader('Location')
|
$response->getHeader('Location')
|
||||||
);
|
);
|
||||||
|
|
||||||
// check second level URLSegment
|
// check second level URLSegment
|
||||||
$response = $this->get('newlevel1/level2');
|
$response = $this->get('newlevel1/level2');
|
||||||
$this->assertEquals($response->getStatusCode(),301 );
|
$this->assertEquals($response->getStatusCode(),301 );
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
@ -104,7 +104,7 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
$response->getHeader('Location')
|
$response->getHeader('Location')
|
||||||
);
|
);
|
||||||
|
|
||||||
// check third level URLSegment
|
// check third level URLSegment
|
||||||
$response = $this->get('newlevel1/newlevel2/level3');
|
$response = $this->get('newlevel1/newlevel2/level3');
|
||||||
$this->assertEquals($response->getStatusCode(), 301);
|
$this->assertEquals($response->getStatusCode(), 301);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
@ -199,7 +199,7 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
|
|
||||||
$response = $this->get('newlevel1/otherparent');
|
$response = $this->get('newlevel1/otherparent');
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$response->getStatusCode(),
|
$response->getStatusCode(),
|
||||||
404,
|
404,
|
||||||
'Requesting an unrelated page on a renamed parent should be interpreted as a missing action, not a redirect'
|
'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
|
* NOTE: This test requires nested_urls
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function testRedirectsNestedRenamedPagesWithGetParameters() {
|
public function testRedirectsNestedRenamedPagesWithGetParameters() {
|
||||||
$this->generateNestedPagesFixture();
|
$this->generateNestedPagesFixture();
|
||||||
|
|
||||||
// check third level URLSegment
|
// check third level URLSegment
|
||||||
$response = $this->get('newlevel1/newlevel2/level3/?foo=bar&test=test');
|
$response = $this->get('newlevel1/newlevel2/level3/?foo=bar&test=test');
|
||||||
$this->assertEquals($response->getStatusCode(), 301);
|
$this->assertEquals($response->getStatusCode(), 301);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
@ -225,7 +225,7 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* NOTE: This test requires nested_urls
|
* NOTE: This test requires nested_urls
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function testDoesntRedirectToNestedRenamedPageWhenNewExists() {
|
public function testDoesntRedirectToNestedRenamedPageWhenNewExists() {
|
||||||
$this->generateNestedPagesFixture();
|
$this->generateNestedPagesFixture();
|
||||||
@ -239,14 +239,14 @@ class ModelAsControllerTest extends FunctionalTest {
|
|||||||
|
|
||||||
$response = $this->get('level1');
|
$response = $this->get('level1');
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$response->getStatusCode(),
|
$response->getStatusCode(),
|
||||||
200
|
200
|
||||||
);
|
);
|
||||||
|
|
||||||
$response = $this->get('level1/newlevel2');
|
$response = $this->get('level1/newlevel2');
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$response->getStatusCode(),
|
$response->getStatusCode(),
|
||||||
404,
|
404,
|
||||||
'The old newlevel2/ URLSegment is checked as an action on the new page, which shouldnt exist.'
|
'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
|
* NOTE: This test requires nested_urls
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function testFindOldPage(){
|
public function testFindOldPage(){
|
||||||
$page = new Page();
|
$page = new Page();
|
||||||
|
@ -15,4 +15,4 @@ Page:
|
|||||||
page3:
|
page3:
|
||||||
Title: Third Page
|
Title: Third Page
|
||||||
URLSegment: page3
|
URLSegment: page3
|
||||||
HomepageForDomain: only.com
|
HomepageForDomain: only.com
|
||||||
|
@ -1 +1 @@
|
|||||||
ContentControllerTestPageWithoutController
|
ContentControllerTestPageWithoutController
|
||||||
|
@ -1 +1 @@
|
|||||||
ContentControllerTestPage_test
|
ContentControllerTestPage_test
|
||||||
|
@ -1 +1 @@
|
|||||||
Controller
|
Controller
|
||||||
|
@ -1 +1 @@
|
|||||||
Page
|
Page
|
||||||
|
@ -1 +1 @@
|
|||||||
$Layout
|
$Layout
|
||||||
|
@ -8,4 +8,4 @@ ErrorPage:
|
|||||||
Title: Permission Failure
|
Title: Permission Failure
|
||||||
URLSegment: permission-denied
|
URLSegment: permission-denied
|
||||||
Content: You do not have permission to view this page
|
Content: You do not have permission to view this page
|
||||||
ErrorCode: 403
|
ErrorCode: 403
|
||||||
|
@ -3,8 +3,8 @@ File:
|
|||||||
file1:
|
file1:
|
||||||
Filename: assets/testscript-test-file.pdf
|
Filename: assets/testscript-test-file.pdf
|
||||||
|
|
||||||
Page:
|
Page:
|
||||||
page1:
|
page1:
|
||||||
Title: page1
|
Title: page1
|
||||||
URLSegment: page1
|
URLSegment: page1
|
||||||
Content: <p><img src="assets/testscript-test-file.pdf" /></p>
|
Content: <p><img src="assets/testscript-test-file.pdf" /></p>
|
||||||
|
@ -31,7 +31,7 @@ RedirectorPage:
|
|||||||
Title: Reflexive
|
Title: Reflexive
|
||||||
RedirectionType: Internal
|
RedirectionType: Internal
|
||||||
LinkTo: =>RedirectorPage.reflexive
|
LinkTo: =>RedirectorPage.reflexive
|
||||||
URLSegment: reflexive
|
URLSegment: reflexive
|
||||||
transitive:
|
transitive:
|
||||||
Title: Transitive
|
Title: Transitive
|
||||||
RedirectionType: Internal
|
RedirectionType: Internal
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* - action_deletefromlive
|
* - action_deletefromlive
|
||||||
* - action_rollback
|
* - action_rollback
|
||||||
* - action_revert
|
* - action_revert
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*/
|
*/
|
||||||
|
@ -30,4 +30,4 @@ Member:
|
|||||||
Groups: =>Group.cmsreadonly
|
Groups: =>Group.cmsreadonly
|
||||||
cmsnodeleteeditor:
|
cmsnodeleteeditor:
|
||||||
Email: cmsnodeleteeditor@test.com
|
Email: cmsnodeleteeditor@test.com
|
||||||
Groups: =>Group.cmsnodelete
|
Groups: =>Group.cmsnodelete
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Page:
|
Page:
|
||||||
page1:
|
page1:
|
||||||
ID: 1
|
ID: 1
|
||||||
Title: page1
|
Title: page1
|
||||||
@ -13,5 +13,5 @@ Page:
|
|||||||
URLSegment: page3
|
URLSegment: page3
|
||||||
Content: '<p><a href="[sitetree_link,id=1]">Testing page 1 link</a></p>'
|
Content: '<p><a href="[sitetree_link,id=1]">Testing page 1 link</a></p>'
|
||||||
LinkTracking: =>Page.page1
|
LinkTracking: =>Page.page1
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
|
|||||||
|
|
||||||
// Confirm no broken link
|
// Confirm no broken link
|
||||||
$this->assertEquals(0, (int)$linkSrc->HasBrokenLink);
|
$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());
|
WHERE \"ID\" = $linkSrc->ID")->value());
|
||||||
|
|
||||||
// Delete page from draft
|
// Delete page from draft
|
||||||
@ -119,7 +119,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
|
|||||||
$linkSrc = $this->objFromFixture('Page', 'content');
|
$linkSrc = $this->objFromFixture('Page', 'content');
|
||||||
|
|
||||||
$this->assertEquals(1, (int)$linkSrc->HasBrokenLink);
|
$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());
|
WHERE \"ID\" = $linkSrc->ID")->value());
|
||||||
|
|
||||||
// Delete from live
|
// Delete from live
|
||||||
@ -131,7 +131,7 @@ class SiteTreeBrokenLinksTest extends SapphireTest {
|
|||||||
$linkSrc = $this->objFromFixture('Page', 'content');
|
$linkSrc = $this->objFromFixture('Page', 'content');
|
||||||
|
|
||||||
$this->assertEquals(1, (int)$linkSrc->HasBrokenLink);
|
$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());
|
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->Content = "<p><a href=\"[sitetree_link,id=$linkDest->ID]\">about us</a></p>";
|
||||||
$linkSrc->write();
|
$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();
|
$linkSrc->doPublish();
|
||||||
|
|
||||||
// Verify that the link isn't broken on draft but is broken on published
|
// Verify that the link isn't broken on draft but is broken on published
|
||||||
$this->assertEquals(0, (int)$linkSrc->HasBrokenLink);
|
$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());
|
WHERE \"ID\" = $linkSrc->ID")->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,4 +24,4 @@ File:
|
|||||||
ErrorPage:
|
ErrorPage:
|
||||||
404:
|
404:
|
||||||
Title: Page not Found
|
Title: Page not Found
|
||||||
ErrorCode: 404
|
ErrorCode: 404
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*
|
*
|
||||||
* @todo Test canAddChildren()
|
* @todo Test canAddChildren()
|
||||||
* @todo Test canCreate()
|
* @todo Test canCreate()
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
$this->assertEquals($response->getStatusCode(), '302');
|
$this->assertEquals($response->getStatusCode(), '302');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
Config::inst()->get('Security', 'login_url'),
|
Config::inst()->get('Security', 'login_url'),
|
||||||
$response->getHeader('Location')
|
$response->getHeader('Location')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -85,4 +85,4 @@ Page:
|
|||||||
URLSegment: deleteTestChildPage
|
URLSegment: deleteTestChildPage
|
||||||
draftOnlyPage:
|
draftOnlyPage:
|
||||||
CanViewType: Anyone
|
CanViewType: Anyone
|
||||||
URLSegment: draft-only
|
URLSegment: draft-only
|
||||||
|
@ -413,7 +413,7 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
Versioned::reading_stage('Stage');
|
Versioned::reading_stage('Stage');
|
||||||
Config::inst()->update('SiteTree', 'enforce_strict_hierarchy', true);
|
Config::inst()->update('SiteTree', 'enforce_strict_hierarchy', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDeleteFromLiveOperatesRecursivelyStrict() {
|
public function testDeleteFromLiveOperatesRecursivelyStrict() {
|
||||||
$this->logInWithPermission('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
@ -1196,7 +1196,7 @@ class SiteTreeTest_Conflicted_Controller extends Page_Controller implements Test
|
|||||||
return parent::hasActionTemplate($template);
|
return parent::hasActionTemplate($template);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SiteTreeTest_NullHtmlCleaner extends HTMLCleaner {
|
class SiteTreeTest_NullHtmlCleaner extends HTMLCleaner {
|
||||||
@ -1214,7 +1214,7 @@ class SiteTreeTest_ClassA extends Page implements TestOnly {
|
|||||||
|
|
||||||
class SiteTreeTest_ClassB extends Page implements TestOnly {
|
class SiteTreeTest_ClassB extends Page implements TestOnly {
|
||||||
// Also allowed subclasses
|
// Also allowed subclasses
|
||||||
private static $allowed_children = array('SiteTreeTest_ClassC');
|
private static $allowed_children = array('SiteTreeTest_ClassC');
|
||||||
}
|
}
|
||||||
|
|
||||||
class SiteTreeTest_ClassC extends Page implements TestOnly {
|
class SiteTreeTest_ClassC extends Page implements TestOnly {
|
||||||
|
@ -275,7 +275,7 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
|
|
||||||
$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\" = 'T1'")->value());
|
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());
|
WHERE \"RecordID\" = $vp->ID AND \"Title\" = 'T2'")->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 \"Version\" = $vp->Version")->value());
|
WHERE \"RecordID\" = $vp->ID AND \"Version\" = $vp->Version")->value());
|
||||||
@ -286,12 +286,12 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
// version
|
// version
|
||||||
$liveVersion = DB::query("SELECT \"Version\" FROM \"SiteTree_Live\" WHERE \"ID\" = $vp->ID")->value();
|
$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());
|
WHERE \"ID\" = $vp->ID")->value());
|
||||||
|
|
||||||
// SiteTree_Live.Version should reference a legal entry in SiteTree_versions for the
|
// SiteTree_Live.Version should reference a legal entry in SiteTree_versions for the
|
||||||
// virtual page
|
// 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());
|
WHERE \"RecordID\" = $vp->ID AND \"Version\" = $liveVersion")->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,12 +422,12 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
$virtual->copyFrom($original);
|
$virtual->copyFrom($original);
|
||||||
// Using getField() to avoid side effects from an overloaded __get()
|
// Using getField() to avoid side effects from an overloaded __get()
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'original',
|
'original',
|
||||||
$virtual->getField('MyInitiallyCopiedField'),
|
$virtual->getField('MyInitiallyCopiedField'),
|
||||||
'Fields listed in $initially_copied_fields are copied on first copyFrom() invocation'
|
'Fields listed in $initially_copied_fields are copied on first copyFrom() invocation'
|
||||||
);
|
);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'original',
|
'original',
|
||||||
$virtual->getField('MyVirtualField'),
|
$virtual->getField('MyVirtualField'),
|
||||||
'Fields not listed in $initially_copied_fields are copied in copyFrom()'
|
'Fields not listed in $initially_copied_fields are copied in copyFrom()'
|
||||||
);
|
);
|
||||||
@ -440,7 +440,7 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
$original->write();
|
$original->write();
|
||||||
$virtual->copyFrom($original);
|
$virtual->copyFrom($original);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'original',
|
'original',
|
||||||
$virtual->MyInitiallyCopiedField,
|
$virtual->MyInitiallyCopiedField,
|
||||||
'Fields listed in $initially_copied_fields are not copied on subsequent copyFrom() invocations'
|
'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->Title = 'changed 1';
|
||||||
$virtual->writeWithoutVersion();
|
$virtual->writeWithoutVersion();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$virtual->Version,
|
$virtual->Version,
|
||||||
$virtualVersion,
|
$virtualVersion,
|
||||||
'writeWithoutVersion() on VirtualPage doesnt increment version'
|
'writeWithoutVersion() on VirtualPage doesnt increment version'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -477,8 +477,8 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
DataObject::flush_and_destroy_cache();
|
DataObject::flush_and_destroy_cache();
|
||||||
$virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false);
|
$virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$virtual->Version,
|
$virtual->Version,
|
||||||
$virtualVersion,
|
$virtualVersion,
|
||||||
'writeWithoutVersion() on original page doesnt increment version on related VirtualPage'
|
'writeWithoutVersion() on original page doesnt increment version on related VirtualPage'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -487,8 +487,8 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
DataObject::flush_and_destroy_cache();
|
DataObject::flush_and_destroy_cache();
|
||||||
$virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false);
|
$virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false);
|
||||||
$this->assertGreaterThan(
|
$this->assertGreaterThan(
|
||||||
$virtualVersion,
|
$virtualVersion,
|
||||||
$virtual->Version,
|
$virtual->Version,
|
||||||
'write() on original page does increment version on related VirtualPage'
|
'write() on original page does increment version on related VirtualPage'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -500,7 +500,7 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
|
|
||||||
$notRootPage = new VirtualPageTest_NotRoot();
|
$notRootPage = new VirtualPageTest_NotRoot();
|
||||||
// we don't want the original on root, but rather the VirtualPage pointing to it
|
// 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();
|
$notRootPage->write();
|
||||||
|
|
||||||
$virtual = new VirtualPage();
|
$virtual = new VirtualPage();
|
||||||
@ -517,7 +517,7 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
} catch(ValidationException $e) {
|
} catch(ValidationException $e) {
|
||||||
$this->assertContains('is not allowed on the root level', $e->getMessage());
|
$this->assertContains('is not allowed on the root level', $e->getMessage());
|
||||||
$isDetected = true;
|
$isDetected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$isDetected) $this->fail('Fails validation with $can_be_root=false');
|
if(!$isDetected) $this->fail('Fails validation with $can_be_root=false');
|
||||||
}
|
}
|
||||||
@ -645,7 +645,7 @@ class VirtualPageTest extends FunctionalTest {
|
|||||||
} catch(ValidationException $e) {
|
} catch(ValidationException $e) {
|
||||||
$this->assertContains('not allowed as child of this parent page', $e->getMessage());
|
$this->assertContains('not allowed as child of this parent page', $e->getMessage());
|
||||||
$isDetected = true;
|
$isDetected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$isDetected) $this->fail("Shouldn't be allowed to write a VirtualPage that links to a disallowed child");
|
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 {
|
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 {
|
class VirtualPageTest_ClassC extends Page implements TestOnly {
|
||||||
|
@ -14,4 +14,4 @@ VirtualPage:
|
|||||||
vp2:
|
vp2:
|
||||||
CopyContentFrom: =>Page.master
|
CopyContentFrom: =>Page.master
|
||||||
Parent: =>Page.holder
|
Parent: =>Page.holder
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@ SiteTree:
|
|||||||
after:
|
after:
|
||||||
Title: after
|
Title: after
|
||||||
before:
|
before:
|
||||||
Title: before
|
Title: before
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
/**
|
/**
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage testing
|
* @subpackage testing
|
||||||
*
|
*
|
||||||
* @todo Fix unpublished pages check in testPublishedPagesMatchedByTitle()
|
* @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
|
* @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...
|
* Because this manipulates the test database in severe ways, I've renamed the test to force it to run last...
|
||||||
*/
|
*/
|
||||||
class ZZZSearchFormTest extends FunctionalTest {
|
class ZZZSearchFormTest extends FunctionalTest {
|
||||||
|
@ -40,4 +40,4 @@ File:
|
|||||||
ShowInSearch: 1
|
ShowInSearch: 1
|
||||||
dontShowInSearchFile:
|
dontShowInSearchFile:
|
||||||
Title: dontShowInSearchFile
|
Title: dontShowInSearchFile
|
||||||
ShowInSearch: 0
|
ShowInSearch: 0
|
||||||
|
@ -58,7 +58,7 @@ class MigrateSiteTreeLinkingTaskTest extends SapphireTest {
|
|||||||
'HTML URLSegment links are rewritten.'
|
'HTML URLSegment links are rewritten.'
|
||||||
);
|
);
|
||||||
$this->assertEquals (
|
$this->assertEquals (
|
||||||
$aboutContent,
|
$aboutContent,
|
||||||
DataObject::get_by_id('SiteTree', $aboutID)->Content
|
DataObject::get_by_id('SiteTree', $aboutID)->Content
|
||||||
);
|
);
|
||||||
$this->assertEquals (
|
$this->assertEquals (
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* parent2
|
* parent2
|
||||||
* child2_1_published_orphaned // is orphaned because parent is not published
|
* child2_1_published_orphaned // is orphaned because parent is not published
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* <h2>Cleaned up tree</h2>
|
* <h2>Cleaned up tree</h2>
|
||||||
* <code>
|
* <code>
|
||||||
* parent1_published
|
* parent1_published
|
||||||
@ -24,9 +24,9 @@
|
|||||||
* child2_1_published_orphaned
|
* child2_1_published_orphaned
|
||||||
* parent2
|
* parent2
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @author Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
|
* @author Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
|
||||||
*
|
*
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*/
|
*/
|
||||||
|
@ -29,4 +29,4 @@ Page:
|
|||||||
Title: Parent2
|
Title: Parent2
|
||||||
child2_1_published_orphaned:
|
child2_1_published_orphaned:
|
||||||
Title: Child2.1
|
Title: Child2.1
|
||||||
Parent: =>Page.parent2
|
Parent: =>Page.parent2
|
||||||
|
Loading…
Reference in New Issue
Block a user