From 59a0c53c3889f9580b6026f8613088c1b428e04c Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 19 Oct 2017 11:45:59 -0500 Subject: [PATCH] Minor - Update redirection plugin documentation and translations - refs #2200 --- plugin/redirection/README.md | 17 ++++++++++++----- plugin/redirection/RedirectionPlugin.php | 12 +++++++++++- plugin/redirection/admin.php | 2 +- plugin/redirection/lang/english.php | 4 ++-- plugin/redirection/lang/french.php | 2 ++ 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/plugin/redirection/README.md b/plugin/redirection/README.md index 78dc0bf76d..77478624f7 100644 --- a/plugin/redirection/README.md +++ b/plugin/redirection/README.md @@ -1,8 +1,15 @@ -# chamilo-plugin-redirection -Plugin chamilo para la redirección de usuarios. +Redirection plugin +=== -Requiere agregar: +Chamilo plugin for the redirection of specific users after they login. - +Requires the addition of the following in configuration.php: + +``` $_configuration['plugin_redirection_enabled'] = true; - \ No newline at end of file +``` + +This setting is defined in configuration.php rather than in settings_current to reduce the +load, as it is used on every login. + +@TODO Check the load difference for *just* checking it in settings_current rather than building the plugin object \ No newline at end of file diff --git a/plugin/redirection/RedirectionPlugin.php b/plugin/redirection/RedirectionPlugin.php index 55985559d7..a4c6c7fafe 100644 --- a/plugin/redirection/RedirectionPlugin.php +++ b/plugin/redirection/RedirectionPlugin.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ /** - * Config the plugin + * Redirection plugin. Allows the configuration of redirection of specific users right after they login * @author Enrique Alcaraz Lopez * @package chamilo.plugin.redirection */ @@ -31,6 +31,7 @@ class RedirectionPlugin extends Plugin } /** + * Inser a new redirection (and delete the previous one for this user, if any) * @param int $userId * @param string $url * @return false|string @@ -62,6 +63,7 @@ class RedirectionPlugin extends Plugin } /** + * Get the current redirection for a given user (if any) * @param $userId * @return array * @throws \Doctrine\DBAL\DBALException @@ -79,6 +81,7 @@ class RedirectionPlugin extends Plugin } /** + * Deletes an existing redirection * @param int $id */ public static function delete($id) @@ -91,6 +94,7 @@ class RedirectionPlugin extends Plugin } /** + * Get all current redirection records * @return array */ public static function getAll() @@ -100,6 +104,9 @@ class RedirectionPlugin extends Plugin return Database::select('*', $table); } + /** + * Install the required DB structure to store the plugin data + */ public static function install() { $table = Database::get_main_table('plugin_redirection'); @@ -113,6 +120,9 @@ class RedirectionPlugin extends Plugin Database::query($sql); } + /** + * Uninstall the plugin, cleaning up the database structure created on install + */ public static function uninstall() { $table = Database::get_main_table('plugin_redirection'); diff --git a/plugin/redirection/admin.php b/plugin/redirection/admin.php index 4c3fd6f23f..e7970fe86a 100644 --- a/plugin/redirection/admin.php +++ b/plugin/redirection/admin.php @@ -2,7 +2,7 @@ /* For licensing terms, see /license.txt */ /** - * Config the plugin + * Admin interface for the plugin configuration * @author Enrique Alcaraz Lopez * @package chamilo.plugin.redirection */ diff --git a/plugin/redirection/lang/english.php b/plugin/redirection/lang/english.php index dcaea29143..982a00208d 100644 --- a/plugin/redirection/lang/english.php +++ b/plugin/redirection/lang/english.php @@ -1,5 +1,5 @@