Permalink
Browse files

Merge branch '3.0'

  • Loading branch information...
2 parents bb4af2e + a2d76c9 commit b599c3a93111ffe106d575f0ed4d94f90163ca75 @halkyon halkyon committed Sep 17, 2012
Showing with 9 additions and 5 deletions.
  1. +2 −2 code/controllers/CMSMain.php
  2. +4 −0 javascript/CMSMain.AddForm.js
  3. +3 −3 templates/ContentController.ss
@@ -341,7 +341,7 @@ public function Breadcrumbs($unlinked = false) {
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 @@ public function SiteTreeHints() {
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>

0 comments on commit b599c3a

Please sign in to comment.