|
|
|
@ -1966,10 +1966,7 @@ class UserGroup extends Model |
|
|
|
$form->addHeader($header); |
|
|
|
$form->addHeader($header); |
|
|
|
|
|
|
|
|
|
|
|
// Name |
|
|
|
// Name |
|
|
|
$form->addElement('text', 'name', get_lang('Name'), ['maxlength' => 255]); |
|
|
|
$form->addText('name', get_lang('Name'), true, ['maxlength' => 255]); |
|
|
|
$form->applyFilter('name', 'trim'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
|
|
|
$form->addRule('name', '', 'maxlength', 255); |
|
|
|
$form->addRule('name', '', 'maxlength', 255); |
|
|
|
|
|
|
|
|
|
|
|
// Description |
|
|
|
// Description |
|
|
|
@ -1986,13 +1983,12 @@ class UserGroup extends Model |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// url |
|
|
|
// url |
|
|
|
$form->addElement('text', 'url', get_lang('Url')); |
|
|
|
$form->addText('url', get_lang('Url'), false); |
|
|
|
$form->applyFilter('url', 'trim'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Picture |
|
|
|
// Picture |
|
|
|
$allowed_picture_types = $this->getAllowedPictureExtensions(); |
|
|
|
$allowed_picture_types = $this->getAllowedPictureExtensions(); |
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('file', 'picture', get_lang('AddPicture')); |
|
|
|
$form->addFile('picture', get_lang('AddPicture')); |
|
|
|
$form->addRule( |
|
|
|
$form->addRule( |
|
|
|
'picture', |
|
|
|
'picture', |
|
|
|
get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', |
|
|
|
get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', |
|
|
|
@ -2003,7 +1999,7 @@ class UserGroup extends Model |
|
|
|
if (isset($data['picture']) && strlen($data['picture']) > 0) { |
|
|
|
if (isset($data['picture']) && strlen($data['picture']) > 0) { |
|
|
|
$picture = $this->get_picture_group($data['id'], $data['picture'], 80); |
|
|
|
$picture = $this->get_picture_group($data['id'], $data['picture'], 80); |
|
|
|
$img = '<img src="'.$picture['file'].'" />'; |
|
|
|
$img = '<img src="'.$picture['file'].'" />'; |
|
|
|
$form->addElement('label', null, $img); |
|
|
|
$form->addLabel(null, $img); |
|
|
|
$form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
|
|
|
$form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|