mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge branch '3.0'
This commit is contained in:
commit
b599c3a931
@ -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 %>
|
||||
|
Loading…
Reference in New Issue
Block a user