diff --git a/main/admin/settings.lib.php b/main/admin/settings.lib.php
index d5633013a2..00b2c470e4 100755
--- a/main/admin/settings.lib.php
+++ b/main/admin/settings.lib.php
@@ -290,7 +290,6 @@ function handle_stylesheets() {
//echo '
';
echo ' ';
- //var_dump($list_of_names);
if ($is_style_changeable){
echo '';
}
@@ -563,8 +562,7 @@ function handle_search() {
if ($form->validate()) {
- $formvalues = $form->exportValues();
- var_dump($formvalues);
+ $formvalues = $form->exportValues();
$r = api_set_settings_category('Search', 'false', $_configuration['access_url']);
// Save the settings.
foreach ($formvalues as $key => $value) {
@@ -576,8 +574,6 @@ function handle_search() {
$form->display();
echo '';
}
-
-
}
/**
diff --git a/main/admin/settings.php b/main/admin/settings.php
index 8ae909e0a6..f622771bc2 100755
--- a/main/admin/settings.php
+++ b/main/admin/settings.php
@@ -18,7 +18,7 @@ if (isset($_GET['category']) && $_GET['category'] == 'Templates') {
} else if(isset($_GET['category']) && $_GET['category'] == 'Gradebook') {
$language_file = array('admin', 'gradebook');
} else {
- $language_file = 'admin';
+ $language_file = array('admin', 'document');
}
// Resetting the course id.
@@ -386,22 +386,22 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
$form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');
$form->addElement('html', '');
- $form->setDefaults($default_values);
-
-
+ $form->setDefaults($default_values);
+ $message = array();
if ($form->validate()) {
$values = $form->exportValues();
-
-
$pdf_export_watermark_path = $_FILES['pdf_export_watermark_path'];
-
- if (!empty($pdf_export_watermark_path['name'])) {
- $pdf_export_watermark_path_result = PDF::upload_watermark($pdf_export_watermark_path['name'], $pdf_export_watermark_path['tmp_name']);
+
+ if (isset($pdf_export_watermark_path) && !empty($pdf_export_watermark_path['name'])) {
+ $pdf_export_watermark_path_result = PDF::upload_watermark($pdf_export_watermark_path['name'], $pdf_export_watermark_path['tmp_name']);
+ if ($pdf_export_watermark_path_result) {
+ $message['confirmation'][] = get_lang('UplUploadSucceeded');
+ } else {
+ $message['warning'][] = get_lang('UplUnableToSaveFile').' '.get_lang('Folder').': '.api_get_path(SYS_CODE_PATH).'default_course_document';
+ }
unset($update_values['pdf_export_watermark_path']);
}
-
-
// Set true for allow_message_tool variable if social tool is actived.
if ($values['allow_social_tool'] == 'true') {
@@ -519,25 +519,15 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
event_system(LOG_CONFIGURATION_SETTINGS_CHANGE, LOG_CONFIGURATION_SETTINGS_VARIABLE, $variable, $time, $user_id);
}
}
-
- header('Location: settings.php?action=stored&category='.Security::remove_XSS($_GET['category']));
- exit;
+ //header('Location: settings.php?action=stored&category='.Security::remove_XSS($_GET['category']).'&message='.$message);
+ //exit;
}
}
// Including the header (banner).
Display :: display_header($tool_name);
-if ($watermark_deleted) {
- Display :: display_normal_message(get_lang('FileDeleted'));
-}
-
-//api_display_tool_title($tool_name);
-// Displaying the message that the settings have been stored.
-if (!empty($_GET['action']) && $_GET['action'] == 'stored') {
- Display :: display_confirmation_message(get_lang('SettingsStored'));
-}
// The action images.
$action_images['platform'] = 'platform.png';
@@ -561,16 +551,37 @@ $action_images['extra'] = 'wizard.png';
//$selectcategories = "SELECT DISTINCT category FROM ".$table_settings_current." WHERE category NOT IN ('stylesheets','Plugins')";
//$resultcategories = Database::query($selectcategories);
$resultcategories = api_get_settings_categories(array('stylesheets', 'Plugins', 'Templates', 'Search'));
-echo "\n