From 6f18a6399b905fa79468175130d22069140786de Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 22 May 2017 13:48:13 +0200 Subject: [PATCH] Minor - format code --- main/admin/user_import.php | 9 +++++---- main/inc/lib/events_dispatcher.class.php | 4 ++-- .../inc/lib/search/xapian/XapianIndexer.class.php | 15 +++++++++------ plugin/buycourses/src/service_information.php | 2 +- plugin/buycourses/src/service_process.php | 2 +- plugin/buycourses/src/service_success.php | 2 -- plugin/buycourses/src/session_catalog.php | 2 +- plugin/buycourses/src/session_panel.php | 2 +- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/main/admin/user_import.php b/main/admin/user_import.php index 475f68ced9..92cb36d9e3 100644 --- a/main/admin/user_import.php +++ b/main/admin/user_import.php @@ -1,4 +1,4 @@ - 0) { } } ?> -

:

-
+

:

+
 LastName;FirstName;Email;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate; 0) echo implode(';', $list).';'; ?>Courses;ClassId;
 xxx;xxx;xxx;xxx;xxx;;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00; 0) echo implode(';', $list_reponse).';'; ?>xxx1|xxx2|xxx3;1;
diff --git a/main/inc/lib/events_dispatcher.class.php b/main/inc/lib/events_dispatcher.class.php index 27fec8e5c6..1582f5b058 100755 --- a/main/inc/lib/events_dispatcher.class.php +++ b/main/inc/lib/events_dispatcher.class.php @@ -23,8 +23,8 @@ class EventsDispatcher foreach ($event_config[$event_name]["actions"] as $func) { $execute = true; - if (!function_exists($func)) // if the function doesn't exist, we log - { + // if the function doesn't exist, we log + if (!function_exists($func)) { error_log("EventsDispatcher warning : ".$func." does not exist."); $execute = false; } diff --git a/main/inc/lib/search/xapian/XapianIndexer.class.php b/main/inc/lib/search/xapian/XapianIndexer.class.php index cd6608a841..5fd67a927b 100755 --- a/main/inc/lib/search/xapian/XapianIndexer.class.php +++ b/main/inc/lib/search/xapian/XapianIndexer.class.php @@ -15,7 +15,6 @@ require_once __DIR__.'/../IndexableChunk.class.php'; abstract class XapianIndexer { /* XapianWritableDatabase */ - protected $db; /* IndexableChunk[] */ protected $chunks; @@ -27,7 +26,7 @@ abstract class XapianIndexer /** * Class contructor */ - function __construct() + public function __construct() { $this->db = null; $this->stemmer = null; @@ -70,13 +69,16 @@ abstract class XapianIndexer */ function connectDb($path = null, $dbMode = null, $lang = 'english') { - if ($this->db != null) + if ($this->db != null) { return $this->db; - if ($dbMode == null) + } + if ($dbMode == null) { $dbMode = Xapian::DB_CREATE_OR_OPEN; + } - if ($path == null) + if ($path == null) { $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/'; + } try { $this->db = new XapianWritableDatabase($path, $dbMode); @@ -203,7 +205,8 @@ abstract class XapianIndexer * * @param int $did Xapian::docid * @param array $terms New terms of the document - * @param string $prefix Prefix used to categorize the doc (usually 'T' for title, 'A' for author) + * @param string $prefix Prefix used to categorize the doc + * (usually 'T' for title, 'A' for author) * @return boolean false on error */ function update_terms($did, $terms, $prefix) diff --git a/plugin/buycourses/src/service_information.php b/plugin/buycourses/src/service_information.php index 996a730343..220028bb7e 100644 --- a/plugin/buycourses/src/service_information.php +++ b/plugin/buycourses/src/service_information.php @@ -36,4 +36,4 @@ $template->assign('essence', Essence\Essence::instance()); $content = $template->fetch('buycourses/view/service_information.tpl'); $template->assign('content', $content); -$template->display_one_col_template(); \ No newline at end of file +$template->display_one_col_template(); diff --git a/plugin/buycourses/src/service_process.php b/plugin/buycourses/src/service_process.php index ae37f17aaa..48a2434e9d 100644 --- a/plugin/buycourses/src/service_process.php +++ b/plugin/buycourses/src/service_process.php @@ -152,7 +152,7 @@ if ($typeUser) { // Now get all the courses lp's $thisLpList = $em->getRepository('ChamiloCourseBundle:CLp')->findBy(['cId' => $course->getCourse()->getId()]); foreach ($thisLpList as $lp) { - $courseLpList[$lp->getCId()] = $lp->getName().' ('.$course->getCourse()->getTitle().')'; ; + $courseLpList[$lp->getCId()] = $lp->getName().' ('.$course->getCourse()->getTitle().')'; } } diff --git a/plugin/buycourses/src/service_success.php b/plugin/buycourses/src/service_success.php index febd48225b..914bf9c300 100644 --- a/plugin/buycourses/src/service_success.php +++ b/plugin/buycourses/src/service_success.php @@ -157,9 +157,7 @@ if ($form->validate()) { } unset($_SESSION['bc_service_sale_id']); - header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); - exit; } diff --git a/plugin/buycourses/src/session_catalog.php b/plugin/buycourses/src/session_catalog.php index d2522a29a8..155306fa9d 100644 --- a/plugin/buycourses/src/session_catalog.php +++ b/plugin/buycourses/src/session_catalog.php @@ -57,7 +57,7 @@ $form->addButtonFilter(get_lang('Search')); $sessionList = $plugin->getCatalogSessionList($nameFilter, $minFilter, $maxFilter); -//View +// View if (api_is_platform_admin()) { $interbreadcrumb[] = [ 'url' => 'configuration.php', diff --git a/plugin/buycourses/src/session_panel.php b/plugin/buycourses/src/session_panel.php index b471206c62..eb7853c498 100644 --- a/plugin/buycourses/src/session_panel.php +++ b/plugin/buycourses/src/session_panel.php @@ -62,4 +62,4 @@ $tpl->assign( ); $tpl->assign('header', $templateName); $tpl->assign('content', $content); -$tpl->display_one_col_template(); \ No newline at end of file +$tpl->display_one_col_template();