ENHANCEMENT "Readonly" behaviour for CMS tabs

This commit is contained in:
Ingo Schommer 2012-09-28 16:32:16 +02:00
parent d504e9e634
commit 91e4fde96f
2 changed files with 14 additions and 2 deletions

View File

@ -933,7 +933,16 @@ jQuery.noConflict();
return false; return false;
} }
}, },
selected: (selectedTab.index() != -1) ? selectedTab.index() : 0 selected: (selectedTab.index() != -1) ? selectedTab.index() : 0,
show: function(e, ui) {
// Usability: Hide actions for "readonly" tabs (which don't contain any editable fields)
var actions = $(this).closest('form').find('.Actions');
if($(ui.tab).closest('li').hasClass('readonly')) {
actions.fadeOut();
} else {
actions.show();
}
}
}); });
}, },

View File

@ -1182,6 +1182,9 @@ class Member extends DataObject implements TemplateGlobalProvider {
} }
} }
$permissionsTab = $fields->fieldByName("Root")->fieldByName('Permissions');
if($permissionsTab) $permissionsTab->addExtraClass('readonly');
$defaultDateFormat = Zend_Locale_Format::getDateFormat($this->Locale); $defaultDateFormat = Zend_Locale_Format::getDateFormat($this->Locale);
$dateFormatMap = array( $dateFormatMap = array(
'MMM d, yyyy' => Zend_Date::now()->toString('MMM d, yyyy'), 'MMM d, yyyy' => Zend_Date::now()->toString('MMM d, yyyy'),