Rename add_textfield to addTextfield

1.10.x
Julio Montoya 11 years ago
parent 497bf58238
commit 060fb00f2f
  1. 4
      main/admin/class_add.php
  2. 2
      main/admin/class_edit.php
  3. 8
      main/admin/course_add.php
  4. 8
      main/admin/course_edit.php
  5. 4
      main/admin/course_list.php
  6. 4
      main/admin/course_request_edit.php
  7. 10
      main/admin/group_list.php
  8. 10
      main/admin/ldap_users_list.php
  9. 2
      main/admin/settings.lib.php
  10. 2
      main/admin/system_announcements.php
  11. 12
      main/admin/user_list.php
  12. 2
      main/attendance/attendance_add.php
  13. 2
      main/attendance/attendance_edit.php
  14. 2
      main/course_description/add.php
  15. 2
      main/course_description/course_description_form.class.php
  16. 2
      main/course_description/edit.php
  17. 10
      main/course_info/infocours.php
  18. 2
      main/course_progress/thematic.php
  19. 2
      main/course_progress/thematic_advance.php
  20. 4
      main/course_progress/thematic_plan.php
  21. 2
      main/create_course/add_course.php
  22. 2
      main/document/document.php
  23. 2
      main/document/edit_document.php
  24. 2
      main/glossary/glossary_form.class.php
  25. 6
      main/gradebook/lib/fe/catform.class.php
  26. 22
      main/gradebook/lib/fe/evalform.class.php
  27. 10
      main/gradebook/lib/fe/linkaddeditform.class.php
  28. 2
      main/group/group_category.php
  29. 2
      main/group/group_edit.php
  30. 10
      main/inc/lib/blog.lib.php
  31. 4
      main/inc/lib/formvalidator/FormValidator.class.php
  32. 2
      main/inc/lib/statistics.lib.php
  33. 2
      main/link/category_form.class.php
  34. 6
      main/link/link_form.class.php
  35. 4
      main/messages/new_message.php
  36. 2
      main/notebook/notebook_form.class.php
  37. 4
      main/reservation/m_category.php
  38. 6
      main/reservation/m_item.php
  39. 6
      main/reservation/m_item_origineel.php
  40. 2
      main/social/message_for_group_form.inc.php
  41. 4
      main/user/subscribe_class.php
  42. 2
      main/user/subscribe_user.php
  43. 2
      main/user/user.php
  44. 2
      main/user/userInfo.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();
Display :: display_footer();

@ -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())

@ -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'));

@ -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');

@ -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';

@ -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'));

@ -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');

@ -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']);

@ -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'));

@ -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');

@ -836,20 +836,20 @@ $form->addElement('header', get_lang('AdvancedSearch'));
$form->addElement('html', '<table>');
$form->addElement('html', '<tr><td>');
$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', '</td><td width="200px;">');
$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', '</td></tr>');
$form->addElement('html', '<tr><td>');
$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', '</td>');
$form->addElement('html', '<td>');
$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', '</td></tr>');
$form->addElement('html', '<tr><td>');
$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', '</td><td>');
$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', '<div id="extra_data_text" style="display:none;">');
$form->add_textfield('keyword_extra_data_text', '', false, array('style'=>'margin-left:17px', 'id'=>'input_extra_text'));
$form->addText('keyword_extra_data_text', '', false, array('style'=>'margin-left:17px', 'id'=>'input_extra_text'));
$form->addElement('html', '</div>');
} else {
$form->addElement('html', '<div id="extra_data_text" style="display:none;">');

@ -28,7 +28,7 @@ $form = new FormValidator('attendance_add','POST','index.php?action=attendance_a
$form->addElement('header', '', get_lang('CreateANewAttendance'));
$form->addElement('hidden', 'sec_token', $token);
$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->applyFilter('title','html_filter');
$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150'));

@ -31,7 +31,7 @@ $form->addElement('header', '', get_lang('Edit'));
$form->addElement('hidden', 'sec_token',$token);
$form->addElement('hidden', 'attendance_id', $attendance_id);
$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->applyFilter('title','html_filter');
$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));

@ -52,7 +52,7 @@ $form = new FormValidator('course_description','POST','index.php?action=add&'.ap
$form->addElement('header', '', $header);
$form->addElement('hidden', 'description_type',$description_type);
$form->addElement('hidden', 'sec_token',$token);
$form->add_textfield('title', get_lang('Title'), true, array('size'=>'width: 350px;'));
$form->addText('title', get_lang('Title'), true, array('size'=>'width: 350px;'));
$form->applyFilter('title','html_filter');
$form->addHtmlEditor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');

@ -74,7 +74,7 @@ class CourseDescriptionForm extends \FormValidator
$this->addHidden('description_type', $description->get_description_type());
$this->addHidden('c_id', $description->c_id);
$this->addHidden('id', $description->id);
$this->add_textfield('title', get_lang('Title'), true, array('size' => 'width: 350px;'));
$this->addText('title', get_lang('Title'), true, array('size' => 'width: 350px;'));
$this->applyFilter('title', 'html_filter');
$this->addHtmlEditor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
$this->addButton('save', get_lang('Save'));

@ -56,7 +56,7 @@ $form->addElement('header','',$header);
$form->addElement('hidden', 'id', $original_id);
$form->addElement('hidden', 'description_type',$description_type);
$form->addElement('hidden', 'sec_token',$token);
$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->applyFilter('title','html_filter');
$form->addHtmlEditor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');

@ -125,18 +125,18 @@ if (file_exists($course_path.'/course-pic85x85.png')) {
}
$form->addElement('html', $image_html);
$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');
$form->addElement('select', 'category_code', get_lang('Fac'), $categories, array('style'=>'width:350px', 'class'=>'chzn-select', 'id'=>'category_code'));
$form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang')));
$form->add_textfield('department_name', get_lang('Department'), false, array('class' => 'span5'));
$form->addText('department_name', get_lang('Department'), false, array('class' => 'span5'));
$form->applyFilter('department_name', 'html_filter');
$form->applyFilter('department_name', 'trim');
$form->add_textfield('department_url', get_lang('DepartmentUrl'), false, array('class' => 'span5'));
$form->addText('department_url', get_lang('DepartmentUrl'), false, array('class' => 'span5'));
$form->applyFilter('department_url', 'html_filter');
// Picture
@ -148,7 +148,7 @@ $form->addElement('checkbox', 'delete_picture', null, get_lang('DeletePicture'))
if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
$url = PDF::get_watermark($course_code);
$form->add_textfield('pdf_export_watermark_text', get_lang('PDFExportWatermarkTextTitle'), false, array('size' => '60'));
$form->addText('pdf_export_watermark_text', get_lang('PDFExportWatermarkTextTitle'), false, array('size' => '60'));
$form->addElement('file', 'pdf_export_watermark_path', get_lang('AddWaterMark'));
if ($url != false) {
$delete_url = '<a href="?delete_watermark">'.Display::return_icon('delete.png',get_lang('DelImage')).'</a>';
@ -195,7 +195,7 @@ $group[]=$form->createElement('radio', 'unsubscribe', get_lang('Unsubscription')
$group[]=$form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0);
$form->addGroup($group, '', array(get_lang("Unsubscription")), '');
$form->add_textfield('course_registration_password', get_lang('CourseRegistrationPassword'), false, array('size' => '60'));
$form->addText('course_registration_password', get_lang('CourseRegistrationPassword'), false, array('size' => '60'));
$form->addElement('checkbox', 'activate_legal', array(null, get_lang('ShowALegalNoticeWhenEnteringTheCourse')), get_lang('ActivateLegal'));
$form->addElement('textarea', 'legal', get_lang('CourseLegalAgreement'), array('class'=>'span6', 'rows' => 8));

@ -252,7 +252,7 @@ if ($action == 'thematic_list') {
$form->addElement('hidden', 'thematic_id',$thematic_id);
}
$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');

@ -70,7 +70,7 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$form->addElement('html', '</div>');
$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'));

@ -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','<div class="clear" style="margin-top:50px;"></div>');
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');

@ -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);

@ -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('<span>{element}</span> ');
$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);

@ -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'];

@ -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'));

@ -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,

@ -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('<span>{element}</span> ');
$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 .. <span id="max_weight">' . $all_categories[0]->get_weight() . '</span>] '), true, array(
$this->addText('weight_mask', array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">' . $all_categories[0]->get_weight() . '</span>] '), true, array(
'size' => '4',
'maxlength' => '5',
'class' => 'span1'
));
/* $this->add_textfield('weight', array(null, null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array (
/* $this->addText('weight', array(null, null, '/ <span id="max_weight">'.$default_weight.'</span>'), 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'
));

@ -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 .. <span id="max_weight">'.$category_object[0]->get_weight().'</span>] '),
true,
@ -106,7 +106,7 @@ class LinkAddEditForm extends FormValidator
/*
// ELEMENT: weight
$this->add_textfield('weight', array(get_lang('Weight'), null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array (
$this->addText('weight', array(get_lang('Weight'), null, '/ <span id="max_weight">'.$default_weight.'</span>'), 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', '>=');
}

@ -108,7 +108,7 @@ if (isset($_GET['id'])) {
if (api_get_setting('allow_group_categories') == 'true') {
$form->addElement('header', $nameTools);
$form->addElement('html', '<div class="row"><div class="span6">');
$form->add_textfield('title', get_lang('Title'));
$form->addText('title', get_lang('Title'));
// Groups per user
$possible_values = array();

@ -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));

@ -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);

@ -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);
}

@ -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'])) {

@ -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'));

@ -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'));

@ -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'])) {

@ -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');

@ -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']));

@ -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']);

@ -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']);

@ -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;
}

@ -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();
Display :: display_footer();

@ -62,7 +62,7 @@ if (api_get_setting('ProfilingFilterAddingUsers') == 'true') {
$form = new FormValidator('search_user', 'get', '', '', null, false);
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$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);

@ -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('<span>{element}</span> ');
$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();

@ -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');

Loading…
Cancel
Save