|
|
|
@ -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. |
|
|
|
@ -388,21 +388,21 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', ' |
|
|
|
|
|
|
|
|
|
$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'])) { |
|
|
|
|
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') { |
|
|
|
|
$values['allow_message_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<div class=\"actions\">"; |
|
|
|
|
echo "<div class=\"actions\">"; |
|
|
|
|
//while ($row = Database::fetch_array($resultcategories)) |
|
|
|
|
foreach ($resultcategories as $row) { |
|
|
|
|
echo "\n\t<a href=\"".api_get_self()."?category=".$row['category']."\">".Display::return_icon($action_images[strtolower($row['category'])], api_ucfirst(get_lang($row['category'])),'','32')."</a>"; |
|
|
|
|
echo "<a href=\"".api_get_self()."?category=".$row['category']."\">".Display::return_icon($action_images[strtolower($row['category'])], api_ucfirst(get_lang($row['category'])),'','32')."</a>"; |
|
|
|
|
} |
|
|
|
|
echo "\n\t<a href=\"".api_get_self()."?category=Search\">".Display::return_icon($action_images['search'], api_ucfirst(get_lang('Search')),'','32')."</a>"; |
|
|
|
|
echo "\n\t<a href=\"".api_get_self()."?category=stylesheets\">".Display::return_icon($action_images['stylesheets'], api_ucfirst(get_lang('Stylesheets')),'','32')."</a>"; |
|
|
|
|
echo "\n\t<a href=\"".api_get_self()."?category=Templates\">".Display::return_icon($action_images['templates'], api_ucfirst(get_lang('Templates')),'','32')."</a>"; |
|
|
|
|
echo "\n\t<a href=\"".api_get_self()."?category=Plugins\">".Display::return_icon($action_images['plugins'], api_ucfirst(get_lang('Plugins')),'','32')."</a>"; |
|
|
|
|
echo "\n</div>"; |
|
|
|
|
echo "<a href=\"".api_get_self()."?category=Search\">".Display::return_icon($action_images['search'], api_ucfirst(get_lang('Search')),'','32')."</a>"; |
|
|
|
|
echo "<a href=\"".api_get_self()."?category=stylesheets\">".Display::return_icon($action_images['stylesheets'], api_ucfirst(get_lang('Stylesheets')),'','32')."</a>"; |
|
|
|
|
echo "<a href=\"".api_get_self()."?category=Templates\">".Display::return_icon($action_images['templates'], api_ucfirst(get_lang('Templates')),'','32')."</a>"; |
|
|
|
|
echo "<a href=\"".api_get_self()."?category=Plugins\">".Display::return_icon($action_images['plugins'], api_ucfirst(get_lang('Plugins')),'','32')."</a>"; |
|
|
|
|
echo "</div>"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 (isset($form) && $form->validate()) { |
|
|
|
|
|
|
|
|
|
Display::display_confirmation_message(get_lang('SettingsStored')); |
|
|
|
|
if (is_array($message)) { |
|
|
|
|
foreach($message as $type => $content) { |
|
|
|
|
foreach($content as $msg) { |
|
|
|
|
echo Display::return_message($msg, $type); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($_GET['category'])) { |
|
|
|
|
switch ($_GET['category']) { |
|
|
|
|