Adding chosen to the language select and the main/admin/user_add.php file to use it just add this class "chzn-select" to a select ...

skala
Julio Montoya 14 years ago
parent c777634640
commit 74c387dea0
  1. 5
      main/admin/user_add.php
  2. 3
      main/document/create_audio.php
  3. 2
      main/exercice/exercise.class.php
  4. 1
      main/inc/footer.inc.php
  5. 10
      main/inc/header.inc.php
  6. 9
      main/inc/lib/formvalidator/Element/select_language.php
  7. 7
      main/inc/lib/main_api.lib.php
  8. 1
      main/wiki/index.php

@ -7,7 +7,6 @@
// Language files that should be included
$language_file = array('admin', 'registration');
$cidReset = true;
// Including necessary libraries.
require_once '../inc/global.inc.php';
$libpath = api_get_path(LIBRARY_PATH);
@ -145,8 +144,8 @@ $status[STUDENT] = get_lang('Learner');
$status[DRH] = get_lang('Drh');
$status[SESSIONADMIN] = get_lang('SessionsAdmin');
$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'onchange' => 'javascript: display_drh_list();'));
$form->addElement('select_language', 'language', get_lang('Language'));
$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'class'=>'chzn-select', 'onchange' => 'javascript: display_drh_list();'));
$form->addElement('select_language', 'language', get_lang('Language'), null);
//drh list (display only if student)
$display = ($_POST['status'] == STUDENT || !isset($_POST['status'])) ? 'block' : 'none';

@ -39,9 +39,6 @@ if (empty($document_data)) {
}
$document_id = $document_data['id'];
$dir = $document_data['path'];
//javascript jquery
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery-1.4.4.min.js" type="text/javascript"></script>';
//jquery textareaCounter
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/textareacounter/jquery.textareaCounter.plugin.js" type="text/javascript"></script>';
//need jquery for hide menus

@ -984,7 +984,7 @@ class Exercise {
$option = range(0,$max);
$option[0]=get_lang('No');
$random[] = FormValidator :: createElement ('select', 'randomQuestions',null,$option);
$random[] = FormValidator :: createElement ('select', 'randomQuestions',null,$option, array('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 />');

@ -162,5 +162,6 @@ if (api_is_platform_admin()) {
}
}
?>
<script> $(".chzn-select").chosen(); </script>
</body>
</html>

@ -114,9 +114,17 @@ if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=
?>
/*]]>*/
</style>
<script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/jquery.js" type="text/javascript" ></script>
<script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/jquery.min.js" type="text/javascript" ></script>
<script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/chosen/chosen.jquery.min.js" type="text/javascript" ></script>
<script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.js" type="text/javascript" ></script>
<link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.css" type="text/css" media="projection, screen" />
<link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/chosen/chosen.css" type="text/css" media="projection, screen" />
<link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
<link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" />
<link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'), ENT_QUOTES); ?>" />

@ -30,15 +30,16 @@ class HTML_QuickForm_Select_Language extends HTML_QuickForm_select
/**
* Class constructor
*/
function HTML_QuickForm_Select_Language($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{
function HTML_QuickForm_Select_Language($elementName=null, $elementLabel=null, $options=null, $attributes=null){
if (!isset($attributes['class'])) {
$attributes['class'] = 'chzn-select';
}
parent::HTML_QuickForm_Select($elementName, $elementLabel, $options, $attributes);
// Get all languages
$languages = api_get_languages();
$this->_options = array();
$this->_values = array();
foreach ($languages['name'] as $index => $name)
{
foreach ($languages['name'] as $index => $name) {
if($languages['folder'][$index] == api_get_setting('platformLanguage')) {
$this->addOption($name,$languages['folder'][$index],array('selected'=>'selected'));
} else {

@ -2747,7 +2747,7 @@ function api_get_languages_combo($name = 'language') {
$languages = $language_list['name'];
$folder = $language_list['folder'];
$ret .= '<select name="'.$name.'">';
$ret .= '<select name="'.$name.'" class="chzn-select" >';
foreach ($languages as $key => $value) {
if ($folder[$key] == $default) {
$selected = ' selected="selected"';
@ -2795,7 +2795,8 @@ function api_display_language_form($hide_if_no_choice = false) {
//-->
</script>
<?php
echo '<form id="lang_form" name="lang_form" method="post" action="'.api_get_self().'">', "<select name=\"language_list\" onchange=\"javascript: jumpMenu('parent',this,0);\">";
echo '<form id="lang_form" name="lang_form" method="post" action="'.api_get_self().'">';
echo "<select class=\"chzn-select\" name=\"language_list\" onchange=\"javascript: jumpMenu('parent',this,0);\">";
foreach ($original_languages as $key => $value) {
if ($folder[$key] == $user_selected_language) {
$option_end = ' selected="selected" >';
@ -4953,7 +4954,7 @@ function api_get_js($file) {
* Returns the js header to include the jquery library
*/
function api_get_jquery_js() {
return api_get_js('jquery-1.4.4.min.js');
return api_get_js('jquery.min.js');
}

@ -31,7 +31,6 @@ require_once 'wiki.inc.php';
$htmlHeadXtra[] ='<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'wiki/css/default.css"/>';
// javascript for advanced parameters menu
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-1.4.4.min.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {

Loading…
Cancel
Save