Skip to content

Commit

Permalink
Minimize use of Chosen-Select. Conflicts with Bootstrap Select
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Sep 24, 2015
1 parent ed32d4a commit cc4b8e9
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 42 deletions.
5 changes: 0 additions & 5 deletions app/Resources/public/css/base.css
Expand Up @@ -2143,11 +2143,6 @@ div.admin_section h4 {
overflow:hidden;
}

/* chosen javascript checkbox select width fix */
.chzn-select {
/*min-width: 173px; */
}

#lp_item_list {
margin:0;
padding: 0;
Expand Down
2 changes: 1 addition & 1 deletion main/admin/career_dashboard.php
Expand Up @@ -47,7 +47,7 @@
'filter',
get_lang('Career'),
$career_select_list,
array('id' => 'filter_1', 'class' => 'chzn-select')
array('id' => 'filter_1')
);
$form->addButtonSearch(get_lang('Filter'));

Expand Down
5 changes: 4 additions & 1 deletion main/admin/course_add.php
Expand Up @@ -70,7 +70,10 @@
'course_teachers',
get_lang('CourseTeachers'),
$teachers,
' id="course_teachers" class="chzn-select" style="width:350px" multiple="multiple" '
[
'id' => 'course_teachers',
'multiple' => 'multiple'
]
);
$form->applyFilter('course_teachers', 'html_filter');

Expand Down
3 changes: 1 addition & 2 deletions main/admin/user_add.php
Expand Up @@ -224,8 +224,7 @@ function display_drh_list(){
$status,
array(
'id' => 'status_select',
'class' => 'chzn-select',
'onchange' => 'javascript: display_drh_list();',
'onchange' => 'javascript: display_drh_list();'
)
);

Expand Down
3 changes: 1 addition & 2 deletions main/admin/user_edit.php
Expand Up @@ -228,8 +228,7 @@ function confirmation(name) {
$status,
array(
'id' => 'status_select',
'onchange' => 'javascript: display_drh_list();',
'class' => 'chzn-select'
'onchange' => 'javascript: display_drh_list();'
)
);

Expand Down
10 changes: 8 additions & 2 deletions main/course_info/infocours.php
Expand Up @@ -130,7 +130,13 @@ function is_settings_editable()
$form->applyFilter('title', 'html_filter');
$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->addText('department_name', get_lang('Department'), false);
Expand Down Expand Up @@ -164,7 +170,7 @@ function is_settings_editable()
'SelectTheme',
'course_theme',
null,
array('class' => ' ', 'id' => 'course_theme_id')
array('id' => 'course_theme_id')
);
$form->addGroup($group, '', array(get_lang("Stylesheets")), '');
}
Expand Down
2 changes: 1 addition & 1 deletion main/document/upload.php
Expand Up @@ -282,7 +282,7 @@ function setFocus(){
$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', '<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">');
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {
Expand Down
3 changes: 1 addition & 2 deletions main/dropbox/dropbox_functions.inc.php
Expand Up @@ -682,8 +682,7 @@ function display_add_form($dropbox_unid, $viewReceivedCategory, $viewSentCategor
$options,
array(
'multiple' => 'multiple',
'size' => '10',
'class' => 'chzn-select',
'size' => '10'
)
);
$form->addButtonUpload(get_lang('Upload'), 'submitWork');
Expand Down
4 changes: 2 additions & 2 deletions main/exercice/exercise.class.php
Expand Up @@ -1187,7 +1187,7 @@ public function createForm($form, $type='full')
$option = range(0,$max);
$option[0] = get_lang('No');
$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
$radios_random_answers = array();
Expand Down Expand Up @@ -1219,7 +1219,7 @@ public function createForm($form, $type='full')
'exerciseAttempts',
get_lang('ExerciseAttempts'),
$attempt_option,
array('id' => 'exerciseAttempts', 'class' => 'chzn-select')
['id' => 'exerciseAttempts']
);

// Exercise time limit
Expand Down
12 changes: 6 additions & 6 deletions main/exercice/question_pool.php
Expand Up @@ -243,7 +243,7 @@ function confirm_your_choice() {
// Session list, if sessions are used.
$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');
$session_select_list = array();
foreach ($sessionList as $item) {
Expand Down Expand Up @@ -294,7 +294,7 @@ function confirm_your_choice() {
'selected_course',
$course_select_list,
$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);
Expand Down Expand Up @@ -328,7 +328,7 @@ function confirm_your_choice() {
'courseCategoryId',
$categoryList,
$courseCategoryId,
array('class'=>'chzn-select','onchange'=>'submit_form(this);'),
array('onchange' => 'submit_form(this);'),
false
);
echo Display::form_row(get_lang("QuestionCategory"), $selectCourseCategory);
Expand Down Expand Up @@ -362,7 +362,7 @@ function confirm_your_choice() {
'exerciseId',
$my_exercise_list,
$exerciseId,
array('class'=>'chzn-select','onchange'=>'mark_exercise_id_changed(); submit_form(this);'),
array('onchange' => 'mark_exercise_id_changed(); submit_form(this);'),
false
);

Expand All @@ -382,7 +382,7 @@ function confirm_your_choice() {
'exerciseLevel',
$levels,
$exerciseLevel,
array('class'=>'chzn-select', 'onchange'=>'submit_form(this);'),
array('onchange' => 'submit_form(this);'),
false
);
echo Display::form_row(get_lang('Difficulty'), $select_difficulty_html);
Expand Down Expand Up @@ -414,7 +414,7 @@ function confirm_your_choice() {
'answerType',
$new_question_list,
$answerType,
array('class'=>'chzn-select','onchange'=>'submit_form(this);'),
array('onchange' => 'submit_form(this);'),
false
);

Expand Down
4 changes: 2 additions & 2 deletions main/inc/lib/api.lib.php
Expand Up @@ -4147,7 +4147,7 @@ function api_get_item_property_info($course_id, $tool, $ref, $session_id = 0)
* @return string
*/

function api_get_languages_combo($name = 'language', $chozen=true) {
function api_get_languages_combo($name = 'language') {
$ret = '';
$platformLanguage = api_get_setting('platformLanguage');

Expand All @@ -4168,7 +4168,7 @@ function api_get_languages_combo($name = 'language', $chozen=true) {
$languages = $language_list['name'];
$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) {
if ($folder[$key] == $default) {
$selected = ' selected="selected"';
Expand Down
2 changes: 1 addition & 1 deletion main/inc/lib/extra_field.lib.php
Expand Up @@ -1700,7 +1700,7 @@ public function return_form($url, $action)
'field_type',
get_lang('FieldType'),
$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('text', 'variable', get_lang('FieldLabel'), array('class' => 'span5'));
Expand Down
3 changes: 0 additions & 3 deletions main/inc/lib/formvalidator/Element/SelectLanguage.php
Expand Up @@ -11,9 +11,6 @@ class SelectLanguage extends HTML_QuickForm_select
*/
function SelectLanguage($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{
if (!isset($attributes['class'])) {
$attributes['class'] = 'chzn-select';
}
parent::__construct($elementName, $elementLabel, $options, $attributes);
// Get all languages
$languages = api_get_languages();
Expand Down
4 changes: 0 additions & 4 deletions main/inc/lib/formvalidator/Element/SelectTheme.php
Expand Up @@ -10,10 +10,6 @@ class SelectTheme extends HTML_QuickForm_select
* Class constructor
*/
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);
// Get all languages
$themes = api_get_themes();
Expand Down
2 changes: 0 additions & 2 deletions main/inc/lib/gradebook.lib.php
Expand Up @@ -184,8 +184,6 @@ public function show_skill_form($gradebook_id, $url, $header = null)
get_lang('Skills'),
$clean_skill_list,
array(
'width' => '450px',
'class' => 'chzn-select',
'multiple' => 'multiple'
)
);
Expand Down
5 changes: 1 addition & 4 deletions main/inc/lib/sessionmanager.lib.php
Expand Up @@ -6483,7 +6483,6 @@ public static function setForm(FormValidator & $form, $sessionId = 0)
[api_get_user_id() => $userInfo['complete_name']],
array(
'id' => 'coach_username',
'class' => 'chzn-select',
'style' => 'width:370px;',
)
);
Expand Down Expand Up @@ -6556,9 +6555,7 @@ public static function setForm(FormValidator & $form, $sessionId = 0)
$form->addElement('html','<div id="advanced_params_options" style="display:none">');

$form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
'id' => 'session_category',
'class' => 'chzn-select',
'style' => 'width:370px;',
'id' => 'session_category'
));

$form->addHtmlEditor(
Expand Down
2 changes: 1 addition & 1 deletion main/inc/lib/usermanager.lib.php
Expand Up @@ -4526,7 +4526,7 @@ static function set_extra_fields_in_form(
'extra_'.$field_details[1],
$field_details[3],
$options,
array('class' => 'chzn-select', 'id' => 'extra_'.$field_details[1])
array('id' => 'extra_' . $field_details[1])
);

if (!$admin_permissions) {
Expand Down
2 changes: 1 addition & 1 deletion main/session/session_category_list.php
Expand Up @@ -234,7 +234,7 @@ function selectAll(idCheck,numRows,action) {
<a class="btn btn-default" href="#" onclick="selectAll('idChecked',<?php echo $x; ?>,'false');return false;"><?php echo get_lang('UnSelectAll') ?></a>
</div>
<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_on_session"><?php echo get_lang('DeleteSelectedFullSessionCategory'); ?></option>
</select>
Expand Down

0 comments on commit cc4b8e9

Please sign in to comment.