Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent b0ff7b7923
commit 6f18a6399b
  1. 5
      main/admin/user_import.php
  2. 4
      main/inc/lib/events_dispatcher.class.php
  3. 15
      main/inc/lib/search/xapian/XapianIndexer.class.php
  4. 2
      plugin/buycourses/src/service_process.php
  5. 2
      plugin/buycourses/src/service_success.php

@ -1,4 +1,4 @@
<?php *<?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This tool allows platform admins to add users by uploading a CSV or XML file * This tool allows platform admins to add users by uploading a CSV or XML file
@ -171,7 +171,8 @@ function complete_missing_data($user)
* Save the imported data * Save the imported data
* @param array $users List of users * @param array $users List of users
* @return void * @return void
* @uses global variable $inserted_in_course, which returns the list of courses the user was inserted in * @uses global variable $inserted_in_course, which returns the list of
* courses the user was inserted in
*/ */
function save_data($users) function save_data($users)
{ {

@ -23,8 +23,8 @@ class EventsDispatcher
foreach ($event_config[$event_name]["actions"] as $func) { foreach ($event_config[$event_name]["actions"] as $func) {
$execute = true; $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."); error_log("EventsDispatcher warning : ".$func." does not exist.");
$execute = false; $execute = false;
} }

@ -15,7 +15,6 @@ require_once __DIR__.'/../IndexableChunk.class.php';
abstract class XapianIndexer abstract class XapianIndexer
{ {
/* XapianWritableDatabase */ /* XapianWritableDatabase */
protected $db; protected $db;
/* IndexableChunk[] */ /* IndexableChunk[] */
protected $chunks; protected $chunks;
@ -27,7 +26,7 @@ abstract class XapianIndexer
/** /**
* Class contructor * Class contructor
*/ */
function __construct() public function __construct()
{ {
$this->db = null; $this->db = null;
$this->stemmer = null; $this->stemmer = null;
@ -70,13 +69,16 @@ abstract class XapianIndexer
*/ */
function connectDb($path = null, $dbMode = null, $lang = 'english') function connectDb($path = null, $dbMode = null, $lang = 'english')
{ {
if ($this->db != null) if ($this->db != null) {
return $this->db; return $this->db;
if ($dbMode == null) }
if ($dbMode == null) {
$dbMode = Xapian::DB_CREATE_OR_OPEN; $dbMode = Xapian::DB_CREATE_OR_OPEN;
}
if ($path == null) if ($path == null) {
$path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/'; $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/';
}
try { try {
$this->db = new XapianWritableDatabase($path, $dbMode); $this->db = new XapianWritableDatabase($path, $dbMode);
@ -203,7 +205,8 @@ abstract class XapianIndexer
* *
* @param int $did Xapian::docid * @param int $did Xapian::docid
* @param array $terms New terms of the document * @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 * @return boolean false on error
*/ */
function update_terms($did, $terms, $prefix) function update_terms($did, $terms, $prefix)

@ -152,7 +152,7 @@ if ($typeUser) {
// Now get all the courses lp's // Now get all the courses lp's
$thisLpList = $em->getRepository('ChamiloCourseBundle:CLp')->findBy(['cId' => $course->getCourse()->getId()]); $thisLpList = $em->getRepository('ChamiloCourseBundle:CLp')->findBy(['cId' => $course->getCourse()->getId()]);
foreach ($thisLpList as $lp) { foreach ($thisLpList as $lp) {
$courseLpList[$lp->getCId()] = $lp->getName().' ('.$course->getCourse()->getTitle().')'; ; $courseLpList[$lp->getCId()] = $lp->getName().' ('.$course->getCourse()->getTitle().')';
} }
} }

@ -157,9 +157,7 @@ if ($form->validate()) {
} }
unset($_SESSION['bc_service_sale_id']); unset($_SESSION['bc_service_sale_id']);
header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php'); header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
exit; exit;
} }

Loading…
Cancel
Save