Merge remote-tracking branch 'origin/2.4' into post-2.4

Conflicts:
	composer.json
This commit is contained in:
Damian Mooyman 2014-05-20 08:47:34 +12:00
commit 0d2ef15c21
3 changed files with 38 additions and 17 deletions

View File

@ -12,7 +12,7 @@ before_script:
- cd ~/builds/ss - cd ~/builds/ss
script: script:
- phpunit cms/tests - vendor/bin/phpunit cms/tests
branches: branches:
except: except:

View File

@ -70,16 +70,20 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$fields = $record->getCMSFields(); $fields = $record->getCMSFields();
if($fields->hasTabSet()) { if($fields->hasTabSet()) {
$fields->findOrMakeTab('Root.Import',_t('Group.IMPORTTABTITLE', 'Import')); // Add import capabilities. Limit to admin since the import logic can affect assigned permissions
$fields->addFieldToTab('Root.Import', if(Permission::check('ADMIN')) {
new LiteralField( $fields->findOrMakeTab('Root.Import',_t('Group.IMPORTTABTITLE', 'Import'));
'MemberImportFormIframe', $fields->addFieldToTab('Root.Import',
sprintf( new LiteralField(
'<iframe src="%s" id="MemberImportFormIframe" width="100%%" height="400px" border="0"></iframe>', 'MemberImportFormIframe',
$this->Link('memberimport') sprintf(
'<iframe src="%s" id="MemberImportFormIframe" width="100%%" height="400px" border="0"></iframe>',
$this->Link('memberimport')
)
) )
) );
); }
if(Permission::check('APPLY_ROLES')) { if(Permission::check('APPLY_ROLES')) {
$fields->addFieldToTab( $fields->addFieldToTab(
'Root.Roles', 'Root.Roles',
@ -147,8 +151,19 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
) )
) )
) )
), )
new Tab('Import', _t('SecurityAdmin.TABIMPORT', 'Import'), ),
// necessary for tree node selection in LeftAndMain.EditForm.js
new HiddenField('ID', false, 0)
);
// Add import capabilities. Limit to admin since the import logic can affect assigned permissions
if(Permission::check('ADMIN')) {
$fields->addFieldsToTab(
'Root',
new Tab(
'Import',
_t('SecurityAdmin.TABIMPORT', 'Import'),
new LiteralField( new LiteralField(
'GroupImportFormIframe', 'GroupImportFormIframe',
sprintf( sprintf(
@ -157,10 +172,8 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
) )
) )
) )
), );
// necessary for tree node selection in LeftAndMain.EditForm.js }
new HiddenField('ID', false, 0)
);
// Add roles editing interface // Add roles editing interface
if(Permission::check('APPLY_ROLES')) { if(Permission::check('APPLY_ROLES')) {
@ -217,6 +230,8 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
* @return Form * @return Form
*/ */
public function MemberImportForm() { public function MemberImportForm() {
if(!Permission::check('ADMIN')) return false;
$group = $this->currentPage(); $group = $this->currentPage();
$form = new MemberImportForm( $form = new MemberImportForm(
$this, $this,
@ -249,6 +264,8 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
* @return Form * @return Form
*/ */
public function GroupImportForm() { public function GroupImportForm() {
if(!Permission::check('ADMIN')) return false;
$form = new GroupImportForm( $form = new GroupImportForm(
$this, $this,
'GroupImportForm' 'GroupImportForm'

View File

@ -23,5 +23,9 @@
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-post-2.4": "2.5.x-dev" "dev-post-2.4": "2.5.x-dev"
}
},
"require-dev": {
"phpunit/PHPUnit": "~3.7"
} }
}} }