Max group name and description limits see CT#190

skala
Julio Montoya 15 years ago
parent f41f357514
commit 366b61276c
  1. 9
      main/admin/group_edit.php
  2. 9
      main/social/group_add.php
  3. 8
      main/social/group_edit.php
  4. 9
      main/social/groups.php

@ -43,21 +43,22 @@ $form->addElement('header', '', $tool_name);
$form->addElement('hidden', 'id', $group_id);
// name
$form->addElement('text', 'name', get_lang('Name'));
$form->addElement('text', 'name', get_lang('Name'), array('size'=>60));
$form->applyFilter('name', 'html_filter');
$form->applyFilter('name', 'trim');
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('name', '', 'maxlength',120);
// Description
$form->addElement('text', 'description', get_lang('Description'));
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>8, 'cols'=>58));
$form->applyFilter('description', 'html_filter');
$form->applyFilter('description', 'trim');
$form->addRule('name', '', 'maxlength',255);
// url
$form->addElement('text', 'url', get_lang('URL'));
$form->addElement('text', 'url', get_lang('URL'), array('size'=>35));
$form->applyFilter('url', 'html_filter');
$form->applyFilter('url', 'trim');
// Picture
$form->addElement('file', 'picture', get_lang('AddPicture'));
$allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');

@ -21,19 +21,20 @@ $table_message = Database::get_main_table(TABLE_MESSAGE);
$form = new FormValidator('add_group');
// name
$form->addElement('text', 'name', get_lang('Name'), array('size'=>30));
$form->addElement('text', 'name', get_lang('Name'), array('size'=>60));
$form->applyFilter('name', 'html_filter');
$form->applyFilter('name', 'trim');
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('name', '', 'maxlength',120);
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>5, 'cols'=>50));
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>8, 'cols'=>58));
$form->applyFilter('description', 'html_filter');
$form->applyFilter('description', 'trim');
$form->addRule('name', '', 'maxlength',255);
// url
$form->addElement('text', 'url', get_lang('URL'), array('size'=>30));
$form->addElement('text', 'url', get_lang('URL'), array('size'=>35));
$form->applyFilter('url', 'html_filter');
$form->applyFilter('url', 'trim');

@ -48,18 +48,20 @@ $form = new FormValidator('group_edit', 'post', '', '', array('style' => 'width:
$form->addElement('hidden', 'id', $group_id);
// name
$form->addElement('text', 'name', get_lang('Name'), array('size'=>30));
$form->addElement('text', 'name', get_lang('Name'), array('size'=>60));
$form->applyFilter('name', 'html_filter');
$form->applyFilter('name', 'trim');
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('name', '', 'maxlength',120);
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>5, 'cols'=>50));
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>8, 'cols'=>58));
$form->applyFilter('description', 'html_filter');
$form->applyFilter('description', 'trim');
$form->addRule('name', '', 'maxlength',255);
// url
$form->addElement('text', 'url', get_lang('URL'), array('size'=>30));
$form->addElement('text', 'url', get_lang('URL'), array('size'=>35));
$form->applyFilter('url', 'html_filter');
$form->applyFilter('url', 'trim');

@ -152,12 +152,11 @@ if ($group_id != 0 ) {
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$result['name'].= Display::return_icon('admin_star.png', get_lang('Admin'));
}
if ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$result['name'].= Display::return_icon('moderator_star.png', get_lang('Moderator'));
//$result['name'] .= Display::return_icon('admin_star.png', get_lang('Admin'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$result['name'] = Display::return_icon('moderator_star.png', get_lang('Moderator'));
}
$groups[]= array($url_open.$result['picture_uri'].$url_close, cut($url_open.$result['name'],200,true).$url_close,cut($result['description'],180,true));
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.cut($result['name'],200).$url_close, cut($result['description'],180));
}
}
echo '<br/>';

Loading…
Cancel
Save