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() { public function SiteTreeHints() {
$json = ''; $json = '';
$classes = ClassInfo::subclassesFor( $this->stat('tree_class') ); $classes = SiteTree::page_type_classes();
$cacheCanCreate = array(); $cacheCanCreate = array();
foreach($classes as $class) $cacheCanCreate[$class] = singleton($class)->canCreate(); 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($instance instanceof HiddenClass) continue;
if(!$cacheCanCreate[$child]) continue; if(!array_key_exists($child, $cacheCanCreate) || !$cacheCanCreate[$child]) continue;
// skip this type if it is restricted // skip this type if it is restricted
if($instance->stat('need_permission') && !$this->can(singleton($class)->stat('need_permission'))) continue; if($instance->stat('need_permission') && !$this->can(singleton($class)->stat('need_permission'))) continue;

View File

@ -55,6 +55,10 @@
} }
selectedEl.setSelected(true); selectedEl.setSelected(true);
selectedEl.siblings().setSelected(false); 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"> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html>
<!-- very simple template that exists mainly so that edge cases like test execution don't fail --> <!-- very simple template that exists mainly so that edge cases like test execution don't fail -->
<head> <head>
<% base_tag %> <% base_tag %>