From c382eb331d9a4eb44f4854637aca83a743bfe610 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 16 Nov 2017 10:36:39 +0100 Subject: [PATCH] Minor - format code - Add @deprecated for unused functions, - Change function name --- index.php | 2 +- main/inc/lib/events.lib.php | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/index.php b/index.php index 0103a8818b..9a0e8eb6c1 100755 --- a/index.php +++ b/index.php @@ -85,7 +85,7 @@ if (!empty($_POST['submitAuth'])) { } } else { // Only if login form was not sent because if the form is sent the user was already on the page. - Event::event_open(); + Event::open(); } if (api_get_setting('display_categories_on_homepage') === 'true') { $controller->tpl->assign('course_category_block', $controller->return_courses_in_categories()); diff --git a/main/inc/lib/events.lib.php b/main/inc/lib/events.lib.php index 1fefdc5997..a263f67280 100644 --- a/main/inc/lib/events.lib.php +++ b/main/inc/lib/events.lib.php @@ -17,7 +17,7 @@ class Event * @author Sebastien Piraux * @desc Record information for open event (when homepage is opened) */ - public static function event_open() + public static function open() { global $_configuration; global $TABLETRACK_OPEN; @@ -1091,19 +1091,20 @@ class Event } $sql = "DELETE FROM $lp_view_table - WHERE - c_id = $course_id AND - user_id = $user_id AND - lp_id= $lp_id AND - session_id = $session_id + WHERE + c_id = $course_id AND + user_id = $user_id AND + lp_id= $lp_id AND + session_id = $session_id "; Database::query($sql); $sql = "SELECT exe_id FROM $track_e_exercises - WHERE exe_user_id = $user_id AND - session_id = $session_id AND - c_id = $course_id AND - orig_lp_id = $lp_id"; + WHERE + exe_user_id = $user_id AND + session_id = $session_id AND + c_id = $course_id AND + orig_lp_id = $lp_id"; $result = Database::query($sql); $exe_list = array(); while ($row = Database::fetch_array($result, 'ASSOC')) { @@ -2216,6 +2217,7 @@ class Event * It's called by EventsDispatcher and fires the good function * with the good require_once. * + * @deprecated * @param string $event_name * @param array $params */ @@ -2261,7 +2263,8 @@ class Event /** * Basic template event message filter (to be used by other filters as default) - * @param array $values (passing by reference) + * @deprecated + * @param array $values (passing by reference) * * @return boolean True if everything is OK, false otherwise */ public function event_send_mail_filter_func(&$values) @@ -2271,6 +2274,7 @@ class Event /** * user_registration - send_mail filter + * @deprecated * @param array $values (passing by reference) * @return boolean True if everything is OK, false otherwise */ @@ -2283,6 +2287,7 @@ class Event /** * portal_homepage_edited - send_mail filter + * @deprecated * @param array $values (passing by reference) * @return boolean True if everything is OK, false otherwise */