Fix footer_extra_content and header_extra_content - Issue #1604

pull/2487/head
José Loguercio 9 years ago
parent 7748e03feb
commit 6469a566d3
  1. 4
      main/admin/settings.lib.php
  2. 8
      main/admin/settings.php
  3. 4
      main/inc/lib/api.lib.php

@ -1364,7 +1364,7 @@ function generateSettingsForm($settings, $settings_by_access_list)
break;
case 'textarea':
if ($row['variable'] == 'header_extra_content') {
$file = api_get_path(SYS_PATH).api_get_home_path().'header_extra_content.txt';
$file = api_get_home_path().'header_extra_content.txt';
$value = '';
if (file_exists($file)) {
$value = file_get_contents($file);
@ -1372,7 +1372,7 @@ function generateSettingsForm($settings, $settings_by_access_list)
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme);
$default_values[$row['variable']] = $value;
} elseif ($row['variable'] == 'footer_extra_content') {
$file = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
$file = api_get_home_path().'footer_extra_content.txt';
$value = '';
if (file_exists($file)) {
$value = file_get_contents($file);

@ -278,12 +278,12 @@ if (!empty($_GET['category']) &&
$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';
file_put_contents(api_get_home_path().'header_extra_content.txt', $value);
$value = api_get_home_path().'header_extra_content.txt';
break;
case 'footer_extra_content':
file_put_contents(api_get_path(SYS_PATH).api_get_home_path().'/footer_extra_content.txt', $value);
$value = api_get_home_path().'/footer_extra_content.txt';
file_put_contents(api_get_home_path().'footer_extra_content.txt', $value);
$value = api_get_home_path().'footer_extra_content.txt';
break;
case 'InstitutionUrl':
case 'course_validation_terms_and_conditions_url':

@ -2346,7 +2346,7 @@ function api_get_setting($variable, $key = null)
{
global $_setting;
if ($variable == 'header_extra_content') {
$filename = api_get_path(SYS_PATH).api_get_home_path().'header_extra_content.txt';
$filename = api_get_home_path().'header_extra_content.txt';
if (file_exists($filename)) {
$value = file_get_contents($filename);
return $value;
@ -2355,7 +2355,7 @@ function api_get_setting($variable, $key = null)
}
}
if ($variable == 'footer_extra_content') {
$filename = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
$filename = api_get_home_path().'footer_extra_content.txt';
if (file_exists($filename)) {
$value = file_get_contents($filename);
return $value;

Loading…
Cancel
Save