This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
/**
* Reduction factor for small font.
*/
-define('K_SMALL_RATIO', 2/3);
+define('K_SMALL_RATIO', 2 / 3);
/**
* Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
use Galette\Repository\Members;
use Galette\Filters\MembersList;
-$app->group('/ajax', function() use ($authenticate) {
+$app->group('/ajax', function () use ($authenticate) {
$this->get(
'/messages',
- function($request, $response) {
+ function ($request, $response) {
$this->view->render(
$response,
'ajax_messages.tpl'
$this->post(
'photo',
- function($request, $response) {
+ function ($request, $response) {
$post = $request->getParsedBody();
$ret = ['result' => false];
$this->post(
'/suggest/towns',
- function($request, $response) {
+ function ($request, $response) {
$post = $request->getParsedBody();
$ret = [];
$this->post(
'/suggest/countries',
- function($request, $response) {
+ function ($request, $response) {
$post = $request->getParsedBody();
$ret = [];
$this->get(
'/telemetry/infos',
- function($request, $response) {
+ function ($request, $response) {
$telemetry = new \Galette\Util\Telemetry(
$this->zdb,
$this->preferences,
$this->post(
'/telemetry/send',
- function($request, $response) {
+ function ($request, $response) {
$telemetry = new \Galette\Util\Telemetry(
$this->zdb,
$this->preferences,
$this->get(
'/telemetry/registered',
- function($request, $response) {
+ function ($request, $response) {
$this->preferences->pref_registration_date = date('Y-m-d H:i:s');
$this->preferences->store();
return $response->withJson(['message' => _T('Thank you for registering!')]);
$this->post(
'/contribution/dates',
- function($request, $response) {
+ function ($request, $response) {
$post = $request->getParsedBody();
$contrib = new Contribution(
$this->post(
'/contribution/members[/{page:\d+}[/{search}]]',
- function($request, $response, $args) {
+ function ($request, $response, $args) {
$post = $request->getParsedBody();
$filters = new MembersList();
if (isset($post['page'])) {
$this->post(
'/password/strength',
- function($request, $response) {
+ function ($request, $response) {
//post params may be passed from security tab test password
$post = $request->getParsedBody();
$app->get(
'/texts[/{lang}/{ref}]',
- function($request, $response, $args) {
+ function ($request, $response, $args) {
if (!isset($args['lang'])) {
$args['lang'] = $this->preferences->pref_lang;
}
$app->post(
'/texts/change',
- function($request, $response) {
+ function ($request, $response) {
$post = $request->getParsedBody();
return $response
->withStatus(301)
$app->post(
'/texts',
- function($request, $response) {
+ function ($request, $response) {
$post = $request->getParsedBody();
$texts = new Texts($this->preferences, $this->router);
$app->group(
'/plugins',
- function() use ($authenticate, $app) {
+ function () use ($authenticate, $app) {
$container = $this->getContainer();
$modules = $container->plugins->getModules();
//Global route to access plugin resources (CSS, JS, images, ...)
$this->get(
'/{plugin}/res/{path:.*}',
- function($request, $response, $args) {
+ function ($request, $response, $args) {
$plugin = $args['plugin'];
$path = $args['path'];
$ext = pathinfo($args['path'])['extension'];
//Declare configured routes for each plugin
foreach ($modules as $module_id => $module) {
- $container['Plugin ' . $module['name']] = function($c) use ($module_id) {
+ $container['Plugin ' . $module['name']] = function ($c) use ($module_id) {
return $module_id;
};
$this->group(
'/' . $module['route'],
- function() use ($module, $module_id, $authenticate) {
+ function () use ($module, $module_id, $authenticate) {
//Plugin home: give information
$this->get(
'',
- function($request, $response) use ($module) {
+ function ($request, $response) use ($module) {
$params = [
'page_title' => $module['name'],
'name' => $module['name'],
use Galette\Repository\Members;
use Galette\Filters\MembersList;
-$showPublicPages = function($request, $response, $next) use ($container) {
+$showPublicPages = function ($request, $response, $next) use ($container) {
$login = $container->login;
$preferences = $container->preferences;
return $next($request, $response);
};
-$app->group('/public', function() {
+$app->group('/public', function () {
//public members list
$this->get(
'/{type:list|trombi}[/{option:page|order}/{value:\d+}]',
$this->get(
'/members[/{option:page|order}/{value:\d+}]',
- function($request, $response, $args = []) {
+ function ($request, $response, $args = []) {
$args['type'] = 'list';
return $response
->withStatus(301)
$this->get(
'/trombinoscope',
- function($request, $response, $args = []) {
+ function ($request, $response, $args = []) {
$args['type'] = 'trombi';
return $response
->withStatus(301)
}
$path = ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
- . $className
- . $this->fileExtension;
+ . $className
+ . $this->fileExtension;
if (file_exists($path)) {
require $path;
$csv = new CsvIn($this->zdb);
/** FIXME:
- * - set fields that should not be part of import
- */
+ * - set fields that should not be part of import
+ */
$fields = $model->getFields();
$defaults = $csv->getDefaultFields();
$defaults_loaded = false;
$trans = array();
/**
- * FIXME : it would be faster to get all translations at once
- * for a specific string
- */
+ * FIXME : it would be faster to get all translations at once
+ * for a specific string
+ */
foreach ($this->i18n->getList() as $l) {
$text_trans = \getDynamicTranslation($text_orig, $l->getLongID());
$lang_name = $l->getName();
$warning_detected = array_merge($warning_detected, $this->preferences->checkCardsSizes());
// picture upload
- if (GALETTE_MODE !== 'DEMO' && isset($_FILES['logo'])) {
+ if (GALETTE_MODE !== 'DEMO' && isset($_FILES['logo'])) {
if ($_FILES['logo']['error'] === UPLOAD_ERR_OK) {
if ($_FILES['logo']['tmp_name'] != '') {
if (is_uploaded_file($_FILES['logo']['tmp_name'])) {
$filters->filter_account = Members::ACTIVE_ACCOUNT;
$membership = ($args['membership'] === 'nearly' ?
- Members::MEMBERSHIP_NEARLY :
- Members::MEMBERSHIP_LATE);
+ Members::MEMBERSHIP_NEARLY : Members::MEMBERSHIP_LATE);
$filters->membership_filter = $membership;
//TODO: filter on reminder may take care of parent email as well
$mail = ($args['mail'] === 'withmail' ?
- Members::FILTER_W_EMAIL :
- Members::FILTER_WO_EMAIL);
+ Members::FILTER_W_EMAIL : Members::FILTER_WO_EMAIL);
$filters->email_filter = $mail;
$this->session->filter_members = $filters;
{
$locale = ($locale ?: $this->getLocale());
- if (! isset($this->messages[$textDomain][$locale])) {
+ if (!isset($this->messages[$textDomain][$locale])) {
$this->loadMessages($textDomain, $locale);
}
} else {
Analog::log(
'Unable to delete group ' . $this->group_name .
- ' (' . $this->id . ') |' . $e->getMessage(),
+ ' (' . $this->id . ') |' . $e->getMessage(),
Analog::ERROR
);
}
Analog::log(
'An error occurred trying to attach member `' .
$m->sname . '` to group `' . $this->group_name .
- '` (' . $this->id . ').',
+ '` (' . $this->id . ').',
Analog::ERROR
);
throw new \Exception(
Analog::log(
'An error occurred trying to attach manager `' .
$m->sname . '` to group `' . $this->group_name .
- '` (' . $this->id . ').',
+ '` (' . $this->id . ').',
Analog::ERROR
);
throw new \Exception(
}
/**
- * Delete a translation stored in the database
- *
- * @param string $text_orig Text to translate
- *
- * @return boolean
- */
+ * Delete a translation stored in the database
+ *
+ * @param string $text_orig Text to translate
+ *
+ * @return boolean
+ */
protected function deleteTranslation($text_orig)
{
try {
$logo = new Core\Logo();
$logo_elt = '<img' .
- ' src="' . $preferences->getURL() . $router->pathFor('logo') . '"' .
- ' width="' . $logo->getOptimalWidth() . '"' .
+ ' src="' . $preferences->getURL() . $router->pathFor('logo') . '"' .
+ ' width="' . $logo->getOptimalWidth() . '"' .
' height="' . $logo->getOptimalHeight() . '"' .
'/>';
private $sum;
- /**
+ /**
* Default constructor
*
* @param Db $zdb Database
return true;
} else {
Analog::log(
- 'Trying to order by ' . $field_name . ' while it is not in ' .
+ 'Trying to order by ' . $field_name . ' while it is not in ' .
'selected fields.',
Analog::WARNING
);
private $count = null;
- /**
+ /**
* Default constructor
*
* @param Db $zdb Database
$this->plugins = $plugins;
}
- /**
- * Grab telemetry information
- *
- * @return array
- */
+ /**
+ * Grab telemetry information
+ *
+ * @return array
+ */
public function getTelemetryInfos()
{
$data = [
return $data;
}
- /**
- * Grab Galette part information
- *
- * @return array
- */
+ /**
+ * Grab Galette part information
+ *
+ * @return array
+ */
public function grabGaletteInfos()
{
$galette = [
return '5000+';
}
- /**
+ /**
* Send telemetry information
*
* @return boolean
return $this->getUuid('instance');
}
- /**
+ /**
* Get registration UUID
*
* @return string
return $this->getRegistrationDate() != false;
}
- /**
- * Get a random string
- *
- * @param integer $length of the random string
- *
- * @return string
- *
- * @see https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425
- */
+ /**
+ * Get a random string
+ *
+ * @param integer $length of the random string
+ *
+ * @return string
+ *
+ * @see https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425
+ */
private function getRandomString($length)
{
$keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';