Minimize use of Chosen-Select. Conflicts with Bootstrap Select

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent ed32d4a747
commit cc4b8e9802
  1. 5
      app/Resources/public/css/base.css
  2. 2
      main/admin/career_dashboard.php
  3. 5
      main/admin/course_add.php
  4. 3
      main/admin/user_add.php
  5. 3
      main/admin/user_edit.php
  6. 10
      main/course_info/infocours.php
  7. 2
      main/document/upload.php
  8. 3
      main/dropbox/dropbox_functions.inc.php
  9. 4
      main/exercice/exercise.class.php
  10. 12
      main/exercice/question_pool.php
  11. 4
      main/inc/lib/api.lib.php
  12. 2
      main/inc/lib/extra_field.lib.php
  13. 3
      main/inc/lib/formvalidator/Element/SelectLanguage.php
  14. 4
      main/inc/lib/formvalidator/Element/SelectTheme.php
  15. 2
      main/inc/lib/gradebook.lib.php
  16. 5
      main/inc/lib/sessionmanager.lib.php
  17. 2
      main/inc/lib/usermanager.lib.php
  18. 2
      main/session/session_category_list.php

@ -2143,11 +2143,6 @@ div.admin_section h4 {
overflow:hidden; overflow:hidden;
} }
/* chosen javascript checkbox select width fix */
.chzn-select {
/*min-width: 173px; */
}
#lp_item_list { #lp_item_list {
margin:0; margin:0;
padding: 0; padding: 0;

@ -47,7 +47,7 @@ $form->addSelect(
'filter', 'filter',
get_lang('Career'), get_lang('Career'),
$career_select_list, $career_select_list,
array('id' => 'filter_1', 'class' => 'chzn-select') array('id' => 'filter_1')
); );
$form->addButtonSearch(get_lang('Filter')); $form->addButtonSearch(get_lang('Filter'));

@ -70,7 +70,10 @@ $form->addElement(
'course_teachers', 'course_teachers',
get_lang('CourseTeachers'), get_lang('CourseTeachers'),
$teachers, $teachers,
' id="course_teachers" class="chzn-select" style="width:350px" multiple="multiple" ' [
'id' => 'course_teachers',
'multiple' => 'multiple'
]
); );
$form->applyFilter('course_teachers', 'html_filter'); $form->applyFilter('course_teachers', 'html_filter');

@ -224,8 +224,7 @@ $form->addElement(
$status, $status,
array( array(
'id' => 'status_select', 'id' => 'status_select',
'class' => 'chzn-select', 'onchange' => 'javascript: display_drh_list();'
'onchange' => 'javascript: display_drh_list();',
) )
); );

@ -228,8 +228,7 @@ $form->addElement(
$status, $status,
array( array(
'id' => 'status_select', 'id' => 'status_select',
'onchange' => 'javascript: display_drh_list();', 'onchange' => 'javascript: display_drh_list();'
'class' => 'chzn-select'
) )
); );

@ -130,7 +130,13 @@ $form->addText('title', get_lang('Title'), true);
$form->applyFilter('title', 'html_filter'); $form->applyFilter('title', 'html_filter');
$form->applyFilter('title', 'trim'); $form->applyFilter('title', 'trim');
$form->addElement('select', 'category_code', get_lang('Fac'), $categories, array('style'=>'width:350px', 'class'=>'chzn-select', 'id'=>'category_code')); $form->addElement(
'select',
'category_code',
get_lang('Fac'),
$categories,
['style'=>'width:350px', 'id'=>'category_code']
);
$form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang'))); $form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang')));
$form->addText('department_name', get_lang('Department'), false); $form->addText('department_name', get_lang('Department'), false);
@ -164,7 +170,7 @@ if (api_get_setting('allow_course_theme') == 'true') {
'SelectTheme', 'SelectTheme',
'course_theme', 'course_theme',
null, null,
array('class' => ' ', 'id' => 'course_theme_id') array('id' => 'course_theme_id')
); );
$form->addGroup($group, '', array(get_lang("Stylesheets")), ''); $form->addGroup($group, '', array(get_lang("Stylesheets")), '');
} }

@ -282,7 +282,7 @@ if (api_get_setting('search_enabled') == 'true') {
$form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument').'<div style="font-size: 80%" >'.$supported_formats.'</div>'); $form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument').'<div style="font-size: 80%" >'.$supported_formats.'</div>');
$form->addElement('html', '<br /><div class="sub-form">'); $form->addElement('html', '<br /><div class="sub-form">');
$form->addElement('html', '<div class="label">'.get_lang('SearchFeatureDocumentLanguage').'</div>'); $form->addElement('html', '<div class="label">'.get_lang('SearchFeatureDocumentLanguage').'</div>');
$form->addElement('html', '<div>'.api_get_languages_combo(null,false).'</div>'); $form->addElement('html', '<div>' . api_get_languages_combo(null) . '</div>');
$form->addElement('html', '</div><div class="sub-form">'); $form->addElement('html', '</div><div class="sub-form">');
$specific_fields = get_specific_field_list(); $specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) { foreach ($specific_fields as $specific_field) {

@ -682,8 +682,7 @@ function display_add_form($dropbox_unid, $viewReceivedCategory, $viewSentCategor
$options, $options,
array( array(
'multiple' => 'multiple', 'multiple' => 'multiple',
'size' => '10', 'size' => '10'
'class' => 'chzn-select',
) )
); );
$form->addButtonUpload(get_lang('Upload'), 'submitWork'); $form->addButtonUpload(get_lang('Upload'), 'submitWork');

@ -1187,7 +1187,7 @@ class Exercise
$option = range(0,$max); $option = range(0,$max);
$option[0] = get_lang('No'); $option[0] = get_lang('No');
$option[-1] = get_lang('AllQuestionsShort'); $option[-1] = get_lang('AllQuestionsShort');
$form->addElement('select', 'randomQuestions',array(get_lang('RandomQuestions'), get_lang('RandomQuestionsHelp')), $option, array('id'=>'randomQuestions','class'=>'chzn-select')); $form->addElement('select', 'randomQuestions',array(get_lang('RandomQuestions'), get_lang('RandomQuestionsHelp')), $option, array('id'=>'randomQuestions'));
// Random answers // Random answers
$radios_random_answers = array(); $radios_random_answers = array();
@ -1219,7 +1219,7 @@ class Exercise
'exerciseAttempts', 'exerciseAttempts',
get_lang('ExerciseAttempts'), get_lang('ExerciseAttempts'),
$attempt_option, $attempt_option,
array('id' => 'exerciseAttempts', 'class' => 'chzn-select') ['id' => 'exerciseAttempts']
); );
// Exercise time limit // Exercise time limit

@ -243,7 +243,7 @@ echo '<input type="hidden" name="fromExercise" value="'.$fromExercise.'">';
// Session list, if sessions are used. // Session list, if sessions are used.
$sessionList = SessionManager::get_sessions_by_user(api_get_user_id(), api_is_platform_admin()); $sessionList = SessionManager::get_sessions_by_user(api_get_user_id(), api_is_platform_admin());
$tabAttrParam = array('class'=>'chzn-select', 'onchange'=>'submit_form(this)'); $tabAttrParam = array('onchange' => 'submit_form(this)');
$labelFormRow = get_lang('Session'); $labelFormRow = get_lang('Session');
$session_select_list = array(); $session_select_list = array();
foreach ($sessionList as $item) { foreach ($sessionList as $item) {
@ -294,7 +294,7 @@ $select_course_html = Display::select(
'selected_course', 'selected_course',
$course_select_list, $course_select_list,
$selected_course, $selected_course,
array('class'=>'chzn-select','onchange'=>'mark_course_id_changed(); submit_form(this);') array('onchange' => 'mark_course_id_changed(); submit_form(this);')
); );
echo Display::form_row(get_lang('Course'), $select_course_html); echo Display::form_row(get_lang('Course'), $select_course_html);
@ -328,7 +328,7 @@ $selectCourseCategory = Display::select(
'courseCategoryId', 'courseCategoryId',
$categoryList, $categoryList,
$courseCategoryId, $courseCategoryId,
array('class'=>'chzn-select','onchange'=>'submit_form(this);'), array('onchange' => 'submit_form(this);'),
false false
); );
echo Display::form_row(get_lang("QuestionCategory"), $selectCourseCategory); echo Display::form_row(get_lang("QuestionCategory"), $selectCourseCategory);
@ -362,7 +362,7 @@ $select_exercise_html = Display::select(
'exerciseId', 'exerciseId',
$my_exercise_list, $my_exercise_list,
$exerciseId, $exerciseId,
array('class'=>'chzn-select','onchange'=>'mark_exercise_id_changed(); submit_form(this);'), array('onchange' => 'mark_exercise_id_changed(); submit_form(this);'),
false false
); );
@ -382,7 +382,7 @@ $select_difficulty_html = Display::select(
'exerciseLevel', 'exerciseLevel',
$levels, $levels,
$exerciseLevel, $exerciseLevel,
array('class'=>'chzn-select', 'onchange'=>'submit_form(this);'), array('onchange' => 'submit_form(this);'),
false false
); );
echo Display::form_row(get_lang('Difficulty'), $select_difficulty_html); echo Display::form_row(get_lang('Difficulty'), $select_difficulty_html);
@ -414,7 +414,7 @@ $select_answer_html = Display::select(
'answerType', 'answerType',
$new_question_list, $new_question_list,
$answerType, $answerType,
array('class'=>'chzn-select','onchange'=>'submit_form(this);'), array('onchange' => 'submit_form(this);'),
false false
); );

@ -4147,7 +4147,7 @@ function api_get_item_property_info($course_id, $tool, $ref, $session_id = 0)
* @return string * @return string
*/ */
function api_get_languages_combo($name = 'language', $chozen=true) { function api_get_languages_combo($name = 'language') {
$ret = ''; $ret = '';
$platformLanguage = api_get_setting('platformLanguage'); $platformLanguage = api_get_setting('platformLanguage');
@ -4168,7 +4168,7 @@ function api_get_languages_combo($name = 'language', $chozen=true) {
$languages = $language_list['name']; $languages = $language_list['name'];
$folder = $language_list['folder']; $folder = $language_list['folder'];
$ret .= '<select name="'.$name.'" id="language_chosen" '.($chozen?'class="chzn-select"':'').' >'; $ret .= '<select name="' . $name . '" id="language_chosen">';
foreach ($languages as $key => $value) { foreach ($languages as $key => $value) {
if ($folder[$key] == $default) { if ($folder[$key] == $default) {
$selected = ' selected="selected"'; $selected = ' selected="selected"';

@ -1700,7 +1700,7 @@ EOF;
'field_type', 'field_type',
get_lang('FieldType'), get_lang('FieldType'),
$types, $types,
array('id' => 'field_type', 'class' => 'chzn-select', 'data-placeholder' => get_lang('Select')) array('id' => 'field_type')
); );
$form->addElement('label', get_lang('Example'), '<div id="example">-</div>'); $form->addElement('label', get_lang('Example'), '<div id="example">-</div>');
$form->addElement('text', 'variable', get_lang('FieldLabel'), array('class' => 'span5')); $form->addElement('text', 'variable', get_lang('FieldLabel'), array('class' => 'span5'));

@ -11,9 +11,6 @@ class SelectLanguage extends HTML_QuickForm_select
*/ */
function SelectLanguage($elementName=null, $elementLabel=null, $options=null, $attributes=null) function SelectLanguage($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{ {
if (!isset($attributes['class'])) {
$attributes['class'] = 'chzn-select';
}
parent::__construct($elementName, $elementLabel, $options, $attributes); parent::__construct($elementName, $elementLabel, $options, $attributes);
// Get all languages // Get all languages
$languages = api_get_languages(); $languages = api_get_languages();

@ -10,10 +10,6 @@ class SelectTheme extends HTML_QuickForm_select
* Class constructor * Class constructor
*/ */
function SelectTheme($elementName=null, $elementLabel=null, $options=null, $attributes=null) { function SelectTheme($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
if (!isset($attributes['class'])) {
//todo this was comment due a bug in infocours.php with jquery-ui
//$attributes['class'] = 'chzn-select';
}
parent::__construct($elementName, $elementLabel, $options, $attributes); parent::__construct($elementName, $elementLabel, $options, $attributes);
// Get all languages // Get all languages
$themes = api_get_themes(); $themes = api_get_themes();

@ -184,8 +184,6 @@ class Gradebook extends Model
get_lang('Skills'), get_lang('Skills'),
$clean_skill_list, $clean_skill_list,
array( array(
'width' => '450px',
'class' => 'chzn-select',
'multiple' => 'multiple' 'multiple' => 'multiple'
) )
); );

@ -6483,7 +6483,6 @@ class SessionManager
[api_get_user_id() => $userInfo['complete_name']], [api_get_user_id() => $userInfo['complete_name']],
array( array(
'id' => 'coach_username', 'id' => 'coach_username',
'class' => 'chzn-select',
'style' => 'width:370px;', 'style' => 'width:370px;',
) )
); );
@ -6556,9 +6555,7 @@ class SessionManager
$form->addElement('html','<div id="advanced_params_options" style="display:none">'); $form->addElement('html','<div id="advanced_params_options" style="display:none">');
$form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array( $form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
'id' => 'session_category', 'id' => 'session_category'
'class' => 'chzn-select',
'style' => 'width:370px;',
)); ));
$form->addHtmlEditor( $form->addHtmlEditor(

@ -4526,7 +4526,7 @@ class UserManager
'extra_'.$field_details[1], 'extra_'.$field_details[1],
$field_details[3], $field_details[3],
$options, $options,
array('class' => 'chzn-select', 'id' => 'extra_'.$field_details[1]) array('id' => 'extra_' . $field_details[1])
); );
if (!$admin_permissions) { if (!$admin_permissions) {

@ -234,7 +234,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
<a class="btn btn-default" href="#" onclick="selectAll('idChecked',<?php echo $x; ?>,'false');return false;"><?php echo get_lang('UnSelectAll') ?></a> <a class="btn btn-default" href="#" onclick="selectAll('idChecked',<?php echo $x; ?>,'false');return false;"><?php echo get_lang('UnSelectAll') ?></a>
</div> </div>
<div class="list-category"> <div class="list-category">
<select class="chzn-select" name="action"> <select class="selectpicker show-tick form-control" name="action">
<option value="delete_off_session" selected="selected"><?php echo get_lang('DeleteSelectedSessionCategory'); ?></option> <option value="delete_off_session" selected="selected"><?php echo get_lang('DeleteSelectedSessionCategory'); ?></option>
<option value="delete_on_session"><?php echo get_lang('DeleteSelectedFullSessionCategory'); ?></option> <option value="delete_on_session"><?php echo get_lang('DeleteSelectedFullSessionCategory'); ?></option>
</select> </select>

Loading…
Cancel
Save