Fix customfooter

ofaj
jmontoyaa 10 years ago
parent f3c53ae075
commit 78fa5c9dc1
  1. 19
      plugin/customfooter/index.php
  2. 16
      plugin/customfooter/install.php
  3. 13
      plugin/customfooter/plugin.php

@ -3,14 +3,13 @@
* @package chamilo.plugin.customfooter * @package chamilo.plugin.customfooter
*/ */
echo '<div class="well">'; if (isset($plugin_info['current_region'])) {
if (!empty($plugin_info['settings']['customfooter_show_type'])) { switch($plugin_info['current_region']) {
echo "<h2>".$plugin_info['settings']['customfooter_show_type']."</h2>"; case 'footer_left':
} else { echo $plugin_info['settings']['customfooter_footer_left'];
echo "<h2>Custom Footer</h2>"; break;
case 'footer_right':
echo $plugin_info['settings']['customfooter_footer_right'];
break;
}
} }
//Using get_lang inside a plugin
echo get_lang('CustomFooter');
echo '</div>';

@ -13,5 +13,17 @@
*/ */
global $_configuration; global $_configuration;
api_add_setting(@$_configuration['defaults']['customfooter_footer_left'], 'customfooter_footer_left', 'customfooter', 'setting', 'Plugins'); api_add_setting(
api_add_setting(@$_configuration['defaults']['customfooter_footer_right'], 'customfooter_footer_right', 'customfooter', 'setting', 'Plugins'); @$_configuration['defaults']['customfooter_footer_left'],
'customfooter_footer_left',
'customfooter',
'setting',
'Plugins'
);
api_add_setting(
@$_configuration['defaults']['customfooter_footer_right'],
'customfooter_footer_right',
'customfooter',
'setting',
'Plugins'
);

@ -6,8 +6,7 @@
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*/ */
require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php'; require_once __DIR__.'/lib/customfooter_plugin.class.php';
require_once dirname(__FILE__).'/lib/customfooter_plugin.class.php';
/** /**
* Plugin details (must be present) * Plugin details (must be present)
@ -16,13 +15,13 @@ require_once dirname(__FILE__).'/lib/customfooter_plugin.class.php';
/* Plugin config */ /* Plugin config */
//the plugin title //the plugin title
$plugin_info['title'] = 'Custom Footer'; $plugin_info['title'] = 'Custom Footer';
//the comments that go with the plugin //the comments that go with the plugin
$plugin_info['comment'] = "Drives configuration parameters that plugs custom footer notes"; $plugin_info['comment'] = "Drives configuration parameters that plugs custom footer notes";
//the plugin version //the plugin version
$plugin_info['version'] = '1.0'; $plugin_info['version'] = '1.0';
//the plugin author //the plugin author
$plugin_info['author'] = 'Valery Fremaux'; $plugin_info['author'] = 'Valery Fremaux, Julio Montoya';
/* Plugin optional settings */ /* Plugin optional settings */
@ -48,7 +47,7 @@ foreach ($config as $fooid => $configrecord) {
$form->addElement('text', 'footer_left', $plugininstance->get_lang('footerleft')); $form->addElement('text', 'footer_left', $plugininstance->get_lang('footerleft'));
$form->addElement('text', 'footer_right', $plugininstance->get_lang('footerright')); $form->addElement('text', 'footer_right', $plugininstance->get_lang('footerright'));
$form->addElement('style_submit_button', 'submit_button', $plugininstance->get_lang('Save')); $form->addButtonSave($plugininstance->get_lang('Save'));
$form->setDefaults($form_settings); $form->setDefaults($form_settings);

Loading…
Cancel
Save