Merge branch 'candidasa-cms-enhancements'

This commit is contained in:
Ingo Schommer 2011-10-11 09:36:53 +02:00
commit 9016204dec
6 changed files with 46 additions and 6 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
.sass-cache
.sass-cache
.DS_Store

View File

@ -1042,14 +1042,22 @@ JS;
);
$pageTypes[$type->getField('ClassName')] = $html;
}
$labelTriangle = '<span class="label-triangle"></span>';
$fields = new FieldSet(
// new HiddenField("ParentID", false, ($this->parentRecord) ? $this->parentRecord->ID : null),
// TODO Should be part of the form attribute, but not possible in current form API
$hintsField = new LiteralField('Hints', sprintf('<span class="hints" data-hints="%s"></span>', $this->SiteTreeHints())),
$parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Parent page'), 'SiteTree'),
new OptionsetField("PageType", "", $pageTypes, 'Page')
$label1 = new LabelField("1", _t('CMSMain.1', '1').$labelTriangle),
$parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Choose parent'), 'SiteTree'),
$label2 = new LabelField("1", _t('CMSMain.2', '2').$labelTriangle),
new OptionsetField("PageType", _t('CMSMain.ChoosePageType', 'Choose page type'), $pageTypes, 'Page')
);
$label1->addExtraClass("numeric-label");
$label1->setAllowHTML(true);
$label2->addExtraClass("numeric-label");
$label2->setAllowHTML(true);
$parentField->setValue(($record) ? $record->ID : null);
$actions = new FieldSet(

View File

@ -1,5 +1,8 @@
/** Style custom to the CMSMain admin interface. CMSMain extends the built in sapphire admin section styles. As much as possible we want to use those built in styles. If anything in this file can be implemented in a generic way then it should be include in the admin scss files. @package cms */
/** ------------------------------------------------------------------ Page History Section. ----------------------------------------------------------------- */
/* line 15, ../scss/CMSMain.scss */
#cms-page-history-versions tr.loading { color: #999; }
/* line 20, ../scss/CMSMain.scss */
#cms-page-history-versions tr.loading td:hover { cursor: none; }
/* line 27, ../scss/CMSMain.scss */
#cms-page-history-versions td:hover { cursor: pointer; }

View File

@ -243,5 +243,32 @@
return confirm(message);
}
});
/**
* Class: .cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked
*
* Showing the "Page location" "Parent page" chooser only when the "Sub-page underneath a parent page"
* radio button is selected
*/
$('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({
/**
* Function: onclick
*
* Parameters:
* (Event) e
*/
onchange: function(e) {
var parentTreeDropDown = $('.cms-edit-form.CMSPageSettingsController #ParentID');
if (e.target.id == 'Form_EditForm_ParentType_root') parentTreeDropDown.slideUp();
else parentTreeDropDown.slideDown();
}
});
//trigger an initial change event to do the initial hiding of the element, if necessary
if ($('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr('id') == 'Form_EditForm_ParentType_root') {
$('.cms-edit-form.CMSPageSettingsController #ParentID').hide(); //quick hide on first run
}
});
}(jQuery));

View File

@ -28,4 +28,5 @@
cursor: pointer;
}
}
}
}

View File

@ -41,7 +41,7 @@
$SiteTreeAsUL
</div>
<div class="ss-dialog cms-page-add-form-dialog" id="cms-page-add-form" title="<% _t('CMSMain.ChoosePageType', 'Choose a page type') %>">
<div class="ss-dialog cms-page-add-form-dialog" id="cms-page-add-form" title="<% _t('CMSMain.AddNew', 'Add new page') %>">
$AddForm
</div>