Skip to content

Commit

Permalink
Fix footer_extra_content and header_extra_content - Issue #1604
Browse files Browse the repository at this point in the history
  • Loading branch information
jloguercio committed Feb 1, 2017
1 parent 7748e03 commit 6469a56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions main/admin/settings.lib.php
Expand Up @@ -1364,15 +1364,15 @@ 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);
}
$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);
Expand Down
8 changes: 4 additions & 4 deletions main/admin/settings.php
Expand Up @@ -278,12 +278,12 @@ function get_settings($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':
Expand Down
4 changes: 2 additions & 2 deletions main/inc/lib/api.lib.php
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 6469a56

Please sign in to comment.