diff --git a/main/admin/settings.lib.php b/main/admin/settings.lib.php index 28578db481..cd29eac9ca 100644 --- a/main/admin/settings.lib.php +++ b/main/admin/settings.lib.php @@ -106,7 +106,6 @@ function handle_plugins() { $all_plugins = $plugin_obj->read_plugins_from_path(); $installed_plugins = $plugin_obj->get_installed_plugins(); - //Plugins NOT installed echo Display::page_subheader(get_lang('Plugins')); echo '
'; @@ -1008,6 +1007,19 @@ function select_gradebook_number_decimals() { return array('0', '1', '2'); } +function select_gradebook_default_grade_model_id() { + $grade_model = new GradeModel(); + $models = $grade_model->get_all(); + $options = array(); + $options[-1] = get_lang('None'); + if (!empty($models)) { + foreach ($models as $model) { + $options[$model['id']] = $model['name']; + } + } + return $options; +} + /** * Updates the gradebook score custom values using the scoredisplay class of the * gradebook module @@ -1039,24 +1051,12 @@ function generate_settings_form($settings, $settings_by_access_list) { $form = new FormValidator('settings', 'post', 'settings.php?category='.Security::remove_XSS($_GET['category'])); $form ->addElement('hidden', 'search_field', Security::remove_XSS($_GET['search_field'])); - $default_values = array(); - $count_settings = count($settings); + $default_values = array(); - foreach ($settings as $row) { - if (in_array($row['variable'], array_keys($settings_to_avoid))) { continue; } + $i = 0; + foreach ($settings as $row) { + if (in_array($row['variable'], array_keys($settings_to_avoid))) { continue; } - $anchor_name = $row['variable'].(!empty($row['subkey']) ? '_'.$row['subkey'] : ''); - $form->addElement('html',"\n\n"); - - ($count_settings % 10) < 5 ? $b = $count_settings - 10 : $b = $count_settings; - if ($i % 10 == 0 and $i < $b AND $i != 0) { - $form->addElement('html', '
'); - $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); - $form->addElement('html', '
'); - } - - $i++; - if ( $_configuration['multiple_access_urls']) { if (api_is_global_platform_admin()) { if ($row['access_url_locked'] == 0) { @@ -1220,47 +1220,50 @@ function generate_settings_form($settings, $settings_by_access_list) { break; case 'link': $form->addElement('static', null, array(get_lang($row['title']), get_lang($row['comment'])), get_lang('CurrentValue').' : '.$row['selected_value'], $hideme); - break; - /* - * To populate its list of options, the select type dynamically calls a function that must be called select_ + the name of the variable being displayed. - * The functions being called must be added to the file settings.lib.php. - */ + break; case 'select': + /* + * To populate the list of options, the select type dynamically calls a function that must be called select_ + the name of the variable being displayed. + * The functions being called must be added to the file settings.lib.php. + */ $form->addElement('select', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), call_user_func('select_'.$row['variable']), $hideme); $default_values[$row['variable']] = $row['selected_value']; break; case 'custom': break; - } - - if ($row['variable'] == 'pdf_export_watermark_enable') { - $url = PDF::get_watermark($course_code); - $form->addElement('file', 'pdf_export_watermark_path', get_lang('AddWaterMark')); - if ($url != false) { - $delete_url = ''.Display::return_icon('delete.png',get_lang('DelImage')).''; - $form->addElement('html', ''.$url.' '.$delete_url.''); - } - $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif'); - $form->addRule('pdf_export_watermark_path', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types); } - - if ($row['variable'] == 'timezone_value') { - $timezone = $row['selected_value']; - if (empty($timezone)) { - $timezone = _api_get_timezone(); - } - $form->addElement('html', sprintf(get_lang('LocalTimeUsingPortalTimezoneXIsY'), $timezone, api_get_local_time())); - } - } + + switch ($row['variable']) { + case 'pdf_export_watermark_enable': + $url = PDF::get_watermark($course_code); + $form->addElement('file', 'pdf_export_watermark_path', get_lang('AddWaterMark')); + if ($url != false) { + $delete_url = ''.Display::return_icon('delete.png',get_lang('DelImage')).''; + $form->addElement('html', ''.$url.' '.$delete_url.''); + } + $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif'); + $form->addRule('pdf_export_watermark_path', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types); + break; + case 'timezone_value': + $timezone = $row['selected_value']; + if (empty($timezone)) { + $timezone = _api_get_timezone(); + } + $form->addElement('html', sprintf(get_lang('LocalTimeUsingPortalTimezoneXIsY'), $timezone, api_get_local_time())); + break; + } + } // end for - if (!empty($settings)) { - $form->addElement('html', '
'); - $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); - $form->addElement('html', '
'); + if (!empty($settings)) { $form->setDefaults($default_values); } - return $form; + $form->addElement('html', '
'); + $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); + $form->addElement('html', '
'); + + + return $form; } /** diff --git a/main/admin/settings.php b/main/admin/settings.php index d371ecf285..90ba661317 100644 --- a/main/admin/settings.php +++ b/main/admin/settings.php @@ -180,8 +180,8 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', ' // Treat gradebook values in separate function. //if (strpos($key, 'gradebook_score_display_custom_values') === false) { if (!is_array($value)) { - $old_value = api_get_setting($key); - switch ($key) { + $old_value = api_get_setting($key); + switch ($key) { case 'header_extra_content': file_put_contents(api_get_path(SYS_PATH).api_get_home_path().'/header_extra_content.txt', $value); $value = api_get_home_path().'/header_extra_content.txt'; diff --git a/main/css/base.css b/main/css/base.css index d31c22d123..e230a17789 100644 --- a/main/css/base.css +++ b/main/css/base.css @@ -3831,3 +3831,24 @@ footer { text-decoration: none; font-weight: normal; } + + +.bottom_actions { + background:#efefef; + border:1px solid #ccc; + padding:10px; + vertical-align:middle; + + display: block; + + width: 100%; + +} + +.bottom_actions_fixed { + position: fixed; + z-index: 9001; + bottom: 0; + left: 0px; + +} \ No newline at end of file diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 0351fd5272..8ae0e363eb 100644 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -29,7 +29,7 @@ class Template { var $params = array(); - function __construct($title = '', $show_header = true, $show_footer = true, $show_learnpath = false) { + function __construct($title = '', $show_header = true, $show_footer = true, $show_learnpath = false, $hide_global_chat = false) { //Twig settings Twig_Autoloader::register(); @@ -73,8 +73,6 @@ class Template { $this->twig->addFilter('display_page_header', new Twig_Filter_Function('Display::page_header_and_translate')); $this->twig->addFilter('display_page_subheader', new Twig_Filter_Function('Display::page_subheader_and_translate')); - - /* $lexer = new Twig_Lexer($this->twig, array( //'tag_comment' => array('{*', '*}'), @@ -87,6 +85,7 @@ class Template { //Page title $this->title = $title; $this->show_learnpath = $show_learnpath; + $this->hide_global_chat = $hide_global_chat; //Setting system variables $this->set_system_parameters(); @@ -418,10 +417,8 @@ class Template { if (api_get_setting('allow_global_chat') == 'true') { if (!api_is_anonymous()) { //Do not include the global chat in LP - if ($this->show_learnpath == false) { - if ($this->show_footer == true) { - $js_files[] = 'chat/js/chat.js'; - } + if ($this->show_learnpath == false && $this->show_footer == true && $this->hide_global_chat == false) { + $js_files[] = 'chat/js/chat.js'; } } } diff --git a/main/template/default/layout/head.tpl b/main/template/default/layout/head.tpl index 1817185873..b70a3f9db8 100644 --- a/main/template/default/layout/head.tpl +++ b/main/template/default/layout/head.tpl @@ -27,7 +27,7 @@ {{ css_style_print }} /*]]>*/ -