Actualización
This commit is contained in:
14
plugin/customfooter/index.php
Normal file
14
plugin/customfooter/index.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @package chamilo.plugin.customfooter
|
||||
*/
|
||||
if (isset($plugin_info['current_region'])) {
|
||||
switch ($plugin_info['current_region']) {
|
||||
case 'footer_left':
|
||||
echo $plugin_info['settings']['customfooter_footer_left'];
|
||||
break;
|
||||
case 'footer_right':
|
||||
echo $plugin_info['settings']['customfooter_footer_right'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
29
plugin/customfooter/install.php
Normal file
29
plugin/customfooter/install.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/* PHP code to install the plugin
|
||||
* For example:
|
||||
*
|
||||
// To query something to the database
|
||||
|
||||
$table = Database::get_main_table(TABLE_MAIN_USER); // TABLE_MAIN_USER is a constant check the main/inc/database.constants.inc.php
|
||||
$sql = "SELECT firstname, lastname FROM $table_users ";
|
||||
$users = Database::query($sql);
|
||||
|
||||
You can also use the Chamilo classes
|
||||
$users = UserManager::get_user_list();
|
||||
*/
|
||||
global $_configuration;
|
||||
|
||||
api_add_setting(
|
||||
@$_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'
|
||||
);
|
||||
71
plugin/customfooter/lang/en/tool_delivery.php
Normal file
71
plugin/customfooter/lang/en/tool_delivery.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
$string['accesstools'] = 'Go to delivery tools';
|
||||
$string['application'] = 'Application';
|
||||
$string['action'] = 'Command';
|
||||
$string['backtoprod'] = 'Plug in back';
|
||||
$string['clearreportarea'] = 'Clear report file area';
|
||||
$string['closesession'] = 'Close last session';
|
||||
$string['comment'] = 'Comment';
|
||||
$string['component'] = 'Component';
|
||||
$string['componentpath'] = 'Component Path';
|
||||
$string['configtooldeliverydir'] = 'From tools location the symlink directory where delivery must change moodle code';
|
||||
$string['configtooldeliveryenablesessions'] = 'If enabled, you need open and close delivery sessions for updating code. Session reports will be notified to reported recipients at the end of each session.';
|
||||
$string['configtooldeliverymethod'] = 'Choose the method (toolkit) for delivery';
|
||||
$string['configtooldeliveryprodscriptpath'] = 'Setup the physical path to reach delivery commands';
|
||||
$string['configtooldeliveryreportlogo'] = 'Logo image for the delivery report';
|
||||
$string['configtooldeliverysessionopenrecipients'] = 'All recipients (comma separated list) here will be notified when a delivery session is opened';
|
||||
$string['configtooldeliverysudo'] = 'Uses sudo in outcomming system commands';
|
||||
$string['configtooldeliverysudouser'] = 'Sudo username if sudo enabled (note that sudo user must have access to the whole delivery commands with NOPASSWD tag AND has write access to all the moodle files)';
|
||||
$string['configtooldirectdeliverytools'] = 'If checked, the delivery framework expects having tools in the immediate location given by the Path to Delivery Commands parameter. Tjhis is usefull when using a tool set located elsewhere then inthe delivery toolset.';
|
||||
$string['continuesession'] = 'Continue last session';
|
||||
$string['cvs'] = 'CVS';
|
||||
$string['dateend'] = 'End date';
|
||||
$string['datestart'] = 'Start date';
|
||||
$string['delivery'] = 'Code delivery';
|
||||
$string['deliveryoptions'] = 'Delivery Settings';
|
||||
$string['deliveryreport'] = 'Delivery Session Report';
|
||||
$string['deliverysessions'] = 'Delivery sessions';
|
||||
$string['deliverystate'] = 'Delivery State';
|
||||
$string['deliverytools'] = 'Delivery Tools';
|
||||
$string['errornotexecutable'] = 'Error : tools are not executable ({$a})';
|
||||
$string['errornotfound'] = 'Error : tools are not found ({$a})';
|
||||
$string['followup'] = 'Follow up';
|
||||
$string['goback'] = 'Plug out';
|
||||
$string['impact'] = 'Impact';
|
||||
$string['newdeliverysession'] = 'New delivery session';
|
||||
$string['nosessions'] = 'No delivery sessions';
|
||||
$string['opensession'] = 'Open new session';
|
||||
$string['outputstatus'] = 'Output state';
|
||||
$string['pluginname'] = 'Code Delivery Tools';
|
||||
$string['productionstate'] = 'Production State';
|
||||
$string['reports'] = 'Reports';
|
||||
$string['reporttitle'] = 'Code delivery report';
|
||||
$string['run'] = 'Run';
|
||||
$string['save'] = 'Save';
|
||||
$string['saveandclose'] = 'Save and close';
|
||||
$string['savesessiondata'] = 'Save session information';
|
||||
$string['security'] = 'Access security';
|
||||
$string['sessionend'] = 'Session end';
|
||||
$string['sessionlogs'] = 'Session logs';
|
||||
$string['sessionopening'] = 'Opening delivery session on {$a}';
|
||||
$string['sessionclosing'] = 'Closing delivery session on {$a}';
|
||||
$string['sessionstart'] = 'Session start';
|
||||
$string['sessiontitle'] = 'Session title';
|
||||
$string['sudomodeon'] = 'Sudo Mode: On';
|
||||
$string['summary'] = 'Summary';
|
||||
$string['supersyncback'] = 'Synchronize safe and supersafe codebase';
|
||||
$string['svn'] = 'SVN';
|
||||
$string['syncback'] = 'Synchronize safe codebase';
|
||||
$string['time'] = 'Time';
|
||||
$string['tooldeliverydir'] = 'Delivery dir radical';
|
||||
$string['tooldeliveryenablesessions'] = 'Enable delivery sessions';
|
||||
$string['tooldeliverymethod'] = 'Delivery method';
|
||||
$string['tooldeliveryprodscriptpath'] = 'Path to delivery commands';
|
||||
$string['tooldeliveryreportlogo'] = 'Delivery Report Logo';
|
||||
$string['tooldeliverysessionopenrecipients'] = 'Recipients for session opening';
|
||||
$string['tooldeliverysudo'] = 'Delivery uses sudo';
|
||||
$string['tooldeliverysudouser'] = 'User for sudo';
|
||||
$string['tooldirectdeliverytools'] = 'Direct path to delivery tools';
|
||||
$string['update'] = 'Update code';
|
||||
$string['updatesession'] = 'Update session';
|
||||
66
plugin/customfooter/lang/fr/tool_delivery.php
Normal file
66
plugin/customfooter/lang/fr/tool_delivery.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
$string['accesstools'] = 'Aller aux outils de livraison';
|
||||
$string['application'] = 'Application';
|
||||
$string['action'] = 'Commande';
|
||||
$string['backtoprod'] = 'Rétablir la production';
|
||||
$string['clearreportarea'] = 'Vider la zone de fichiers';
|
||||
$string['closesession'] = 'Clôturer la session en cours';
|
||||
$string['comment'] = 'Commentaire';
|
||||
$string['component'] = 'Composant';
|
||||
$string['componentpath'] = 'Chemin du composant';
|
||||
$string['configtooldeliverydir'] = 'Le code à maintenir doit se trouver dans ce répertoire, à partir du chemin des outils de livraison. Il s\'agit d\'un lien symbolique pointant vers le réperoire effectif du code de production';
|
||||
$string['configtooldeliveryenablesessions'] = 'Si activé, les modifications de code ont lieu dans des sessions de travail que l\'ont peut ouvrir et fermer. Un rapport est émis lors de la clôture.';
|
||||
$string['configtooldeliverymethod'] = 'La méthode (outil de versionnement) pour la livraison';
|
||||
$string['configtooldeliveryprodscriptpath'] = 'La racine d\'implantation des outils de livraison';
|
||||
$string['configtooldeliveryreportlogo'] = 'Logo pour les rapports de livraison';
|
||||
$string['configtooldeliverysessionopenrecipients'] = 'fournir une liste des adresses mail à notifier séparée par des virgules';
|
||||
$string['configtooldeliverysudo'] = 'Utiliser sudo pour les commandes systeme sortantes';
|
||||
$string['configtooldeliverysudouser'] = 'Utilisateur de sudo (Notez que cet utilisateur doit avoir accès à toutes commandes de livraison avec le mode NOPASSWD, et doit avoir l\'accès en écriture aux fichiers source de Moodle)';
|
||||
$string['configtooldirectdeliverytools'] = 'Si coché, l\'infrastructure de livraison s\'attend à trouver les scripts de livraison immédiatement dans le répertoire indiqué dans le paramètre "Chemin vers les outils". Ceci est utile lorsque les outils sont implantés en dehors de la présente distribution.';
|
||||
$string['continuesession'] = 'Continuer la dernière session';
|
||||
$string['cvs'] = 'CVS';
|
||||
$string['delivery'] = 'Livraison de code';
|
||||
$string['deliveryoptions'] = 'Réglages des outils de livraison';
|
||||
$string['deliveryreport'] = 'Rapport de Session de Livraison';
|
||||
$string['deliverysessions'] = 'Sessions de livraison';
|
||||
$string['deliverystate'] = 'Mode Livraison';
|
||||
$string['deliverytools'] = 'Outils de livraison';
|
||||
$string['errornotexecutable'] = 'Erreur : les outils ne sont pas exécutables ({$a})';
|
||||
$string['errornotfound'] = 'Erreur : les outils ne sont pas trouvés ({$a})';
|
||||
$string['goback'] = 'Remiser la production';
|
||||
$string['newdeliverysession'] = 'Nouvelle session de livraison';
|
||||
$string['nosessions'] = 'Pas de sessions';
|
||||
$string['opensession'] = 'Ouvrir une session';
|
||||
$string['outputstatus'] = 'Etat';
|
||||
$string['pluginname'] = 'Outils de livraison de code';
|
||||
$string['productionstate'] = 'Mode Production';
|
||||
$string['reports'] = 'Rapports';
|
||||
$string['reporttitle'] = 'Rapport de mise à jour de code';
|
||||
$string['run'] = 'Lancer l\'outil';
|
||||
$string['save'] = 'Enregistrer';
|
||||
$string['saveandclose'] = 'Enregistrer et clôturer';
|
||||
$string['savesessiondata'] = 'Sauvegarder les données de session';
|
||||
$string['security'] = 'Sécurisation de la livraison';
|
||||
$string['sessionend'] = 'Fin de session';
|
||||
$string['sessionopening'] = 'Ouverture de session de livraison sur {$a}';
|
||||
$string['sessionclosing'] = 'Fermeture de session de livraison sur {$a}';
|
||||
$string['sessionstart'] = 'Début de session';
|
||||
$string['sessiontitle'] = 'Titre de session';
|
||||
$string['sudomodeon'] = 'Mode "sudo" : Actif';
|
||||
$string['summary'] = 'Description';
|
||||
$string['supersyncback'] = 'Synchroniser la version de sauvegarde et la version de sécurité';
|
||||
$string['svn'] = 'SVN';
|
||||
$string['syncback'] = 'Synchroniser la version de sauvegarde';
|
||||
$string['time'] = 'Temps';
|
||||
$string['tooldeliverydir'] = 'Radical de réperoire de livraison';
|
||||
$string['tooldeliveryenablesessions'] = 'Activer les sessions';
|
||||
$string['tooldeliverymethod'] = 'Méthode de livraison';
|
||||
$string['tooldeliveryprodscriptpath'] = 'Chemin vers les outils';
|
||||
$string['tooldeliveryreportlogo'] = 'Logo';
|
||||
$string['tooldeliverysessionopenrecipients'] = 'Destinataires des notifications d\'ouverture de sessions';
|
||||
$string['tooldeliverysudo'] = 'Livraison par sudo';
|
||||
$string['tooldeliverysudouser'] = 'Utilisateur sudo';
|
||||
$string['tooldirectdeliverytools'] = 'Le répertoire vers les outils est direct';
|
||||
$string['update'] = 'Mettre à jour le code';
|
||||
$string['updatesession'] = 'Mettre à jour la session';
|
||||
54
plugin/customfooter/lib/customfooter_plugin.class.php
Normal file
54
plugin/customfooter/lib/customfooter_plugin.class.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Description of Custom Footer.
|
||||
*
|
||||
* @copyright (c) 2014 VF Consulting
|
||||
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
|
||||
* @author Valery Fremaux <valery.fremaux@gmail.com>
|
||||
*/
|
||||
class CustomFooterPlugin extends Plugin
|
||||
{
|
||||
protected function __construct()
|
||||
{
|
||||
parent::__construct('1.1', 'Valery Fremaux');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CustomFooterPlugin
|
||||
*/
|
||||
public static function create()
|
||||
{
|
||||
static $result = null;
|
||||
|
||||
return $result ? $result : $result = new self();
|
||||
}
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'customfooter';
|
||||
}
|
||||
|
||||
public function pix_url($pixname, $size = 16)
|
||||
{
|
||||
global $_configuration;
|
||||
|
||||
if (file_exists(
|
||||
$_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png'
|
||||
)) {
|
||||
return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.png';
|
||||
}
|
||||
if (file_exists(
|
||||
$_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.jpg'
|
||||
)) {
|
||||
return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.jpg';
|
||||
}
|
||||
if (file_exists(
|
||||
$_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.gif'
|
||||
)) {
|
||||
return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.gif';
|
||||
}
|
||||
|
||||
return $_configuration['root_web'].'/main/img/icons/'.$size.'/'.$pixname.'.png';
|
||||
}
|
||||
}
|
||||
56
plugin/customfooter/plugin.php
Normal file
56
plugin/customfooter/plugin.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* This plugin allows you to configure a footer note to plug some additional features. In a way, it works a bit like
|
||||
* any block plugin to be added in a region.
|
||||
*
|
||||
* @package chamilo.plugin
|
||||
*
|
||||
* @author Julio Montoya <gugli100@gmail.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugin details (must be present).
|
||||
*/
|
||||
|
||||
/* Plugin config */
|
||||
$plugin_info = CustomFooterPlugin::create()->get_info();
|
||||
|
||||
//the plugin title
|
||||
$plugin_info['title'] = 'Custom Footer';
|
||||
//the comments that go with the plugin
|
||||
$plugin_info['comment'] = "Drives configuration parameters that plugs custom footer notes";
|
||||
//the plugin version
|
||||
$plugin_info['version'] = '1.0';
|
||||
//the plugin author
|
||||
$plugin_info['author'] = 'Valery Fremaux, Julio Montoya';
|
||||
|
||||
/* Plugin optional settings */
|
||||
|
||||
/*
|
||||
* This form will be showed in the plugin settings once the plugin was installed
|
||||
* in the plugin/hello_world/index.php you can have access to the value: $plugin_info['settings']['hello_world_show_type']
|
||||
*/
|
||||
|
||||
$form = new FormValidator('customfooter_form');
|
||||
|
||||
$plugininstance = CustomFooterPlugin::create();
|
||||
|
||||
$config = api_get_settings_params(
|
||||
['subkey = ? ' => 'customfooter', ' AND category = ? ' => 'Plugins']
|
||||
);
|
||||
$form_settings = [];
|
||||
|
||||
foreach ($config as $fooid => $configrecord) {
|
||||
$canonic = preg_replace('/^customfooter_/', '', $configrecord['variable']);
|
||||
if (in_array($canonic, ['footer_left', 'footer_right'])) {
|
||||
$form_settings[$canonic] = $configrecord['selected_value'];
|
||||
}
|
||||
}
|
||||
|
||||
// A simple select.
|
||||
$form->addElement('text', 'footer_left', $plugininstance->get_lang('footerleft'));
|
||||
$form->addElement('text', 'footer_right', $plugininstance->get_lang('footerright'));
|
||||
$form->addButtonSave($plugininstance->get_lang('Save'));
|
||||
$form->setDefaults($form_settings);
|
||||
|
||||
$plugin_info['settings_form'] = $form;
|
||||
Reference in New Issue
Block a user