ENHANCEMENT When loading CMS, ensure that "Parent page" tree dropdown is

either hidden or shown depending on initial "Page location" state
This commit is contained in:
Sean Harvey 2012-04-23 21:02:29 +12:00
parent 677623c11f
commit 614f307a37
3 changed files with 7 additions and 4 deletions

View File

@ -1899,7 +1899,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$parentTypeSelector = new CompositeField(
new OptionsetField("ParentType", _t("SiteTree.PAGELOCATION", "Page location"), array(
"root" => _t("SiteTree.PARENTTYPE_ROOT", "Top-level page"),
"subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page (choose below)"),
"subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page"),
)),
$parentIDField = new TreeDropdownField("ParentID", $this->fieldLabel('ParentID'), 'SiteTree', 'ID', 'MenuTitle')
),

View File

@ -275,7 +275,10 @@
* radio button is selected
*/
$('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({
onmatch: function() {
this.onclick();
this._super();
},
/**
* Function: onclick
*
@ -286,7 +289,7 @@
var parentTreeDropDown = $('.cms-edit-form.CMSPageSettingsController #ParentID');
if (e.target.id == 'Form_EditForm_ParentType_root') parentTreeDropDown.slideUp();
else parentTreeDropDown.slideDown();
else parentTreeDropDown.slideDown();
}
});

View File

@ -338,7 +338,7 @@ en:
PARENTID: "Parent page"
PARENTTYPE: "Page location"
PARENTTYPE_ROOT: "Top-level page"
PARENTTYPE_SUBPAGE: "Sub-page underneath a parent page (choose below)"
PARENTTYPE_SUBPAGE: "Sub-page underneath a parent page"
PERMISSION_GRANTACCESS_DESCRIPTION: "Manage access rights for content"
PERMISSION_GRANTACCESS_HELP: "Allow setting of page-specific access restrictions in the \"Pages\" section."
# Pural name of the object, used in dropdowns and to generally identify a collection of this object in the interface