mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge remote-tracking branch 'origin/3'
This commit is contained in:
commit
3cefb2edad
@ -74,8 +74,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
Versioned::reading_stage("Stage");
|
|
||||||
|
|
||||||
Requirements::css(CMS_DIR . '/css/screen.css');
|
Requirements::css(CMS_DIR . '/css/screen.css');
|
||||||
Requirements::customCSS($this->generatePageIconsCss());
|
Requirements::customCSS($this->generatePageIconsCss());
|
||||||
Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true);
|
Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true);
|
||||||
|
@ -369,7 +369,7 @@ class CMSPageHistoryController extends CMSMain {
|
|||||||
$fromVersion = $versionID;
|
$fromVersion = $versionID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$toVersion || !$toVersion) return false;
|
if(!$toVersion || !$fromVersion) return false;
|
||||||
|
|
||||||
$id = $this->currentPageID();
|
$id = $this->currentPageID();
|
||||||
$page = DataObject::get_by_id("SiteTree", $id);
|
$page = DataObject::get_by_id("SiteTree", $id);
|
||||||
|
@ -401,7 +401,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
static public function page_type_classes() {
|
public static function page_type_classes() {
|
||||||
$classes = ClassInfo::getValidSubClasses();
|
$classes = ClassInfo::getValidSubClasses();
|
||||||
|
|
||||||
$baseClassIndex = array_search('SiteTree', $classes);
|
$baseClassIndex = array_search('SiteTree', $classes);
|
||||||
@ -426,10 +426,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$kill_ancestors = array_unique($kill_ancestors);
|
$kill_ancestors = array_unique($kill_ancestors);
|
||||||
foreach($kill_ancestors as $mark) {
|
foreach($kill_ancestors as $mark) {
|
||||||
// unset from $classes
|
// unset from $classes
|
||||||
$idx = array_search($mark, $classes);
|
$idx = array_search($mark, $classes, true);
|
||||||
|
if ($idx !== false) {
|
||||||
unset($classes[$idx]);
|
unset($classes[$idx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $classes;
|
return $classes;
|
||||||
}
|
}
|
||||||
@ -2225,7 +2227,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$existsOnLive = $this->getExistsOnLive();
|
$existsOnLive = $this->getExistsOnLive();
|
||||||
|
|
||||||
// Major actions appear as buttons immediately visible as page actions.
|
// Major actions appear as buttons immediately visible as page actions.
|
||||||
$majorActions = CompositeField::create()->setName('MajorActions')->setTag('fieldset')->addExtraClass('ss-ui-buttonset');
|
$majorActions = CompositeField::create()->setName('MajorActions')->setTag('fieldset')->addExtraClass('ss-ui-buttonset noborder');
|
||||||
|
|
||||||
// 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');
|
||||||
@ -2234,7 +2236,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
_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);
|
||||||
$rootTabSet->addExtraClass('ss-ui-action-tabset action-menus');
|
$rootTabSet->addExtraClass('ss-ui-action-tabset action-menus noborder');
|
||||||
|
|
||||||
// Render page information into the "more-options" drop-up, on the top.
|
// Render page information into the "more-options" drop-up, on the top.
|
||||||
$live = Versioned::get_one_by_stage('SiteTree', 'Live', array(
|
$live = Versioned::get_one_by_stage('SiteTree', 'Live', array(
|
||||||
|
@ -874,6 +874,15 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
$classes = SiteTree::page_type_classes();
|
$classes = SiteTree::page_type_classes();
|
||||||
$this->assertNotContains('SiteTree', $classes, 'Page types do not include base class');
|
$this->assertNotContains('SiteTree', $classes, 'Page types do not include base class');
|
||||||
$this->assertContains('Page', $classes, 'Page types do contain subclasses');
|
$this->assertContains('Page', $classes, 'Page types do contain subclasses');
|
||||||
|
|
||||||
|
// Testing what happens in an incorrect config value is set - hide_ancestor should be a string
|
||||||
|
Config::inst()->update('SiteTreeTest_ClassA', 'hide_ancestor', true);
|
||||||
|
$newClasses = SiteTree::page_type_classes();
|
||||||
|
$this->assertEquals(
|
||||||
|
$classes,
|
||||||
|
$newClasses,
|
||||||
|
'Setting hide_ancestor to a boolean (incorrect) value caused a page class to be hidden'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAllowedChildren() {
|
public function testAllowedChildren() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user