diff --git a/main/admin/settings.php b/main/admin/settings.php index 26ffb527c1..ef2ab71a89 100644 --- a/main/admin/settings.php +++ b/main/admin/settings.php @@ -197,7 +197,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', ' } break; case 'textarea': - if ($row['variable'] == 'header_extra_content') { + if ($row['variable'] == 'header_extra_content') { $file = api_get_path(SYS_PATH).api_get_home_path().'header_extra_content'; $value = ''; if (file_exists($file)) { @@ -205,6 +205,14 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', ' } $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10','cols'=>'50'), $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'; + $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','cols'=>'50'), $hideme); + $default_values[$row['variable']] = $value; } else { $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10','cols'=>'50'), $hideme); $default_values[$row['variable']] = $row['selected_value']; @@ -417,7 +425,10 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', ' file_put_contents(api_get_path(SYS_PATH).api_get_home_path().'/header_extra_content', $value); $value = api_get_home_path().'/header_extra_content'; break; - + case 'footer_extra_content': + file_put_contents(api_get_path(SYS_PATH).api_get_home_path().'/footer_extra_content', $value); + $value = api_get_home_path().'/footer_extra_content'; + break; // URL validation for some settings. case 'InstitutionUrl': case 'course_validation_terms_and_conditions_url': @@ -583,4 +594,4 @@ if (!empty($_GET['category'])) { } /* FOOTER */ -Display :: display_footer(); \ No newline at end of file +Display :: display_footer(); diff --git a/main/inc/footer.inc.php b/main/inc/footer.inc.php old mode 100755 new mode 100644 index f1a64ca264..11e1379b8e --- a/main/inc/footer.inc.php +++ b/main/inc/footer.inc.php @@ -136,6 +136,14 @@ echo ''; echo ' '; + +if (!api_is_platform_admin()) { + $extra_footer = trim(api_get_setting('footer_extra_content')); + if (!empty($extra_footer)) { + echo $extra_footer; + } +} + /* // Test server mode indicator and information for testing purposes. if (api_is_platform_admin()) { @@ -173,4 +181,4 @@ $(document).ready( function() { }); - \ No newline at end of file + diff --git a/main/inc/header.inc.php b/main/inc/header.inc.php index a91c2faad5..1070f0eeb8 100644 --- a/main/inc/header.inc.php +++ b/main/inc/header.inc.php @@ -214,4 +214,4 @@ if (defined('CHAMILO_HOMEPAGE') && CHAMILO_HOMEPAGE) '.$_configuration['software_name'].' '.$_configuration['system_version'].' © '.date('Y'); //$this->assign('platform_name', $platform); + + if (!api_is_platform_admin()) { + $extra_footer = trim(api_get_setting('footer_extra_content')); + if (!empty($extra_footer)) { + $this->assign('footer_extra_content', $extra_footer); + } + } $administrator_data = get_lang('Manager'). ' : '. Display::encrypted_mailto_link(api_get_setting('emailAdministrator'), api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))); $this->assign('administrator_name', $administrator_data); @@ -325,4 +332,4 @@ class Template extends Smarty { $this->assign('execution_stats', $stats); } -} \ No newline at end of file +} diff --git a/main/install/migrate-db-1.8.8-1.9.0-pre.sql b/main/install/migrate-db-1.8.8-1.9.0-pre.sql index 5e236bbff2..ee56122fe3 100755 --- a/main/install/migrate-db-1.8.8-1.9.0-pre.sql +++ b/main/install/migrate-db-1.8.8-1.9.0-pre.sql @@ -13,11 +13,11 @@ -- This first part is for the main database -- xxMAINxx -UPDATE settings_current SET selected_value = '1.9.0.15672' WHERE variable = 'chamilo_database_version'; +UPDATE settings_current SET selected_value = '1.9.0.15858' WHERE variable = 'chamilo_database_version'; INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('filter_terms', NULL, 'textarea', 'Security', '', 'FilterTermsTitle', 'FilterTermsComment', NULL, NULL, 0); -INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('header_extra_content', NULL, 'textarea', 'Tracking', '', 'HeaderExtraContentTitle', 'HeaderExtraContentComment', NULL, NULL, 1); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('header_extra_content', NULL, 'textarea', 'Tracking', '', 'HeaderExtraContentTitle', 'HeaderExtraContentComment', NULL, NULL, 1),('footer_extra_content', NULL, 'textarea', 'Tracking', '', 'FooterExtraContentTitle', 'FooterExtraContentComment', NULL, NULL,1); ALTER TABLE personal_agenda ADD COLUMN all_day INTEGER NOT NULL DEFAULT 0; ALTER TABLE sys_calendar ADD COLUMN all_day INTEGER NOT NULL DEFAULT 0; diff --git a/main/template/default/layout/footer.tpl b/main/template/default/layout/footer.tpl index 94eab7c65c..c563954449 100644 --- a/main/template/default/layout/footer.tpl +++ b/main/template/default/layout/footer.tpl @@ -19,7 +19,7 @@
- +{$footer_extra_content} {literal} {/literal} -{$execution_stats} \ No newline at end of file +{$execution_stats}