Improving advanced_settings element in order to hide/show a desired div.

1.10.x
Julio Montoya 12 years ago
parent 59715dde9e
commit 7c196ad3ca
  1. 13
      main/admin/extra_fields.php
  2. 18
      main/admin/user_list.php
  3. 9
      main/attendance/attendance_add.php
  4. 19
      main/attendance/attendance_edit.php
  5. 10
      main/attendance/index.php
  6. 5
      main/create_course/add_course.php
  7. 13
      main/exercice/exercise.class.php
  8. 11
      main/exercice/exercise_admin.php
  9. 9
      main/exercice/hotpotatoes.php
  10. 2
      main/exercice/question.class.php
  11. 2
      main/exercice/upload_exercise.php
  12. 14
      main/forum/editpost.php
  13. 38
      main/forum/forumfunction.inc.php
  14. 13
      main/forum/index.php
  15. 14
      main/forum/newthread.php
  16. 16
      main/forum/reply.php
  17. 28
      main/forum/viewforumcategory.php
  18. 1
      main/inc/lib/course.lib.php
  19. 2
      main/inc/lib/grade_model.lib.php
  20. 38
      main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
  21. 1
      main/inc/lib/pear/HTML/QuickForm/element.php
  22. 4
      main/messages/new_message.php
  23. 3
      main/newscorm/lp_add.php
  24. 3
      main/session/session_add.php
  25. 34
      main/survey/create_new_survey.php
  26. 12
      main/template/default/layout/footer.tpl
  27. 2
      main/work/work.lib.php
  28. 5
      main/work/work.php

@ -97,19 +97,6 @@ $(function() {
break;
}
});
var value = 1;
$("#advanced_parameters").on("click", function() {
$("#options").toggle(function() {
if (value == 1) {
$("#advanced_parameters").addClass("btn-hide");
value = 0;
} else {
$("#advanced_parameters").removeClass("btn-hide");
value = 1;
}
});
});
});
</script>';

@ -94,16 +94,6 @@ function clear_session_list (div_session) {
$("div#"+div_session).hide("");
}
function display_advanced_search_form () {
if ($("#advanced_search_form").css("display") == "none") {
$("#advanced_search_form").css("display","block");
$("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
} else {
$("#advanced_search_form").css("display","none");
$("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
}
}
$(document).ready(function() {
var select_val = $("#input_select_extra_data").val();
if ( document.getElementById(\'extra_data_text\')) {
@ -631,12 +621,12 @@ $renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$form->addElement('text','keyword',get_lang('keyword'), 'size="25"');
$form->addElement('style_submit_button', 'submit',get_lang('Search'),'class="btn"');
$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;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>');
$form->addElement('advanced_settings', 'user_list_filter', get_lang('AdvancedSearch'));
$actions = '';
if (api_is_platform_admin()) {
$actions .= '<span style="float:right;">'.
'<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'.
'<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'.
'</span>';
}
$actions .= $form->return_form();
@ -669,7 +659,7 @@ while ($row_admin = Database::fetch_row($res_admin)) {
// display advanced search form
$form = new FormValidator('advanced_search','get');
$form->addElement('html','<div id="advanced_search_form" style="display:none;">');
$form->addElement('html','<div id="user_list_filter_options" style="display:none;">');
$form->addElement('header', get_lang('AdvancedSearch'));
$form->addElement('html', '<table>');

@ -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 = '<a href="javascript://" class = "advanced_parameters" ><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
if (Gradebook::is_active()) {
$form -> addElement('advanced_settings',$advanced);
$form->addElement('html','<div id="id_qualify" style="display:none">');
$form->addElement('html','<div id="id_qualify_options" style="display:none">');
// 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\';}"');

@ -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 = '<a href="javascript://" class="advanced_parameters"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
$form->addElement('advanced_settings',$advanced);
$form->addElement('html','<div id="id_qualify" style="display:block">');
$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','<div id="options_field" style="display:block">');
$form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
$form->addElement('html','<div id="id_qualify_options" style="display:block">');
$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','<div id="options_field" style="display:block">');
} else {
$advanced = '<a href="javascript://" class="advanced_parameters"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
$form->addElement('advanced_settings',$advanced);
$form->addElement('html','<div id="id_qualify" style="display:none">');
$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','<div id="options_field" style="display:none">');
$form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
$form->addElement('html','<div id="id_qualify_options" style="display:none">');
$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','<div id="options_field" style="display:none">');
}
load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));

@ -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(\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\');
} else {
$("#id_qualify").css("display","none");
$("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\');
}
});
});
</script>';

@ -69,11 +69,8 @@ $form->addElement(
);
$form->applyFilter('title', 'html_filter');
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('advanced_settings', '<a class="btn btn-show advanced_parameters" id="advanced_params" href="javascript://">'.get_lang('AdvancedParameters').'</a>');
$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="advanced_params_options">');
// Course category.
$categories_select = $form->addElement(
'select',

@ -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',
'<a href="javascript://" onclick=" return advanced_parameters()">
<span id="img_plus_and_minus">
<div style="vertical-align:top;" >
'.Display::return_icon('div_show.gif').' '.addslashes(get_lang('AdvancedParameters')).'</div>
</span>
</a>'
);
$form->addElement('html', '<div id="options" style="">');
$form->addElement('html', '<div id="options_options" style="display:none">');
// Model type
$radio = array(

@ -86,16 +86,6 @@ $htmlHeadXtra[] = '<script>
});
});
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.Display::return_icon('div_hide.gif').' '.addslashes(get_lang('AdvancedParameters')).'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\' '.Display::return_icon('div_show.gif').' '.addslashes(get_lang('AdvancedParameters')).'\';
}
}
function FCKeditor_OnComplete( editorInstance ) {
if (document.getElementById ( \'HiddenFCK\' + editorInstance.Name )) {
HideFCKEditorByInstanceName (editorInstance.Name);
@ -230,7 +220,6 @@ function setFocus(){
$(document).ready(function () {
setFocus();
});
window.onload = advanced_parameters;
</script>';
// INIT EXERCISE

@ -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').'<br />'.get_lang('Notice').' : '.get_lang(

@ -1494,7 +1494,7 @@ abstract class Question
if ($this->exercise->fastEdition == false) {
// Advanced parameters
$form->addElement('advanced_settings', '<a class="btn btn-show advanced_parameters" id="advanced_params" href="javascript://">'.get_lang('AdvancedParameters').'</a>');
$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="advanced_params_options" style="display:none;">');
}

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

@ -51,20 +51,6 @@ if (isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
}
// javascript
$htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'id_qualify\').style.display == \'none\') {
document.getElementById(\'id_qualify\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style' => 'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), array('style' => 'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
</script>';
/* MAIN DISPLAY SECTION */
/* Retrieving forum and forum categorie information */

@ -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'), '&nbsp;');
}
$form->addElement(
'advanced_settings',
'<a href="javascript://" onclick="advanced_parameters()" ><span id="plus_minus">&nbsp;'.Display::return_icon(
'div_show.gif',
get_lang('Show'),
array('style' => 'vertical-align:middle')
).'&nbsp;'.get_lang('AdvancedParameters').'</span></a>',
''
);
$form->addElement('html', '<div id="options" style="display:none">');
$form->addElement('advanced_settings', 'options', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="options_options" style="display:none">');
$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',
'<a href="javascript://" onclick="return advanced_parameters()">
<span id="img_plus_and_minus">&nbsp;'.Display::return_icon(
'div_show.gif',
get_lang('Show'),
array('style' => 'vertical-align:middle')
).' '.get_lang('AdvancedParameters').'</span></a>'
);
$form->addElement('html', '<div id="id_qualify" style="display:none">');
$form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="id_qualify_options" style="display:none">');
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',
'<a href="javascript://" onclick="return advanced_parameters()"><span id="img_plus_and_minus">'.Display::return_icon(
'div_show.gif',
get_lang('Show'),
array('style' => 'vertical-align:middle')
).''.get_lang('AdvancedParameters').'</span></a>'
);
$form->addElement('html', '<div id="id_qualify" style="display:none">');
$form->addElement('advanced_settings', 'id_qualify', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="id_qualify_options" style="display:none">');
if (!isset($_GET['edit'])) {
if (Gradebook::is_active()) {

@ -35,17 +35,6 @@ $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(\'.hide-me\').slideUp() });
function hidecontent(content){ $(content).slideToggle(\'normal\'); }
</script>';
$htmlHeadXtra[] = '<script type="text/javascript">
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
</script>';
// The section (tabs).
$this_section = SECTION_COURSES;
@ -407,4 +396,4 @@ if (is_array($forum_categories_list)) {
echo '</table>';
}
}
Display :: display_footer();
Display :: display_footer();

@ -51,21 +51,7 @@ if (isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
}
// javascript
$htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'id_qualify\').style.display == \'none\') {
document.getElementById(\'id_qualify\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
</script>';
/* 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.

@ -42,20 +42,6 @@ if (isset($_GET['origin'])) {
require_once 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
// javascript
$htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'id_qualify\').style.display == \'none\') {
document.getElementById(\'id_qualify\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
</script>';
/* 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();
}
}

@ -28,22 +28,14 @@ $language_file = 'forum';
// Including the global initialization file.
require_once '../inc/global.inc.php';
$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
$(document).ready(function(){ $(\'.hide-me\').slideUp() });
function hidecontent(content){ $(content).slideToggle(\'normal\'); }
</script>';
$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
</script>';
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
$(\'.hide-me\').slideUp()
});
function hidecontent(content){
$(content).slideToggle(\'normal\');
}
</script>';
// The section (tabs)
$this_section = SECTION_COURSES;
@ -80,7 +72,7 @@ $interbreadcrumb[] = array('url' => 'index.php?gradebook='.$gradebook.'&amp;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'].'&amp;origin='.$origin,'name' => $current_forum_category['cat_title']);
$interbreadcrumb[] = array('url' =>'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&amp;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 '<td>'.$my_number_threads.'</td>';
echo '<td>'.$my_number_posts.'</td>';

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

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

@ -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 '<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
'.HTML_QuickForm_static::toHtml().'
<a id="'.$name.'" class="btn btn-default advanced_options" href="#">
<i class="fa fa-bars"></i> '.$text.'
</a>
</div>
</div>';
}
}
}

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

@ -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').'<span id="filepaths">
$form->addElement('label', null, get_lang('FilesAttachment').'<span id="filepaths">
<div id="filepath_1">
<input type="file" name="attach_1"/><br />
'.get_lang('Description').'&nbsp;&nbsp;<input type="text" name="legend[]" /><br /><br />
</div>
</span>');
$form->addElement('advanced_settings','<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span>&nbsp;('.sprintf(get_lang('MaximunFileSizeX'),Text::format_file_size(api_get_setting('message_max_upload_filesize'))).')');
$form->addElement('label', null, '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span>&nbsp;('.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"');

@ -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','<div id="lp_options" style="display:none">');
$items = learnpath::get_category_from_course_into_select(api_get_course_int_id());

@ -198,9 +198,8 @@ if (api_is_platform_admin()) {
$form->addElement('hidden', 'id_coach', api_get_user_id());
}
$form->addElement('advanced_settings','<a class="btn btn-show advanced_parameters" id="advanced_params" href="javascript://">'.get_lang('AdvancedParameters').'</a>');
$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html','<div id="advanced_params_options" style="display:none">');
//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'));

@ -27,24 +27,6 @@ require_once 'survey.lib.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
$htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;'.Display::return_icon(
'div_hide.gif',
get_lang('Hide'),
array('style' => 'vertical-align:middle')
).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;'.Display::return_icon(
'div_show.gif',
get_lang('Show'),
array('style' => 'vertical-align:middle')
).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
function setFocus(){
$("#surveycode_title").focus();
}
@ -174,18 +156,8 @@ $form->addElement(
array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false)
);
// Aditional Parameters
$form->addElement(
'advanced_settings',
'<a href="javascript: void(0);" onclick="javascript: advanced_parameters();" >
<span id="plus_minus">&nbsp;'.Display::return_icon(
'div_show.gif',
null,
array('style' => 'vertical-align:middle')
).'&nbsp;'.get_lang('AdvancedParameters').'</span></a>'
);
$form->addElement('html', '<div id="options" style="display: none;">');
$form->addElement('advanced_settings', 'options', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="options_options" style="display: none;">');
if (Gradebook::is_active()) {
// An option: Qualify the fact that survey has been answered in the gradebook
@ -351,4 +323,4 @@ if ($form->validate()) {
$form->display();
}
// Footer
Display :: display_footer();
Display :: display_footer();

@ -142,15 +142,6 @@ $(document).bind("ajaxSend", function(){
$("#loading_block").hide();
});
$("form").on("click", ' .advanced_parameters', function() {
var id = $(this).attr('id') + '_options';
var button = $(this);
$("#"+id).toggle(function() {
button.toggleClass('active');
});
});
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
/*
@ -213,9 +204,6 @@ $(document).ready( function() {
/** Makes row highlighting possible */
$('.advanced_parameters').addClass('btn-default');
//$('.btn').addClass('btn-default');
// Chosen select.
$(".chzn-select").chosen({
disable_search_threshold: 10

@ -572,7 +572,7 @@ function display_student_publications_list($id, $my_folder_data, $work_parents,
$form_folder->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'work', 'Width' => '80%', 'Height' => '200'));
$there_is_a_end_date = false;
$form_folder->addElement('advanced_settings', Display::url(get_lang('AdvancedParameters'), '#', array('id' => 'work', 'class' => 'advanced_options')));
$form_folder->addElement('advanced_settings', 'work', get_lang('AdvancedParameters'));
$form_folder->addElement('html', '<div id="work_options" style="display: none;">');
if (empty($default)) {

@ -315,10 +315,11 @@ switch ($action) {
$form->addRule('new_dir', get_lang('ThisFieldIsRequired'), 'required');
$form->add_html_editor('description', get_lang('Description'), false, false, getWorkDescriptionToolbar());
$form->addElement('advanced_settings', Display::url(get_lang('AdvancedParameters'), '#', array('id' => 'add_work', 'class' => 'advanced_options')));
$form->addElement('advanced_settings', 'add_work', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="add_work_options" style="display: none;">');
//QualificationOfAssignment
// QualificationOfAssignment
$form->addElement('text', 'qualification_value', get_lang('QualificationNumeric'));
if (Gradebook::is_active()) {

Loading…
Cancel
Save