Browse Source

Minor - Fix buttons style - refs #7539

Yannick Warnier 10 years ago
parent
commit
fe52861c6e
54 changed files with 187 additions and 137 deletions
  1. 4 4
      main/admin/course_request_edit.php
  2. 1 1
      main/admin/settings.lib.php
  3. 2 2
      main/admin/specific_fields_add.php
  4. 2 2
      main/admin/sub_language_add.php
  5. 4 4
      main/admin/system_announcements.php
  6. 5 5
      main/attendance/attendance_calendar.php
  7. 1 1
      main/auth/gotocourse.php
  8. 1 1
      main/auth/set_temp_password.php
  9. 1 1
      main/exercice/export/aiken/aiken_import.inc.php
  10. 7 6
      main/exercice/global_multiple_answer.class.php
  11. 1 1
      main/exercice/hotspot.class.php
  12. 1 1
      main/exercice/question_create.php
  13. 2 2
      main/exercice/tests_category.php
  14. 1 1
      main/exercice/upload_exercise.php
  15. 2 2
      main/forum/forumfunction.inc.php
  16. 7 6
      main/gradebook/lib/fe/evalform.class.php
  17. 2 2
      main/gradebook/lib/fe/userform.class.php
  18. 1 1
      main/group/group_category.php
  19. 2 2
      main/group/group_creation.php
  20. 1 1
      main/group/group_edit.php
  21. 1 1
      main/help/faq.php
  22. 1 1
      main/inc/lib/api.lib.php
  23. 2 2
      main/inc/lib/blog.lib.php
  24. 2 2
      main/inc/lib/document.lib.php
  25. 2 2
      main/inc/lib/event_email_template.class.php
  26. 78 34
      main/inc/lib/formvalidator/FormValidator.class.php
  27. 1 1
      main/inc/lib/gradebook.lib.php
  28. 1 1
      main/inc/lib/myspace.lib.php
  29. 1 1
      main/inc/lib/plugin.class.php
  30. 1 1
      main/inc/lib/plugin.lib.php
  31. 2 2
      main/inc/lib/statistics.lib.php
  32. 6 6
      main/inc/lib/timeline.lib.php
  33. 2 2
      main/mySpace/user_add.php
  34. 1 1
      main/social/group_add.php
  35. 1 1
      main/social/group_edit.php
  36. 1 7
      main/social/home.php
  37. 1 1
      main/social/message_for_group_form.inc.php
  38. 1 1
      main/survey/copy_survey.php
  39. 1 1
      main/survey/fillsurvey.php
  40. 1 1
      main/tracking/course_log_resources.php
  41. 1 1
      main/tracking/course_session_report.php
  42. 1 1
      main/tracking/exams.php
  43. 1 1
      main/tracking/lp_results_by_user.php
  44. 19 9
      main/tracking/question_course_report.php
  45. 1 1
      main/upload/upload_ppt.php
  46. 1 1
      main/user/user_import.php
  47. 1 1
      main/work/work.lib.php
  48. 1 1
      plugin/add_cas_login_button/plugin.php
  49. 1 1
      plugin/add_cas_logout_button/plugin.php
  50. 1 1
      plugin/add_facebook_login_button/plugin.php
  51. 1 1
      plugin/add_shibboleth_login_button/plugin.php
  52. 1 1
      plugin/ext_auth_chamilo_logout_button_behaviour/plugin.php
  53. 1 1
      plugin/hello_world/plugin.php
  54. 1 1
      plugin/ticket/src/myticket.php

+ 4 - 4
main/admin/course_request_edit.php

@@ -97,15 +97,15 @@ if ($course_validation_feature) {
         $form->addElement('checkbox', 'exemplary_content', get_lang('FillWithExemplaryContent'));
 
         // Submit buttons.
-        $submit_buttons[] = $form->createElement('style_submit_button', 'save_button', get_lang('Save'), array('class' => 'save'));
+        $submit_buttons[] = $form->addButtonSave(get_lang('Save'), 'save_button', true);
         if ($course_request_info['status'] != COURSE_REQUEST_ACCEPTED) {
-            $submit_buttons[] = $form->createElement('style_submit_button', 'accept_button', get_lang('Accept'), array('class' => 'save', 'style' => 'background-image: url('.api_get_path(WEB_IMG_PATH).'icons/16/accept.png);'));
+            $submit_buttons[] = $form->addButtonSave(get_lang('Accept'), 'accept_button', true);
         }
         if ($course_request_info['status'] != COURSE_REQUEST_ACCEPTED && $course_request_info['status'] != COURSE_REQUEST_REJECTED) {
-            $submit_buttons[] = $form->createElement('style_submit_button', 'reject_button', get_lang('Reject'), array('class' => 'save', 'style' => 'background-image: url('.api_get_path(WEB_IMG_PATH).'icons/16/error.png);'));
+            $submit_buttons[] = $form->addButtonCancel(get_lang('Reject'), 'reject_button', true);
         }
         if ($course_request_info['status'] != COURSE_REQUEST_ACCEPTED && intval($course_request_info['info']) <= 0) {
-            $submit_buttons[] = $form->createElement('style_submit_button', 'ask_info_button', get_lang('AskAdditionalInfo'), array('class' => 'save', 'style' => 'background-image: url('.api_get_path(WEB_IMG_PATH).'request_info.gif);'));
+            $submit_buttons[] = $form->addButtonPreview(get_lang('AskAdditionalInfo'), 'ask_info_button', true);
         }
         $form->addGroup($submit_buttons);
 

+ 1 - 1
main/admin/settings.lib.php

@@ -955,7 +955,7 @@ function add_edit_template() {
         $form->setDefaults($defaults);
     }
     // Setting the form elements: the submit button.
-    $form->addElement('style_submit_button' , 'submit', get_lang('Ok') ,'class="save"');
+    $form->addButtonSave(get_lang('Ok'), 'submit');
 
     // Setting the rules: the required fields.
     $form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');

+ 2 - 2
main/admin/specific_fields_add.php

@@ -53,14 +53,14 @@ if (is_numeric($_REQUEST['field_id'])) {
 }
 $form->setDefaults($defaults);
 // Submit button
-$form->addElement('style_submit_button', 'submit', get_lang('Add'),'class="add"');
+$form->addButtonCreate(get_lang('Add'), 'submit');
 
 // Validate form
 if ($form->validate()) {
     $field = $form->exportValues();
     $field_name = $field['field_name'];
     if (is_numeric($field['field_id']) && $field['field_id']<>0 && !empty($field['field_id'])) {
-        edit_specific_field($field['field_id'],$field['field_name']);
+        edit_specific_field($field['field_id'], $field['field_name']);
         $message = get_lang('FieldEdited');
     } else {
         $field_id = add_specific_field($field_name);

+ 2 - 2
main/admin/sub_language_add.php

@@ -271,7 +271,7 @@ if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') {
 	$form->addRule('isocode', get_lang('ThisFieldIsRequired'), 'required');
 	$form->addElement('static', null, '&nbsp;', '<i>en, es, fr</i>');
 	$form->addElement('checkbox', 'sub_language_is_visible', '', get_lang('Visibility'));
-	$form->addElement('style_submit_button', 'SubmitAddNewLanguage', get_lang('CreateSubLanguage'), 'class="'.$class.'"');
+	$form->addButtonCreate(get_lang('CreateSubLanguage'), 'SubmitAddNewLanguage');
         //$values['original_name'] = $language_details['original_name'].'...'; -> cannot be used because of quickform filtering (freeze)
         $values['english_name'] = $language_details['english_name'].'2';
         $values['isocode'] = $language_details['isocode'];
@@ -286,7 +286,7 @@ if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') {
 		$form->addElement('static', '', get_lang('OriginalName'),$original_name);
 		$form->addElement('static', '', get_lang('EnglishName'),$english_name);
 		$form->addElement('static', '', get_lang('PlatformCharsetTitle'),$isocode);
-		$form->addElement('style_submit_button', 'SubmitAddDeleteLanguage', get_lang('DeleteSubLanguage'), 'class="'.$class.'"');
+		$form->addButtonCreate(get_lang('DeleteSubLanguage'), 'SubmitAddDeleteLanguage');
 		$form->display();
 	}
 	if (isset($_GET['action']) && $_GET['action']=='definenewsublanguage') {

+ 4 - 4
main/admin/system_announcements.php

@@ -176,18 +176,18 @@ if ($action_todo) {
         $form->addElement('hidden', 'action', 'edit');
     }
     $form->addElement('checkbox', 'send_email_test', null, get_lang('SendOnlyAnEmailToMySelfToTest'));
-    $form->addElement('style_submit_button', 'submit', $text, 'class="'.$class.'"');
+    $form->addButtonSend($text, 'submit');
     $form->setDefaults($values);
 
     if ($form->validate()) {
         $values = $form->exportValues();
-        if ( !isset($values['visible_teacher'])) {
+        if (!isset($values['visible_teacher'])) {
             $values['visible_teacher'] = false;
         }
-        if ( !isset($values['visible_student'])) {
+        if (!isset($values['visible_student'])) {
             $values['visible_student'] = false;
         }
-        if ( !isset($values['visible_guest'])) {
+        if (!isset($values['visible_guest'])) {
             $values['visible_guest'] = false;
         }
         if ($values['lang'] == 'all') {

+ 5 - 5
main/attendance/attendance_calendar.php

@@ -131,16 +131,16 @@ if (isset($action) && $action == 'calendar_add') {
 
                 $form->addElement('date_time_picker', 'date_time', '', array('form_name'=>'attendance_calendar_edit'), 5);
                 $defaults['date_time'] = $calendar['date_time'];
-                $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
-                $form->addElement('style_submit_button', 'cancel', get_lang('Cancel'), 'class="cancel"');
+                $form->addButtonSave(get_lang('Save'));
+                $form->addButtonCancel(get_lang('Cancel'), 'cancel');
                 $form->setDefaults($defaults);
                 $form->display();
                 echo '</div>';
             } else {
                 echo Display::return_icon(
-                        'lp_calendar_event.png',
-                        get_lang('DateTime')
-                    ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
+                    'lp_calendar_event.png',
+                    get_lang('DateTime')
+                ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
 
                 if (isset($calendar['groups']) && !empty($calendar['groups'])) {
                     foreach ($calendar['groups'] as $group) {

+ 1 - 1
main/auth/gotocourse.php

@@ -27,7 +27,7 @@ if (isset($_GET['firstpage'])) {
     $form = new FormValidator('formLogin', 'post', $action, null, array('class'=>'form-stacked'));
     $form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'span3 autocapitalize_off')); //new
     $form->addElement('password', 'password', null, array('placeholder' => get_lang('Password'), 'class' => 'span3')); //new
-    $form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn span3'));
+    $form->addButtonNext(get_lang('LoginEnter'), 'submitAuth');
     // see same text in main_api.lib.php function api_not_allowed
     if (api_is_cas_activated()) {
         $msg .= Display::return_message(sprintf(get_lang('YouHaveAnInstitutionalAccount'), api_get_setting("Institution")), '', false);

+ 1 - 1
main/auth/set_temp_password.php

@@ -36,7 +36,7 @@ $form->addElement('header', get_lang('CourseRequiresPassword'));
 $form->addElement('hidden', 'course_id', $course_id);
 $form->addElement('hidden', 'session_id', $session_id);
 $form->addElement('password', 'course_password', null, get_lang('Password'));
-$form->addElement('style_submit_button', null, get_lang('Accept'), 'class="save"');
+$form->addButtonSave(get_lang('Accept'));
 
 if ($form->validate()) {
     $form_values = $form->exportValues();

+ 1 - 1
main/exercice/export/aiken/aiken_import.inc.php

@@ -45,7 +45,7 @@ function aiken_display_form($msg = '') {
     $form_validator->addElement('header', $name_tools);
     $form_validator->addElement('text', 'total_weight', get_lang('TotalWeight'));
     $form_validator->addElement('file', 'userFile', get_lang('DownloadFile'));
-    $form_validator->addElement('style_submit_button', 'submit', get_lang('Send'), 'class="upload"');
+    $form_validator->addButtonUpload(get_lang('Send'), 'submit');
     $form .= $form_validator->return_form();
     $form .= '<blockquote>'.get_lang('ImportAikenQuizExplanation').'<br /><pre>'.get_lang('ImportAikenQuizExplanationExample').'</pre></blockquote>';
     echo $form;

+ 7 - 6
main/exercice/global_multiple_answer.class.php

@@ -141,13 +141,14 @@ class GlobalMultipleAnswer extends Question
         //ie6 fix
         if ($obj_ex->edit_exercise_in_lp == true) {
             if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') {
-                $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'), 'class="minus"');
-                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'), 'class="plus"');
-                $form->addElement('submit', 'submitQuestion', $text, 'class="' . $class . '"');
+                $form = new FormValidator();
+                $form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers');
+                $form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers');
+                $form->addButtonSave($text, 'submitQuestion');
             } else {
-                $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'), 'class="minus"');
-                $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'), 'class="plus"');
-                $form->addElement('style_submit_button', 'submitQuestion', $text, 'class="' . $class . '"');
+                $form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers');
+                $form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers');
+                $form->addButtonSave($text, 'submitQuestion');
                 // setting the save button here and not in the question class.php
             }
         }

+ 1 - 1
main/exercice/hotspot.class.php

@@ -35,7 +35,7 @@ class HotSpot extends Question
 
 			// setting the save button here and not in the question class.php
 			// Saving a question
-			$form->addElement('style_submit_button','submitQuestion',get_lang('GoToQuestion'), 'class="'.$class.'"');
+			$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
 			//$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion');
 			$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
 			$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');

+ 1 - 1
main/exercice/question_create.php

@@ -50,7 +50,7 @@ $form->addElement('select', 'exercice', get_lang('Exercice'), $exercises);
 $form->addElement('checkbox', 'is_content', null, get_lang('DefaultContent'), array('checked' => true));
 
 // the submit button
-$form->addElement('style_submit_button', 'SubmitCreateQuestion', get_lang('CreateQuestion'), 'class="add"');
+$form->addButtonCreate(get_lang('CreateQuestion'), 'SubmitCreateQuestion');
 
 // setting the rules
 $form->addRule('exercice', get_lang('ThisFieldIsRequired'), 'required');

+ 2 - 2
main/exercice/tests_category.php

@@ -72,7 +72,7 @@ function edit_category_form($in_action) {
         $form->addElement('hidden', 'category_id');
         $form->addElement('text', 'category_name', get_lang('CategoryName'), array('size' => '95'));
         $form->addHtmlEditor('category_description', get_lang('CategoryDescription'), false, false, array('ToolbarSet' => 'test_category', 'Width' => '90%', 'Height' => '200'));
-        $form->addElement('style_submit_button', 'SubmitNote', get_lang('ModifyCategory'), 'class="add"');
+        $form->addButtonSave(get_lang('ModifyCategory'), 'SubmitNote');
 
         // setting the defaults
         $defaults = array();
@@ -140,7 +140,7 @@ function add_category_form($in_action) {
     $form->addElement('header', get_lang('AddACategory'));
     $form->addElement('text', 'category_name', get_lang('CategoryName'), array('size' => '95'));
     $form->addHtmlEditor('category_description', get_lang('CategoryDescription'), false, false, array('ToolbarSet' => 'test_category', 'Width' => '90%', 'Height' => '200'));
-    $form->addElement('style_submit_button', 'SubmitNote', get_lang('AddTestCategory'), 'class="add"');
+    $form->addButtonCreate(get_lang('AddTestCategory'), 'SubmitNote');
     // setting the rules
     $form->addRule('category_name', get_lang('ThisFieldIsRequired'), 'required');
     // The validation or display

+ 1 - 1
main/exercice/upload_exercise.php

@@ -90,7 +90,7 @@ function lp_upload_quiz_main() {
     $form->addRule('user_upload_quiz', get_lang('ThisFieldIsRequired'), 'required');
 
     $form->add_progress_bar();
-    $form->addElement('style_submit_button', 'submit_upload_quiz', get_lang('Send'), 'class="upload"');
+    $form->addButtonUpload(get_lang('Send'), 'submit_upload_quiz');
 
     // Display the upload field
     $form->display();

+ 2 - 2
main/forum/forumfunction.inc.php

@@ -3535,7 +3535,7 @@ function move_thread_form()
     $form->addElement('html', $htmlcontent);
 
     // The OK button
-    $form->addElement('style_submit_button', 'SubmitForum', get_lang('MoveThread'), 'class="save"');
+    $form->addButtonSave(get_lang('MoveThread'), 'SubmitForum');
 
     // Validation or display
     if ($form->validate()) {
@@ -3577,7 +3577,7 @@ function move_post_form()
     $form->applyFilter('thread', 'html_filter');
 
     // The OK button
-    $form->addElement('style_submit_button', 'submit', get_lang('MovePost'), 'class="save"');
+    $form->addButtonSave(get_lang('MovePost'), 'submit');
 
     // Setting the rules
     $form->addRule('thread', get_lang('ThisFieldIsRequired'), 'required');

+ 7 - 6
main/gradebook/lib/fe/evalform.class.php

@@ -203,7 +203,7 @@ class EvalForm extends FormValidator
             $renderer->setElementTemplate($template, 'score[' . $result->get_id() . ']');
         }
         $this->setDefaults($defaults);
-        $this->addElement('style_submit_button', 'submit', get_lang('EditResult'), 'class="save"');
+        $this->addButtonSave(get_lang('EditResult'), 'submit');
         $renderer->setElementTemplate($template_submit, 'submit');
     }
 
@@ -218,6 +218,7 @@ class EvalForm extends FormValidator
         $this->addElement('static', null, null, '"' . $this->evaluation_object->get_name() . '" ');
         $this->addElement('static', null, null, get_lang('MoveTo') . ' : ');
         $select = $this->addElement('select', 'move_cat', null, null);
+        $line = '';
         foreach ($this->evaluation_object->get_target_categories() as $cat) {
             for ($i = 0; $i < $cat[2]; $i++) {
                 $line .= '&mdash;';
@@ -225,7 +226,7 @@ class EvalForm extends FormValidator
             $select->addoption($line . ' ' . $cat[1], $cat[0]);
             $line = '';
         }
-        $this->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="save"');
+        $this->addButtonSave(get_lang('Ok'), 'submit');
     }
 
     /**
@@ -309,7 +310,7 @@ class EvalForm extends FormValidator
         }
         $this->addElement('hidden', 'nr_users', $nr_users);
         $this->addElement('hidden', 'evaluation_id', $this->result_object->get_evaluation_id());
-        $this->addElement('style_submit_button', 'submit', get_lang('AddResult'), 'class="save"');
+        $this->addButtonSave(get_lang('AddResult'), 'submit');
 
         $template_submit = '<tr>
                 <td colspan="4" ></td>
@@ -347,7 +348,7 @@ class EvalForm extends FormValidator
           'disabled' => 'disabled'
           )); */
 
-        $this->addElement('style_submit_button', 'submit', get_lang('Edit'), 'class="save"');
+        $this->addButtonSave(get_lang('Edit'), 'submit');
         $this->addElement('hidden', 'minvalue', 0);
         $this->addElement('hidden', 'hid_user_id', $this->result_object->get_user_id());
         $this->addElement('hidden', 'maxvalue', $this->evaluation_object->get_max());
@@ -376,7 +377,7 @@ class EvalForm extends FormValidator
         } else {
             $this->addElement('checkbox', 'addresult', null, get_lang('AddResult'));
         }
-        $this->addElement('style_submit_button', 'submit', get_lang('AddAssessment'), 'class="add"');
+        $this->addButtonCreate(get_lang('AddAssessment'), 'submit');
     }
 
     /**
@@ -409,7 +410,7 @@ class EvalForm extends FormValidator
         $id_current = isset($this->id) ? $this->id : null;
         $this->addElement('hidden', 'hid_id', $id_current);
         $this->build_basic_form(1);
-        $this->addElement('style_submit_button', 'submit', get_lang('ModifyEvaluation'), 'class="save"');
+        $this->addButtonSave(get_lang('ModifyEvaluation'), 'submit');
     }
 
     /**

+ 2 - 2
main/gradebook/lib/fe/userform.class.php

@@ -48,7 +48,7 @@ class UserForm extends FormValidator
 		$renderer =& $this->defaultRenderer();
 		$renderer->setCustomElementTemplate('<span>{element}</span> ');
 		$this->addElement('text','keyword','');
-		$this->addElement('style_submit_button','submit',get_lang('Search'),'class="search"');
+		$this->addButtonSearch(get_lang('Search'), 'submit');
 	}
 
 	protected function build_user_info_form()
@@ -64,7 +64,7 @@ class UserForm extends FormValidator
 		$this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>');
 		$this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']);
 		$this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']);
-		$this->addElement('style_submit_button', 'submit', get_lang('Back'),'class="save"');
+		$this->addButtonSave(get_lang('Back'), 'submit');
 	}
 
 	function display()

+ 1 - 1
main/group/group_category.php

@@ -216,7 +216,7 @@ $form->addElement('html', '</div>');
 $form->addElement('html', '<div class="span12">');
 
 // Submit
-$form->addElement('style_submit_button', 'submit', get_lang('PropModify'), 'class="save"');
+$form->addButtonSave(get_lang('PropModify'), 'submit');
 
 // If form validates -> save data
 if ($form->validate()) {

+ 2 - 2
main/group/group_creation.php

@@ -202,7 +202,7 @@ EOT;
 		$defaults['action'] = 'create_groups';
 		$defaults['number_of_groups'] = intval($_POST['number_of_groups']);
 		$form->setDefaults($defaults);
-		$form->addElement('style_submit_button', 'submit', get_lang('CreateGroup'), 'class="save"');
+		$form->addButtonCreate(get_lang('CreateGroup'), 'submit');
         $form->display();
 	}
 } else {
@@ -215,7 +215,7 @@ EOT;
 		$create_groups_form->addElement('header', $nameTools);
 		$group_el = array ();
 		$group_el[] = $create_groups_form->createElement('text', 'number_of_groups', array(get_lang('Create'), '1'));
-		$group_el[] = $create_groups_form->createElement('style_submit_button', 'submit', get_lang('ProceedToCreateGroup'), 'class="save"');
+		$group_el[] = $create_groups_form->addButtonCreate(get_lang('ProceedToCreateGroup'), 'submit', true);
 		$create_groups_form->addGroup($group_el, 'create_groups', get_lang('NumberOfGroupsToCreate'), ' ', false);
 		$defaults = array();
 		$defaults['number_of_groups'] = 1;

+ 1 - 1
main/group/group_edit.php

@@ -239,7 +239,7 @@ $group = array(
 $form->addGroup($group, '', Display::return_icon('chat.png', get_lang('Chat'), array(), ICON_SIZE_SMALL).' '.get_lang('Chat'), '', false);
 
 // submit button
-$form->addElement('style_submit_button', 'submit', get_lang('SaveSettings'), 'class="save"');
+$form->addButtonSave(get_lang('SaveSettings'), 'submit');
 
 if ($form->validate()) {
     $values = $form->exportValues();

+ 1 - 1
main/help/faq.php

@@ -24,7 +24,7 @@ $faq_file = 'faq.html';
 if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin()) {
     $form = new FormValidator('set_faq', 'post', 'faq.php?edit=true');
     $form->addHtmlEditor('faq_content', null, false, false, array('ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300'));
-    $form->addElement('style_submit_button', 'faq_submit', get_lang('Ok'));
+    $form->addButtonSave(get_lang('Ok'), 'faq_submit');
     $faq_content = @(string)file_get_contents(api_get_path(SYS_PATH).'home/faq.html');
     $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
     $form->setDefaults(array('faq_content' => $faq_content));

+ 1 - 1
main/inc/lib/api.lib.php

@@ -3385,7 +3385,7 @@ function api_not_allowed($print_headers = false, $message = null)
         $form = new FormValidator('formLogin', 'post', $action, null, array('class'=>'form-stacked'));
         $form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'col-md-3 autocapitalize_off')); //new
         $form->addElement('password', 'password', null, array('placeholder' => get_lang('Password'), 'class' => 'col-md-3')); //new
-        $form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn col-md-3'));
+        $form->addButtonNext(get_lang('LoginEnter'), 'submitAuth');
 
         // see same text in auth/gotocourse.php and main_api.lib.php function api_not_allowed (bellow)
         $msg = Display::return_message(get_lang('NotAllowed'), 'error', false);

+ 2 - 2
main/inc/lib/blog.lib.php

@@ -2425,7 +2425,7 @@ class Blog
         $form->addElement('textarea', 'blog_subtitle', get_lang('SubTitle'));
 
         $form->addElement('hidden', 'new_blog_submit', 'true');
-        $form->addElement('style_submit_button', null, get_lang('SaveProject'));
+        $form->addButtonSave(get_lang('SaveProject'));
 
         $defaults = array(
 			'blog_name' => isset($_POST['blog_name']) ? Security::remove_XSS($_POST['blog_name']) : null,
@@ -2462,7 +2462,7 @@ class Blog
 
         $form->addElement('hidden', 'edit_blog_submit', 'true');
         $form->addElement('hidden', 'blog_id', $blog['blog_id']);
-        $form->addElement('style_submit_button', null, get_lang('Save'));
+        $form->addButtonSave(get_lang('Save'));
 
         $defaults = array();
         $defaults['blog_name'] = $blog['blog_name'];

+ 2 - 2
main/inc/lib/document.lib.php

@@ -5783,8 +5783,8 @@ class DocumentManager
         $form->addElement('hidden', 'id', intval($dirId));
         $form->addElement('header', '', get_lang('CreateDir'));
         $form->addElement('text', 'dirname', get_lang('NewDir'), array('autofocus' => 'autofocus'));
-        $form->addElement('style_submit_button', 'submit','<i class="fa fa-folder-open"></i> '. get_lang('CreateFolder'), 'class="btn-primary"');
-        $new_folder_text = $form->return_form();
+        $form->addButtonCreate(get_lang('CreateFolder'), 'submit');
+        $new_folder_text = $form->returnForm();
         return $new_folder_text;
     }
 

+ 2 - 2
main/inc/lib/event_email_template.class.php

@@ -78,9 +78,9 @@ class EventEmailTemplate extends Model {
         }
 
         if ($action == 'edit') {
-        	$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+            $form->addButtonSave(get_lang('Modify'), 'submit');
         } else {
-        	$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="save"');
+            $form->addButtonCreate(get_lang('Add'), 'submit');
         }
 
         // Setting the defaults

+ 78 - 34
main/inc/lib/formvalidator/FormValidator.class.php

@@ -293,10 +293,10 @@ EOT;
     }
 
     /**
-     * @param string $label
-     * @param string $name
-     * @param bool $createElement
-     *
+     * Returns a button with the primary color and a check mark
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
      * @return HTML_QuickForm_button
      */
     public function addButtonSave($label, $name = 'submit', $createElement = false)
@@ -314,10 +314,10 @@ EOT;
     }
 
     /**
-     * @param string $label
-     * @param string $name
-     * @param bool $createElement
-     *
+     * Returns a button with the primary color and a "plus" icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
      * @return HTML_QuickForm_button
      */
     public function addButtonCreate($label, $name = 'submit', $createElement = false)
@@ -335,10 +335,10 @@ EOT;
     }
 
     /**
-     * @param string $label
-     * @param string $name
-     * @param bool $createElement
-     *
+     * Returns a button with the primary color and a pencil icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
      * @return HTML_QuickForm_button
      */
     public function addButtonUpdate($label, $name = 'submit', $createElement = false)
@@ -356,8 +356,11 @@ EOT;
     }
 
     /**
-     * Shortcut to delete button
-     * @param string $label
+     * Returns a button with the danger color and a trash icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonDelete($label, $name = 'submit', $createElement = false)
     {
@@ -374,10 +377,10 @@ EOT;
     }
 
     /**
-     * @param string $label
-     * @param string $name
-     * @param bool $createElement
-     *
+     * Returns a button with the primary color and a paper-plane icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
      * @return HTML_QuickForm_button
      */
     public function addButtonSend($label, $name = 'submit', $createElement = false)
@@ -395,20 +398,22 @@ EOT;
     }
 
     /**
-     * Shortcut to search button
-     * @param string $label
+     * Returns a button with the default (grey?) color and a magnifier icon
+     * @param string $label Text appearing on the button
+     * @return HTML_QuickForm_button
      */
     public function addButtonSearch($label = null)
     {
-        if (empty($label))  {
+        if (empty($label)) {
             $label = get_lang('Search');
         }
         return $this->addButton('submit', $label, 'search', 'default');
     }
 
     /**
-     * Shortcut to update button
-     * @param string $label
+     * Returns a button with the primary color and a right-pointing arrow icon
+     * @param string $label Text appearing on the button
+     * @return HTML_QuickForm_button
      */
     public function addButtonNext($label)
     {
@@ -416,8 +421,11 @@ EOT;
     }
 
     /**
-     * Shortcut to import button
-     * @param string $label
+     * Returns a button with the primary color and a check mark icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonImport($label, $name = 'submit', $createElement = false)
     {
@@ -434,8 +442,11 @@ EOT;
     }
 
     /**
-     * Shortcut to export button
-     * @param string $label
+     * Returns a button with the primary color and a check-mark icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonExport($label, $name = 'submit', $createElement = false)
     {
@@ -453,7 +464,10 @@ EOT;
 
     /**
      * Shortcut to filter button
-     * @param string $label
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonFilter($label, $name = 'submit', $createElement = false)
     {
@@ -470,8 +484,11 @@ EOT;
     }
 
     /**
-     * Shortcut to upload button
-     * @param string $label
+     * Returns a button with the primary color and an upload icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonUpload($label, $name = 'submit', $createElement = false)
     {
@@ -488,8 +505,11 @@ EOT;
     }
 
     /**
-     * Shortcut to upload button
-     * @param string $label
+     * Returns a button with the primary color and a download icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonDownload($label, $name = 'submit', $createElement = false)
     {
@@ -506,8 +526,11 @@ EOT;
     }
 
     /**
-     * Shortcut to preview button
-     * @param string $label
+     * Returns a button with the primary color and a magnifier icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
      */
     public function addButtonPreview($label, $name = 'submit', $createElement = false)
     {
@@ -523,6 +546,27 @@ EOT;
         );
     }
 
+    /**
+     * Returns a button with the primary color and a copy (double sheet) icon
+     * @param string $label Text appearing on the button
+     * @param string $name Element name (for form treatment purposes)
+     * @param bool $createElement Whether to use the create or add method
+     * @return HTML_QuickForm_button
+     */
+    public function addButtonCopy($label, $name = 'submit', $createElement = false)
+    {
+        return $this->addButton(
+            $name,
+            $label,
+            'copy',
+            'primary',
+            null,
+            null,
+            array(),
+            $createElement
+        );
+    }
+
     /**
      * @param string $name
      * @param string $label

+ 1 - 1
main/inc/lib/gradebook.lib.php

@@ -191,7 +191,7 @@ class Gradebook extends Model
             }
         }
 
-        $form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="save"');
+        $form->addButtonCreate(get_lang('Add'), 'submit');
 
         $form->setDefaults(array('skill'=>$clean_selected_skills));
 

+ 1 - 1
main/inc/lib/myspace.lib.php

@@ -1069,7 +1069,7 @@ class MySpace
                 foreach ($extrafields as $key => $extra) {
                     $form->addElement('checkbox', 'extra_export_field'.$extra[0], '', $extra[3]);
                 }
-                $form->addElement('style_submit_button','submit', get_lang('Ok'),'class="save"' );
+                $form->addButtonSave(get_lang('Ok'), 'submit');
 
                 // setting the default values for the form that contains all the extra fields
                 if (is_array($_SESSION['additional_export_fields'])) {

+ 1 - 1
main/inc/lib/plugin.class.php

@@ -250,7 +250,7 @@ class Plugin
             $result->addGroup($checkboxGroup, null, array($this->get_lang('sms_types'), $help));
         }
         $result->setDefaults($defaults);
-        $result->addElement('style_submit_button', 'submit_button', $this->get_lang('Save'));
+        $result->addButtonSave($this->get_lang('Save'), 'submit_button');
         return $result;
     }
 

+ 1 - 1
main/inc/lib/plugin.lib.php

@@ -534,7 +534,7 @@ class AppPlugin
                 foreach ($groups as $k => $v) {
                     $form->addGroup($groups[$k], $k, array($obj->get_lang($k)));
                 }
-                $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');
+                $form->addButtonSave(get_lang('SaveSettings'));
                 $form->addElement('html', '</div></div>');
             }
         }

+ 2 - 2
main/inc/lib/statistics.lib.php

@@ -589,7 +589,7 @@ class Statistics
         $form->addElement('hidden', 'activities_direction', 'DESC');
         $form->addElement('hidden', 'activities_column', '4');
         $form->addElement('text', 'keyword', get_lang('Keyword'));
-        $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
+        $form->addButtonSearch(get_lang('Search'), 'submit');
         echo '<div class="actions">';
             $form->display();
         echo '</div>';
@@ -645,7 +645,7 @@ class Statistics
         $form->addElement('hidden', 'report', 'courselastvisit');
         $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"');
+        $form->addButtonSearch(get_lang('Search'), 'submit');
         if (!isset($_GET['date_diff'])) {
             $defaults['date_diff'] = 60;
         } else {

+ 6 - 6
main/inc/lib/timeline.lib.php

@@ -89,16 +89,16 @@ class Timeline extends Model
 
         $form->addElement('text', 'headline', get_lang('Name'), array('size' => '70'));
         //$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'careers','Width' => '100%', 'Height' => '250'));
-	    $status_list = $this->get_status_list();
+       $status_list = $this->get_status_list();
         $form->addElement('select', 'status', get_lang('Status'), $status_list);
         if ($action == 'edit') {
             //$form->addElement('text', 'created_at', get_lang('CreatedAt'));
             //$form->freeze('created_at');
         }
         if ($action == 'edit') {
-        	$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+            $form->addButtonSave(get_lang('Modify'), 'submit');
         } else {
-        	$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="save"');
+            $form->addButtonCreate(get_lang('Add'), 'submit');
         }
 
         $form->addRule('headline', get_lang('ThisFieldIsRequired'), 'required');
@@ -116,7 +116,7 @@ class Timeline extends Model
 
         // Setting the rules
         $form->addRule('headline', get_lang('ThisFieldIsRequired'), 'required');
-		return $form;
+        return $form;
     }
 
     /**
@@ -158,9 +158,9 @@ class Timeline extends Model
         if ($action == 'edit') {
             // Setting the defaults
             $defaults = $this->get($id);
-        	$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+            $form->addButtonSave(get_lang('Modify'), 'submit');
         } else {
-        	$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="save"');
+            $form->addButtonCreate(get_lang('Add'), 'submit');
         }
 
         /*if (!empty($defaults['created_at'])) {

+ 2 - 2
main/mySpace/user_add.php

@@ -217,8 +217,8 @@ $defaults['session_id'] = api_get_session_id();
 $form->setDefaults($defaults);
 // Submit button
 $select_level = array ();
-$html_results_enabled[] = FormValidator :: createElement ('style_submit_button', 'submit_plus', get_lang('Add').'+', 'class="add"');
-$html_results_enabled[] = FormValidator :: createElement ('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
+$html_results_enabled[] = FormValidator :: addButtonCreate(get_lang('Add') . '+', 'submit_plus', true);
+$html_results_enabled[] = FormValidator :: addButtonCreate(get_lang('Add'), 'submit', true);
 $form->addGroup($html_results_enabled);
 // Validate form
 if ($form->validate()) {

+ 1 - 1
main/social/group_add.php

@@ -34,7 +34,7 @@ $table_message = Database::get_main_table(TABLE_MESSAGE);
 
 $form = new FormValidator('add_group');
 $form = GroupPortalManager::setGroupForm($form);
-$form->addElement('style_submit_button', 'add_group', get_lang('AddGroup'), 'class="save"');
+$form->addButtonCreate(get_lang('AddGroup'), 'add_group');
 
 $form->setRequiredNote(api_xml_http_response_encode('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>'));
 

+ 1 - 1
main/social/group_edit.php

@@ -52,7 +52,7 @@ $form = new FormValidator('group_edit', 'post', '', '');
 $form->addElement('hidden', 'id', $group_id);
 $form = GroupPortalManager::setGroupForm($form, $group_data);
 // Submit button
-$form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation'), 'class="save"');
+$form->addButtonSave(get_lang('ModifyInformation'), 'submit');
 
 // Validate form
 if ($form->validate()) {

+ 1 - 7
main/social/home.php

@@ -53,13 +53,7 @@ if (api_get_setting('profile', 'picture') == 'true') {
         'filetype',
         $allowed_picture_types
     );
-    $form->addElement(
-        'style_submit_button',
-        'apply_change',
-        get_lang('SaveSettings'),
-        'floppy-o',
-        'btn btn-success'
-    );
+    $form->addButtonSave(get_lang('SaveSettings'), 'apply_change');
 
     if ($form->validate()) {
         $user_data = $form->getSubmitValues();

+ 1 - 1
main/social/message_for_group_form.inc.php

@@ -124,7 +124,7 @@ if (api_get_setting('allow_message_tool') == 'true') {
         )
     );
 
-    $form->addElement('style_submit_button', 'submit', get_lang('SendMessage'));
+    $form->addButtonSend(get_lang('SendMessage'), 'submit');
     Display::display_no_header();
     //Display::display_reduced_header();
     $form->display();

+ 1 - 1
main/survey/copy_survey.php

@@ -66,7 +66,7 @@ if ($surveys && count($courses) > 1) {
         }
     }
     $form->addElement('select', 'destination_course', get_lang('SelectDestinationCourse'), $options);
-    $form->addElement('style_submit_button', 'submit', get_lang('CopySurvey'), 'class="save"');
+    $form->addButtonCopy(get_lang('CopySurvey'));
 }
 
 // Add Security token

+ 1 - 1
main/survey/fillsurvey.php

@@ -494,7 +494,7 @@ if ($survey_data['form_fields'] != '' && $survey_data['anonymous'] == 0 && is_ar
     $extra_data = UserManager :: get_extra_user_data($user_id, true);
     UserManager::set_extra_fields_in_form($form, $extra_data, 'profile');
 
-    $form->addElement('style_submit_button', '', get_lang('Next'), array('class' => 'next'));
+    $form->addButtonNext(get_lang('Next'));
     $user_data = array_merge($user_data, $extra_data);
     $form->setDefaults($user_data);
 }

+ 1 - 1
main/tracking/course_log_resources.php

@@ -106,7 +106,7 @@ $renderer->setCustomElementTemplate('<span>{element}</span>');
 $form->addElement('text', 'keyword', get_lang('Keyword'));
 $form->addElement('hidden', 'cidReq', api_get_course_id());
 $form->addElement('hidden', 'id_session', $session_id);
-$form->addElement('style_submit_button', 'submit', get_lang('SearchUsers'), 'class="search"');
+$form->addButtonSearch(get_lang('SearchUsers'), 'submit');
 echo '<div class="actions">';
 $form->display();
 echo '</div>';

+ 1 - 1
main/tracking/course_session_report.php

@@ -45,7 +45,7 @@ if (count($session_list) == 0) {
 	$my_session_list[0] = get_lang('None');
 }
 $form->addElement('select', 'session_id', get_lang('Sessions'), $my_session_list);
-$form->addElement('style_submit_button','submit',get_lang('Filter'));
+$form->addButtonFilter(get_lang('Filter'));
 
 
 if (!empty($_REQUEST['score']))	$filter_score = intval($_REQUEST['score']); else $filter_score = 70;

+ 1 - 1
main/tracking/exams.php

@@ -74,7 +74,7 @@ if ($global) {
     $form->addElement('select', 'exercise_id', get_lang('Exercise'), $exerciseList);
 }
 
-$form->addElement('style_submit_button', 'submit', get_lang('Filter'), 'class="search"');
+$form->addButtonFilter(get_lang('Filter'));
 
 $filter_score = isset($_REQUEST['score']) ? intval($_REQUEST['score']) : 70;
 $exerciseId = isset($_REQUEST['exercise_id']) ? intval($_REQUEST['exercise_id']) : 0;

+ 1 - 1
main/tracking/lp_results_by_user.php

@@ -70,7 +70,7 @@ if ($global) {
 }
 
 //$form->addElement('submit','submit',get_lang('Filter'));
-$form->addElement('style_submit_button','submit', get_lang('Filter'),'class="search"' );
+$form->addButtonFilter(get_lang('Filter'));
 
 if (!empty($_REQUEST['course_code']))
     $selected_course = $_REQUEST['course_code'];

+ 19 - 9
main/tracking/question_course_report.php

@@ -66,18 +66,28 @@ $session_list = SessionManager::get_sessions_list(array(), array('name'));
 
 $my_session_list = array();
 $my_session_list[0] = get_lang('None');
-foreach($session_list as $sesion_item) {
-	$my_session_list[$sesion_item['id']] = $sesion_item['name'];
+foreach ($session_list as $sesion_item) {
+    $my_session_list[$sesion_item['id']] = $sesion_item['name'];
 }
 
-$form = new FormValidator('search_simple','POST','','',null,false);
-$form->addElement('select', 'session_id', get_lang('Sessions'), $my_session_list, array('id'=>'session_id', 'onchange'=>'load_courses();'));
-$form->addElement('select', 'course_code',get_lang('Courses'), $course_select_list);
-$form->addElement('style_submit_button','submit_form', get_lang('Filter'));
-
-if (!empty($_REQUEST['course_code']))	$course_code = $_REQUEST['course_code']; else $course_code = '';
+$form = new FormValidator('search_simple', 'POST', '', '', null, false);
+$form->addElement(
+    'select',
+    'session_id',
+    get_lang('Sessions'),
+    $my_session_list,
+    array('id'=>'session_id', 'onchange'=>'load_courses();')
+);
+$form->addElement('select', 'course_code', get_lang('Courses'), $course_select_list);
+$form->addButtonFilter(get_lang('Filter'), 'submit_form');
+
+if (!empty($_REQUEST['course_code'])) {
+    $course_code = $_REQUEST['course_code'];
+} else {
+    $course_code = '';
+}
 if (empty($course_code)) {
-	$course_code = 0;
+    $course_code = 0;
 }
 
 $form->setDefaults(array('course_code'=>(string)$course_code));

+ 1 - 1
main/upload/upload_ppt.php

@@ -89,7 +89,7 @@ if (api_get_setting('search_enabled') == 'true') {
     }
 }
 
-$form->addElement('style_submit_button', 'convert', get_lang('ConvertToLP'));
+$form->addButtonUpload(get_lang('ConvertToLP'), 'convert');
 $form->addElement('hidden', 'ppt2lp', 'true');
 
 $form->add_real_progress_bar(md5(rand(0, 10000)), 'user_file', 1, true);

+ 1 - 1
main/user/user_import.php

@@ -25,7 +25,7 @@ $form->addElement('file', 'import_file', get_lang('ImportCSVFileLocation'));
 
 $form->addElement('checkbox', 'unsubscribe_users', null, get_lang('UnsubscribeUsersAlreadyAddedInCourse'));
 
-$form->addElement('style_submit_button', 'submit', get_lang('Import'), 'class="save"');
+$form->addButtonImport(get_lang('Import'));
 
 $course_code = api_get_course_id();
 

+ 1 - 1
main/work/work.lib.php

@@ -3748,7 +3748,7 @@ function setWorkUploadForm($form, $uploadFormType = 0)
             break;
     }
 
-    $form->addElement('style_submit_button', 'submitWork', get_lang('Send'), array('class'=> 'upload', 'value' => "submitWork"));
+    $form->addButtonUpload(get_lang('Send'), 'submitWork');
 }
 
 /**

+ 1 - 1
plugin/add_cas_login_button/plugin.php

@@ -24,7 +24,7 @@ $form = new FormValidator('add_cas_button_form');
 $form->addElement('text', 'cas_button_label', 'CAS connexion title', '');
 $form->addElement('text', 'cas_button_comment', 'CAS connexion description', '');
 $form->addElement('text', 'cas_image_url', 'Logo URL if any (image, 50px height)');
-$form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
+$form->addButtonSave(get_lang('Save'), 'submit_button');
 //get default value for form
 $tab_default_add_cas_login_button_cas_button_label = api_get_setting('add_cas_login_button_cas_button_label');
 $tab_default_add_cas_login_button_cas_button_comment = api_get_setting('add_cas_login_button_cas_button_comment');

+ 1 - 1
plugin/add_cas_logout_button/plugin.php

@@ -23,7 +23,7 @@ $form = new FormValidator('add_cas_button_form');
 $form->addElement('text', 'cas_logout_label', 'CAS logout title', '');
 $form->addElement('text', 'cas_logout_comment', 'CAS logout description', '');
 $form->addElement('text', 'cas_logout_image_url', 'Logo URL if any (image, 50px height)');
-$form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
+$form->addButtonSave(get_lang('Save'), 'submit_button');
 //get default value for form
 $tab_default_add_cas_logout_button_cas_logout_label = api_get_setting('add_cas_logout_button_cas_logout_label');
 $tab_default_add_cas_logout_button_cas_logout_comment = api_get_setting('add_cas_logout_button_cas_logout_comment');

+ 1 - 1
plugin/add_facebook_login_button/plugin.php

@@ -26,7 +26,7 @@ $form->addElement(
     'Facebook connexion image URL',
     ''
 );
-$form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
+$form->addButtonSave(get_lang('Save'), 'submit_button');
 //get default value for form
 $tab_default_add_facebook_login_button_facebook_button_url = api_get_setting(
     'add_facebook_login_button_facebook_button_url'

+ 1 - 1
plugin/add_shibboleth_login_button/plugin.php

@@ -38,7 +38,7 @@ $form->addElement(
     'shibboleth_image_url',
     'Logo URL if any (image, 50px height)'
 );
-$form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
+$form->addButtonSave(get_lang('Save'), 'submit_button');
 //get default value for form
 $tab_default_add_shibboleth_login_button_shibboleth_button_label = api_get_setting(
     'add_shibboleth_login_button_shibboleth_button_label'

+ 1 - 1
plugin/ext_auth_chamilo_logout_button_behaviour/plugin.php

@@ -27,7 +27,7 @@ $form->addElement('checkbox', 'eaclbb_form_link_image', "Display the logout butt
 $form->addElement('checkbox', 'eaclbb_form_alert_onoff', "Display an alert when clicking on the logout button", "",  array('checked' => true));
 $form->addElement('text', 'eaclbb_form_alert_text', "Text displayed in the alert box when clickng on the logout button (if checkbox above has been checked).");
 
-$form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
+$form->addButtonSave(get_lang('Save'), 'submit_button');
 //get default value for form
 $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url');
 $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle');

+ 1 - 1
plugin/hello_world/plugin.php

@@ -33,6 +33,6 @@ $form = new FormValidator('hello_world_form');
 //A simple select
 $options = array('hello_world' => 'Hello World', 'hello' =>'Hello', 'hi' =>'Hi!');
 $form->addElement('select', 'show_type', 'Hello world types', $options);
-$form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
+$form->addButtonSave(get_lang('Save'), 'submit_button');
 
 $plugin_info['settings_form'] = $form;

+ 1 - 1
plugin/ticket/src/myticket.php

@@ -252,7 +252,7 @@ if ($isAdmin) {
     $renderer = & $form->defaultRenderer();
     $renderer->setCustomElementTemplate('<span>{element}</span> ');
     $form->addElement('text', 'keyword', get_lang('Keyword'), 'size="25"');
-    $form->addElement('style_submit_button', 'submit_simple', get_lang('Search'), 'class="search"');
+    $form->addButtonSearch(get_lang('Search'), 'submit_simple');
     $form->addElement('static', 'search_advanced_link', null,
             '<a href="javascript://" class = "advanced-parameters" onclick="display_advanced_search_form();">'
             . '<span id="img_plus_and_minus">&nbsp;'