Merge branch '3.0'

This commit is contained in:
Sean Harvey 2012-09-17 15:18:10 +12:00
commit b599c3a931
3 changed files with 9 additions and 5 deletions

View File

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

View File

@ -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);
}
});

View File

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