diff --git a/main/admin/class_add.php b/main/admin/class_add.php index 7a72977008..b49927bfcf 100755 --- a/main/admin/class_add.php +++ b/main/admin/class_add.php @@ -29,7 +29,7 @@ $interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('Class $tool_name = get_lang("AddClasses"); $form = new FormValidator('add_class'); -$form->add_textfield('name', get_lang('ClassName')); +$form->addText('name', get_lang('ClassName')); $form->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="add"'); if ($form->validate()) { $values = $form->exportValues(); @@ -44,4 +44,4 @@ Display :: display_header($tool_name); $form->display(); // Displaying the footer. -Display :: display_footer(); \ No newline at end of file +Display :: display_footer(); diff --git a/main/admin/class_edit.php b/main/admin/class_edit.php index ecdcf28810..67edc01f22 100755 --- a/main/admin/class_edit.php +++ b/main/admin/class_edit.php @@ -33,7 +33,7 @@ $tool_name = get_lang('ModifyClassInfo'); $class_id = intval($_GET['idclass']); $class = ClassManager :: get_class_info($class_id); $form = new FormValidator('edit_class', 'post', 'class_edit.php?idclass='.$class_id); -$form->add_textfield('name',get_lang('ClassName')); +$form->addText('name',get_lang('ClassName')); $form->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="add"'); $form->setDefaults(array('name'=>$class['name'])); if($form->validate()) diff --git a/main/admin/course_add.php b/main/admin/course_add.php index 614120a648..61834d2035 100755 --- a/main/admin/course_add.php +++ b/main/admin/course_add.php @@ -46,12 +46,12 @@ $form = new FormValidator('update_course'); $form->addElement('header', $tool_name); // Title -$form->add_textfield('title', get_lang('Title'), true, array ('class' => 'span6')); +$form->addText('title', get_lang('Title'), true, array ('class' => 'span6')); $form->applyFilter('title', 'html_filter'); $form->applyFilter('title', 'trim'); // Code -$form->add_textfield('visual_code', array(get_lang('CourseCode'), get_lang('OnlyLettersAndNumbers')) , false, array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE)); +$form->addText('visual_code', array(get_lang('CourseCode'), get_lang('OnlyLettersAndNumbers')) , false, array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE)); $form->applyFilter('visual_code', 'api_strtoupper'); $form->applyFilter('visual_code', 'html_filter'); @@ -75,12 +75,12 @@ $form->addElement( ); // Course department -$form->add_textfield('department_name', get_lang('CourseDepartment'), false, array ('size' => '60')); +$form->addText('department_name', get_lang('CourseDepartment'), false, array ('size' => '60')); $form->applyFilter('department_name', 'html_filter'); $form->applyFilter('department_name', 'trim'); // Department URL -$form->add_textfield('department_url', get_lang('CourseDepartmentURL'), false, array ('size' => '60')); +$form->addText('department_url', get_lang('CourseDepartmentURL'), false, array ('size' => '60')); $form->applyFilter('department_url', 'html_filter'); $form->addElement('select_language', 'course_language', get_lang('CourseLanguage')); diff --git a/main/admin/course_edit.php b/main/admin/course_edit.php index 9840260733..b6bf289d5a 100755 --- a/main/admin/course_edit.php +++ b/main/admin/course_edit.php @@ -92,7 +92,7 @@ $form->addElement('header', get_lang('Course') . ' #' . $course_info['real_id'] $form->addElement('hidden', 'code', $course_code); //title -$form->add_textfield('title', get_lang('Title'), true, array('class' => 'span6')); +$form->addText('title', get_lang('Title'), true, array('class' => 'span6')); $form->applyFilter('title', 'html_filter'); $form->applyFilter('title', 'trim'); @@ -101,7 +101,7 @@ $element = $form->addElement('text', 'real_code', array(get_lang('CourseCode'), $element->freeze(); // Visual code -$form->add_textfield('visual_code', array(get_lang('VisualCode'), get_lang('OnlyLettersAndNumbers'), get_lang('ThisValueIsUsedInTheCourseURL')), true, array('class' => 'span4')); +$form->addText('visual_code', array(get_lang('VisualCode'), get_lang('OnlyLettersAndNumbers'), get_lang('ThisValueIsUsedInTheCourseURL')), true, array('class' => 'span4')); $form->applyFilter('visual_code', 'strtoupper'); $form->applyFilter('visual_code', 'html_filter'); @@ -192,11 +192,11 @@ if (!empty($course['category_code'])) { $form->addElement('select_ajax', 'category_code', get_lang('CourseFaculty'), null, array('url' => $url, 'defaults' => $categoryList)); -$form->add_textfield('department_name', get_lang('CourseDepartment'), false, array('size' => '60')); +$form->addText('department_name', get_lang('CourseDepartment'), false, array('size' => '60')); $form->applyFilter('department_name', 'html_filter'); $form->applyFilter('department_name', 'trim'); -$form->add_textfield('department_url', get_lang('CourseDepartmentURL'), false, array('size' => '60')); +$form->addText('department_url', get_lang('CourseDepartmentURL'), false, array('size' => '60')); $form->applyFilter('department_url', 'html_filter'); $form->applyFilter('department_url', 'trim'); diff --git a/main/admin/course_list.php b/main/admin/course_list.php index 77cdb60735..4e001c0ad2 100755 --- a/main/admin/course_list.php +++ b/main/admin/course_list.php @@ -278,8 +278,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') { //api_display_tool_title($tool_name); $form = new FormValidator('advanced_course_search', 'get'); $form->addElement('header', $tool_name); - $form->add_textfield('keyword_code', get_lang('CourseCode'), false); - $form->add_textfield('keyword_title', get_lang('Title'), false); + $form->addText('keyword_code', get_lang('CourseCode'), false); + $form->addText('keyword_title', get_lang('Title'), false); // Category code $url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category'; diff --git a/main/admin/course_request_edit.php b/main/admin/course_request_edit.php index 33f2a73b80..0b8a00b20a 100755 --- a/main/admin/course_request_edit.php +++ b/main/admin/course_request_edit.php @@ -72,13 +72,13 @@ if ($course_validation_feature) { ); // Course code. - $form->add_textfield('wanted_code', get_lang('Code'), false, array('size' => '$maxlength', 'maxlength' => $maxlength)); + $form->addText('wanted_code', get_lang('Code'), false, array('size' => '$maxlength', 'maxlength' => $maxlength)); $form->applyFilter('wanted_code', 'html_filter'); $form->addRule('wanted_code', get_lang('Max'), 'maxlength', $maxlength); $form->addRule('wanted_code', get_lang('ThisFieldIsRequired'), 'required'); // The teacher. - $titular = $form->add_textfield('tutor_name', get_lang('Professor'), null, array('size' => '60', 'disabled' => 'disabled')); + $titular = $form->addText('tutor_name', get_lang('Professor'), null, array('size' => '60', 'disabled' => 'disabled')); // Description of the requested course. $form->addElement('textarea', 'description', get_lang('Description'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); diff --git a/main/admin/group_list.php b/main/admin/group_list.php index ffa053f29f..d3f955d1fb 100755 --- a/main/admin/group_list.php +++ b/main/admin/group_list.php @@ -263,11 +263,11 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') { //api_display_tool_title($tool_name); $form = new FormValidator('advanced_search', 'get'); $form->addElement('header', '', $tool_name); - $form->add_textfield('keyword_firstname', get_lang('FirstName'), false); - $form->add_textfield('keyword_lastname', get_lang('LastName'), false); - $form->add_textfield('keyword_username', get_lang('LoginName'), false); - $form->add_textfield('keyword_email', get_lang('Email'), false); - $form->add_textfield('keyword_officialcode', get_lang('OfficialCode'), false); + $form->addText('keyword_firstname', get_lang('FirstName'), false); + $form->addText('keyword_lastname', get_lang('LastName'), false); + $form->addText('keyword_username', get_lang('LoginName'), false); + $form->addText('keyword_email', get_lang('Email'), false); + $form->addText('keyword_officialcode', get_lang('OfficialCode'), false); $status_options = array(); $status_options['%'] = get_lang('All'); $status_options[STUDENT] = get_lang('Student'); diff --git a/main/admin/ldap_users_list.php b/main/admin/ldap_users_list.php index 094fe3dcbb..db84e8fb5f 100755 --- a/main/admin/ldap_users_list.php +++ b/main/admin/ldap_users_list.php @@ -171,16 +171,16 @@ if (isset ($_POST['action'])) } $form = new FormValidator('advanced_search','get'); -$form->add_textfield('keyword_username',get_lang('LoginName'),false); +$form->addText('keyword_username',get_lang('LoginName'),false); if (api_is_western_name_order()) { - $form->add_textfield('keyword_firstname', get_lang('FirstName'), false); - $form->add_textfield('keyword_lastname', get_lang('LastName'), false); + $form->addText('keyword_firstname', get_lang('FirstName'), false); + $form->addText('keyword_lastname', get_lang('LastName'), false); } else { - $form->add_textfield('keyword_lastname',get_lang('LastName'),false); - $form->add_textfield('keyword_firstname',get_lang('FirstName'),false); + $form->addText('keyword_lastname',get_lang('LastName'),false); + $form->addText('keyword_firstname',get_lang('FirstName'),false); } if (isset($_GET['id_session'])) $form->addElement('hidden','id_session',$_GET['id_session']); diff --git a/main/admin/settings.lib.php b/main/admin/settings.lib.php index 2657e001cf..9238b964b0 100755 --- a/main/admin/settings.lib.php +++ b/main/admin/settings.lib.php @@ -895,7 +895,7 @@ function add_edit_template() { $form->addElement('header', '', $title); // Setting the form elements: the title of the template. - $form->add_textfield('title', get_lang('Title'), false); + $form->addText('title', get_lang('Title'), false); // Setting the form elements: the content of the template (wysiwyg editor). $form->addElement('html_editor', 'template_text', get_lang('Text'), null, array('ToolbarSet' => 'AdminTemplates', 'Width' => '100%', 'Height' => '400')); diff --git a/main/admin/system_announcements.php b/main/admin/system_announcements.php index 861691cd0b..7cc6e111da 100755 --- a/main/admin/system_announcements.php +++ b/main/admin/system_announcements.php @@ -133,7 +133,7 @@ if ($action_todo) { } $form = new FormValidator('system_announcement'); $form->addElement('header', '', $form_title); - $form->add_textfield('title', get_lang('Title'), true, array('class'=>'span4')); + $form->addText('title', get_lang('Title'), true, array('class'=>'span4')); $language_list = api_get_languages(); $language_list_with_keys = array(); $language_list_with_keys['all'] = get_lang('All'); diff --git a/main/admin/user_list.php b/main/admin/user_list.php index c23a5d714c..418364b916 100755 --- a/main/admin/user_list.php +++ b/main/admin/user_list.php @@ -836,20 +836,20 @@ $form->addElement('header', get_lang('AdvancedSearch')); $form->addElement('html', ''); $form->addElement('html', ''); $form->addElement('html', ''); $form->addElement('html', ''); $form->addElement('html', '
'); -$form->add_textfield('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px')); +$form->addText('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px')); $form->addElement('html', ''); -$form->add_textfield('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px')); +$form->addText('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px')); $form->addElement('html', '
'); -$form->add_textfield('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px')); +$form->addText('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px')); $form->addElement('html', ''); -$form->add_textfield('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px')); +$form->addText('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px')); $form->addElement('html', '
'); -$form->add_textfield('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px')); +$form->addText('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px')); $form->addElement('html', ''); $status_options = array(); @@ -886,7 +886,7 @@ if (!empty($extra_data)) { $form->addElement('select', 'keyword_extra_data', get_lang('ExtraData'), $extra_options, array('id'=>'input_select_extra_data', 'style'=>'margin-left:17px', 'onchange'=>'if(this.value!=0){document.getElementById(\'extra_data_text\').style.display=\'block\';document.getElementById(\'input_extra_text\').value = "";}else{document.getElementById(\'extra_data_text\').style.display=\'none\';}')); $form->addElement('html', ''); } else { $form->addElement('html', ''); - $form->add_textfield('duration_in_hours', get_lang('DurationInHours'), false, array('size'=>'3','id'=>'duration_in_hours_element', 'autofocus' => 'autofocus')); + $form->addText('duration_in_hours', get_lang('DurationInHours'), false, array('size'=>'3','id'=>'duration_in_hours_element', 'autofocus' => 'autofocus')); $form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150')); //$form->addElement('textarea', 'content', get_lang('Content')); diff --git a/main/course_progress/thematic_plan.php b/main/course_progress/thematic_plan.php index 364c0780a3..bee123a687 100755 --- a/main/course_progress/thematic_plan.php +++ b/main/course_progress/thematic_plan.php @@ -40,7 +40,7 @@ if ($action == 'thematic_plan_list') { foreach ($default_thematic_plan_title as $id => $title) { $form->addElement('hidden', 'description_type['.$id.']', $id); - $form->add_textfield('title['.$id.']', get_lang('Title'), false, array('size'=>'50')); + $form->addText('title['.$id.']', get_lang('Title'), false, array('size'=>'50')); $form->addHtmlEditor('description['.$id.']', get_lang('Description'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150')); //$form->addElement('textarea', 'description['.$id.']', get_lang('Description')); if (!empty($thematic_simple_list) && in_array($id, $thematic_simple_list)) { @@ -82,7 +82,7 @@ if ($action == 'thematic_plan_list') { $form->addElement('hidden', 'description_type', $description_type); } - $form->add_textfield('title', get_lang('Title'), true, array('size'=>'50')); + $form->addText('title', get_lang('Title'), true, array('size'=>'50')); $form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150')); //$form->addElement('html','
'); $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); diff --git a/main/create_course/add_course.php b/main/create_course/add_course.php index b9ccb4a850..4a13da620c 100755 --- a/main/create_course/add_course.php +++ b/main/create_course/add_course.php @@ -98,7 +98,7 @@ $form->addElement( ); // Course code -$form->add_textfield('wanted_code', array(get_lang('Code'), get_lang('OnlyLettersAndNumbers')), '', array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE)); +$form->addText('wanted_code', array(get_lang('Code'), get_lang('OnlyLettersAndNumbers')), '', array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE)); $form->applyFilter('wanted_code', 'html_filter'); $form->addRule('wanted_code', get_lang('Max'), 'maxlength', CourseManager::MAX_COURSE_LENGTH_CODE); diff --git a/main/document/document.php b/main/document/document.php index 7695ffcc03..5e5fce5e10 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -1502,7 +1502,7 @@ if (!$is_certificate_mode) { $form = new FormValidator('search_document', 'get', api_get_self().'?'.api_get_cidreq()); $renderer = & $form->defaultRenderer(); $renderer->setElementTemplate('{element} '); - $form->add_textfield('keyword', '', false, array('class' => 'span2')); + $form->addText('keyword', '', false, array('class' => 'span2')); $form->addElement('hidden', 'cidReq', api_get_course_id()); $form->addElement('hidden', 'id_session', api_get_session_id()); $form->addElement('hidden', 'gidReq', $groupId); diff --git a/main/document/edit_document.php b/main/document/edit_document.php index c4a409a6f2..d274bb2757 100755 --- a/main/document/edit_document.php +++ b/main/document/edit_document.php @@ -439,7 +439,7 @@ if ($owner_id == api_get_user_id() || $form->addElement('hidden', 'showedit'); $form->addElement('hidden', 'origin'); $form->addElement('hidden', 'origin_opt'); - $form->add_textfield('title', get_lang('Title')); + $form->addText('title', get_lang('Title')); $defaults['title'] = $document_data['title']; diff --git a/main/glossary/glossary_form.class.php b/main/glossary/glossary_form.class.php index 5fbc2f7906..c61aa721bf 100755 --- a/main/glossary/glossary_form.class.php +++ b/main/glossary/glossary_form.class.php @@ -76,7 +76,7 @@ class GlossaryForm extends \FormValidator $form_name = $glossary->id ? get_lang('TermEdit') : get_lang('TermAddNew'); $this->addHeader($form_name); - $this->add_textfield('name', get_lang('TermName'), $required = true, array('class' => 'span3')); + $this->addText('name', get_lang('TermName'), $required = true, array('class' => 'span3')); $this->addHtmlEditor('description', get_lang('TermDefinition'), true, array('ToolbarSet' => 'Glossary', 'Width' => '90%', 'Height' => '300')); $this->addButton('save', get_lang('Save')); diff --git a/main/gradebook/lib/fe/catform.class.php b/main/gradebook/lib/fe/catform.class.php index 5a2311b0ad..a243ae806f 100755 --- a/main/gradebook/lib/fe/catform.class.php +++ b/main/gradebook/lib/fe/catform.class.php @@ -194,7 +194,7 @@ class CatForm extends FormValidator private function build_basic_form() { $this->addElement('hidden', 'zero', 0); - $this->add_textfield( + $this->addText( 'name', get_lang('CategoryName'), true, @@ -216,7 +216,7 @@ class CatForm extends FormValidator } else { $value = 100; } - $this->add_textfield('weight', array(get_lang('TotalWeight'), get_lang('TotalSumOfWeights')), true, array('value'=>$value, 'class'=>'span1','maxlength'=>'5')); + $this->addText('weight', array(get_lang('TotalWeight'), get_lang('TotalSumOfWeights')), true, array('value'=>$value, 'class'=>'span1','maxlength'=>'5')); $this->addRule('weight', get_lang('ThisFieldIsRequired'), 'required'); if (api_is_platform_admin() || api_is_drh()) { @@ -270,7 +270,7 @@ class CatForm extends FormValidator if (isset($this->category_object) && $this->category_object->get_parent_id( ) == 0 ) { - $this->add_textfield( + $this->addText( 'certif_min_score', get_lang('CertificateMinScore'), false, diff --git a/main/gradebook/lib/fe/evalform.class.php b/main/gradebook/lib/fe/evalform.class.php index 3c3f2dc384..71d078ca8e 100755 --- a/main/gradebook/lib/fe/evalform.class.php +++ b/main/gradebook/lib/fe/evalform.class.php @@ -174,7 +174,7 @@ class EvalForm extends FormValidator $result = $result_and_user['result']; $renderer = &$this->defaultRenderer(); - $this->add_textfield('score[' . $result->get_id() . ']', $this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']), false, array('class' => "span2", + $this->addText('score[' . $result->get_id() . ']', $this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']), false, array('class' => "span2", 'maxlength' => 5)); $this->addRule('score[' . $result->get_id() . ']', get_lang('OnlyNumbers'), 'numeric'); @@ -275,14 +275,14 @@ class EvalForm extends FormValidator foreach ($tblusers as $user) { $element_name = 'score[' . $user[0] . ']'; - + $scoreColumnProperties = array('class' => 'span1', 'maxlength' => 5); if ($firstUser) { $scoreColumnProperties['autofocus'] = ''; $firstUser = false; } //user_id, user.username, lastname, firstname - $this->add_textfield($element_name, $this->build_stud_label($user[0], $user[1], $user[2], $user[3]), false, $scoreColumnProperties); + $this->addText($element_name, $this->build_stud_label($user[0], $user[1], $user[2], $user[3]), false, $scoreColumnProperties); $this->addRule($element_name, get_lang('OnlyNumbers'), 'numeric'); $this->addRule(array($element_name, 'maxvalue'), get_lang('OverMax'), 'compare', '<='); @@ -335,13 +335,13 @@ class EvalForm extends FormValidator $renderer->setElementTemplate('{element} '); $this->addElement('label', get_lang('User'), $userinfo['complete_name']); - $this->add_textfield('score', array(get_lang('Score'), null, '/ ' . $this->evaluation_object->get_max()), false, array( + $this->addText('score', array(get_lang('Score'), null, '/ ' . $this->evaluation_object->get_max()), false, array( 'size' => '4', 'class' => 'span1', 'maxlength' => '5' )); - /* $this->add_textfield('maximum', null, false, array ( + /* $this->addText('maximum', null, false, array ( 'size' => '4', 'maxlength' => '5', 'disabled' => 'disabled' @@ -428,7 +428,7 @@ class EvalForm extends FormValidator $this->addElement('hidden', 'hid_user_id'); $this->addElement('hidden', 'hid_course_code'); - $this->add_textfield('name', get_lang('EvaluationName'), true, array( + $this->addText('name', get_lang('EvaluationName'), true, array( 'class' => 'span3', 'maxlength' => '50', 'id' => 'evaluation_title' @@ -471,13 +471,13 @@ class EvalForm extends FormValidator } } - $this->add_textfield('weight_mask', array(get_lang('Weight'), null, ' [0 .. ' . $all_categories[0]->get_weight() . '] '), true, array( + $this->addText('weight_mask', array(get_lang('Weight'), null, ' [0 .. ' . $all_categories[0]->get_weight() . '] '), true, array( 'size' => '4', 'maxlength' => '5', 'class' => 'span1' )); - /* $this->add_textfield('weight', array(null, null, '/ '.$default_weight.''), true, array ( + /* $this->addText('weight', array(null, null, '/ '.$default_weight.''), true, array ( 'size' => '4', 'maxlength' => '5', 'class' => 'span1' @@ -486,19 +486,19 @@ class EvalForm extends FormValidator if ($edit) { if (!$this->evaluation_object->has_results()) { - $this->add_textfield('max', get_lang('QualificationNumeric'), true, array( + $this->addText('max', get_lang('QualificationNumeric'), true, array( 'class' => 'span1', 'maxlength' => '5' )); } else { - $this->add_textfield('max', array(get_lang('QualificationNumeric'), get_lang('CannotChangeTheMaxNote')), false, array( + $this->addText('max', array(get_lang('QualificationNumeric'), get_lang('CannotChangeTheMaxNote')), false, array( 'class' => 'span1', 'maxlength' => '5', 'disabled' => 'disabled' )); } } else { - $this->add_textfield('max', get_lang('QualificationNumeric'), true, array( + $this->addText('max', get_lang('QualificationNumeric'), true, array( 'class' => 'span1', 'maxlength' => '5' )); diff --git a/main/gradebook/lib/fe/linkaddeditform.class.php b/main/gradebook/lib/fe/linkaddeditform.class.php index 5554df8afc..6c7b189515 100755 --- a/main/gradebook/lib/fe/linkaddeditform.class.php +++ b/main/gradebook/lib/fe/linkaddeditform.class.php @@ -47,7 +47,7 @@ class LinkAddEditForm extends FormValidator // ELEMENT: name if ($form_type == self :: TYPE_ADD || $link->is_allowed_to_change_name()) { if ($link->needs_name_and_description()) { - $this->add_textfield('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40')); + $this->addText('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40')); } else { $select = $this->addElement('select', 'select_link', get_lang('ChooseItem')); foreach ($link->get_all_links() as $newlink) { @@ -90,7 +90,7 @@ class LinkAddEditForm extends FormValidator } } - $this->add_textfield( + $this->addText( 'weight_mask', array(get_lang('Weight'), null, ' [0 .. '.$category_object[0]->get_weight().'] '), true, @@ -106,7 +106,7 @@ class LinkAddEditForm extends FormValidator /* // ELEMENT: weight - $this->add_textfield('weight', array(get_lang('Weight'), null, '/ '.$default_weight.''), true, array ( + $this->addText('weight', array(get_lang('Weight'), null, '/ '.$default_weight.''), true, array ( 'size' => '4', 'maxlength' => '5', 'class' => 'span1' @@ -135,9 +135,9 @@ class LinkAddEditForm extends FormValidator // ELEMENT: max if ($link->needs_max()) { if ($form_type == self :: TYPE_EDIT && $link->has_results()) { - $this->add_textfield('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); + $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); } else { - $this->add_textfield('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); + $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); $this->addRule('max', get_lang('OnlyNumbers'), 'numeric'); $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); } diff --git a/main/group/group_category.php b/main/group/group_category.php index fda97efa81..69cb8366a1 100755 --- a/main/group/group_category.php +++ b/main/group/group_category.php @@ -108,7 +108,7 @@ if (isset($_GET['id'])) { if (api_get_setting('allow_group_categories') == 'true') { $form->addElement('header', $nameTools); $form->addElement('html', '
'); - $form->add_textfield('title', get_lang('Title')); + $form->addText('title', get_lang('Title')); // Groups per user $possible_values = array(); diff --git a/main/group/group_edit.php b/main/group/group_edit.php index 09ee8d2e99..30a1919aaf 100755 --- a/main/group/group_edit.php +++ b/main/group/group_edit.php @@ -132,7 +132,7 @@ $form->addElement('hidden', 'action'); $form->addElement('hidden', 'referer'); // Group name -$form->add_textfield('name', get_lang('GroupName')); +$form->addText('name', get_lang('GroupName')); // Description $form->addElement('textarea', 'description', get_lang('Description'), array ('class' => 'span6', 'rows' => 6)); diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index dadadff4b4..b63377047b 100755 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -1116,7 +1116,7 @@ class Blog ); $form->addHidden('post_title_edited', 'false'); $form->addHeader(get_lang('NewPost')); - $form->add_textfield('title', get_lang('Title')); + $form->addText('title', get_lang('Title')); $config = array(); if (!api_is_allowed_to_edit()) { $config['ToolbarSet'] = 'ProjectStudent'; @@ -1125,7 +1125,7 @@ class Blog } $form->addHtmlEditor('full_text', get_lang('Content'), false, false, $config); $form->add_file('user_upload', get_lang('AddAnAttachment')); - $form->add_textarea('post_file_comment', get_lang('FileComment')); + $form->addTextarea('post_file_comment', get_lang('FileComment')); $form->addHidden('new_post_submit', 'true'); $form->addButton('save', get_lang('Save')); @@ -1169,7 +1169,7 @@ class Blog ); $form->addHeader(get_lang('EditPost')); - $form->add_textfield('title', get_lang('Title')); + $form->addText('title', get_lang('Title')); if (!api_is_allowed_to_edit()) { $config['ToolbarSet'] = 'ProjectStudent'; @@ -2217,7 +2217,7 @@ class Blog $header = get_lang('ExecuteThisTask'); } $form->addHeader($header); - $form->add_textfield('title', get_lang('Title')); + $form->addText('title', get_lang('Title')); $config = array(); if (!api_is_allowed_to_edit()) { @@ -2228,7 +2228,7 @@ class Blog $form->addHtmlEditor('comment', get_lang('Comment'), false, false, $config); $form->add_file('user_upload', get_lang('AddAnAttachment')); - $form->add_textarea('post_file_comment', get_lang('FileComment')); + $form->addTextarea('post_file_comment', get_lang('FileComment')); $form->addHidden('action', null); $form->addHidden('comment_parent_id', 0); diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index 164f5c08b6..16ef01bdd6 100755 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -236,7 +236,7 @@ EOT; * @param boolean $required (optional) Is the form-element required (default=true) * @param array $attributes (optional) List of attributes for the form-element */ - function add_textfield($name, $label, $required = true, $attributes = array()) + public function addText($name, $label, $required = true, $attributes = array()) { $this->addElement('text', $name, $label, $attributes); $this->applyFilter($name, 'trim'); @@ -282,7 +282,7 @@ EOT; * @param string $label * @param array $attributes */ - public function add_textarea($name, $label, $attributes = array()) + public function addTextarea($name, $label, $attributes = array()) { $this->addElement('textarea', $name, $label, $attributes); } diff --git a/main/inc/lib/statistics.lib.php b/main/inc/lib/statistics.lib.php index 8ad623fb3e..89712cdfb8 100644 --- a/main/inc/lib/statistics.lib.php +++ b/main/inc/lib/statistics.lib.php @@ -618,7 +618,7 @@ class Statistics } $form = new FormValidator('courselastvisit', 'get'); $form->addElement('hidden','report','courselastvisit'); - $form->add_textfield('date_diff',get_lang('Days'),true); + $form->addText('date_diff',get_lang('Days'),true); $form->addRule('date_diff','InvalidNumber','numeric'); $form->addElement('style_submit_button', 'submit', get_lang('Search'),'class="search"'); if (!isset($_GET['date_diff'])) { diff --git a/main/link/category_form.class.php b/main/link/category_form.class.php index cee75fb25f..8389483df3 100755 --- a/main/link/category_form.class.php +++ b/main/link/category_form.class.php @@ -57,7 +57,7 @@ class CategoryForm extends \FormValidator $form_name = $category->id ? get_lang('ModifyCategory') : get_lang('AddCategory'); $this->addHeader($form_name); - $this->add_textfield('category_title', get_lang('Title')); + $this->addText('category_title', get_lang('Title')); $this->addRule('category_title', get_lang('Required'), 'required'); $this->addElement('textarea', 'category_description', get_lang('Description')); diff --git a/main/link/link_form.class.php b/main/link/link_form.class.php index cf147d3dcf..306e9bee7a 100755 --- a/main/link/link_form.class.php +++ b/main/link/link_form.class.php @@ -65,12 +65,12 @@ class LinkForm extends \FormValidator $form_name = $category->id ? get_lang('LinkMod') : get_lang('LinkAdd'); $this->addHeader($form_name); - $this->add_textfield('url', get_lang('Url'), $required = true, array('class' => 'span6')); + $this->addText('url', get_lang('Url'), $required = true, array('class' => 'span6')); $this->addRule('url', get_lang('MalformedUrl'), 'regex', '|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i'); - $this->add_textfield('title', get_lang('Title'), $required = false, array('class' => 'span6')); + $this->addText('title', get_lang('Title'), $required = false, array('class' => 'span6')); - $this->add_textarea('description', get_lang('Description'), array('class' => 'span3')); + $this->addTextarea('description', get_lang('Description'), array('class' => 'span3')); $this->addCheckBox('on_homepage', '', get_lang('OnHomepage')); diff --git a/main/messages/new_message.php b/main/messages/new_message.php index 6f41d7a895..9d197ca61a 100755 --- a/main/messages/new_message.php +++ b/main/messages/new_message.php @@ -166,7 +166,7 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null) { $form = new FormValidator('compose_message', null, api_get_self().'?f='.$param_f, null, array('enctype'=>'multipart/form-data')); if (empty($group_id)) { if (isset($select_from_user_list)) { - $form->add_textfield( + $form->addText( 'id_text_name', get_lang('SendMessageTo'), true, @@ -199,7 +199,7 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null) { $form->addElement('hidden','parent_id',$message_id); } - $form->add_textfield('title', get_lang('Subject'), true, array('class' => 'span4')); + $form->addText('title', get_lang('Subject'), true, array('class' => 'span4')); $form->addHtmlEditor('content', get_lang('Message'), false, false, array('ToolbarSet' => 'Messages', 'Width' => '95%', 'Height' => '250')); if (isset($_GET['re_id'])) { diff --git a/main/notebook/notebook_form.class.php b/main/notebook/notebook_form.class.php index c4b53cc536..ba8297b25a 100755 --- a/main/notebook/notebook_form.class.php +++ b/main/notebook/notebook_form.class.php @@ -69,7 +69,7 @@ class NotebookForm extends \FormValidator $form_name = $notebook->id ? get_lang('ModifyNote') : get_lang('NoteAddNew'); $this->addHeader($form_name); - $this->add_textfield('title', get_lang('NoteTitle'), $required = true, array('class' => 'span3')); + $this->addText('title', get_lang('NoteTitle'), $required = true, array('class' => 'span3')); if (api_is_allowed_to_edit()) { $toolbar = array('ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300'); diff --git a/main/reservation/m_category.php b/main/reservation/m_category.php index e17ab91e9e..c697145445 100755 --- a/main/reservation/m_category.php +++ b/main/reservation/m_category.php @@ -34,7 +34,7 @@ switch ($_GET['action']) { Display :: display_header(get_lang('AddNewResourceType')); api_display_tool_title(get_lang('AddNewResourceType')); $form = new FormValidator('category', 'post', 'm_category.php?action=add'); - $form->add_textfield('name', get_lang('ResourceTypeName'), true, array ('maxlength' => '128')); + $form->addText('name', get_lang('ResourceTypeName'), true, array ('maxlength' => '128')); $form->addElement('style_submit_button', 'submit', get_lang('CreateResourceType'),'class="add"'); if ($form->validate()) { $values = $form->exportValues(); @@ -50,7 +50,7 @@ switch ($_GET['action']) { Display :: display_header(get_lang('EditResourceType')); api_display_tool_title(get_lang('EditResourceType')); $form = new FormValidator('category', 'post', 'm_category.php?action=edit'); - $form->add_textfield('name', get_lang('ResourceTypeName'), true, array ('maxlength' => '128')); + $form->addText('name', get_lang('ResourceTypeName'), true, array ('maxlength' => '128')); $form->addElement('hidden', 'id', intval($_GET['id'])); $form->addElement('style_submit_button', 'submit', get_lang('ModifyResourceType'),'class="save"'); $form->setDefaults(Rsys :: get_category($_GET['id'])); diff --git a/main/reservation/m_item.php b/main/reservation/m_item.php index 9635c02b55..444a73c995 100755 --- a/main/reservation/m_item.php +++ b/main/reservation/m_item.php @@ -235,7 +235,7 @@ switch ($_GET['action']) { api_display_tool_title(get_lang('EditRight')); $form = new FormValidator('itemright', 'post', "m_item.php?id=".$item['id']."&action=m_rights&subaction=edit"); - $form->add_textfield('classn', get_lang('Class'), true, array ('readonly' => 'readonly')); + $form->addText('classn', get_lang('Class'), true, array ('readonly' => 'readonly')); $form->addElement('checkbox', 'edit_right', get_lang('EditRight')); $form->addElement('checkbox', 'delete_right', get_lang('DeleteRight')); @@ -336,7 +336,7 @@ switch ($_GET['action']) { foreach ($cats as $cat) $catOptions[$cat['id']] = $cat['name']; $form->addElement('select', 'category', get_lang('ResourceType'), $catOptions); - $form->add_textfield('name', get_lang('ResourceName'), true, array ('maxlength' => '128')); + $form->addText('name', get_lang('ResourceName'), true, array ('maxlength' => '128')); $form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3', 'cols' => '40')); $form->addRule('category', get_lang('ThisFieldIsRequired'), 'required'); @@ -372,7 +372,7 @@ switch ($_GET['action']) { api_display_tool_title(get_lang('EditResource')); $form = new FormValidator('item', 'post', 'm_item.php?action=edit'); $form->addElement('select', 'category_id', get_lang('ResourceType'), $catOptions); - $form->add_textfield('name', get_lang('ResourceName'), array ('maxlength' => '128')); + $form->addText('name', get_lang('ResourceName'), array ('maxlength' => '128')); $form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3', 'cols' => '40')); $form->addRule('category_id', get_lang('ThisFieldIsRequired'), 'required'); $form->addElement('hidden', 'id', $item['id']); diff --git a/main/reservation/m_item_origineel.php b/main/reservation/m_item_origineel.php index 535f885da9..54f04375a3 100755 --- a/main/reservation/m_item_origineel.php +++ b/main/reservation/m_item_origineel.php @@ -222,7 +222,7 @@ switch ($_GET['action']) { api_display_tool_title(get_lang('EditRight')); $form = new FormValidator('itemright', 'post', "m_item.php?id=".$item['id']."&action=m_rights&subaction=edit"); - $form->add_textfield('classn', get_lang('LangClass'), true, array ('readonly' => 'readonly')); + $form->addText('classn', get_lang('LangClass'), true, array ('readonly' => 'readonly')); $form->addElement('checkbox', 'edit_right', get_lang('EditRight')); $form->addElement('checkbox', 'delete_right', get_lang('DeleteRight')); @@ -308,7 +308,7 @@ switch ($_GET['action']) { foreach ($cats as $cat) $catOptions[$cat['id']] = $cat['name']; $form->addElement('select', 'category', get_lang('Category'), $catOptions); - $form->add_textfield('name', get_lang('ItemName'), true, array ('maxlength' => '128')); + $form->addText('name', get_lang('ItemName'), true, array ('maxlength' => '128')); $form->addElement('textarea', 'description', get_lang('ItemDescription'), array ('rows' => '3', 'cols' => '40')); $form->addRule('category', get_lang('ThisFieldIsRequired'), 'required'); @@ -336,7 +336,7 @@ switch ($_GET['action']) { api_display_tool_title(get_lang('EditItem2')); $form = new FormValidator('item', 'post', 'm_item.php?action=edit'); $form->addElement('select', 'category_id', get_lang('Category'), $catOptions); - $form->add_textfield('name', get_lang('ItemName'), array ('maxlength' => '128')); + $form->addText('name', get_lang('ItemName'), array ('maxlength' => '128')); $form->addElement('textarea', 'description', get_lang('ItemDescription'), array ('rows' => '3', 'cols' => '40')); $form->addRule('category_id', get_lang('ThisFieldIsRequired'), 'required'); $form->addElement('hidden', 'id', $item['id']); diff --git a/main/social/message_for_group_form.inc.php b/main/social/message_for_group_form.inc.php index d18517db31..fa0696da7c 100755 --- a/main/social/message_for_group_form.inc.php +++ b/main/social/message_for_group_form.inc.php @@ -92,7 +92,7 @@ if (api_get_setting('allow_message_tool') == 'true') { $user_info = api_get_user_info($userfriend_id); $height = 180; if ($allowed_action == 'add_message_group') { - $form->add_textfield('title', get_lang('Title')); + $form->addText('title', get_lang('Title')); $height = 140; } diff --git a/main/user/subscribe_class.php b/main/user/subscribe_class.php index a26edaeb29..ad21d25b23 100755 --- a/main/user/subscribe_class.php +++ b/main/user/subscribe_class.php @@ -127,7 +127,7 @@ function reg_filter($class_id) { // Build search-form $form = new FormValidator('search_class', 'get', '', '', null, false); -$form->add_textfield('keyword', '', false); +$form->addText('keyword', '', false); $form->addElement('button', 'submit', get_lang('SearchButton')); // Build table @@ -145,4 +145,4 @@ $table->set_form_actions(array('subscribe' => get_lang('reg')), 'class'); // Display form & table $form->display(); $table->display(); -Display :: display_footer(); \ No newline at end of file +Display :: display_footer(); diff --git a/main/user/subscribe_user.php b/main/user/subscribe_user.php index b8d60f65f1..09b9d3b6a0 100755 --- a/main/user/subscribe_user.php +++ b/main/user/subscribe_user.php @@ -62,7 +62,7 @@ if (api_get_setting('ProfilingFilterAddingUsers') == 'true') { $form = new FormValidator('search_user', 'get', '', '', null, false); $renderer = $form->defaultRenderer(); $renderer->setElementTemplate('{element} '); -$form->add_textfield('keyword', '', false); +$form->addText('keyword', '', false); $form->addElement('hidden', 'type', $type); $form->addElement('style_submit_button', 'submit', get_lang('SearchButton'), 'class="search"'); $form->addElement('static', 'additionalactions', null, $actions); diff --git a/main/user/user.php b/main/user/user.php index 779e0c6e2d..eb3a23a752 100755 --- a/main/user/user.php +++ b/main/user/user.php @@ -511,7 +511,7 @@ if (api_is_allowed_to_edit(null, true)) { $form = new FormValidator('search_user', 'get', '', '', null, false); $renderer = $form->defaultRenderer(); $renderer->setElementTemplate('{element} '); - $form->add_textfield('keyword', '', false); + $form->addText('keyword', '', false); $form->addElement('style_submit_button', 'submit', get_lang('SearchButton'), 'class="search"'); $form->addElement('static', 'additionalactions', null, $actions); $form->display(); diff --git a/main/user/userInfo.php b/main/user/userInfo.php index c599806a48..a6724874a2 100755 --- a/main/user/userInfo.php +++ b/main/user/userInfo.php @@ -260,7 +260,7 @@ if ($displayMode == "viewDefEdit") { $catToEdit = get_cat_def($_GET['editDef']); $edit_heading_form = new FormValidator('edit_heading_form'); $edit_heading_form->addElement('hidden', 'id'); - $edit_heading_form->add_textfield('title', get_lang('Title')); + $edit_heading_form->addText('title', get_lang('Title')); $edit_heading_form->addElement('textarea', 'comment', get_lang('Comment'), array ('cols' => 60, 'rows' => 4)); $possible_line_nrs[1] = '1 '.get_lang('Line'); $possible_line_nrs[3] = '3 '.get_lang('Lines');