');
$form->addElement('header', get_lang('AdvancedSearch'));
$form->addElement('html', '
');
diff --git a/main/attendance/attendance_add.php b/main/attendance/attendance_add.php
index 9ef0e5a4aa..42333d73f3 100644
--- a/main/attendance/attendance_add.php
+++ b/main/attendance/attendance_add.php
@@ -9,6 +9,7 @@
// protect a course script
api_protect_course_script(true);
+$error = isset($error) ? $error : null;
// error messages
if ($error) {
@@ -33,12 +34,10 @@ $form->applyFilter('title','html_filter');
$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150'));
// Adavanced Parameters
+if (Gradebook::is_active()) {
+ $form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
-$advanced = ' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'';
-if (Gradebook::is_active()) {
- $form -> addElement('advanced_settings',$advanced);
-
- $form->addElement('html','');
+ $form->addElement('html','
');
// Qualify Attendance for gradebook option
$form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
diff --git a/main/attendance/attendance_edit.php b/main/attendance/attendance_edit.php
index 89ba73821a..7f50d019ef 100644
--- a/main/attendance/attendance_edit.php
+++ b/main/attendance/attendance_edit.php
@@ -40,18 +40,15 @@ $form->add_html_editor('description', get_lang('Description'), false, false, arr
if (Gradebook::is_active()) {
if (!empty($attendance_qualify_title) || !empty($attendance_weight)) {
- $advanced = '
'.Display::return_icon('div_hide.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'';
- $form->addElement('advanced_settings',$advanced);
-
- $form->addElement('html','
');
- $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}'));
- $form->addElement('html','
');
+ $form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
+ $form->addElement('html','
');
+ $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}'));
+ $form->addElement('html','
');
} else {
- $advanced = '
'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'';
- $form->addElement('advanced_settings',$advanced);
- $form->addElement('html','
');
- $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
- $form->addElement('html','
');
+ $form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
+ $form->addElement('html','
');
+ $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
+ $form->addElement('html','
');
}
load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
diff --git a/main/attendance/index.php b/main/attendance/index.php
index b5cf16bc99..438780051e 100644
--- a/main/attendance/index.php
+++ b/main/attendance/index.php
@@ -166,16 +166,6 @@ $(function() {
$(".row_odd").css({"background-color":"#F9F9F9"});
$(".row_even").css({"background-color":"#FFF"});
});
-
- $(".advanced_parameters").click(function() {
- if ($("#id_qualify").css("display") == "none") {
- $("#id_qualify").css("display","block");
- $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'\');
- } else {
- $("#id_qualify").css("display","none");
- $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'\');
- }
- });
});
';
diff --git a/main/create_course/add_course.php b/main/create_course/add_course.php
index 9ce5f99691..83adfce4d9 100644
--- a/main/create_course/add_course.php
+++ b/main/create_course/add_course.php
@@ -69,11 +69,8 @@ $form->addElement(
);
$form->applyFilter('title', 'html_filter');
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
-
-$form->addElement('advanced_settings', '
'.get_lang('AdvancedParameters').'');
-
+$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html', '
');
-
// Course category.
$categories_select = $form->addElement(
'select',
diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php
index 24ed303efd..b5dd03ded8 100644
--- a/main/exercice/exercise.class.php
+++ b/main/exercice/exercise.class.php
@@ -1730,18 +1730,9 @@ class Exercise
}
$form->add_html_editor('exerciseDescription', get_lang('ExerciseDescription'), false, false, $editor_config);
+ $form->addElement('advanced_settings', 'options', get_lang('AdvancedParameters'));
- $form->addElement(
- 'advanced_settings',
- '
-
-
- '.Display::return_icon('div_show.gif').' '.addslashes(get_lang('AdvancedParameters')).'
-
- '
- );
-
- $form->addElement('html', '
');
+ $form->addElement('html', '
');
// Model type
$radio = array(
diff --git a/main/exercice/exercise_admin.php b/main/exercice/exercise_admin.php
index 972622fe9c..2b4136c94c 100644
--- a/main/exercice/exercise_admin.php
+++ b/main/exercice/exercise_admin.php
@@ -86,16 +86,6 @@ $htmlHeadXtra[] = '';
// INIT EXERCISE
diff --git a/main/exercice/hotpotatoes.php b/main/exercice/hotpotatoes.php
index ed8fa11130..e5ef743361 100644
--- a/main/exercice/hotpotatoes.php
+++ b/main/exercice/hotpotatoes.php
@@ -73,11 +73,7 @@ $form->addElement('hidden', 'uploadPath');
$form->addElement('hidden', 'fld', $fld);
$form->addElement('hidden', 'imgcount', $imgcount);
$form->addElement('hidden', 'finish', $finish);
-
$form->addElement('html', GenerateHiddenList($imgparams));
-
-$form->addElement('advanced_settings', Display::return_icon('hotpotatoes.jpg', get_lang('HotPotatoes')));
-
$label = get_lang('DownloadImg').' : ';
if ($finish == 0) {
$label = get_lang('DownloadFile').' : ';
@@ -86,19 +82,14 @@ if ($finish == 0) {
$form->addElement('file', 'userFile', $label);
$form->addElement('button', 'submit', get_lang('SendFile'));
-
// If finish is set; it's because the user came from this script in the first place (displaying hidden "finish" field).
if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2))) {
-
-
// Moved this down here as the upload handling functions give output.
if ($form->validate()) {
-
//initialise $finish
if (!isset($finish)) {
$finish = 0;
}
-
//if the size is not defined, it's probably because there has been an error or no file was submitted
if (!$_FILES['userFile']['size']) {
$dialogBox .= get_lang('SendFileError').'
'.get_lang('Notice').' : '.get_lang(
diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php
index c778ad5800..104a93401c 100644
--- a/main/exercice/question.class.php
+++ b/main/exercice/question.class.php
@@ -1494,7 +1494,7 @@ abstract class Question
if ($this->exercise->fastEdition == false) {
// Advanced parameters
- $form->addElement('advanced_settings', '
'.get_lang('AdvancedParameters').'');
+ $form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html', '
');
}
diff --git a/main/exercice/upload_exercise.php b/main/exercice/upload_exercise.php
index 11aa038ec9..25b81127ea 100644
--- a/main/exercice/upload_exercise.php
+++ b/main/exercice/upload_exercise.php
@@ -91,7 +91,7 @@ function lp_upload_quiz_main() {
16
).get_lang('DownloadExcelTemplate');
- $form->addElement('advanced_settings', $link);
+ $form->addElement('label', null, $link);
//button send document
$form->addElement('style_submit_button', 'submit_upload_quiz', get_lang('Send'), 'class="upload"');
diff --git a/main/forum/editpost.php b/main/forum/editpost.php
index e73bcf382c..efc4223ca4 100644
--- a/main/forum/editpost.php
+++ b/main/forum/editpost.php
@@ -51,20 +51,6 @@ if (isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
}
-// javascript
-$htmlHeadXtra[] = '';
-
/* MAIN DISPLAY SECTION */
/* Retrieving forum and forum categorie information */
diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php
index b81fdadf9f..f938813129 100644
--- a/main/forum/forumfunction.inc.php
+++ b/main/forum/forumfunction.inc.php
@@ -248,17 +248,8 @@ function show_add_forum_form($inputvalues = array(), $lp_id)
$group[] = $form->createElement('radio', 'allow_anonymous', null, get_lang('No'), 0);
$form->addGroup($group, 'allow_anonymous_group', get_lang('AllowAnonymousPosts'), ' ');
}
-
- $form->addElement(
- 'advanced_settings',
- '
'.Display::return_icon(
- 'div_show.gif',
- get_lang('Show'),
- array('style' => 'vertical-align:middle')
- ).' '.get_lang('AdvancedParameters').'',
- ''
- );
- $form->addElement('html', '
');
+ $form->addElement('advanced_settings', 'options', get_lang('AdvancedParameters'));
+ $form->addElement('html', '
');
$group = array();
$group[] = $form->createElement('radio', 'students_can_edit', null, get_lang('Yes'), 1);
@@ -2344,17 +2335,8 @@ function show_add_post_form($action = '', $id = '', $form_values = '')
);
$form->addRule('post_text', get_lang('ThisFieldIsRequired'), 'required');
- $form->addElement(
- 'advanced_settings',
- '
- '.Display::return_icon(
- 'div_show.gif',
- get_lang('Show'),
- array('style' => 'vertical-align:middle')
- ).' '.get_lang('AdvancedParameters').''
- );
-
- $form->addElement('html', '
');
+ $form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
+ $form->addElement('html', '
');
if ((api_is_course_admin() || api_is_course_coach() || api_is_course_tutor()) && !($my_thread)) {
@@ -2874,16 +2856,8 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
: array('ToolbarSet' => 'ForumStudent', 'Width' => '100%', 'Height' => '400', 'UserStatus' => 'student')
);
$form->addRule('post_text', get_lang('ThisFieldIsRequired'), 'required');
- $form->addElement(
- 'advanced_settings',
- '
'.Display::return_icon(
- 'div_show.gif',
- get_lang('Show'),
- array('style' => 'vertical-align:middle')
- ).''.get_lang('AdvancedParameters').''
- );
-
- $form->addElement('html', '
');
+ $form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
+ $form->addElement('html', '
');
if (!isset($_GET['edit'])) {
if (Gradebook::is_active()) {
diff --git a/main/forum/index.php b/main/forum/index.php
index e4474c0d8f..7015116892 100644
--- a/main/forum/index.php
+++ b/main/forum/index.php
@@ -35,17 +35,6 @@ $htmlHeadXtra[] = '';
-$htmlHeadXtra[] = '';
// The section (tabs).
$this_section = SECTION_COURSES;
@@ -407,4 +396,4 @@ if (is_array($forum_categories_list)) {
echo '
';
}
}
-Display :: display_footer();
\ No newline at end of file
+Display :: display_footer();
diff --git a/main/forum/newthread.php b/main/forum/newthread.php
index ec8f9c24ec..87c12e869b 100644
--- a/main/forum/newthread.php
+++ b/main/forum/newthread.php
@@ -51,21 +51,7 @@ if (isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
}
-// javascript
-$htmlHeadXtra[] = '';
-
/* MAIN DISPLAY SECTION */
-
/* Retrieving forum and forum category information */
$current_forum = get_forum_information($_GET['forum']); // Note: This has to be validated that it is an existing forum.
diff --git a/main/forum/reply.php b/main/forum/reply.php
index aeab659753..51bb2d9268 100644
--- a/main/forum/reply.php
+++ b/main/forum/reply.php
@@ -42,20 +42,6 @@ if (isset($_GET['origin'])) {
require_once 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
-// javascript
-$htmlHeadXtra[] = '';
-
/* MAIN DISPLAY SECTION */
/* Retrieving forum and forum categorie information */
@@ -171,4 +157,4 @@ if (!empty($values) AND isset($_POST['SubmitPost'])) {
if ($origin != 'learnpath') {
Display :: display_footer();
-}
\ No newline at end of file
+}
diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php
index f9e7a17737..58e0c0371a 100644
--- a/main/forum/viewforumcategory.php
+++ b/main/forum/viewforumcategory.php
@@ -28,22 +28,14 @@ $language_file = 'forum';
// Including the global initialization file.
require_once '../inc/global.inc.php';
-$htmlHeadXtra[] = '';
-$htmlHeadXtra[] = '';
+$htmlHeadXtra[] = '';
// The section (tabs)
$this_section = SECTION_COURSES;
@@ -80,7 +72,7 @@ $interbreadcrumb[] = array('url' => 'index.php?gradebook='.$gradebook.'&sear
if (!empty($_GET['action']) && !empty($_GET['content'])) {
if ($_GET['action']=='add' && $_GET['content']=='forum' ) {
- $interbreadcrumb[] = array('url' =>'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&origin='.$origin,'name' => $current_forum_category['cat_title']);
+ $interbreadcrumb[] = array('url' =>'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&origin='.$origin,'name' => $current_forum_category['cat_title']);
$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('AddForum'));
}
} else {
@@ -300,7 +292,7 @@ if ($action_forums != 'add') {
//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
// the number of topics and posts
$my_number_threads = isset($forum['number_of_threads']) ? $forum['number_of_threads'] : '';
-
+
$my_number_posts = isset($forum['number_of_posts']) ? $forum['number_of_posts'] : '';
echo '
'.$my_number_threads.' | ';
echo '
'.$my_number_posts.' | ';
diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php
index 9a9bb671d1..56bddd35a2 100644
--- a/main/inc/lib/course.lib.php
+++ b/main/inc/lib/course.lib.php
@@ -2683,7 +2683,6 @@ class CourseManager
}
$params['icon'] = Display::return_icon('blackboard.png', $course_info['title'], array(), ICON_SIZE_LARGE);
-
$params['right_actions'] = '';
if (api_is_platform_admin()) {
diff --git a/main/inc/lib/grade_model.lib.php b/main/inc/lib/grade_model.lib.php
index 40e630f7b3..2171b94f5e 100644
--- a/main/inc/lib/grade_model.lib.php
+++ b/main/inc/lib/grade_model.lib.php
@@ -191,7 +191,7 @@ class GradeModel extends Model
//New rule added in the formvalidator compare_fields that filters a group of fields in order to compare with the wanted value
$form->addRule($component_array, get_lang('AllMustWeight100'), 'compare_fields', '==@100');
- $form->addElement('advanced_settings', get_lang('AllMustWeight100'));
+ $form->addElement('label', null, get_lang('AllMustWeight100'));
if ($action == 'edit') {
$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
diff --git a/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php b/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
index 31bc383b4c..0b499604fc 100644
--- a/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
+++ b/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
@@ -18,43 +18,51 @@ require_once 'HTML/QuickForm/static.php';
* @since 3.0
* @deprecated Please use the templates rather than add raw HTML via this element
*/
-class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
+class HTML_QuickForm_advanced_settings extends HTML_QuickForm_element
{
- // {{{ constructor
-
/**
- * Class constructor
- *
- * @param string $text raw HTML to add
- * @access public
- * @return void
+ * @param string $name
+ * @param string $label
+ * @param array $attributes
*/
- function HTML_QuickForm_advanced_settings($text = null)
+ function HTML_QuickForm_advanced_settings($name = null, $label = null)
{
- $this->HTML_QuickForm_static(null, null, $text);
+ if (empty($label)) {
+ $label = get_lang('AdvancedParameters');
+ }
+ $this->updateAttributes(
+ array(
+ 'label' => $label,
+ 'name' => $name
+ )
+ );
$this->_type = 'html';
}
/**
* Accepts a renderer
*
- * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
+ * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
* @access public
* @return void
*/
function accept(&$renderer, $required = false, $error = null)
{
$renderer->renderHtml($this);
- } // end func accept
-
+ }
function toHtml()
{
+ $name = $this->getAttribute('name');
+ $text = $this->getAttribute('label');
+
return '
';
}
-}
\ No newline at end of file
+}
diff --git a/main/inc/lib/pear/HTML/QuickForm/element.php b/main/inc/lib/pear/HTML/QuickForm/element.php
index 3b8b3b6bf8..def79338c5 100644
--- a/main/inc/lib/pear/HTML/QuickForm/element.php
+++ b/main/inc/lib/pear/HTML/QuickForm/element.php
@@ -96,6 +96,7 @@ class HTML_QuickForm_element extends HTML_Common
//'checkbox',
'group'
);
+
if (in_array($this->getType(), $array)) {
if (empty($attributes)) {
$attributes = array('class' => 'form-control ');
diff --git a/main/messages/new_message.php b/main/messages/new_message.php
index cc517421b4..eba63d6a97 100644
--- a/main/messages/new_message.php
+++ b/main/messages/new_message.php
@@ -204,13 +204,13 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null) {
}
if (empty($group_id)) {
- $form->addElement('advanced_settings', get_lang('FilesAttachment').'
+ $form->addElement('label', null, get_lang('FilesAttachment').'
'.get_lang('Description').'
');
- $form->addElement('advanced_settings',''.get_lang('AddOneMoreFile').' ('.sprintf(get_lang('MaximunFileSizeX'),Text::format_file_size(api_get_setting('message_max_upload_filesize'))).')');
+ $form->addElement('label', null, ''.get_lang('AddOneMoreFile').' ('.sprintf(get_lang('MaximunFileSizeX'),Text::format_file_size(api_get_setting('message_max_upload_filesize'))).')');
}
$form->addElement('style_submit_button','compose',api_xml_http_response_encode(get_lang('SendMessage')),'class="save"');
diff --git a/main/newscorm/lp_add.php b/main/newscorm/lp_add.php
index a2a6a1cf38..7677f9d43a 100644
--- a/main/newscorm/lp_add.php
+++ b/main/newscorm/lp_add.php
@@ -119,8 +119,7 @@ $form->applyFilter('lp_name', 'html_filter');
$form->addRule('lp_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('hidden', 'post_time', time());
$form->addElement('hidden', 'action', 'add_lp');
-
-$form->addElement('advanced_settings', Display::url(get_lang('AdvancedParameters'), '#', array('id'=> 'lp', 'class' => 'advanced_options')));
+$form->addElement('advanced_settings', 'lp', get_lang('AdvancedParameters'));
$form->addElement('html','');
$items = learnpath::get_category_from_course_into_select(api_get_course_int_id());
diff --git a/main/session/session_add.php b/main/session/session_add.php
index be6844a813..0ca271608c 100644
--- a/main/session/session_add.php
+++ b/main/session/session_add.php
@@ -198,9 +198,8 @@ if (api_is_platform_admin()) {
$form->addElement('hidden', 'id_coach', api_get_user_id());
}
-$form->addElement('advanced_settings','
'.get_lang('AdvancedParameters').'');
+$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html','
');
-
//Dates
$form->addElement('text', 'display_start_date', array(get_lang('SessionDisplayStartDate'), get_lang('SessionDisplayStartDateComment')), array('id' => 'display_start_date'));
$form->addElement('text', 'display_end_date', array(get_lang('SessionDisplayEndDate'), get_lang('SessionDisplayEndDateComment')), array('id' => 'display_end_date'));
diff --git a/main/survey/create_new_survey.php b/main/survey/create_new_survey.php
index 1916786f65..059006fc23 100644
--- a/main/survey/create_new_survey.php
+++ b/main/survey/create_new_survey.php
@@ -27,24 +27,6 @@ require_once 'survey.lib.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
$htmlHeadXtra[] = '