mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge remote branch 'origin/master' into translation-staging
This commit is contained in:
commit
14fd4ee7be
@ -341,7 +341,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
public function SiteTreeHints() {
|
||||
$json = '';
|
||||
|
||||
$classes = ClassInfo::subclassesFor( $this->stat('tree_class') );
|
||||
$classes = SiteTree::page_type_classes();
|
||||
|
||||
$cacheCanCreate = array();
|
||||
foreach($classes as $class) $cacheCanCreate[$class] = singleton($class)->canCreate();
|
||||
@ -373,7 +373,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
|
||||
if($instance instanceof HiddenClass) continue;
|
||||
|
||||
if(!$cacheCanCreate[$child]) continue;
|
||||
if(!array_key_exists($child, $cacheCanCreate) || !$cacheCanCreate[$child]) continue;
|
||||
|
||||
// skip this type if it is restricted
|
||||
if($instance->stat('need_permission') && !$this->can(singleton($class)->stat('need_permission'))) continue;
|
||||
|
@ -55,6 +55,10 @@
|
||||
}
|
||||
selectedEl.setSelected(true);
|
||||
selectedEl.siblings().setSelected(false);
|
||||
|
||||
// Disable the "Create" button if none of the pagetypes are available
|
||||
var buttonState = (this.find('#PageType li:not(.disabled)').length) ? 'enable' : 'disable';
|
||||
this.find('button[name=action_doAdd]').button(buttonState);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- very simple template that exists mainly so that edge cases like test execution don't fail -->
|
||||
<head>
|
||||
<% base_tag %>
|
||||
@ -9,7 +9,7 @@
|
||||
<h1>$Title</h1>
|
||||
$Content
|
||||
$Form
|
||||
|
||||
|
||||
<p><i>Generated with the default ContentController.ss template</i></p>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user