Fixing chosen width. Adding "chosen selects" when adding a session or a course.

Note: The select *must* containt an id otherwise it wouldn't work when there are 2 chosen selects #3740
skala
Julio Montoya 14 years ago
parent 74c387dea0
commit 77dd2b119f
  1. 4
      main/admin/session_add.php
  2. 4
      main/admin/session_edit.php
  3. 2
      main/create_course/add_course.php
  4. 5
      main/css/base.css
  5. 4
      main/exercice/exercise.class.php
  6. 2
      main/exercice/exercise_admin.php
  7. 11
      main/inc/lib/main_api.lib.php

@ -192,7 +192,7 @@ if (intval($count_users)<50) {
$result=Database::query($sql);
$Coaches=Database::store_result($result);
?>
<select name="coach_username" value="true" style="width:350px;">
<select id="coach_username" class="chzn-select" name="coach_username" value="true" style="width:350px;">
<option value="0"><?php get_lang('None'); ?></option>
<?php foreach($Coaches as $enreg): ?>
<option value="<?php echo $enreg['username']; ?>" <?php if($sent && $enreg['user_id'] == $id_coach) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
@ -212,7 +212,7 @@ $Categories = SessionManager::get_all_session_category();
<tr>
<td width="40%"><?php echo get_lang('SessionCategory') ?></td>
<td width="60%">
<select name="session_category" value="true" style="width:350px;">
<select id="session_category" class="chzn-select" name="session_category" value="true" style="width:350px;">
<option value="0"><?php get_lang('None'); ?></option>
<?php
if (!empty($Categories)) {

@ -115,7 +115,7 @@ if (!empty($return)) {
</tr>
<tr>
<td width="30%"><?php echo get_lang('CoachName') ?>&nbsp;&nbsp;</td>
<td width="70%"><select name="id_coach" style="width:380px;">
<td width="70%"><select class="chzn-select" name="id_coach" style="width:380px;">
<option value="">----- <?php echo get_lang('Choose') ?> -----</option>
<?php
foreach($Coaches as $enreg) {
@ -131,7 +131,7 @@ $Categories = SessionManager::get_all_session_category();
<tr>
<td width="30%"><?php echo get_lang('SessionCategory') ?></td>
<td width="70%">
<select name="session_category" style="width:380px;">
<select class="chzn-select" id="session_category" name="session_category" style="width:380px;">
<option value="0"><?php get_lang('None'); ?></option>
<?php
if (!empty($Categories)) {

@ -100,7 +100,7 @@ $form->addElement('static', null, null, get_lang('Ex'));
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
// Course category.
$categories_select = $form->addElement('select', 'category_code', get_lang('Fac'), array(), array('style'=>'width:350px'));
$categories_select = $form->addElement('select', 'category_code', get_lang('Fac'), array(), array('id'=> 'category_code','class'=>'chzn-select', 'style'=>'width:350px'));
$form->applyFilter('category_code', 'html_filter');
CourseManager::select_and_sort_categories($categories_select);
$form->addElement('static', null, null, get_lang('TargetFac'));

@ -2192,4 +2192,9 @@ div.admin_section h4 {
.tableFloatingHeaderOriginal th, .tableWithFloatingHeader th{
height:80px;
}
/* chosen javascript checkbox select width fix */
.chzn-select {
width: 200px;
}

@ -984,7 +984,7 @@ class Exercise {
$option = range(0,$max);
$option[0]=get_lang('No');
$random[] = FormValidator :: createElement ('select', 'randomQuestions',null,$option, array('class'=>'chzn-select'));
$random[] = FormValidator :: createElement ('select', 'randomQuestions',null, $option, array('id'=>'randomQuestions','class'=>'chzn-select'));
$random[] = FormValidator :: createElement ('static', 'help','help','<span style="font-style: italic;">'.get_lang('RandomQuestionsHelp').'</span>');
//$random[] = FormValidator :: createElement ('text', 'randomQuestions', null,null,'0');
$form->addGroup($random,null,get_lang('RandomQuestions'),'<br />');
@ -999,7 +999,7 @@ class Exercise {
$attempt_option=range(0,10);
$attempt_option[0]=get_lang('Infinite');
$form->addElement('select', 'exerciseAttempts',get_lang('ExerciseAttempts'),$attempt_option);
$form->addElement('select', 'exerciseAttempts',get_lang('ExerciseAttempts'),$attempt_option, array('id'=>'exerciseAttempts','class'=>'chzn-select'));
$form->addElement('checkbox', 'activate_start_date_check',get_lang('EnableStartTime'),null, array('onclick' => 'activate_start_date()'));

@ -142,7 +142,7 @@ $(document).ready(function () {
// INIT EXERCISE
require_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
$objExercise = new Exercise();
//INIT FORM

@ -2725,9 +2725,7 @@ function api_get_item_property_info($course_id, $tool, $ref) {
*/
function api_get_languages_combo($name = 'language') {
$ret = '';
$platformLanguage = api_get_setting('platformLanguage');
// Retrieve a complete list of all the languages.
@ -2744,20 +2742,19 @@ function api_get_languages_combo($name = 'language') {
$default = $platformLanguage;
}
$languages = $language_list['name'];
$folder = $language_list['folder'];
$languages = $language_list['name'];
$folder = $language_list['folder'];
$ret .= '<select name="'.$name.'" class="chzn-select" >';
$ret .= '<select name="'.$name.'" id="language_chosen" class="chzn-select" >';
foreach ($languages as $key => $value) {
if ($folder[$key] == $default) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
$ret .= sprintf('<option value=%s" %s>%s</option>'."\n", $folder[$key], $selected, $value);
$ret .= sprintf('<option value=%s" %s>%s</option>', $folder[$key], $selected, $value);
}
$ret .= '</select>';
return $ret;
}

Loading…
Cancel
Save