Replace buttons calls.

From:

$form->addElement(
    'style_submit_button',
    'submit',
    get_lang('ModifyInformation'),
    'class="save"'
);

To

$form->addButtonUpdate(get_lang('ModifyInformation'));
1.10.x
Julio Montoya 11 years ago
parent 757a27f590
commit b55ac70d10
  1. 4
      main/admin/group_add.php
  2. 2
      main/admin/group_edit.php
  3. 5
      main/admin/group_list.php
  4. 2
      main/course_description/add.php
  5. 2
      main/course_description/edit.php
  6. 34
      main/document/create_document.php
  7. 4
      main/document/edit_document.php
  8. 2
      main/document/upload.php
  9. 40
      main/forum/forumfunction.inc.php
  10. 4
      main/inc/lib/extra_field.lib.php
  11. 18
      main/inc/lib/formvalidator/FormValidator.class.php
  12. 3
      main/survey/create_new_survey.php
  13. 2
      main/tracking/courseLog.php
  14. 14
      main/user/user.php
  15. 6
      main/work/work.php

@ -10,7 +10,7 @@ $language_file = array('admin', 'registration', 'userInfo');
$cidReset = true;
// Including necessary libraries.
require '../inc/global.inc.php';
require_once '../inc/global.inc.php';
$libpath = api_get_path(LIBRARY_PATH);
// Section for the tabs
@ -96,7 +96,7 @@ $defaults['status'] = GROUP_PERMISSION_OPEN;
$form->setDefaults($defaults);
// Submit button
$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
$form->addButtonCreate(get_lang('Add'));
// Validate form
if( $form->validate()) {

@ -86,7 +86,7 @@ $status[GROUP_PERMISSION_CLOSED] = get_lang('Closed');
$form->addElement('select', 'visibility', get_lang('GroupPermissions'), $status, array());
// Submit button
$form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation'), 'class="save"');
$form->addButtonUpdate(get_lang('ModifyInformation'));
// Set default values
$form->setDefaults($group_data);

@ -278,7 +278,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
$active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active'));
$active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive'));
$form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false);
$form->addElement('style_submit_button', 'submit', get_lang('SearchUsers'), 'class="search"');
$form->addButtonSearch(get_lang('SearchUsers'));
$defaults['keyword_active'] = 1;
$defaults['keyword_inactive'] = 1;
$form->setDefaults($defaults);
@ -355,8 +355,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
//$form->addElement('static','search_advanced_link',null,'<a href="user_list.php?search=advanced">'.get_lang('AdvancedSearch').'</a>');
$form->addButtonSearch(get_lang('Search'));
echo '<div class="actions" style="width:100%;">';
if (api_is_platform_admin()) {
echo '<span style="float:right;">'.

@ -55,7 +55,7 @@ $form->addElement('hidden', 'sec_token',$token);
$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"');
$form->addButtonCreate(get_lang('Save'));
// display default questions
if (isset ($question[$description_type])) {

@ -59,7 +59,7 @@ $form->addElement('hidden', 'sec_token',$token);
$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"');
$form->addButtonCreate(get_lang('Save'));
// Set some default values
if (!empty($description_title)) {

@ -19,8 +19,8 @@ $htmlHeadXtra[] = '
var hide_bar = function() {
$("#template_col").hide();
$("#doc_form").removeClass("span9");
$("#doc_form").addClass("span11");
$("#doc_form").removeClass("col-md-9");
$("#doc_form").addClass("col-md-11");
$("#hide_bar_template").css({"background-image" : \'url("../img/hide2.png")\'})
}
@ -34,8 +34,8 @@ $(document).ready(function() {
},
function() {
$("#template_col").show();
$("#doc_form").removeClass("span11");
$("#doc_form").addClass("span9");
$("#doc_form").removeClass("col-md-11");
$("#doc_form").addClass("col-md-9");
$(this).css("background-image", \'url("../img/hide0.png")\');
}
);
@ -44,15 +44,6 @@ $(document).ready(function() {
showTemplates();
});
});
function setFocus() {
$("#document_title").focus();
}
$(window).load(function () {
setFocus();
});
</script>';
//I'm in the certification module?
@ -279,9 +270,9 @@ function document_exists($filename) {
// Add group to the form
if ($is_certificate_mode) {
$form->addElement('text', 'title', get_lang('CertificateName'), 'class="span4" id="document_title"');
$form->addText('title', get_lang('CertificateName'), true, array('autofocus'));
} else {
$form->addElement('text', 'title', get_lang('Title'), 'class="span4" id="document_title"');
$form->addText('title', get_lang('Title'), true, array('autofocus'));
}
// Show read-only box only in groups
@ -395,10 +386,11 @@ if (!$is_certificate_mode && !DocumentManager::is_my_shared_folder($userId, $dir
}
}
if ($is_certificate_mode)
$form->addElement('style_submit_button', 'submit', get_lang('CreateCertificate'), 'class="save"');
else
$form->addElement('style_submit_button', 'submit', get_lang('CreateDoc'), 'class="save"');
if ($is_certificate_mode) {
$form->addButtonCreate(get_lang('CreateCertificate'));
} else {
$form->addButtonCreate(get_lang('CreateDoc'));
}
$form->setDefaults($defaults);
@ -588,11 +580,11 @@ if ($form->validate()) {
}
// HTML-editor
echo '<div class="row-fluid" style="overflow:hidden">
<div id="template_col" class="span3" style="width:200px">
<div id="template_col" class="col-md-3" style="width:200px">
<div id="frmModel" ></div>
</div>
<div id="hide_bar_template"></div>
<div id="doc_form" class="span9">
<div id="doc_form" class="col-md-9">
'.$form->return_form().'
</div>
</div>';

@ -487,9 +487,9 @@ if ($owner_id == api_get_user_id() ||
}
if ($is_certificate_mode) {
$form->addElement('style_submit_button', 'submit', get_lang('SaveCertificate'), 'class="save"');
$form->addButtonUpdate(get_lang('SaveCertificate'));
} else {
$form->addElement('style_submit_button','submit',get_lang('SaveDocument'), 'class="save"');
$form->addButtonUpdate(get_lang('SaveDocument'));
}
$defaults['filename'] = $filename;

@ -288,7 +288,7 @@ $form->addElement('radio', 'if_exists', '', get_lang('UplRenameLong'), 'rename')
$form->addElement('html', '</div>');
// Button upload document
$form->addElement('style_submit_button', 'submitDocument', get_lang('SendDocument'), 'class="upload"');
$form->addButtonSend(get_lang('SendDocument'), 'submitDocument');
$form->add_real_progress_bar('DocumentUpload', 'file');
$fileExistsOption = api_get_configuration_value('document_if_file_exists_option');

@ -221,7 +221,7 @@ function show_add_forumcategory_form($inputvalues = array(), $lp_id)
$form->addElement('html_editor', 'forum_category_comment', get_lang('Description'), null, array('ToolbarSet' => 'Forum', 'Width' => '98%', 'Height' => '200'));
//$form->applyFilter('forum_category_comment', 'html_filter');
$form->addElement('style_submit_button', 'SubmitForumCategory', get_lang('CreateCategory'), 'class="add"');
$form->addButtonCreate(get_lang('CreateCategory'), 'SubmitForumCategory');
// Setting the rules.
$form->addRule('forum_category_title', get_lang('ThisFieldIsRequired'), 'required');
@ -368,13 +368,11 @@ function show_add_forum_form($inputvalues = array(), $lp_id)
// The OK button
if (isset($_GET['id']) && $_GET['action'] == 'edit') {
$class = 'save';
$text = get_lang('ModifyForum');
$form->addButtonUpdate(get_lang('ModifyForum'), 'SubmitForum');
} else {
$class = 'add';
$text = get_lang('CreateForum');
$form->addButtonCreate(get_lang('CreateForum'), 'SubmitForum');
}
$form->addElement('style_submit_button', 'SubmitForum', $text, 'class="'.$class.'"');
// setting the rules
$form->addRule('forum_title', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('forum_category', get_lang('ThisFieldIsRequired'), 'required');
@ -2362,21 +2360,6 @@ function show_add_post_form($current_forum, $forum_setting, $action = '', $id =
$gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : null;
// Setting the class and text of the form title and submit button.
if ($action == 'quote') {
$class = 'save';
$text = get_lang('QuoteMessage');
} elseif ($action == 'replythread') {
$class = 'save';
$text = get_lang('ReplyToThread');
} elseif ($action == 'replymessage') {
$class = 'save';
$text = get_lang('ReplyToMessage');
} else {
$class = 'add';
$text = get_lang('CreateThread');
}
// Initialize the object.
$myThread = isset($_GET['thread']) ? $_GET['thread'] : '';
$my_forum = isset($_GET['forum']) ? $_GET['forum'] : '';
@ -2459,7 +2442,16 @@ function show_add_post_form($current_forum, $forum_setting, $action = '', $id =
$form->addElement('html', '</div>');
$form->addElement('style_submit_button', 'SubmitPost', $text, 'class="'.$class.'"');
// Setting the class and text of the form title and submit button.
if ($action == 'quote') {
$form->addButtonCreate(get_lang('QuoteMessage'), 'SubmitPost');
} elseif ($action == 'replythread') {
$form->addButtonCreate(get_lang('ReplyToThread'), 'SubmitPost');
} elseif ($action == 'replymessage') {
$form->addButtonCreate(get_lang('ReplyToMessage'), 'SubmitPost');
} else {
$form->addButtonCreate(get_lang('CreateThread'), 'SubmitPost');
}
if (!empty($form_values)) {
$defaults['post_title'] = prepare4display($form_values['post_title']);
@ -2895,7 +2887,7 @@ function show_edit_post_form($forum_setting, $current_post, $current_thread, $cu
}
$form->addElement('html', '</div>');
$form->addElement('style_submit_button', 'SubmitPost', get_lang('ModifyThread'), 'class="save"');
$form->addButtonUpdate(get_lang('ModifyThread'), 'SubmitPost');
// Setting the default values for the form elements.
$defaults['post_title'] = $current_post['post_title'];
@ -3783,7 +3775,7 @@ function forum_search()
$form->addElement('text', 'search_term', get_lang('SearchTerm'), 'class="input_titles" id="search_title"');
$form->applyFilter('search_term', 'html_filter');
$form->addElement('static', 'search_information', '', get_lang('ForumSearchInformation'));
$form->addElement('style_submit_button', null, get_lang('Search'), 'class="search"');
$form->addButtonSearch(get_lang('Search'));
// Setting the rules.
$form->addRule('search_term', get_lang('ThisFieldIsRequired'), 'required');

@ -1499,12 +1499,12 @@ EOF;
$form->freeze('field_options');
}
$defaults['field_options'] = $option->get_field_options_by_field_to_string($id);
$form->addElement('button', 'submit', get_lang('Modify'), 'class="save"');
$form->addButtonUpdate(get_lang('Modify'));
} else {
$defaults['field_visible'] = 0;
$defaults['field_changeable'] = 0;
$defaults['field_filter'] = 0;
$form->addElement('button', 'submit', get_lang('Add'), 'class="save"');
$form->addButtonCreate(get_lang('Add'));
}
/*if (!empty($defaults['created_at'])) {

@ -288,6 +288,24 @@ EOT;
return $this->addButton('submit', $label, 'arrow-right', 'primary');
}
/**
* Shortcut to import button
* @param string $label
*/
public function addButtonImport($label, $name = 'submit')
{
return $this->addButton($name, $label, 'check', 'primary');
}
/**
* Shortcut to import button
* @param string $label
*/
public function addButtonExport($label, $name = 'submit')
{
return $this->addButton($name, $label, 'check', 'primary');
}
/**
* @param string $name
* @param string $label

@ -235,11 +235,12 @@ $form->addElement('html', '</div><br />');
if (isset($_GET['survey_id']) && $_GET['action'] == 'edit') {
$class = 'save';
$text = get_lang('ModifySurvey');
$form->addButtonUpdate(get_lang('ModifySurvey'), 'submit_survey');
} else {
$class = 'add';
$text = get_lang('CreateSurvey');
$form->addButtonCreate(get_lang('CreateSurvey'), 'submit_survey');
}
$form->addElement('style_submit_button', 'submit_survey', $text, 'class="'.$class.'"');
// Setting the rules
if ($_GET['action'] == 'add') {

@ -268,7 +268,7 @@ $form_search->addElement('hidden', 'from', Security::remove_XSS($from));
$form_search->addElement('hidden', 'session_id', $sessionId);
$form_search->addElement('hidden', 'id_session', $sessionId);
$form_search->addElement('text', 'user_keyword');
$form_search->addElement('style_submit_button', 'submit', get_lang('SearchUsers'), 'class="search"');
$form_search->addButtonSearch(get_lang('SearchUsers'));
$form_search->display();
echo '</div>';

@ -426,18 +426,6 @@ if (api_is_allowed_to_edit(null, true)) {
}
}
/**
* Display search form
*/
function display_user_search_form()
{
echo '<form method="get" action="user.php">';
echo get_lang("SearchForUser") . "&nbsp;&nbsp;";
echo '<input type="text" name="keyword" value="'.Security::remove_XSS($_GET['keyword']).'"/>';
echo '<input type="submit" value="'.get_lang('SearchButton').'"/>';
echo '</form>';
}
if (!$is_allowed_in_course) {
api_not_allowed(true);
}
@ -512,7 +500,7 @@ if (api_is_allowed_to_edit(null, true)) {
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$form->addText('keyword', '', false);
$form->addElement('style_submit_button', 'submit', get_lang('SearchButton'), 'class="search"');
$form->addButtonSearch(get_lang('SearchButton'));
$form->addElement('static', 'additionalactions', null, $actions);
$form->display();
echo '</div>';

@ -185,7 +185,7 @@ switch ($action) {
$form->addElement('hidden', 'action', 'add');
$defaults = isset($_POST) ? $_POST : array();
$form = getFormWork($form, $defaults);
$form->addElement('style_submit_button', 'submit', get_lang('CreateDirectory'));
$form->addButtonCreate(get_lang('CreateDirectory'));
if ($form->validate()) {
$result = addDir(
@ -287,10 +287,10 @@ switch ($action) {
if (api_is_allowed_to_edit() || api_is_coach()) {
// Work list
$content .= '<div class="row">';
$content .= '<div class="span9">';
$content .= '<div class="col-md-9">';
$content .= showTeacherWorkGrid();
$content .= '</div>';
$content .= '<div class="span3">';
$content .= '<div class="col-md-3">';
$content .= showStudentList($work_id);
$content .= '</div>';
} else {

Loading…
Cancel
Save