Introduce new pre-commit hooks and code cleaning

This commit is contained in:
Benjamin Renard 2024-01-23 19:23:10 +01:00
parent e34682de4b
commit 3abd2a328b
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC
50 changed files with 776 additions and 774 deletions

6
.codespell-exclusions Normal file
View file

@ -0,0 +1,6 @@
.git
./static/lib
./vendor
./example/data
./locales/*.js
*.pot

View file

@ -1,9 +1,33 @@
# Pre-commit hooks to run tests and ensure code is cleaned.
# See https://pre-commit.com for more information
---
repos:
- repo: https://github.com/digitalpulp/pre-commit-php.git
rev: 1.4.0
hooks:
- id: php-stan
files: \.(php)$
args: ['--configuration=phpstan.neon']
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
exclude: static/lib/|locales/.*\.js$|\.pot$
args: ["--write-changes"]
exclude_types: [csv, json]
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
ignore: .github/
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
- repo: https://github.com/digitalpulp/pre-commit-php.git
rev: 1.4.0
hooks:
- id: php-stan
files: \.(php)$
args: ["--configuration=phpstan.neon"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
exclude: (.vscode|.devcontainer)

3
.prettierignore Normal file
View file

@ -0,0 +1,3 @@
/static/lib/*
/locales/*
/example/locales/*

9
.yamllint.yaml Normal file
View file

@ -0,0 +1,9 @@
extends: default
ignore: |
static/lib/*
rules:
line-length:
max: 100
level: warning

View file

@ -10,20 +10,20 @@ This project aim to provide all main necessary elements to build a web applicati
Main features are :
* a configuration manager actually based on the [yaml](https://yaml.org/) file format
* an URL routing system with a syntax based on regex
* a templating solution based on [Smarty](https://www.smarty.net/)
* an easily expandable authentication system with native HTML form, HTTP and CAS SSO support (based on [phpCAS](https://github.com/apereo/phpCAS)), database and LDAP users backends and a ligth user object abstraction solution with expandable attributes
* a logging system with PHP errors & exceptions handling
* a light database integration based on [FluentPDO](https://github.com/envms/fluentpdo)
* a [Sentry](https://sentry.io) integration
* a PHP session manager (with expiration and max life handling)
* a mailer solution to forge and send emails
* an hook system to easily trigger and register hooks on events
* a static files serving system with an overloadable multiple directories support
* an internationalization system based on [Gettext](https://www.gnu.org/software/gettext/) with Smarty templates (based on [Smarty Gettext](https://github.com/smarty-gettext/smarty-gettext)) and Javascript (based on [Babel JS](https://babeljs.io/)) integrations
* a command line manager to easily implement CLI tools
* collection of helpers to check, clean, cast, format (etc) values
- a configuration manager actually based on the [yaml](https://yaml.org/) file format
- an URL routing system with a syntax based on regex
- a templating solution based on [Smarty](https://www.smarty.net/)
- an easily expandable authentication system with native HTML form, HTTP and CAS SSO support (based on [phpCAS](https://github.com/apereo/phpCAS)), database and LDAP users backends and a light user object abstraction solution with expandable attributes
- a logging system with PHP errors & exceptions handling
- a light database integration based on [FluentPDO](https://github.com/envms/fluentpdo)
- a [Sentry](https://sentry.io) integration
- a PHP session manager (with expiration and max life handling)
- a mailer solution to forge and send emails
- an hook system to easily trigger and register hooks on events
- a static files serving system with an overloadable multiple directories support
- an internationalization system based on [Gettext](https://www.gnu.org/software/gettext/) with Smarty templates (based on [Smarty Gettext](https://github.com/smarty-gettext/smarty-gettext)) and Javascript (based on [Babel JS](https://babeljs.io/)) integrations
- a command line manager to easily implement CLI tools
- collection of helpers to check, clean, cast, format (etc) values
All this features can be or not enabled and their initialization are manage by an application abstraction class.
@ -43,9 +43,9 @@ as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

View file

@ -1,39 +1,39 @@
{
"name": "brenard/eesyphp",
"description": "Easyphp PHP framework for simple web apps",
"authors": [
{
"name": "Benjamin Renard",
"email": "brenard@easter-eggs.com"
}
],
"license": "GPL-3.0-or-later",
"autoload": {
"psr-4": {
"EesyPHP\\": "src/"
},
"files": [
"src/functions.php"
]
"name": "brenard/eesyphp",
"description": "Easyphp PHP framework for simple web apps",
"authors": [
{
"name": "Benjamin Renard",
"email": "brenard@easter-eggs.com"
}
],
"license": "GPL-3.0-or-later",
"autoload": {
"psr-4": {
"EesyPHP\\": "src/"
},
"require": {
"envms/fluentpdo": "^2.2",
"pear/console_table": "^1.3",
"brenard/php-unidecode": "dev-master",
"smarty/smarty": "^4.3.0",
"smarty-gettext/smarty-gettext": "^1.6",
"sepia/po-parser": "^6.0",
"sentry/sdk": "^3.3",
"ext-pdo": ">=7.3",
"ext-json": "*",
"ext-yaml": "^2.0",
"league/mime-type-detection": "^1.11",
"apereo/phpcas": "^1.6"
},
"require-dev": {
"phpstan/phpstan": "^1.9"
},
"bin": [
"eesyphp"
"files": [
"src/functions.php"
]
},
"require": {
"envms/fluentpdo": "^2.2",
"pear/console_table": "^1.3",
"brenard/php-unidecode": "dev-master",
"smarty/smarty": "^4.3.0",
"smarty-gettext/smarty-gettext": "^1.6",
"sepia/po-parser": "^6.0",
"sentry/sdk": "^3.3",
"ext-pdo": ">=7.3",
"ext-json": "*",
"ext-yaml": "^2.0",
"league/mime-type-detection": "^1.11",
"apereo/phpcas": "^1.6"
},
"require-dev": {
"phpstan/phpstan": "^1.9"
},
"bin": [
"eesyphp"
]
}

View file

@ -1,6 +1,6 @@
# Configuration
The main configuration file is *includes/config.inc.php*. You can overrides all variables that main configuration file contain in your own configuration file *includes/config.local.php*. This file will be automatically included if present.
The main configuration file is _includes/config.inc.php_. You can overrides all variables that main configuration file contain in your own configuration file _includes/config.local.php_. This file will be automatically included if present.
> **Note :** In the configuration files, to refer to the application root directory, you could use the variable `$root_dir_path` (that does not contain the trailing slash).
@ -11,44 +11,47 @@ The main configuration file is *includes/config.inc.php*. You can overrides all
## Data/files directories :
All application data are, by default, in _data_ sub-directory. You could configure it by using the following variables :
- `$data_dir` : Root DATA directory (Default : _data_)
- `$tmp_root_dir` : Root temporary files directory (Default : _$data_dir/tmp_)
- `$logs_dir_path` : Logs directory (Default : _$data_dir/logs_)
- `$upload_tmp_dir` : Temporary directory for PHP uploading files : when uploading files, PHP will stored files in this directory before application move it to their final destination (Default : _$data_dir/uploading_)
- `$smarty_templates_c_dir` : Templates cache directory (Default : _$tmp_root_dir/templates_c_)
- `$data_dir` : Root DATA directory (Default : _data_)
- `$tmp_root_dir` : Root temporary files directory (Default : _$data_dir/tmp_)
- `$logs_dir_path` : Logs directory (Default : _$data_dir/logs_)
- `$upload_tmp_dir` : Temporary directory for PHP uploading files : when uploading files, PHP will stored files in this directory before application move it to their final destination (Default : _$data_dir/uploading_)
- `$smarty_templates_c_dir` : Templates cache directory (Default : _$tmp_root_dir/templates_c_)
## Logs :
Default log files path is *data/logs/app.log* (and *data/logs/cli.log* for CLI tool). This could be configured using `$log_file` configuration variable. You can also set the log level using `$log_level` variable *(default value = "INFO", see config.inc.php).*
Default log files path is _data/logs/app.log_ (and _data/logs/cli.log_ for CLI tool). This could be configured using `$log_file` configuration variable. You can also set the log level using `$log_level` variable _(default value = "INFO", see config.inc.php)._
## Database configuration :
The database is used to store demo items information. For this reason, a basic *Sqlite* database could be used and is the default database backend. However, you can use any database backend supported by the [PHP PDO abstraction system](http://php.net/pdo).
The database is used to store demo items information. For this reason, a basic _Sqlite_ database could be used and is the default database backend. However, you can use any database backend supported by the [PHP PDO abstraction system](http://php.net/pdo).
The database connection is configured using the following variables :
- `$dn_dsn` : the *Data Source Name (DSN)* depending on your database backend.
- `$db_user` : the database username.
- `$db_pwd` : the database password.
- `$db_options` : the database connection options (see your PHP PDO Driver documentation). By default, this variable value is an empty array ("`array()`").
- `$db_date_format` : the date format as retreive from the database.
- `$db_datetime_format` : the date and time format as retreive from the database.
- `$dn_dsn` : the _Data Source Name (DSN)_ depending on your database backend.
- `$db_user` : the database username.
- `$db_pwd` : the database password.
- `$db_options` : the database connection options (see your PHP PDO Driver documentation). By default, this variable value is an empty array ("`array()`").
- `$db_date_format` : the date format as retrieve from the database.
- `$db_datetime_format` : the date and time format as retrieve from the database.
> **Note :** You could find some configuration examples for _PostgreSQL_, _MariaDB / MySQL_ or _Sqlite_ in _config.inc.php_ file. Initial _SQL_ files could also be found in _data_ directory.
## E-mail configuration :
This application send some mail by using [PEAR Mail library](http://pear.php.net/package/Mail). The path of this library must be specify using `$php_mail_path`. The default value corresponding to the version provided by *php-mail* Debian package.
This application send some mail by using [PEAR Mail library](http://pear.php.net/package/Mail). The path of this library must be specify using `$php_mail_path`. The default value corresponding to the version provided by _php-mail_ Debian package.
This library support different methods to send mail and the default one is *SMTP*. This method require that the [PEAR Net_SMTP library](http://pear.php.net/package/Net_SMTP) is also installed on the system. You could configure another method sending method using the variable `$mail_send_method` (see comment in *config.inc.php* file or [the PEAR Mail library documentation](http://pear.php.net/manual/en/package.mail.mail.factory.php)).
This library support different methods to send mail and the default one is _SMTP_. This method require that the [PEAR Net_SMTP library](http://pear.php.net/package/Net_SMTP) is also installed on the system. You could configure another method sending method using the variable `$mail_send_method` (see comment in _config.inc.php_ file or [the PEAR Mail library documentation](http://pear.php.net/manual/en/package.mail.mail.factory.php)).
Depending on the sending method choose, some options are available to configure their usage (see comment in *config.inc.php* file or [the PEAR Mail library documentation](http://pear.php.net/manual/en/package.mail.mail.factory.php)) and could be configured using `$mail_send_params` variable.
Depending on the sending method choose, some options are available to configure their usage (see comment in _config.inc.php_ file or [the PEAR Mail library documentation](http://pear.php.net/manual/en/package.mail.mail.factory.php)) and could be configured using `$mail_send_params` variable.
To forge e-mail, this application use [PEAR Mail_Mime library](http://pear.php.net/package/Mail_Mime). The path of this library must be specify using `$php_mail_mime_path`. The default value corresponding to the version provided by *php-mail-mime* Debian package.
To forge e-mail, this application use [PEAR Mail_Mime library](http://pear.php.net/package/Mail_Mime). The path of this library must be specify using `$php_mail_mime_path`. The default value corresponding to the version provided by _php-mail-mime_ Debian package.
Some other variables exist to manage the email sending by the application :
- `$mail_headers` : an PHP array of default headers add to mail sent by the application
- `$mail_sender` : the email address of the sender of all emails sent by the application
- `$mail_catch_all` : for debugging purpose, you can using this variable to specify an email address that will received all email sent by the application in place of the original recipient
- `$mail_headers` : an PHP array of default headers add to mail sent by the application
- `$mail_sender` : the email address of the sender of all emails sent by the application
- `$mail_catch_all` : for debugging purpose, you can using this variable to specify an email address that will received all email sent by the application in place of the original recipient
## Web stats JS code inclusion

View file

@ -22,7 +22,7 @@ apt install php-ldap php-net-ldap2
## Deployment :
To deploy this application, for instance in */var/www/eesyphp*, run this commands :
To deploy this application, for instance in _/var/www/eesyphp_, run this commands :
```bash
cd /var/www
@ -77,9 +77,9 @@ sudo mysql items < /var/www/eesyphp/data/mariadb-mysql.init-db.sql
## Configure PHP FPM pool :
You could configure a dedicated *PHP FPM pool*.
You could configure a dedicated _PHP FPM pool_.
***Example :***
**_Example :_**
```
[eesyphp]
@ -104,9 +104,9 @@ php_value[date.timezone] = Europe/Paris
## Configure Apache VirtualHost :
You could configure a dedicated *VirtualHost*.
You could configure a dedicated _VirtualHost_.
***Example :***
**_Example :_**
```
<VirtualHost *:80>

View file

@ -172,7 +172,7 @@ function cli_delete($command_args) {
echo "\n";
if (!delete_item($item['id']))
Log :: fatal(_("An error occured deleting item #%d."), $item_id);
Log :: fatal(_("An error occurred deleting item #%d."), $item_id);
return True;
}

View file

@ -34,7 +34,7 @@ log:
file_path: "${log.directory_path}/app.log"
# Log level (TRACE / DEBUG / INFO / WARNING / ERROR / FATAL)
level: 'INFO'
level: "INFO"
# Log PHP errors levels (as specified to set_error_handler())
# Note: expected a list of PHP error level constants that will be resolved and combine
@ -51,7 +51,6 @@ log:
# - ~E_STRICT
# - ~E_DEPRECATED
#
# Sentry configuration
#
@ -70,7 +69,6 @@ sentry:
- "E_RECOVERABLE_ERROR"
- "E_DEPRECATED"
# Traces sample rate (between 0 and 1)
# Note: this parameter permit to determine how many transactions (=~ access) are traced and
# sent to Sentry, for instance, 0.2 meen that 20% of the transactions will be traced. In dev
@ -118,8 +116,8 @@ db:
options: null
# Date/Datetime format in database (strptime format)
date_format: '%s'
datetime_format: '%s'
date_format: "%s"
datetime_format: "%s"
# Postgresql
#dsn: "pgsql:host=localhost;port=5432;dbname=items"
@ -128,8 +126,8 @@ db:
#options: null
# Date/Datetime format in database (strptime format)
#date_format: '%Y-%m-%d' # Exemple : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Exemple : 2018-10-12 18:06:59
#date_format: '%Y-%m-%d' # Example : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Example : 2018-10-12 18:06:59
# MariaDB / MySQL
#dsn: "mysql:host=localhost;dbname=items"
@ -138,9 +136,8 @@ db:
#options: null
# Date/Datetime format in database (strptime format)
#date_format: '%Y-%m-%d' # Exemple : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Exemple : 2018-10-12 18:06:59
#date_format: '%Y-%m-%d' # Example : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Example : 2018-10-12 18:06:59
#
# Authentication
@ -185,18 +182,18 @@ auth:
#
http:
# HTTP Auth methods :
# * AUTHORIZATION : use HTTP_AUTHORIZATION environnement. This mode could be use with PHP FPM.
# * AUTHORIZATION : use HTTP_AUTHORIZATION environment. This mode could be use with PHP FPM.
# Specific configuration is need in Apache to use this mode :
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# * REMOTE_USER : use REMOTE_USER environnement variable to retreive authenticated user's login
# * REMOTE_USER : use REMOTE_USER environment variable to retrieve authenticated user's login
# This method could be only used with $http_auth_trust_without_password_challenge
# enabled.
# * PHP_AUTH : use PHP_AUTH_USER and PHP_AUTH_PW environnement variables (only available
# * PHP_AUTH : use PHP_AUTH_USER and PHP_AUTH_PW environment variables (only available
# using mod_php with Apache. (default)
method: 'PHP_AUTH'
method: "PHP_AUTH"
# Trust HTTP server authentication
# If enabled, the application will no check user credentials and only retreive user's login
# If enabled, the application will no check user credentials and only retrieve user's login
# from HTTP server.
#trust_without_password_challenge: true
@ -208,17 +205,17 @@ auth:
#
cas:
# CAS host (just the domain name)
host: 'idp.example.com'
host: "idp.example.com"
# CAS context (the root path, default: '/idp/cas')
# Example: for 'http://idp.example.com/idp/cas', put '/idp/cas'
context: '/idp/cas'
context: "/idp/cas"
# CAS HTTP port (default: 443)
#port: 443
# CAS procotol version
# Posssible values: "1.0", "2.0" (default), "3.0" or "S1" (SAML1)
# Possible values: "1.0", "2.0" (default), "3.0" or "S1" (SAML1)
#version: '2.0'
# CAS server SSL certificate validation (set to false to disable)
@ -233,8 +230,8 @@ auth:
# CAS Fake authenticated user
#fake_authenticated_user: 'myusername'
# CAS user attributes to retreive with their properties:
# CAS user attributes to retrieve with their properties:
# [attr name]:
# # CAS attribute name (optional, default: [attr name])
# cas_name: [CAS attr name]
@ -247,14 +244,14 @@ auth:
# Note: only used by casuser auth backend.
user_attributes:
login:
cas_name: 'uid'
cas_name: "uid"
default: null
name:
cas_name: 'displayName'
cas_ldap_name: 'cn'
cas_name: "displayName"
cas_ldap_name: "cn"
default: null
mail:
type: 'string'
type: "string"
#
# Database user backend
@ -275,7 +272,7 @@ auth:
# Password field name (optional, default: password)
password_field: "password"
# Exposed users table fields in resulting EesyPHP\Auth\User object
# (optional, defailt: name, mail)
# (optional, default: name, mail)
exposed_fields:
- "name"
- "mail"
@ -285,7 +282,7 @@ auth:
#
ldap:
# LDAP host (required, multiple hosts could be specified with comma separator)
host: 'ldap://localhost'
host: "ldap://localhost"
# LDAP port (optional)
#port: 389
@ -294,7 +291,7 @@ auth:
#starttls: false
# LDAP directory base DN (required)
basedn: 'o=example'
basedn: "o=example"
# LDAP bind DN (optional)
#bind_dn: 'uid=eesyphp,ou=sysaccounts,${auth.ldap.basedn}'
@ -307,12 +304,12 @@ auth:
#user_filter_by_uid: 'uid=[username]'
# User base DN
user_basedn: 'ou=people,${auth.ldap.basedn}'
user_basedn: "ou=people,${auth.ldap.basedn}"
# Bind with username instead of user DN (optional, default: false)
#bind_with_username: true
# LDAP user attributes to retreive with their properties:
# LDAP user attributes to retrieve with their properties:
# [attr name]:
# # LDAP attribute name (optional, default: [attr name])
# ldap_name: [LDAP attr name]
@ -326,16 +323,16 @@ auth:
# default: null
user_attributes:
login:
ldap_name: 'uid'
ldap_name: "uid"
multivalued: false
default: null
name:
ldap_name: 'displayName'
alt_ldap_name: 'cn'
ldap_name: "displayName"
alt_ldap_name: "cn"
multivalued: false
default: null
mail:
type: 'string'
type: "string"
# PEAR Net_LDAP2 library path (optional, default: Net/LDAP2.php)
#netldap2_path: 'Net/LDAP2.php'
@ -345,15 +342,14 @@ auth:
#
email:
# PHP PEAR Mail and Mail_Mine paths
php_mail_path: 'Mail.php'
php_mail_mime_path: 'Mail/mime.php'
php_mail_path: "Mail.php"
php_mail_mime_path: "Mail/mime.php"
# Sending method :
# - mail : use PHP mail function
# - sendmail : use sendmail system command
# - smtp : use an SMTP server (PHP PEAR Net_SMTP required)
send_method: 'smtp'
send_method: "smtp"
# Sending parameters
# See : http:#pear.php.net/manual/en/package.mail.mail.factory.php
@ -368,7 +364,6 @@ email:
# Catch all e-mails sent to a configured e-mail address
catch_all: false
# Web Stats JS code
#webstats_js_code: ''

View file

@ -34,7 +34,7 @@ function get_items($orderby='id', $raw_values=false) {
return $items;
}
catch (Exception $e) {
Log :: error("Error retreiving items info from database : ".$e->getMessage());
Log :: error("Error retrieving items info from database : ".$e->getMessage());
}
return false;
}
@ -53,7 +53,7 @@ function get_item($id, $raw_values=false) {
return $db -> format_row_info($info, array('date'));
}
catch (Exception $e) {
Log :: error("Error retreiving item #$id info from database : ".$e->getMessage());
Log :: error("Error retrieving item #$id info from database : ".$e->getMessage());
}
return false;
}
@ -280,7 +280,7 @@ function search_items($params) {
}
catch (Exception $e) {
Log :: exception(
$e, "An exception occured searching items with params %s infos from database : ",
$e, "An exception occurred searching items with params %s infos from database : ",
preg_replace("/\n[ \t]*/", " ", print_r($params, true))
);
}
@ -322,7 +322,7 @@ function restore_items($fd=null) {
$result = $db -> fpdo -> deleteFrom('item')
-> execute();
if ($result === false) {
Log :: error("An unknown error occured truncating item table in database.");
Log :: error("An unknown error occurred truncating item table in database.");
return false;
}
}
@ -369,7 +369,7 @@ function restore_items($fd=null) {
$restored++;
}
else {
Log :: error("Unkwown error occured restoring item from line #$line :\n".print_r($values, true));
Log :: error("Unknown error occurred restoring item from line #$line :\n".print_r($values, true));
$error = true;
}
}

View file

@ -31,7 +31,7 @@ function handle_item_post_data(&$info, $enabled_fields=null, $required_fields=nu
$info['name'] = $_POST['name'];
}
else {
$field_errors['name'] = "Ce nom est invalide.";
$field_errors['name'] = "Ce nom est invalid.";
}
}
else {
@ -61,7 +61,7 @@ function handle_item_post_data(&$info, $enabled_fields=null, $required_fields=nu
$info['description'] = $_POST['description'];
}
else {
$field_errors['description'] = "Cette description est invalide.";
$field_errors['description'] = "Cette description est invalid.";
}
}
}
@ -88,7 +88,7 @@ function handle_item_post_data(&$info, $enabled_fields=null, $required_fields=nu
}
/*
* Parser/formater values helpers
* Parser/formatter values helpers
*/
function can_modify($item) {

View file

@ -10,7 +10,7 @@ function get_item_from_url($id, $fatal=false) {
$item = get_item($id);
if(!is_array($item)) {
$error = sprintf(_("Item #% s not found."), $id);
$error = sprintf(_("Item #%s not found."), $id);
if ($fatal)
Log :: fatal($error);
Tpl :: add_error($error);

View file

@ -156,7 +156,7 @@ function handle_create($request) {
if (isset($_POST['submit']) && empty($field_errors)) {
$item = add_item($info);
if (is_array($item)) {
Tpl :: add_message(_("The element '% s' has been created."), $item['name']);
Tpl :: add_message(_("The element '%s' has been created."), $item['name']);
Url :: redirect('item/'.$item['id']);
}
Tpl :: add_error(_("An error occurred while saving this item."));
@ -196,11 +196,11 @@ function handle_modify($request) {
}
Log :: debug('Changes : '.vardump($changes));
if (empty($changes)) {
Tpl :: add_message(_("You have not made any changes to element '% s'."), $item['name']);
Tpl :: add_message(_("You have not made any changes to element '%s'."), $item['name']);
Url :: redirect('item/'.$item['id']);
}
if (update_item($item['id'], $changes) === true) {
Tpl :: add_message(_("The element '% s' has been updated successfully."), $item['name']);
Tpl :: add_message(_("The element '%s' has been updated successfully."), $item['name']);
Url :: redirect('item/'.$item['id']);
}
Tpl :: add_error(_("An error occurred while updating this item."));
@ -229,7 +229,7 @@ Url :: add_url_handler('|^item/(?P<id>[0-9]+)/modify$|', 'handle_modify');
function handle_archive($request) {
$item = get_item_from_url($request -> id);
if(!is_array($item)) {
Tpl :: add_error(_("Item #% s not found."), $request -> id);
Tpl :: add_error(_("Item #%s not found."), $request -> id);
Url :: redirect('item');
}
if ($item['status'] == 'archived') {
@ -239,7 +239,7 @@ function handle_archive($request) {
Tpl :: add_error(_('You cannot archive this item.'));
}
else if (archive_item($item['id']) === true) {
Tpl :: add_message(_("The element '% s' has been archived successfully."), $item['name']);
Tpl :: add_message(_("The element '%s' has been archived successfully."), $item['name']);
}
else {
Tpl :: add_error(_('An error occurred while archiving this item.'));
@ -256,13 +256,13 @@ Url :: add_url_handler('|^item/(?P<id>[0-9]+)/archive$|', 'handle_archive');
function handle_delete($request) {
$item = get_item_from_url($request -> id);
if(!is_array($item)) {
Tpl :: add_error(_("Item #% s not found."), $request -> id);
Tpl :: add_error(_("Item #%s not found."), $request -> id);
}
else if (!can_delete($item)) {
Tpl :: add_error(_('You cannot delete this item.'));
}
else if (delete_item($item['id']) === true) {
Tpl :: add_message(_("The element '% s' has been deleted successfully."), $item['name']);
Tpl :: add_message(_("The element '%s' has been deleted successfully."), $item['name']);
}
else {
Tpl :: add_error(_('An error occurred while deleting this item.'));

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2023-03-09 18:14+0100\n"
"POT-Creation-Date: 2024-01-23 18:09+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: Benjamin Renard <brenard@easter-eggs.com>\n"
"Language-Team: \n"
@ -9,18 +9,18 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.2.2\n"
#: includes/url-helpers.php:9
msgid "Invalid element identifier."
msgstr "Identifiant d'élément invalide."
msgstr "Identifiant d'élément invalid."
#: includes/url-helpers.php:13 includes/url-public.php:242
#: includes/url-public.php:269
#: includes/url-helpers.php:13 includes/url-public.php:232
#: includes/url-public.php:259 includes/cli.php:136 includes/cli.php:160
#, php-format
msgid "Item #% s not found."
msgstr "L'élément #%s est introuvable."
msgid "Item #%s not found."
msgstr "Élément #%s introuvable."
#: includes/url-public.php:38
msgid "Any"
@ -45,14 +45,14 @@ msgstr "Élément %s"
#: includes/url-public.php:159
#, php-format
msgid "The element '% s' has been created."
msgid "The element '%s' has been created."
msgstr "L'élément '%s' a bien été créé."
#: includes/url-public.php:163
#: includes/url-public.php:162
msgid "An error occurred while saving this item."
msgstr "Une erreur est survenue en enregistrant cet élément."
#: includes/url-public.php:170
#: includes/url-public.php:168
msgid ""
"There are errors preventing this item from being saved. Please correct them "
"before attempting to add this item."
@ -60,29 +60,29 @@ msgstr ""
"Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger "
"avant de tenter d'ajouter cet élément."
#: includes/url-public.php:177
#: includes/url-public.php:175
msgid "New"
msgstr "Nouveau"
#: includes/url-public.php:187
#: includes/url-public.php:186
msgid "You cannot edit this item."
msgstr "Vous ne pouvez pas modifier cet élément."
#: includes/url-public.php:200
#: includes/url-public.php:199
#, php-format
msgid "You have not made any changes to element '% s'."
msgid "You have not made any changes to element '%s'."
msgstr "Vous n'avez apporté aucune modification à l'élément '%s'."
#: includes/url-public.php:204
#: includes/url-public.php:203
#, php-format
msgid "The element '% s' has been updated successfully."
msgid "The element '%s' has been updated successfully."
msgstr "L'élément '%s' a bien été mise à jour."
#: includes/url-public.php:208
#: includes/url-public.php:206
msgid "An error occurred while updating this item."
msgstr "Une erreur est survenue en mettant à jour cet élément."
#: includes/url-public.php:216
#: includes/url-public.php:213
msgid ""
"There are errors preventing this item from being saved. Please correct them "
"before attempting to save your changes."
@ -90,198 +90,193 @@ msgstr ""
"Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger "
"avant de tenter d'enregistrer vos modifications."
#: includes/url-public.php:228
#: includes/url-public.php:220
#, php-format
msgid "Element %s: Modification"
msgstr "Élément %s : Modification"
#: includes/url-public.php:246
#: includes/url-public.php:236
msgid "This item is already archived."
msgstr "Cet élément est déjà archivé."
#: includes/url-public.php:249
#: includes/url-public.php:239
msgid "You cannot archive this item."
msgstr "Vous ne pouvez pas archiver cet élément."
#: includes/url-public.php:252
#: includes/url-public.php:242
#, php-format
msgid "The element '% s' has been archived successfully."
msgid "The element '%s' has been archived successfully."
msgstr "L'élément '%s' a bien été archivé."
#: includes/url-public.php:255
#: includes/url-public.php:245
msgid "An error occurred while archiving this item."
msgstr "Une erreur est survenue en archivant cet élément."
#: includes/url-public.php:272
#: includes/url-public.php:262
msgid "You cannot delete this item."
msgstr "Vous ne pouvez pas supprimer cet élément."
#: includes/url-public.php:275
#: includes/url-public.php:265
#, php-format
msgid "The element '% s' has been deleted successfully."
msgid "The element '%s' has been deleted successfully."
msgstr "L'élément '%s' a bien été supprimé."
#: includes/url-public.php:278
#: includes/url-public.php:268
msgid "An error occurred while deleting this item."
msgstr "Une erreur est survenue en supprimant cet élément."
#: includes/core.php:57
#: includes/core.php:61
msgid "Pending"
msgstr "En attente"
#: includes/core.php:58
#: includes/core.php:62
msgid "Validated"
msgstr "Validé"
#: includes/core.php:59
#: includes/core.php:63
msgid "Refused"
msgstr "Refusé"
#: includes/core.php:60
#: includes/core.php:64
msgid "Archived"
msgstr "Archivé"
#: includes/cli.php:23
#: includes/cli.php:24
#, php-format
msgid "Item #%s:\n"
msgstr "Élément #%s :\n"
#: includes/cli.php:24
#: includes/cli.php:25
#, php-format
msgid "ID: %s"
msgstr "ID : %s"
#: includes/cli.php:25
#: includes/cli.php:26
#, php-format
msgid "Name: '%s'"
msgstr "Nom : %s"
#: includes/cli.php:26
#: includes/cli.php:27
#, php-format
msgid "Date: %s"
msgstr "Date : %s"
#: includes/cli.php:28
#: includes/cli.php:29
#, php-format
msgid "Description: %s"
msgstr "Description : %s"
#: includes/cli.php:29
#: includes/cli.php:30
msgid "Not set"
msgstr "Non-défini"
#: includes/cli.php:31
#: includes/cli.php:32
#, php-format
msgid "Status: %s"
msgstr "Statut : %s"
#: includes/cli.php:84
#: includes/cli.php:85
msgid "No item.\n"
msgstr "Aucun élément.\n"
#: includes/cli.php:110
#: includes/cli.php:111
#, php-format
msgid "%d item(s)"
msgstr "%d élément(s)"
#: includes/cli.php:116
#: includes/cli.php:117
msgid "List/search items"
msgstr "Lister/rechercher les éléments"
#: includes/cli.php:117
#: includes/cli.php:118
msgid "[patterns]"
msgstr "[mots clés]"
#: includes/cli.php:119
#: includes/cli.php:120
msgid "-o|--orderby Ordering list criterion. Possible values:"
msgstr "-o|--orderby Critère de tri de la liste. Valeurs possibles :"
#: includes/cli.php:121
#: includes/cli.php:122
msgid "-r|--reverse Reverse order"
msgstr "-r|--reverse Ordre inverse"
#: includes/cli.php:122
#: includes/cli.php:123
msgid "-s|--status Filter on status. Possible values:"
msgstr "-s|--status Filtrer sur le statut. Valeurs possibles :"
#: includes/cli.php:129
#: includes/cli.php:130
msgid "You must provide a valid ID."
msgstr "Vous devez fournir un ID valide."
msgstr "Vous devez fournir un ID valid."
#: includes/cli.php:135 includes/cli.php:159
#, php-format
msgid "Item #%s not found."
msgstr "Élément #%s introuvable."
#: includes/cli.php:143
#: includes/cli.php:144
msgid "Show item"
msgstr "Voir un élément"
#: includes/cli.php:144
#: includes/cli.php:145
msgid "[ID]"
msgstr "[ID]"
#: includes/cli.php:149
#: includes/cli.php:150
msgid "You must provide item ID."
msgstr "Vous devez fournir un ID valide."
msgstr "Vous devez fournir un ID valid."
#: includes/cli.php:153
#: includes/cli.php:154
msgid "Invalid item ID"
msgstr "ID d'élément invalide"
msgstr "ID d'élément invalid"
#: includes/cli.php:164
#: includes/cli.php:165
msgid "Are you sure you want to delete this item? Type 'yes' to continue: "
msgstr ""
"Êtes-vous sûre de vouloir supprimer cet élément ? Taper 'yes' pour "
"continuer : "
#: includes/cli.php:168
#: includes/cli.php:169
msgid "User cancel"
msgstr "L'utilisateur a annulé"
#: includes/cli.php:174
#: includes/cli.php:175
#, php-format
msgid "An error occured deleting item #%d."
msgid "An error occurred deleting item #%d."
msgstr "Une erreur est survenue en supprimant l'élément #%d."
#: includes/cli.php:181
#: includes/cli.php:182
msgid "Delete item"
msgstr "Supprimer un élément"
#: includes/cli.php:182
#: includes/cli.php:183
msgid "[item ID]"
msgstr "[ID de l'élément]"
#: includes/cli.php:194
#: includes/cli.php:195
msgid "Export items (as CSV)"
msgstr "Exporter les éléments (au format CSV)"
#: includes/cli.php:195
#: includes/cli.php:196
msgid "[output file path]"
msgstr "[chemin du fichier de sortie]"
#: includes/cli.php:210
#: includes/cli.php:211
msgid "Restore items (from CSV)"
msgstr "Restaurer les éléments (depuis un fichier CSV)"
#: includes/cli.php:211
#: includes/cli.php:212
msgid "[input file path]"
msgstr "[chemin du fichier d'entrée]"
#: includes/cli.php:278
#: includes/cli.php:279
msgid "Cron to handle item expiration"
msgstr "Cron gérant l'expiration des éléments"
#: includes/cli.php:281
#: includes/cli.php:282
msgid "-j/--just-try Just-try mode : do not really removed expired item(s)"
msgstr ""
"-j/--just-try Mode just-try : Ne supprime pas réellement les éléments "
"expirés"
#: includes/cli.php:282
#: includes/cli.php:283
msgid "-m/--max-age Item expiration limit (in days, optional)"
msgstr ""
"-m/--max-age Limite d'expiration des éléments (en secondes, optionnel)"
"-m/--max-age Limit d'expiration des éléments (en secondes, optionnel)"
#: templates/form.tpl:7 templates/search.tpl:50 templates/show.tpl:5
msgid "Name"
@ -310,7 +305,7 @@ msgstr "Ajouter"
#: templates/search.tpl:8
msgid "Pattern"
msgstr "Mot clé"
msgstr "Not clé"
#: templates/search.tpl:24
msgid "Nb by page"
@ -384,11 +379,11 @@ msgstr ""
#: templates/homepage.tpl:11
msgid ""
"The access to this application is available by the following URL: <a href="
"\"%1\">%1</a>"
"The access to this application is available by the following URL: <a "
"href=\"%1\">%1</a>"
msgstr ""
"L'accès à cette application est possible via l'URL suivante : <a href=\"%1\">"
"%1</a>"
"L'accès à cette application est possible via l'URL suivante : <a "
"href=\"%1\">%1</a>"
#: templates/homepage.tpl:14
msgid "This app contains some demo pages:"

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2023-03-09 18:14+0100\n"
"PO-Revision-Date: 2023-03-09 18:14+0100\n"
"POT-Creation-Date: 2024-01-23 18:09+0000\n"
"PO-Revision-Date: 2024-01-23 18:09+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -10,10 +10,10 @@ msgstr ""
msgid "Invalid element identifier."
msgstr ""
#: includes/url-helpers.php:13 includes/url-public.php:242
#: includes/url-public.php:269
#: includes/url-helpers.php:13 includes/url-public.php:232
#: includes/url-public.php:259 includes/cli.php:136 includes/cli.php:160
#, php-format
msgid "Item #% s not found."
msgid "Item #%s not found."
msgstr ""
#: includes/url-public.php:38
@ -37,232 +37,227 @@ msgstr ""
#: includes/url-public.php:159
#, php-format
msgid "The element '% s' has been created."
msgid "The element '%s' has been created."
msgstr ""
#: includes/url-public.php:163
#: includes/url-public.php:162
msgid "An error occurred while saving this item."
msgstr ""
#: includes/url-public.php:170
#: includes/url-public.php:168
msgid ""
"There are errors preventing this item from being saved. Please correct them "
"before attempting to add this item."
msgstr ""
#: includes/url-public.php:177
#: includes/url-public.php:175
msgid "New"
msgstr ""
#: includes/url-public.php:187
#: includes/url-public.php:186
msgid "You cannot edit this item."
msgstr ""
#: includes/url-public.php:200
#: includes/url-public.php:199
#, php-format
msgid "You have not made any changes to element '% s'."
msgid "You have not made any changes to element '%s'."
msgstr ""
#: includes/url-public.php:204
#: includes/url-public.php:203
#, php-format
msgid "The element '% s' has been updated successfully."
msgid "The element '%s' has been updated successfully."
msgstr ""
#: includes/url-public.php:208
#: includes/url-public.php:206
msgid "An error occurred while updating this item."
msgstr ""
#: includes/url-public.php:216
#: includes/url-public.php:213
msgid ""
"There are errors preventing this item from being saved. Please correct them "
"before attempting to save your changes."
msgstr ""
#: includes/url-public.php:228
#: includes/url-public.php:220
#, php-format
msgid "Element %s: Modification"
msgstr ""
#: includes/url-public.php:246
#: includes/url-public.php:236
msgid "This item is already archived."
msgstr ""
#: includes/url-public.php:249
#: includes/url-public.php:239
msgid "You cannot archive this item."
msgstr ""
#: includes/url-public.php:252
#: includes/url-public.php:242
#, php-format
msgid "The element '% s' has been archived successfully."
msgid "The element '%s' has been archived successfully."
msgstr ""
#: includes/url-public.php:255
#: includes/url-public.php:245
msgid "An error occurred while archiving this item."
msgstr ""
#: includes/url-public.php:272
#: includes/url-public.php:262
msgid "You cannot delete this item."
msgstr ""
#: includes/url-public.php:275
#: includes/url-public.php:265
#, php-format
msgid "The element '% s' has been deleted successfully."
msgid "The element '%s' has been deleted successfully."
msgstr ""
#: includes/url-public.php:278
#: includes/url-public.php:268
msgid "An error occurred while deleting this item."
msgstr ""
#: includes/core.php:57
#: includes/core.php:61
msgid "Pending"
msgstr ""
#: includes/core.php:58
#: includes/core.php:62
msgid "Validated"
msgstr ""
#: includes/core.php:59
#: includes/core.php:63
msgid "Refused"
msgstr ""
#: includes/core.php:60
#: includes/core.php:64
msgid "Archived"
msgstr ""
#: includes/cli.php:23
#, php-format
msgid "Item #%s:\n"
msgstr ""
#: includes/cli.php:24
#, php-format
msgid "ID: %s"
msgid "Item #%s:\n"
msgstr ""
#: includes/cli.php:25
#, php-format
msgid "Name: '%s'"
msgid "ID: %s"
msgstr ""
#: includes/cli.php:26
#, php-format
msgid "Name: '%s'"
msgstr ""
#: includes/cli.php:27
#, php-format
msgid "Date: %s"
msgstr ""
#: includes/cli.php:28
#: includes/cli.php:29
#, php-format
msgid "Description: %s"
msgstr ""
#: includes/cli.php:29
#: includes/cli.php:30
msgid "Not set"
msgstr ""
#: includes/cli.php:31
#: includes/cli.php:32
#, php-format
msgid "Status: %s"
msgstr ""
#: includes/cli.php:84
#: includes/cli.php:85
msgid "No item.\n"
msgstr ""
#: includes/cli.php:110
#: includes/cli.php:111
#, php-format
msgid "%d item(s)"
msgstr ""
#: includes/cli.php:116
#: includes/cli.php:117
msgid "List/search items"
msgstr ""
#: includes/cli.php:117
#: includes/cli.php:118
msgid "[patterns]"
msgstr ""
#: includes/cli.php:119
#: includes/cli.php:120
msgid "-o|--orderby Ordering list criterion. Possible values:"
msgstr ""
#: includes/cli.php:121
#: includes/cli.php:122
msgid "-r|--reverse Reverse order"
msgstr ""
#: includes/cli.php:122
#: includes/cli.php:123
msgid "-s|--status Filter on status. Possible values:"
msgstr ""
#: includes/cli.php:129
#: includes/cli.php:130
msgid "You must provide a valid ID."
msgstr ""
#: includes/cli.php:135 includes/cli.php:159
#, php-format
msgid "Item #%s not found."
msgstr ""
#: includes/cli.php:143
#: includes/cli.php:144
msgid "Show item"
msgstr ""
#: includes/cli.php:144
#: includes/cli.php:145
msgid "[ID]"
msgstr ""
#: includes/cli.php:149
#: includes/cli.php:150
msgid "You must provide item ID."
msgstr ""
#: includes/cli.php:153
#: includes/cli.php:154
msgid "Invalid item ID"
msgstr ""
#: includes/cli.php:164
#: includes/cli.php:165
msgid "Are you sure you want to delete this item? Type 'yes' to continue: "
msgstr ""
#: includes/cli.php:168
#: includes/cli.php:169
msgid "User cancel"
msgstr ""
#: includes/cli.php:174
#: includes/cli.php:175
#, php-format
msgid "An error occured deleting item #%d."
msgstr ""
#: includes/cli.php:181
msgid "Delete item"
msgid "An error occurred deleting item #%d."
msgstr ""
#: includes/cli.php:182
msgid "Delete item"
msgstr ""
#: includes/cli.php:183
msgid "[item ID]"
msgstr ""
#: includes/cli.php:194
#: includes/cli.php:195
msgid "Export items (as CSV)"
msgstr ""
#: includes/cli.php:195
#: includes/cli.php:196
msgid "[output file path]"
msgstr ""
#: includes/cli.php:210
#: includes/cli.php:211
msgid "Restore items (from CSV)"
msgstr ""
#: includes/cli.php:211
#: includes/cli.php:212
msgid "[input file path]"
msgstr ""
#: includes/cli.php:278
#: includes/cli.php:279
msgid "Cron to handle item expiration"
msgstr ""
#: includes/cli.php:281
#: includes/cli.php:282
msgid "-j/--just-try Just-try mode : do not really removed expired item(s)"
msgstr ""
#: includes/cli.php:282
#: includes/cli.php:283
msgid "-m/--max-age Item expiration limit (in days, optional)"
msgstr ""
@ -365,8 +360,8 @@ msgstr ""
#: templates/homepage.tpl:11
msgid ""
"The access to this application is available by the following URL: <a href="
"\"%1\">%1</a>"
"The access to this application is available by the following URL: <a "
"href=\"%1\">%1</a>"
msgstr ""
#: templates/homepage.tpl:14

View file

@ -1,6 +1,6 @@
$( document ).ready(function () {
$(document).ready(function () {
// Submit form on order change
$('select').change(function (e) {
$('button[name=submit]').click();
$("select").change(function (e) {
$("button[name=submit]").click();
});
});

View file

@ -8,7 +8,7 @@
<div class="col-sm-10">
<input name="name" type="text" required
value='{if array_key_exists('name', $info) && $info.name}{$info.name|escape:'quotes'}{/if}'
class="form-control{if array_key_exists('name', $field_errors)} is-invalid{else if $submited} is-valid{/if}"/>
class="form-control{if array_key_exists('name', $field_errors)} is-invalid{else if $submitted} is-valid{/if}"/>
{if array_key_exists('name', $field_errors)}<div class="invalid-feedback">{$field_errors['name']}</div>{/if}
</div>
</div>
@ -17,7 +17,7 @@
<label class="col-sm-2 col-form-label required">{t}Status{/t}</label>
<div class="col-sm-10">
<select name="status" id="status" required
class="form-select{if array_key_exists('status', $field_errors)} is-invalid{else if $submited} is-valid{/if}">
class="form-select{if array_key_exists('status', $field_errors)} is-invalid{else if $submitted} is-valid{/if}">
{html_options options=$status_list selected=$info.status}
</select>
{if array_key_exists('status', $field_errors)}<div class="invalid-feedback">{$field_errors['status']}</div>{/if}
@ -27,14 +27,14 @@
<div class="mb-3 row">
<label class="col-sm-2 col-form-label">{t}Description{/t}</label>
<div class="col-sm-10">
<textarea name="description" id="description" class="form-control{if array_key_exists('description', $field_errors)} is-invalid{else if $submited} is-valid{/if}">{if array_key_exists('description', $info) && $info.description}{$info.description|escape:"htmlall"}{/if}</textarea>
<textarea name="description" id="description" class="form-control{if array_key_exists('description', $field_errors)} is-invalid{else if $submitted} is-valid{/if}">{if array_key_exists('description', $info) && $info.description}{$info.description|escape:"htmlall"}{/if}</textarea>
{if array_key_exists('description', $field_errors)}<div class="form-error">{$field_errors['description']}</div>{/if}
</div>
</div>
<div class="center">
<a href="{if isset($item_id)}item/{$item_id}{else}search{/if}" class="btn btn-light"><i class="fa fa-undo"></i> {t}Back{/t}</a>
<button type="submit" name="submit" value="submited" class="btn btn-primary">
<button type="submit" name="submit" value="submitted" class="btn btn-primary">
{if isset($item_id)}
<i class="fa fa-floppy-o" aria-hidden="true"></i> {t}Save{/t}
{else}

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2023-11-20 17:34+0000\n"
"POT-Creation-Date: 2024-01-23 18:15+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: Benjamin Renard <brenard@easter-eggs.com>\n"
"Language-Team: \n"
@ -20,14 +20,14 @@ msgstr "Aucun template spécifié."
msgid "An error occurred while displaying this page."
msgstr "Une erreur est survenue en affichant cette page."
#: Tpl.php:567
msgid "Unexpected error occured. If problem persist, please contact support."
#: Tpl.php:573
msgid "Unexpected error occurred. If problem persist, please contact support."
msgstr ""
"Une erreur inconnue est survenue. Si le problème persiste, merci de prendre "
"contact avec le support."
#: Tpl.php:896
msgid "Unkwown"
#: Tpl.php:904
msgid "Unknown"
msgstr "Inconnu"
#: Db.php:78
@ -36,15 +36,15 @@ msgstr "Impossible de se connecter à la base de données."
#: Auth/Form.php:51
msgid "Invalid username or password."
msgstr "Nom d'utilisateur ou mot de passe invalide."
msgstr "Nom d'utilisateur ou not de passe invalid."
#: Auth/Form.php:91
msgid "Sign in"
msgstr "Connexion"
msgstr "Connection"
#: Auth/Http.php:37 Url.php:181
msgid "Authentication required"
msgstr "Authentification requise"
msgstr "Authentication requise"
#: Auth/Http.php:124 Auth/Http.php:127 Url.php:185
msgid "Access denied"
@ -60,7 +60,7 @@ msgstr "Mauvaise requête"
#: Url.php:178
msgid "Invalid request."
msgstr "Requête invalide."
msgstr "Requête invalid."
#: Url.php:182
msgid "You have to be authenticated to access to this page."
@ -114,7 +114,7 @@ msgstr "Cette requête ne peut être traitée."
#: Url.php:450
msgid "Authentication required but fail to authenticate you."
msgstr "Authentification requise mais impossible pour vous authentifier."
msgstr "Authentication requise mais impossible pour vous authentifier."
#: Url.php:469
msgid "This request could not be processed correctly."
@ -122,7 +122,7 @@ msgstr "Cette requête n'a put être traitée correctement."
#: Cli.php:44
msgid "Create a new project using EesyPHP framework"
msgstr "Créer un nouveau projet utilisant le framework EesyPHP"
msgstr "Créer un nouveau project utilisant le framework EesyPHP"
#: Cli.php:47
msgid ""
@ -130,7 +130,7 @@ msgid ""
"using the EesyPHP framework."
msgstr ""
"Cette commande peut-être utilisée pour construire facilement la structure "
"d'un nouveau projet utilisant le framework EesyPHP."
"d'un nouveau project utilisant le framework EesyPHP."
#: Cli.php:55
msgid "Start the PHP built-in HTTP server to serve the application"
@ -141,7 +141,7 @@ msgid ""
"This command could be used to start the PHP built-in HTTP server to serve\n"
"the application.\n"
"\n"
"Additionnal parameters:\n"
"Additional parameters:\n"
" -p/--public-url Define the public URL (default: based on "
"listen address)\n"
" -P/--enable-profiler Enable Xdebug profiler\n"
@ -165,7 +165,7 @@ msgstr "La commande CLI '%s' n'existe pas."
#: Cli.php:100
#, php-format
msgid "The CLI command '%s' handler is not callable !"
msgstr "La fonction implémentant la commande CLI '%s' n'est pas exécutable !"
msgstr "La function implémentant la commande CLI '%s' n'est pas exécutable !"
#: Cli.php:132
#, php-format
@ -212,13 +212,13 @@ msgid ""
"Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command."
msgstr ""
"Paramètre \"%s\" invalide.\n"
"Paramètre \"%s\" invalid.\n"
"Note : Les paramètres/arguments de la requête doivent être placés après "
"celle-ci."
#: Cli.php:252
#, php-format
msgid "An exception occured running command %s"
msgid "An exception occurred running command %s"
msgstr "Une exception est survenue en exécutant la commande %s"
#: Cli.php:327
@ -228,48 +228,48 @@ msgstr "L'extension PHP XDEBUG ne semble pas installée."
#: Cli.php:336
#, php-format
msgid "Invalid profiler output directory \"%s\": not found"
msgstr "Dossier de sortie du profiler invalide \"%s\" : introuvable"
msgstr "Dossier de sortie du profiler invalid \"%s\" : introuvable"
#: Cli.php:341
#, php-format
msgid "Invalid profiler output directory \"%s\": not writeable"
msgstr ""
"Dossier de sortie du profiler invalide \"%s\" : non-accessible en écriture"
"Dossier de sortie du profiler invalid \"%s\" : non-accessible en écriture"
#: Cli.php:350
#, php-format
msgid "Invalid parameter \"%s\""
msgstr "Paramètre \"%s\" invalide"
msgstr "Paramètre \"%s\" invalid"
#: Cli.php:361
msgid ""
"Invalid listen address specify. Must be in format host:port, host or :port."
msgstr ""
"Adresse d'écoute spécifiée invalide. Elle doit être au format hôte:port (ou :"
"Address d'écoute spécifiée invalid. Elle doit être au format hôte:port (ou :"
"port)."
#: Cli.php:369
msgid "Invalid listen host specified. Must be an IPv4 or IPv6 address."
msgstr ""
"Hôte d'écoute spécifié invalide. Il doit s'agir d'une adresse IPv4 ou IPv6."
"Hôte d'écoute spécifié invalid. Il doit s'agir d'une address IPv4 ou IPv6."
#: Cli.php:376
msgid ""
"Invalid listen port specified. Must be a positive integer between 1 and "
"65535."
msgstr ""
"Port d'écoute spécifié invalide. Il doit s'agir d'un entier positif entre 1 "
"Port d'écoute spécifié invalid. Il doit s'agir d'un entier positif entre 1 "
"et 65535."
#: Cli.php:418
msgid "Can't invoke bash. Can't ask password prompt."
msgstr ""
"Impossible d'utiliser bash. Impossible de demander à l'utilisateur de saisir "
"un mot de passe."
"un not de passe."
#: Cli.php:421
msgid "Please enter password:"
msgstr "Merci de saisir le mot de passe :"
msgstr "Merci de saisir le not de passe :"
#: functions.php:304
msgid "d"
@ -300,7 +300,7 @@ msgstr "ns"
msgid "Less than 1%s"
msgstr "Moins de 1%s"
#: App.php:239 I18n.php:118
#: App.php:239 I18n.php:119
msgid "Hello world !"
msgstr "Bonjour tout le monde !"
@ -316,23 +316,23 @@ msgstr "Déconnecté"
msgid "You are now disconnected."
msgstr "Vous êtes maintenant déconnecté."
#: I18n.php:138
#: I18n.php:139
msgid "Extract messages that need to be translated"
msgstr "Extraire les messages devant être traduit"
#: I18n.php:140
#: I18n.php:141
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
"Cette commande peut-être utilisée pour générer/mettre à jour le fichier "
"locales/messages.pot."
#: I18n.php:146
#: I18n.php:147
msgid "Update messages in translation PO lang files"
msgstr ""
"Mettre à jour les messages dans les fichiers de traduction PO existants"
#: I18n.php:148
#: I18n.php:149
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
@ -340,15 +340,15 @@ msgstr ""
"Cette commande peut-être utilisée pour initialiser/mettre à jour les "
"fichiers PO dans les dossiers locales/*/LC_MESSAGES."
#: I18n.php:155
#: I18n.php:156
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
"Compiler les messages depuis les fichiers PO de traduction existants vers "
"les fichiers MO et les catalogues JS correspondant"
"les fichiers MO et les catalogues JS correspondent"
#: I18n.php:160
#: I18n.php:161
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
@ -356,99 +356,99 @@ msgstr ""
"Cette commande peut-être utilisée pour compiler les fichiers PO dans les "
"dossiers locales/*/LC_MESSAGES and les catalogues JS dans le dossier locales."
#: I18n.php:168
#: I18n.php:169
msgid "Initialize a new locale for translation."
msgstr "Initialiser un nouvelle locale pour traduction."
#: I18n.php:170
#: I18n.php:171
msgid "This command could be used to initialize a new locale for translation."
msgstr ""
"Cette commande peut-être utilisée pour initialiser une nouvelle locale pour "
"traduction."
#: I18n.php:367
#: I18n.php:368
msgid "You must provide the locale to initialize as unique and first argument."
msgstr ""
"Vous devez fournir la locale à initialiser comme unique et premier argument."
#: I18n.php:370 I18n.php:377
#: I18n.php:371 I18n.php:378
#, php-format
msgid "Invalid locale %s."
msgstr "Locale \"%s\" invalide."
msgstr "Locale \"%s\" invalid."
#: I18n.php:375
#: I18n.php:376
msgid "Fail to list valid locales."
msgstr "Une erreur est survenue en listant les locales valides."
#: I18n.php:386
#: I18n.php:387
#, php-format
msgid "Locale %s directory created (%s)."
msgstr "Dossier de la locale %s créé (%s)."
#: I18n.php:388
#: I18n.php:389
#, php-format
msgid "Fail to create locale %s directory (%s)."
msgstr "Une erreur est survenue en créant le dossier de la locale %s (%s)."
#: I18n.php:391
#: I18n.php:392
#, php-format
msgid "Locale %s directory already exist (%s)."
msgstr "Le dossier de la locale %s existe déjà (%s)."
#: I18n.php:398
#: I18n.php:399
#, php-format
msgid "Locale %s LC_MESSAGES directory created (%s)."
msgstr "Dossier LC_MESSAGES de la locale %s créé (%s)."
#: I18n.php:402
#: I18n.php:403
#, php-format
msgid "Fail to create locale %s LC_MESSAGES directory (%s)."
msgstr ""
"Une erreur est survenue en créant le dossier LC_MESSAGE de la locale %s (%s)."
#: I18n.php:406
#: I18n.php:407
#, php-format
msgid "Locale %s LC_MESSAGES directory already exist (%s)."
msgstr "Le dossier LC_MESSAGES de la locale %s existe déjà (%s)."
#: I18n.php:430
#: I18n.php:431
#, php-format
msgid "Locale %s PO file created (%s)."
msgstr "Fichier PO de la locale %s créé (%s)."
#: I18n.php:434
#: I18n.php:435
#, php-format
msgid "Locale %s PO file already exist (%s)."
msgstr "Le fichier PO de la locale %s existe déjà (%s)."
#: I18n.php:468
#: I18n.php:475
msgid "Fail to list EesyPHP PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP d'EesyPHP."
#: I18n.php:488
#: I18n.php:495
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers PHP "
"d'EesyPHP en utilisant xgettext."
#: I18n.php:505
#: I18n.php:514
msgid "Fail to list application PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP de l'application."
#: I18n.php:525
#: I18n.php:534
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
"Impossible d'extraire les messages depuis les fichiers PHP en utilisant "
"xgettext."
#: I18n.php:542
#: I18n.php:563
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
"Une erreur est survenue en listant les fichiers JS dans le dossier des "
"fichiers statiques '%s'."
#: I18n.php:564
#: I18n.php:585
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
@ -457,7 +457,12 @@ msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers JS du "
"dossier des fichiers statiques '%s' en utilisant xgettext."
#: I18n.php:586
#: I18n.php:617
#, php-format
msgid "Fail to list templates files in directory %s."
msgstr "Une erreur est survenue en listant les fichiers dans le dossier %s."
#: I18n.php:638
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
@ -466,100 +471,100 @@ msgstr ""
"Impossible d'extraire les messages depuis le dossier de templates '%s' en "
"utilisant le script tsmarty2c.php."
#: I18n.php:622
#: I18n.php:674
msgid "Fail to merge messages using msgcat."
msgstr "Impossible de fusionner les messages en utilisant msgcat."
#: I18n.php:636
#: I18n.php:688
#, php-format
msgid "Compendium file %s not found."
msgstr "Fichier compendium %s introuvable."
#: I18n.php:645
#: I18n.php:697
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
"Fichier POT introuvable (%s). Merci de lancer la commande extract_messages "
"pour commencer."
#: I18n.php:657 I18n.php:766
#: I18n.php:709 I18n.php:818
#, php-format
msgid "Lang directory '%s' found"
msgstr "Dossier de langue '%s' trouvé"
#: I18n.php:663 I18n.php:772
#: I18n.php:715 I18n.php:824
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
"Le dossier LC_MESSAGES est introuvable dans le dossier de langue '%s', on "
"l'ignore."
#: I18n.php:678
#: I18n.php:730
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
"Impossible d'initialiser les messages dans le fichier PO %s en utilisant "
"msginit (%s)."
#: I18n.php:696
#: I18n.php:748
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
"Impossible de mettre à jour les messages dans les fichiers PO %s en "
"utilisant msgmerge (%s)."
#: I18n.php:702 I18n.php:780
#: I18n.php:754 I18n.php:832
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
"Le fichier PO est introuvable dans le dossier de langue '%s', on l'ignore."
#: I18n.php:709 I18n.php:835
#: I18n.php:761 I18n.php:887
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr "Impossible d'ouvrir le dossier racine des langues (%s)."
#: I18n.php:736
#: I18n.php:788
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr "Lien symbolique d'alias de langue trouvé : %s -> %s"
#: I18n.php:743
#: I18n.php:795
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr "Lien symbolique de catalogue JS pour %s -> %s créé (%s)"
#: I18n.php:747
#: I18n.php:799
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
"Impossible de créer le lien symbolique de catalogue JS pour %s -> %s (%s)"
#: I18n.php:753
#: I18n.php:805
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr "Le lien symbolique du catalogue JS pour %s -> %s existe déjà (%s)"
#: I18n.php:758
#: I18n.php:810
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
"Le catalogue JS pour %s existe, mais il ne s'agit par d'un lien symbolique "
"vers %s (%s)"
#: I18n.php:793
#: I18n.php:845
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
"Impossible de compiler les messages depuis le fichier PO %s en tant que "
"fichier MO en utilisant msgfmt (%s)."
#: I18n.php:805
#: I18n.php:857
#, php-format
msgid "Include core translated messages from %s PO file"
msgstr "Inclusion des messages traduits (core) depuis le fichier PO %s"
#: I18n.php:812
#: I18n.php:864
#, php-format
msgid ""
"Core PO file %s not found: can not include its translated messages in "
@ -568,24 +573,24 @@ msgstr ""
"Le fichier PO core %s est introuvable : impossible d'inclure ses messages "
"traduits dans le catalogue JSON résultant."
#: I18n.php:818
#: I18n.php:870
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr "Impossible d'ouvrir le catalogue JS %s en mode écriture (%s)."
#: I18n.php:823
#: I18n.php:875
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr "Impossible d'écrire le fichier du catalogue JS %s (%s)."
#: I18n.php:828
#: I18n.php:880
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr "Catalogue JS %s créé (%s)."
#: Email.php:101
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgid "</hr><p><small>Mail initially intended for %s.</small></p>"
msgstr "</hr><p><small>Email initialement destiné à %s.</small></p>"
#: Email.php:102
@ -594,7 +599,7 @@ msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
"Mail initially intended for %s."
msgstr ""
"\n"
"\n"
@ -615,54 +620,13 @@ msgstr ""
"\n"
"%s: %s"
#: static/js/myconfirm.js:4 static/js/myconfirm.js:187
#: static/js/myconfirm.js:216
msgid "Confirmation"
msgstr "Confirmation"
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr "Confirmez-vous ?"
#: static/js/myconfirm.js:18 static/js/myconfirm.js:122
msgid "Cancel"
msgstr "Annuler"
#: static/js/myconfirm.js:24 static/js/myconfirm.js:128
msgid "Validate"
msgstr "Valider"
#: static/js/myconfirm.js:64
msgid "OK"
msgstr "OK"
#: static/js/myconfirm.js:103
msgid "Question"
msgstr "Question"
#: static/js/myconfirm.js:104
msgid "Please enter your answer below:"
msgstr "Merci de saisir vos réponses ci-dessous :"
#: static/js/myconfirm.js:157
msgid "Please wait"
msgstr "Merci de patienter"
#: static/js/myconfirm.js:158
msgid "Please wait while your request is being processed."
msgstr "Merci de patienter pendant le traitement de votre requête."
#: static/js/myconfirm.js:188 static/js/myconfirm.js:217
msgid "Are you sure?"
msgstr "Êtes-vous sure ?"
#: templates/login.tpl:19 templates/login.tpl:20
msgid "Username"
msgstr "Nom d'utilisateur"
#: templates/login.tpl:24 templates/login.tpl:25
msgid "Password"
msgstr "Mot de passe"
msgstr "Not de passe"
#: templates/login.tpl:32
msgid "Remember username"
@ -693,31 +657,31 @@ msgstr "Erreur : %1"
msgid "Back"
msgstr "Retour"
#: templates/empty.tpl:72
#: templates/empty.tpl:74
msgid "Sign out"
msgstr "Déconnexion"
#: templates/empty.tpl:82
#: templates/empty.tpl:84
msgid "Log in"
msgstr "Connexion"
msgstr "Connection"
#: templates/empty.tpl:119
#: templates/empty.tpl:121
msgid "Loading time:"
msgstr "Temps de chargement :"
#: templates/empty.tpl:120
#: templates/empty.tpl:122
msgid "Page: %1"
msgstr "Page : %1"
#: templates/empty.tpl:121
#: templates/empty.tpl:123
msgid "Database: %1"
msgstr "Base de données : %1"
#: templates/empty.tpl:122
#: templates/empty.tpl:124
msgid "Templating: "
msgstr "Modèle : "
#: templates/empty.tpl:123
#: templates/empty.tpl:125
msgid "Total: "
msgstr "Total : "
@ -737,6 +701,36 @@ msgstr ""
"fichier <em>homepage.tpl</em> pour l'écraser. Vous pouvez également écraser "
"le gestionnaire de l'URL racine de l'application web."
#~ msgid "Confirmation"
#~ msgstr "Confirmation"
#~ msgid "Do you confirm?"
#~ msgstr "Confirmez-vous ?"
#~ msgid "Cancel"
#~ msgstr "Annuler"
#~ msgid "Validate"
#~ msgstr "Valider"
#~ msgid "OK"
#~ msgstr "OK"
#~ msgid "Question"
#~ msgstr "Question"
#~ msgid "Please enter your answer below:"
#~ msgstr "Merci de saisir vos réponses ci-dessous :"
#~ msgid "Please wait"
#~ msgstr "Merci de patienter"
#~ msgid "Please wait while your request is being processed."
#~ msgstr "Merci de patienter pendant le traitement de votre requête."
#~ msgid "Are you sure?"
#~ msgstr "Êtes-vous sure ?"
#~ msgid ""
#~ "This command could be used to start the PHP built-in HTTP server to serve "
#~ "the application."
@ -755,10 +749,10 @@ msgstr ""
#~ msgstr "Déconnexion"
#~ msgid "Connection"
#~ msgstr "Connexion"
#~ msgstr "Connection"
#~ msgid ""
#~ "Authentication required but force_authentication function is not defined."
#~ msgstr ""
#~ "Authentification requise mais la fonction force_authentication n'est pas "
#~ "Authentication requise mais la function force_authentication n'est pas "
#~ "définie."

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2023-11-20 17:34+0000\n"
"PO-Revision-Date: 2023-11-20 17:34+0000\n"
"POT-Creation-Date: 2024-01-23 18:19+0000\n"
"PO-Revision-Date: 2024-01-23 18:19+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -14,12 +14,12 @@ msgstr ""
msgid "An error occurred while displaying this page."
msgstr ""
#: Tpl.php:567
msgid "Unexpected error occured. If problem persist, please contact support."
#: Tpl.php:573
msgid "Unexpected error occurred. If problem persist, please contact support."
msgstr ""
#: Tpl.php:896
msgid "Unkwown"
#: Tpl.php:904
msgid "Unknown"
msgstr ""
#: Db.php:78
@ -123,7 +123,7 @@ msgid ""
"This command could be used to start the PHP built-in HTTP server to serve\n"
"the application.\n"
"\n"
"Additionnal parameters:\n"
"Additional parameters:\n"
" -p/--public-url Define the public URL (default: based on "
"listen address)\n"
" -P/--enable-profiler Enable Xdebug profiler\n"
@ -186,7 +186,7 @@ msgstr ""
#: Cli.php:252
#, php-format
msgid "An exception occured running command %s"
msgid "An exception occurred running command %s"
msgstr ""
#: Cli.php:327
@ -260,7 +260,7 @@ msgstr ""
msgid "Less than 1%s"
msgstr ""
#: App.php:239 I18n.php:118
#: App.php:239 I18n.php:119
msgid "Hello world !"
msgstr ""
@ -276,237 +276,242 @@ msgstr ""
msgid "You are now disconnected."
msgstr ""
#: I18n.php:138
#: I18n.php:139
msgid "Extract messages that need to be translated"
msgstr ""
#: I18n.php:140
#: I18n.php:141
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
#: I18n.php:146
#: I18n.php:147
msgid "Update messages in translation PO lang files"
msgstr ""
#: I18n.php:148
#: I18n.php:149
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
msgstr ""
#: I18n.php:155
#: I18n.php:156
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
#: I18n.php:160
#: I18n.php:161
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
msgstr ""
#: I18n.php:168
#: I18n.php:169
msgid "Initialize a new locale for translation."
msgstr ""
#: I18n.php:170
#: I18n.php:171
msgid "This command could be used to initialize a new locale for translation."
msgstr ""
#: I18n.php:367
#: I18n.php:368
msgid "You must provide the locale to initialize as unique and first argument."
msgstr ""
#: I18n.php:370 I18n.php:377
#: I18n.php:371 I18n.php:378
#, php-format
msgid "Invalid locale %s."
msgstr ""
#: I18n.php:375
#: I18n.php:376
msgid "Fail to list valid locales."
msgstr ""
#: I18n.php:386
#: I18n.php:387
#, php-format
msgid "Locale %s directory created (%s)."
msgstr ""
#: I18n.php:388
#: I18n.php:389
#, php-format
msgid "Fail to create locale %s directory (%s)."
msgstr ""
#: I18n.php:391
#: I18n.php:392
#, php-format
msgid "Locale %s directory already exist (%s)."
msgstr ""
#: I18n.php:398
#: I18n.php:399
#, php-format
msgid "Locale %s LC_MESSAGES directory created (%s)."
msgstr ""
#: I18n.php:402
#: I18n.php:403
#, php-format
msgid "Fail to create locale %s LC_MESSAGES directory (%s)."
msgstr ""
#: I18n.php:406
#: I18n.php:407
#, php-format
msgid "Locale %s LC_MESSAGES directory already exist (%s)."
msgstr ""
#: I18n.php:430
#: I18n.php:431
#, php-format
msgid "Locale %s PO file created (%s)."
msgstr ""
#: I18n.php:434
#: I18n.php:435
#, php-format
msgid "Locale %s PO file already exist (%s)."
msgstr ""
#: I18n.php:468
#: I18n.php:475
msgid "Fail to list EesyPHP PHP files."
msgstr ""
#: I18n.php:488
#: I18n.php:495
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
#: I18n.php:505
#: I18n.php:514
msgid "Fail to list application PHP files."
msgstr ""
#: I18n.php:525
#: I18n.php:534
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
#: I18n.php:542
#: I18n.php:563
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
#: I18n.php:564
#: I18n.php:585
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext."
msgstr ""
#: I18n.php:586
#: I18n.php:617
#, php-format
msgid "Fail to list templates files in directory %s."
msgstr ""
#: I18n.php:638
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script."
msgstr ""
#: I18n.php:622
#: I18n.php:674
msgid "Fail to merge messages using msgcat."
msgstr ""
#: I18n.php:636
#: I18n.php:688
#, php-format
msgid "Compendium file %s not found."
msgstr ""
#: I18n.php:645
#: I18n.php:697
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
#: I18n.php:657 I18n.php:766
#: I18n.php:709 I18n.php:818
#, php-format
msgid "Lang directory '%s' found"
msgstr ""
#: I18n.php:663 I18n.php:772
#: I18n.php:715 I18n.php:824
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:678
#: I18n.php:730
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
#: I18n.php:696
#: I18n.php:748
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
#: I18n.php:702 I18n.php:780
#: I18n.php:754 I18n.php:832
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:709 I18n.php:835
#: I18n.php:761 I18n.php:887
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr ""
#: I18n.php:736
#: I18n.php:788
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr ""
#: I18n.php:743
#: I18n.php:795
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr ""
#: I18n.php:747
#: I18n.php:799
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
#: I18n.php:753
#: I18n.php:805
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr ""
#: I18n.php:758
#: I18n.php:810
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
#: I18n.php:793
#: I18n.php:845
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
#: I18n.php:805
#: I18n.php:857
#, php-format
msgid "Include core translated messages from %s PO file"
msgstr ""
#: I18n.php:812
#: I18n.php:864
#, php-format
msgid ""
"Core PO file %s not found: can not include its translated messages in "
"resulting JSON catalog."
msgstr ""
#: I18n.php:818
#: I18n.php:870
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr ""
#: I18n.php:823
#: I18n.php:875
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr ""
#: I18n.php:828
#: I18n.php:880
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr ""
#: Email.php:101
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgid "</hr><p><small>Mail initially intended for %s.</small></p>"
msgstr ""
#: Email.php:102
@ -515,7 +520,7 @@ msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
"Mail initially intended for %s."
msgstr ""
#: Email.php:139
@ -530,47 +535,6 @@ msgid ""
"%s: %s"
msgstr ""
#: static/js/myconfirm.js:4 static/js/myconfirm.js:187
#: static/js/myconfirm.js:216
msgid "Confirmation"
msgstr ""
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr ""
#: static/js/myconfirm.js:18 static/js/myconfirm.js:122
msgid "Cancel"
msgstr ""
#: static/js/myconfirm.js:24 static/js/myconfirm.js:128
msgid "Validate"
msgstr ""
#: static/js/myconfirm.js:64
msgid "OK"
msgstr ""
#: static/js/myconfirm.js:103
msgid "Question"
msgstr ""
#: static/js/myconfirm.js:104
msgid "Please enter your answer below:"
msgstr ""
#: static/js/myconfirm.js:157
msgid "Please wait"
msgstr ""
#: static/js/myconfirm.js:158
msgid "Please wait while your request is being processed."
msgstr ""
#: static/js/myconfirm.js:188 static/js/myconfirm.js:217
msgid "Are you sure?"
msgstr ""
#: templates/login.tpl:19 templates/login.tpl:20
msgid "Username"
msgstr ""
@ -605,31 +569,31 @@ msgstr ""
msgid "Back"
msgstr ""
#: templates/empty.tpl:72
#: templates/empty.tpl:74
msgid "Sign out"
msgstr ""
#: templates/empty.tpl:82
#: templates/empty.tpl:84
msgid "Log in"
msgstr ""
#: templates/empty.tpl:119
#: templates/empty.tpl:121
msgid "Loading time:"
msgstr ""
#: templates/empty.tpl:120
#: templates/empty.tpl:122
msgid "Page: %1"
msgstr ""
#: templates/empty.tpl:121
#: templates/empty.tpl:123
msgid "Database: %1"
msgstr ""
#: templates/empty.tpl:122
#: templates/empty.tpl:124
msgid "Templating: "
msgstr ""
#: templates/empty.tpl:123
#: templates/empty.tpl:125
msgid "Total: "
msgstr ""

4
setup.cfg Normal file
View file

@ -0,0 +1,4 @@
[codespell]
ignore-words-list=fro,hass
exclude-file=.codespell-exclusions
quiet-level=2

View file

@ -34,7 +34,7 @@ log:
file_path: "${log.directory_path}/app.log"
# Log level (TRACE / DEBUG / INFO / WARNING / ERROR / FATAL)
level: 'INFO'
level: "INFO"
# Log PHP errors levels (as specified to set_error_handler())
# Note: expected a list of PHP error level constants that will be resolved and combine
@ -51,7 +51,6 @@ log:
# - ~E_STRICT
# - ~E_DEPRECATED
#
# Sentry configuration
#
@ -70,7 +69,6 @@ sentry:
- "E_RECOVERABLE_ERROR"
- "E_DEPRECATED"
# Traces sample rate (between 0 and 1)
# Note: this parameter permit to determine how many transactions (=~ access) are traced and
# sent to Sentry, for instance, 0.2 meen that 20% of the transactions will be traced. In dev
@ -96,7 +94,7 @@ templates:
#
i18n:
# Default locale (see locales directory for available languages list)
default_locale: 'en_US.UTF8'
default_locale: "en_US.UTF8"
#
# Session
@ -128,8 +126,8 @@ db:
#options: null
# Date/Datetime format in database (strptime format)
#date_format: '%Y-%m-%d' # Exemple : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Exemple : 2018-10-12 18:06:59
#date_format: '%Y-%m-%d' # Example : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Example : 2018-10-12 18:06:59
# MariaDB / MySQL
#dsn: "mysql:host=localhost;dbname=items"
@ -138,9 +136,8 @@ db:
#options: null
# Date/Datetime format in database (strptime format)
#date_format: '%Y-%m-%d' # Exemple : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Exemple : 2018-10-12 18:06:59
#date_format: '%Y-%m-%d' # Example : 2018-10-12
#datetime_format: '%Y-%m-%d %H:%M:%S' # Example : 2018-10-12 18:06:59
#
# Authentication
@ -185,18 +182,18 @@ auth:
#
http:
# HTTP Auth methods :
# * AUTHORIZATION : use HTTP_AUTHORIZATION environnement. This mode could be use with PHP FPM.
# * AUTHORIZATION : use HTTP_AUTHORIZATION environment. This mode could be use with PHP FPM.
# Specific configuration is need in Apache to use this mode :
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# * REMOTE_USER : use REMOTE_USER environnement variable to retreive authenticated user's login
# * REMOTE_USER : use REMOTE_USER environment variable to retrieve authenticated user's login
# This method could be only used with $http_auth_trust_without_password_challenge
# enabled.
# * PHP_AUTH : use PHP_AUTH_USER and PHP_AUTH_PW environnement variables (only available
# * PHP_AUTH : use PHP_AUTH_USER and PHP_AUTH_PW environment variables (only available
# using mod_php with Apache. (default)
method: 'PHP_AUTH'
method: "PHP_AUTH"
# Trust HTTP server authentication
# If enabled, the application will no check user credentials and only retreive user's login
# If enabled, the application will no check user credentials and only retrieve user's login
# from HTTP server.
#trust_without_password_challenge: true
@ -208,17 +205,17 @@ auth:
#
cas:
# CAS host (just the domain name)
host: 'idp.example.com'
host: "idp.example.com"
# CAS context (the root path, default: '/idp/cas')
# Example: for 'http://idp.example.com/idp/cas', put '/idp/cas'
context: '/idp/cas'
context: "/idp/cas"
# CAS HTTP port (default: 443)
#port: 443
# CAS procotol version
# Posssible values: "1.0", "2.0" (default), "3.0" or "S1" (SAML1)
# Possible values: "1.0", "2.0" (default), "3.0" or "S1" (SAML1)
#version: '2.0'
# CAS server SSL certificate validation (set to false to disable)
@ -234,7 +231,7 @@ auth:
# CAS Fake authenticated user
#fake_authenticated_user: 'myusername'
# CAS user attributes to retreive with their properties:
# CAS user attributes to retrieve with their properties:
# [attr name]:
# # CAS attribute name (optional, default: [attr name])
# cas_name: [CAS attr name]
@ -247,14 +244,14 @@ auth:
# Note: only used by casuser auth backend.
user_attributes:
login:
cas_name: 'uid'
cas_name: "uid"
default: null
name:
cas_name: 'displayName'
cas_ldap_name: 'cn'
cas_name: "displayName"
cas_ldap_name: "cn"
default: null
mail:
type: 'string'
type: "string"
#
# Database user backend
@ -275,7 +272,7 @@ auth:
# Password field name (optional, default: password)
#password_field: "password"
# Exposed users table fields in resulting EesyPHP\Auth\User object
# (optional, defailt: name, mail)
# (optional, default: name, mail)
#exposed_fields:
# - "name"
# - "mail"
@ -285,7 +282,7 @@ auth:
#
ldap:
# LDAP host (required, multiple hosts could be specified with comma separator)
host: 'ldap://localhost'
host: "ldap://localhost"
# LDAP port (optional)
#port: 389
@ -294,7 +291,7 @@ auth:
#starttls: false
# LDAP directory base DN (required)
basedn: 'o=example'
basedn: "o=example"
# LDAP bind DN (optional)
#bind_dn: 'uid=eesyphp,ou=sysaccounts,${auth.ldap.basedn}'
@ -307,12 +304,12 @@ auth:
#user_filter_by_uid: 'uid=[username]'
# User base DN
user_basedn: 'ou=people,${auth.ldap.basedn}'
user_basedn: "ou=people,${auth.ldap.basedn}"
# Bind with username instead of user DN (optional, default: false)
#bind_with_username: true
# LDAP user attributes to retreive with their properties:
# LDAP user attributes to retrieve with their properties:
# [attr name]:
# # LDAP attribute name (optional, default: [attr name])
# ldap_name: [LDAP attr name]
@ -326,16 +323,16 @@ auth:
# default: null
user_attributes:
login:
ldap_name: 'uid'
ldap_name: "uid"
multivalued: false
default: null
name:
ldap_name: 'displayName'
alt_ldap_name: 'cn'
ldap_name: "displayName"
alt_ldap_name: "cn"
multivalued: false
default: null
mail:
type: 'string'
type: "string"
# PEAR Net_LDAP2 library path (optional, default: Net/LDAP2.php)
#netldap2_path: 'Net/LDAP2.php'
@ -345,15 +342,14 @@ auth:
#
email:
# PHP PEAR Mail and Mail_Mine paths
php_mail_path: 'Mail.php'
php_mail_mime_path: 'Mail/mime.php'
php_mail_path: "Mail.php"
php_mail_mime_path: "Mail/mime.php"
# Sending method :
# - mail : use PHP mail function
# - sendmail : use sendmail system command
# - smtp : use an SMTP server (PHP PEAR Net_SMTP required)
send_method: 'smtp'
send_method: "smtp"
# Sending parameters
# See : http:#pear.php.net/manual/en/package.mail.mail.factory.php
@ -368,7 +364,6 @@ email:
# Catch all e-mails sent to a configured e-mail address
catch_all: false
# Web Stats JS code
#webstats_js_code: ''

View file

@ -129,7 +129,7 @@ class App {
* @param string $cast The type of expected value. The configuration variable
* value will be cast as this type. Could be : bool, int,
* float or string. (Optional, default : raw value)
* @param bool $split If true, $cast is 'array' and value retreived from configuration
* @param bool $split If true, $cast is 'array' and value retrieved from configuration
* is a string, split the value by comma (optional, default: true)
* @return mixed The configuration variable value
**/
@ -154,7 +154,7 @@ class App {
* @param string $cast The type of expected value. The configuration variable
* default value will be cast as this type. Could be : bool, int,
* float or string. (Optional, default : raw value)
* @param bool $split If true, $cast is 'array' and value retreived from configuration
* @param bool $split If true, $cast is 'array' and value retrieved from configuration
* is a string, split the value by comma (optional, default: true)
* @return mixed The configuration variable default value
**/
@ -222,7 +222,7 @@ class App {
}
/**
* Retreive application root directory path
* Retrieve application root directory path
* @return string|null
*/
public static function root_directory_path() {

View file

@ -51,7 +51,7 @@ class Auth {
foreach(App::get('auth.methods', array(), 'array') as $method) {
if (!$method || !is_string($method)) {
Log::warning(
'Auth Init: Invalid auth method retreive from configuration, ignore it: %s',
'Auth Init: Invalid auth method retrieve from configuration, ignore it: %s',
vardump($method));
continue;
}
@ -62,7 +62,7 @@ class Auth {
);
if (!class_exists($class)) {
Log::warning(
"Auth Init: Unknown auth method '%s' retreived from configuration, ignore it",
"Auth Init: Unknown auth method '%s' retrieved from configuration, ignore it",
$method
);
continue;
@ -90,7 +90,7 @@ class Auth {
foreach(App::get('auth.backends', array(), 'array') as $backend) {
if (!$backend || !is_string($backend)) {
Log::warning(
'Auth Init: Invalid auth backend retreive from configuration, ignore it: %s',
'Auth Init: Invalid auth backend retrieve from configuration, ignore it: %s',
vardump($backend));
continue;
}
@ -101,7 +101,7 @@ class Auth {
);
if (!class_exists($class)) {
Log::warning(
"Auth Init: Unknown auth backend '%s' retreived from configuration, ignore it",
"Auth Init: Unknown auth backend '%s' retrieved from configuration, ignore it",
$backend
);
continue;
@ -140,7 +140,7 @@ class Auth {
}
/**
* Check if a authentification method is enabled
* Check if a authentication method is enabled
* @param string $method
* @return bool
*/
@ -156,7 +156,7 @@ class Auth {
*/
public static function get_user($username, $first=true) {
if (!self :: $backends) {
Log :: warning("No auth backend registered, can't retreive user");
Log :: warning("No auth backend registered, can't retrieve user");
return false;
}
$users = array();

View file

@ -13,7 +13,7 @@ class Backend {
}
/**
* Retreive a user by its username
* Retrieve a user by its username
* @param string $username
* @return \EesyPHP\Auth\User|null|false The user object if found, null it not, false in case of error
*/

View file

@ -14,7 +14,7 @@ use phpCAS;
class Casuser extends Backend {
/**
* Retreive CAS attribute value(s) from CAS authenticated user
* Retrieve CAS attribute value(s) from CAS authenticated user
* @param string $attr The CAS attribute name
* @param mixed $default The default value to return if the CAS attribute is undefined
* (optional, default: null)
@ -27,7 +27,7 @@ class Casuser extends Backend {
}
/**
* Retreive a user by its username
* Retrieve a user by its username
* @param string $username
* @return \EesyPHP\Auth\User|null|false The user object if found, null it not, false in case of error
*/

View file

@ -110,7 +110,7 @@ class Db extends Backend {
}
/**
* Retreive a user by its username
* Retrieve a user by its username
* @param string $username
* @return \EesyPHP\Auth\User|null|false The user object if found, null it not, false in case of error
*/
@ -129,7 +129,7 @@ class Db extends Backend {
return new User($username, '\\EesyPHP\\Auth\\Db', $info);
}
catch (Exception $e) {
Log :: error("Error retreiving user %s info from database: %s", $username, $e->getMessage());
Log :: error("Error retrieving user %s info from database: %s", $username, $e->getMessage());
}
return false;
}
@ -155,7 +155,7 @@ class Db extends Backend {
return password_verify($password, $info['password']);
}
catch (Exception $e) {
Log :: error("Error retreiving user %s password from database: %s", $user, $e->getMessage());
Log :: error("Error retrieving user %s password from database: %s", $user, $e->getMessage());
}
return false;
}

View file

@ -13,7 +13,7 @@ use function EesyPHP\vardump;
class Http extends Method {
/**
* Method to retreive HTTP credentials
* Method to retrieve HTTP credentials
* @var string
*/
private static $method;
@ -45,7 +45,7 @@ class Http extends Method {
}
/**
* Retreive HTTP authentication data
* Retrieve HTTP authentication data
* @return array|false array('username' => '[login]', 'password' => '[password]') or false
*/
private static function get_auth_data() {
@ -61,7 +61,7 @@ class Http extends Method {
);
}
else
Log :: error("Fail to parse HTTP_AUTHORIZATION environnement variable.");
Log :: error("Fail to parse HTTP_AUTHORIZATION environment variable.");
}
break;
case 'REMOTE_USER':
@ -112,7 +112,7 @@ class Http extends Method {
}
/**
* Force HTTP user authentification
* Force HTTP user authentication
* @return never
*/
public static function force_login() {

View file

@ -144,7 +144,7 @@ class Ldap extends Backend {
// @phpstan-ignore-next-line
if (PEAR::isError($search)) {
Log :: error(
'Error occured searching in LDAP with filter "%s" on base DN "%s": %s',
'Error occurred searching in LDAP with filter "%s" on base DN "%s": %s',
$filter, $basedn?$basedn:"unset", $search->getMessage()
);
return false;
@ -187,7 +187,7 @@ class Ldap extends Backend {
}
/**
* Retreive LDAP attribute value(s) from LDAP entry
* Retrieve LDAP attribute value(s) from LDAP entry
* @param array<string,mixed> $entry The LDAP entry
* @param string $attr The LDAP attribute name
* @param bool $all_values Return all values or just the first one (optional, default: false)
@ -208,7 +208,7 @@ class Ldap extends Backend {
}
/**
* Retreive a user by its username
* Retrieve a user by its username
* @param string $username
* @return \EesyPHP\Auth\User|null|false The user object if found, null it not, false in case of error
*/
@ -232,7 +232,7 @@ class Ldap extends Backend {
App::get('auth.ldap.user_basedn', null, 'string')
);
if (!is_array($users)) {
Log::warning('An error occured looking for user "%s" in LDAP directory', $username);
Log::warning('An error occurred looking for user "%s" in LDAP directory', $username);
return false;
}
if (!$users) {

View file

@ -43,31 +43,27 @@ class Check {
return false;
}
public static function email($value, $domain=NULL, $checkDns=true) {
public static function email($value, $domains=NULL, $checkDns=true) {
$regex = '/^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/';
if (!preg_match($regex, $value)) {
return false;
}
$nd = explode('@', $value);
$nd=$nd[1];
$domain = explode('@', $value);
$domain = $domain[1];
if ($domain) {
if(is_array($domain)) {
if (!in_array($nd,$domain)) {
return false;
}
}
else {
if($nd!=$domain) {
return false;
}
}
}
if ($domains && !in_array($domain, ensure_is_array($domains)))
return false;
if ($checkDns && function_exists('checkdnsrr')) {
if (!(checkdnsrr($nd, 'MX') || checkdnsrr($nd, 'A'))) {
if ($checkDns) {
if (!function_exists('checkdnsrr')) {
Log::warning(
"Check::email(): PHP function checkdnsrr is missing, can't check domain against DNS. ".
"Assume is OK."
);
}
else if (!(checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A'))) {
return false;
}
}

View file

@ -58,7 +58,7 @@ class Cli {
"This command could be used to start the PHP built-in HTTP server to serve
the application.
Additionnal parameters:
Additional parameters:
-p/--public-url Define the public URL (default: based on listen address)
-P/--enable-profiler Enable Xdebug profiler
-O/--profiler-output [path] Xdebug profiler output directory path"
@ -249,7 +249,7 @@ Additionnal parameters:
exit($result?0:1);
}
catch(Exception $e) {
Log :: exception($e, I18n::_("An exception occured running command %s"), self :: $command);
Log :: exception($e, I18n::_("An exception occurred running command %s"), self :: $command);
exit(1);
}
}

View file

@ -137,7 +137,7 @@ Class Config {
* the value by comma (optional, default: false)
* @param array|null $config Optional configuration to use instead of current loaded configuration
* @param callable|null $get Optional callable to get another value that will be used to replace
* variables references found in retreived value.
* variables references found in retrieved value.
* @return mixed The configuration variable value
**/
public static function get($key, $default=null, $cast=null, $split=false, &$config=null, $get=null) {
@ -166,10 +166,10 @@ Class Config {
/**
* Replace variable in specified value
* @param mixed $value
* @param array|callable|null $config Optional configuration to use to retreive variable reference
* @param array|callable|null $config Optional configuration to use to retrieve variable reference
* value instead of current loaded configuration. Could be an
* array of configuration data or a callable that could be used
* as Config::get() to retreive the desired variable reference.
* as Config::get() to retrieve the desired variable reference.
* @return mixed
*/
public static function replace_variables($value, $config=null) {

View file

@ -21,7 +21,7 @@ class Date {
/**
* Format a timestamp as date/datetime string
* @param int $time The timestamp to format
* @param bool $with_time If true, include time in formated string
* @param bool $with_time If true, include time in formatted string
* (optional, default: true)
*/
public static function format($time, $with_time=true) {

View file

@ -128,10 +128,10 @@ class Db {
*/
/**
* Helper to retreive one row from a table of the database
* Helper to retrieve one row from a table of the database
* @param string $table The table name
* @param array|string $where WHERE clause(s) as expected by Envms\FluentPDO\Query
* @param array|string|null $fields The expected fields as string (separeted by comma) or an
* @param array|string|null $fields The expected fields as string (separated by comma) or an
* array (optional, default: all table fields will be returned)
* @param array<array{0: 'LEFT'|'RIGHT'|'INNER'|'OUTER'|'FULL', 1: string, 2: string}>|array{0: 'LEFT'|'RIGHT'|'INNER'|'OUTER'|'FULL', 1: string, 2: string} $joins Join specification as array (see apply_joins())
* @return array|false
@ -159,10 +159,10 @@ class Db {
/**
* Helper to retreive multiple rows from a table of the database
* Helper to retrieve multiple rows from a table of the database
* @param string $table The table name
* @param array|string $where WHERE clause(s) as expected by Envms\FluentPDO\Query
* @param array|string|null $fields The expected fields as string (separeted by comma) or an
* @param array|string|null $fields The expected fields as string (separated by comma) or an
* array (optional, default: all table fields will be returned)
* @param string|null $order_by An optional ORDER clause as a string
* @param string|null $limit An optional LIMIT clause as a string
@ -197,7 +197,7 @@ class Db {
}
/**
* Helper to retreive a count from a table of the database
* Helper to retrieve a count from a table of the database
* @param string $table The table name
* @param array|string $where WHERE clause(s) as expected by Envms\FluentPDO\Query
* @param array|string|null $what What to count (optional, default: "*")
@ -267,7 +267,7 @@ class Db {
* @param string $table The table name
* @param Exception $e The exception
* @param array|string $where WHERE clause(s) as expected by Envms\FluentPDO\Query
* @param array|string|null $fields The expected fields as string (separeted by comma) or an
* @param array|string|null $fields The expected fields as string (separated by comma) or an
* array (optional, default: all table fields will be returned)
* @param string|null $order_by An optional ORDER clause as a string
* @param string|null $limit An optional LIMIT clause as a string
@ -277,7 +277,7 @@ class Db {
private function _log_simple_select_query_error(
$multiple, $table, $e, $where=null, $fields=null, $order_by=null, $limit=null, $joins=null
) {
$msg = "Error occured getting %s of the table %s";
$msg = "Error occurred getting %s of the table %s";
$params = [
$multiple?"rows":"one row",
$table,
@ -311,7 +311,7 @@ class Db {
* Helper to insert a row in a table
* @param string $table The table name
* @param array<string,mixed> $values The values of the row
* @param boolean $want_id Set to true if you want to retreive the ID of the inserted row
* @param boolean $want_id Set to true if you want to retrieve the ID of the inserted row
* @return bool|int The ID of the inserted row if $want_id, or true/false in case of success/error
*/
public function insert($table, $values, $want_id=false) {
@ -322,7 +322,7 @@ class Db {
}
catch (Exception $e) {
Log :: error(
"Error occured inserting row in the table %s of the database: %s\nValues:\n%s",
"Error occurred inserting row in the table %s of the database: %s\nValues:\n%s",
$table,
$e->getMessage(),
vardump($values)
@ -356,7 +356,7 @@ class Db {
}
catch (Exception $e) {
Log :: error(
"Error occured updating %s in the table %s of the database (where %s): %s\nChanges:\n%s",
"Error occurred updating %s in the table %s of the database (where %s): %s\nChanges:\n%s",
$expected_row_changes == 1?'row':'rows',
$table,
is_array($where)?
@ -392,7 +392,7 @@ class Db {
}
catch (Exception $e) {
Log :: error(
"Error occured deleting %s in the table %s of the database (where %s): %s",
"Error occurred deleting %s in the table %s of the database (where %s): %s",
$expected_row_changes == 1?'one row':'some rows',
$table,
is_array($where)?

View file

@ -98,8 +98,8 @@ class Email {
$msg .= sprintf(
(
$html?
I18n::_("</hr><p><small>Mail initialy intended for %s.</small></p>"):
I18n::_("\n\n\nMail initialy intended for %s.")
I18n::_("</hr><p><small>Mail initially intended for %s.</small></p>"):
I18n::_("\n\n\nMail initially intended for %s.")
),
(is_array($to)?implode(',', $to):$to));
$headers["X-Orig-To"] = $to;
@ -132,7 +132,7 @@ class Email {
foreach(array_keys($headers) as $header) {
if(in_array(strtoupper($header), array('BCC', 'CC'))) {
if (App :: get('email.catch_all')) {
Log :: debug("Mail catched: remove $header header");
Log :: debug("Mail caught: remove $header header");
$msg .= sprintf(
(
$html?

View file

@ -17,7 +17,7 @@ class Hook {
*
* @param $event string The event name
* @param $callable callable The callable to run on event
* @param $param mixed Paremeter that will be pass to the callable
* @param $param mixed Parameter that will be pass to the callable
* Use an array if you have multiple parameters to pass
*
* @return void
@ -37,7 +37,7 @@ class Hook {
* @param $event string Hook event name
* @param $event_data mixed Hook event data (optional, default: null)
*
* @return boolean True if all triggered actions succefully runned, false otherwise
* @return boolean True if all triggered actions succefully executed, false otherwise
*/
public static function trigger($event_name, $event_data=null) {
$return = true;
@ -54,7 +54,7 @@ class Hook {
}
catch(Exception $e) {
Log :: exception(
$e, "An exception occured running hook ".format_callable($e['callable']).
$e, "An exception occurred running hook ".format_callable($e['callable']).
" on event $event_name");
$return = false;
}

View file

@ -107,11 +107,11 @@ class I18n {
// Gettext firstly look the LANGUAGE env variable, so set it
if (!putenv("LANGUAGE=$locale"))
Log :: error("Fail to set LANGUAGE variable in environnement to '$locale'");
Log :: error("Fail to set LANGUAGE variable in environment to '$locale'");
// Set the locale
if (setlocale(LC_ALL, $locale) === false)
Log :: error("An error occured setting locale to '$locale'");
Log :: error("An error occurred setting locale to '$locale'");
// Configure and set the text domain
$fullpath = bindtextdomain(self :: CORE_TEXT_DOMAIN, self :: $core_root_path);

View file

@ -404,7 +404,7 @@ class Log {
* Log an exception
* @param Throwable $exception
* @param string|null $prefix The prefix of the log message
* (optional, default: "An exception occured")
* (optional, default: "An exception occurred")
* @param array $extra_args Extra arguments to use to compute prefix using sprintf
* @return void
*/
@ -419,7 +419,7 @@ class Log {
}
self :: error(
"%s:\n%s\n## %s:%d : %s",
($prefix?$prefix:"An exception occured"),
($prefix?$prefix:"An exception occurred"),
$exception->getTraceAsString(),
$exception->getFile(), $exception->getLine(),
$exception->getMessage());
@ -456,7 +456,7 @@ class Log {
*/
public static function on_php_error($errno, $errstr, $errfile, $errline) {
self :: error(
"A PHP error occured : [%s] %s\nFile : %s (line : %d)",
"A PHP error occurred : [%s] %s\nFile : %s (line : %d)",
self :: errno2type($errno), $errstr, $errfile, $errline
);
return False;

View file

@ -106,7 +106,7 @@ class SentryIntegration {
public static function on_php_error($errno, $errstr, $errfile, $errline) {
if (in_array($errno, self :: $php_error_types))
self :: log(
"A PHP error occured : [%s] %s\nFile : %s (line : %d)",
"A PHP error occurred : [%s] %s\nFile : %s (line : %d)",
Log :: errno2type($errno), $errstr, $errfile, $errline
);
return false;

View file

@ -470,7 +470,7 @@ class Tpl {
self :: $smarty->display("Tpl:$template");
}
catch (Exception $e) {
Log :: exception($e, "Smarty - An exception occured displaying template '$template'");
Log :: exception($e, "Smarty - An exception occurred displaying template '$template'");
Hook :: trigger('after_displaying_template', array('success' => false));
$sentry_span->finish();
if ($template != 'fatal_error.tpl')
@ -514,7 +514,7 @@ class Tpl {
$success = true;
}
catch (Exception $e) {
Log :: exception($e, "Smarty - An exception occured fetching template '$template'");
Log :: exception($e, "Smarty - An exception occurred fetching template '$template'");
}
Hook :: trigger('after_fetching_template', array('success' => $success));
$sentry_span->finish();
@ -533,7 +533,7 @@ class Tpl {
if (!is_array($data))
$data = array();
// Adjust HTTP error code on unsuccessfull request (or if custom error code is provided)
// Adjust HTTP error code on unsuccessful request (or if custom error code is provided)
if (
$error_code
|| (isset($data['success']) && !$data['success'] && http_response_code() == 200)
@ -570,7 +570,7 @@ class Tpl {
'error' => (
$error?
$error:
I18n::_("Unexpected error occured. If problem persist, please contact support.")
I18n::_("Unexpected error occurred. If problem persist, please contact support.")
),
),
$error_code,
@ -599,7 +599,7 @@ class Tpl {
die("FATAL ERROR: $error\n");
}
// Set HTTP reponse code to 500
// Set HTTP response code to 500
http_response_code(500);
// Handle API mode
@ -696,7 +696,7 @@ class Tpl {
public static function get_template_source($template, $core_only=false) {
$path = self :: resolve_templates_path($template, $core_only);
if (!is_readable($path)) {
// No error return with Smarty3 and highter because it's call
// No error return with Smarty3 and higher because it's call
// template name in lower first systematically
return '';
}
@ -782,7 +782,7 @@ class Tpl {
Url :: add_url_handler(
$pattern,
array('EesyPHP\\Tpl', 'handle_static_file'),
null, // additionnal info
null, // additional info
false, // authenticated
false, // override
false, // API mode
@ -797,7 +797,7 @@ class Tpl {
$priority++;
}
Log :: trace(
'Register additionnal static directory "%s" for root URL "%s" (priority: %d)',
'Register additional static directory "%s" for root URL "%s" (priority: %d)',
$path, $root_url, $priority);
}
@ -901,7 +901,7 @@ class Tpl {
echo format_duration(hrtime(true) - $init_time, 'ns', 'ms');
}
else {
echo _('Unkwown');
echo _('Unknown');
}
}
}

View file

@ -5,7 +5,7 @@ use Smarty_Resource_Custom;
/**
* Smarty ressource for EesyPHP templates
* Smarty resource for EesyPHP templates
*
* @author Benjamin Renard <brenard@zionetrix.net>
*/

View file

@ -330,9 +330,9 @@ class Url {
}
/**
* Retreive current requested URL and return it
* Retrieve current requested URL and return it
*
* @param bool $with_parameters Set to true to retreive current URL with GET parameters
* @param bool $with_parameters Set to true to retrieve current URL with GET parameters
*
* @return string|false The current request URL or false if fail
**/
@ -379,7 +379,7 @@ class Url {
}
/**
* Trigger redirect to specified URL (or homepage if omited)
* Trigger redirect to specified URL (or homepage if omitted)
*
* @param string|false $go The destination URL
*
@ -457,7 +457,7 @@ class Url {
}
catch (Exception $e) {
Log :: exception(
$e, "An exception occured running URL handler %s",
$e, "An exception occurred running URL handler %s",
format_callable(self :: $request -> handler));
}
Hook::trigger(

View file

@ -5,7 +5,7 @@ namespace EesyPHP;
use League\MimeTypeDetection\ExtensionMimeTypeDetector;
/*
* Parser/formater values helpers
* Parser/formatter values helpers
*/
function format_size($size, $digit=False) {
if (!$digit && $digit!==0) $digit=2;
@ -297,7 +297,7 @@ function ___($msg) {
* @param string|null $unit The unit of provide value (optional, default: 's')
* @param string|null $precision Minimal precision to displayed (optional, default: 's')
* @param string|null $separator The separator between time block (optional, default: null = one space)
* @return string|false The formated duration as string, or false in case of error
* @return string|false The formatted duration as string, or false in case of error
*/
function format_duration($value, $unit=null, $precision=null, $separator=null) {
$units = array(

View file

@ -55,15 +55,20 @@ body.signin {
border-top-right-radius: 0;
}
/*
* Common helpers
*/
.center { text-align: center; }
.center {
text-align: center;
}
p { text-align: justify; }
p {
text-align: justify;
}
img { max-width: 100%; }
img {
max-width: 100%;
}
/*
* Messages/errors & fatal errors
@ -82,20 +87,25 @@ img { max-width: 100%; }
/*
* Tables
*/
th a, th a:hover {
color: #000;
text-decoration: none;
th a,
th a:hover {
color: #000;
text-decoration: none;
}
/*
* Forms
*/
.form-inline .form-control, .form-inline label, .form-inline input, .form-inline select, .form-inline button {
margin-left: 1em!important;
.form-inline .form-control,
.form-inline label,
.form-inline input,
.form-inline select,
.form-inline button {
margin-left: 1em !important;
}
label.required::after {
content: " *";
content: " *";
}
.form-error {
@ -107,8 +117,8 @@ label.required::after {
}
span.form-control-plaintext {
padding-top: calc(.375rem + 1px);
padding-bottom: calc(.375rem + 1px);
padding-top: calc(0.375rem + 1px);
padding-bottom: calc(0.375rem + 1px);
margin-bottom: 0;
font-size: inherit;
line-height: 1.5;

View file

@ -1,8 +1,8 @@
var myconfirm = function(opts) {
var myconfirm = function (opts) {
var confirm = false;
var dialog = BootstrapDialog.show({
title: opts.title || _('Confirmation'),
message: opts.question || _('Do you confirm?'),
title: opts.title || _("Confirmation"),
message: opts.question || _("Do you confirm?"),
autodestroy: true,
cssClass: opts.css_class || null,
type: opts.type || BootstrapDialog.TYPE_LIGHT,
@ -15,44 +15,43 @@ var myconfirm = function(opts) {
},
buttons: [
{
label: opts.cancel_label || _('Cancel'),
action: function(dialog) {
label: opts.cancel_label || _("Cancel"),
action: function (dialog) {
dialog.close();
}
},
},
{
label: opts.confirm_label || _('Validate'),
cssClass: 'btn-danger',
action: function(dialog) {
dialog.setData('confirm',true);
label: opts.confirm_label || _("Validate"),
cssClass: "btn-danger",
action: function (dialog) {
dialog.setData("confirm", true);
dialog.close();
}
}
},
},
],
onhidden: function(dialog) {
if (dialog.getData('confirm')) {
if (jQuery.type(dialog.getData('onconfirm')) == 'function') {
dialog.getData('onconfirm')(dialog.getData('data'));
onhidden: function (dialog) {
if (dialog.getData("confirm")) {
if (jQuery.type(dialog.getData("onconfirm")) == "function") {
dialog.getData("onconfirm")(dialog.getData("data"));
}
} else {
if (jQuery.type(dialog.getData("oncancel")) == "function") {
dialog.getData("oncancel")(dialog.getData("data"));
}
}
else {
if (jQuery.type(dialog.getData('oncancel')) == 'function') {
dialog.getData('oncancel')(dialog.getData('data'));
}
}
}
},
});
return dialog;
};
var myalert = function(msg, title, opts) {
if (!opts) opts={};
var myalert = function (msg, title, opts) {
if (!opts) opts = {};
var dialog = BootstrapDialog.show({
title: title || opts.title || _('Error'),
title: title || opts.title || _("Error"),
message: msg,
autodestroy: true,
type: opts.type || BootstrapDialog.TYPE_DANGER,
size: opts.size || BootstrapDialog.SIZE_MEDIUM,
type: opts.type || BootstrapDialog.TYPE_DANGER,
size: opts.size || BootstrapDialog.SIZE_MEDIUM,
draggable: opts.draggable || false,
cssClass: opts.css_class || null,
data: {
@ -61,37 +60,37 @@ var myalert = function(msg, title, opts) {
},
buttons: [
{
label: opts.btnLabel || _('OK'),
cssClass: opts.btnCssClass ||'btn-primary',
action: function(dialog) {
label: opts.btnLabel || _("OK"),
cssClass: opts.btnCssClass || "btn-primary",
action: function (dialog) {
dialog.close();
}
},
},
],
onhidden: function(dialog) {
if (jQuery.type(dialog.getData('onclose')) == 'function') {
dialog.getData('onclose')(dialog.getData('data'));
onhidden: function (dialog) {
if (jQuery.type(dialog.getData("onclose")) == "function") {
dialog.getData("onclose")(dialog.getData("data"));
}
}
},
});
return dialog;
};
var myprompt = function(opts) {
var myprompt = function (opts) {
if ($.type(opts) != "object") {
opts={};
opts = {};
}
var submited = false;
var submitted = false;
var onSubmitBtnClick = function(dialog) {
submited = true;
var val = dialog.getModalBody().find('input').val();
if (jQuery.type(dialog.getData('onsubmit')) == 'function') {
if (!dialog.getData('onsubmit')(val, dialog.getData('data'))) {
if (jQuery.type(dialog.getData('onerror')) == 'function') {
dialog.getData('onerror')(val, dialog.getData('data'));
var onSubmitBtnClick = function (dialog) {
submitted = true;
var val = dialog.getModalBody().find("input").val();
if (jQuery.type(dialog.getData("onsubmit")) == "function") {
if (!dialog.getData("onsubmit")(val, dialog.getData("data"))) {
if (jQuery.type(dialog.getData("onerror")) == "function") {
dialog.getData("onerror")(val, dialog.getData("data"));
}
if (!dialog.getData('closeonerror')) {
if (!dialog.getData("closeonerror")) {
return false;
}
}
@ -100,11 +99,14 @@ var myprompt = function(opts) {
};
var dialog = BootstrapDialog.show({
title: opts.title || _('Question'),
message: "<label for='myprompt_input'>"+(opts.label || _("Please enter your answer below:"))+"</label><input type='text' class='form-control' id='myprompt_input'/>",
title: opts.title || _("Question"),
message:
"<label for='myprompt_input'>" +
(opts.label || _("Please enter your answer below:")) +
"</label><input type='text' class='form-control' id='myprompt_input'/>",
autodestroy: true,
type: opts.type || BootstrapDialog.TYPE_INFO,
size: opts.size || BootstrapDialog.SIZE_MEDIUM,
type: opts.type || BootstrapDialog.TYPE_INFO,
size: opts.size || BootstrapDialog.SIZE_MEDIUM,
cssClass: opts.css_class || null,
draggable: opts.draggable || false,
data: {
@ -115,118 +117,123 @@ var myprompt = function(opts) {
default_answer: opts.default_answer,
onSubmitBtnClick: onSubmitBtnClick,
data: opts.data,
submited: false,
submitted: false,
},
buttons: [
{
label: opts.cancel_label || _('Cancel'),
action: function(dialog) {
label: opts.cancel_label || _("Cancel"),
action: function (dialog) {
dialog.close();
}
},
},
{
label: opts.submit_label || _('Validate'),
cssClass: 'btn-danger',
action: onSubmitBtnClick
}
label: opts.submit_label || _("Validate"),
cssClass: "btn-danger",
action: onSubmitBtnClick,
},
],
onshown: function(dialog) {
var input = dialog.getModalBody().find('input');
input.on('keyup', function (e) {
onshown: function (dialog) {
var input = dialog.getModalBody().find("input");
input.on("keyup", function (e) {
if (e.keyCode == 13) {
dialog.getData('onSubmitBtnClick')(dialog);
dialog.getData("onSubmitBtnClick")(dialog);
}
});
if (dialog.getData('default_answer')) {
input.val(dialog.getData('default_answer'));
if (dialog.getData("default_answer")) {
input.val(dialog.getData("default_answer"));
}
},
onhidden: function(dialog) {
if (!submited && jQuery.type(dialog.getData('oncancel')) == 'function') {
dialog.getData('oncancel')(dialog.getData('data'));
onhidden: function (dialog) {
if (!submitted && jQuery.type(dialog.getData("oncancel")) == "function") {
dialog.getData("oncancel")(dialog.getData("data"));
}
}
},
});
};
var myloadingalert = function(opts) {
if (!opts) opts={};
var myloadingalert = function (opts) {
if (!opts) opts = {};
var opened = false;
var closed = false;
var dialog = BootstrapDialog.show({
title: opts.title || _('Please wait'),
message: opts.message || _('Please wait while your request is being processed.'),
title: opts.title || _("Please wait"),
message:
opts.message || _("Please wait while your request is being processed."),
autodestroy: true,
type: opts.type || BootstrapDialog.TYPE_INFO,
size: opts.size || BootstrapDialog.SIZE_NORMAL,
type: opts.type || BootstrapDialog.TYPE_INFO,
size: opts.size || BootstrapDialog.SIZE_NORMAL,
cssClass: opts.css_class || null,
centered: opts.centered || true,
closable: opts.closable || false,
draggable: opts.draggable || false,
onshown: function (dialog) {
if (closed)
dialog.close();
if (closed) dialog.close();
opened = true;
}
},
});
return {
'modal': dialog,
'close': function() {
if (opened)
dialog.close();
modal: dialog,
close: function () {
if (opened) dialog.close();
closed = true;
}
},
};
};
$( document ).ready(function () {
$(document).ready(function () {
// Manage .myconfirm-link
$('.myconfirm-link').click(function(event) {
$(".myconfirm-link").click(function (event) {
event.preventDefault();
myconfirm({
title: $(this).data("myconfirm-title") || _("Confirmation"),
question: "<p><strong>"+($(this).data("myconfirm-question") || _("Are you sure?"))+"</strong></p>",
onconfirm: function(data) {
question:
"<p><strong>" +
($(this).data("myconfirm-question") || _("Are you sure?")) +
"</strong></p>",
onconfirm: function (data) {
window.location = data.confirm_url;
},
data: {
confirm_url: $(this).data('myconfirm-url')
}
confirm_url: $(this).data("myconfirm-url"),
},
});
});
// Manage .myloading-link
$('.myloading-link').click(function(event) {
$(".myloading-link").click(function (event) {
event.preventDefault();
myloadingalert({
title: $(this).data("myloading-title"),
message: $(this).data("myloading-message"),
});
window.location = $(this).data('myloading-url');
window.location = $(this).data("myloading-url");
});
// Manage .myconfirm-btn
$('.myconfirm-btn').click(function(event) {
if ($(this).data('myconfirm-btn-confirmed') == '1') {
$(this).data('myconfirm-btn-confirmed', '');
$(".myconfirm-btn").click(function (event) {
if ($(this).data("myconfirm-btn-confirmed") == "1") {
$(this).data("myconfirm-btn-confirmed", "");
return true;
}
event.preventDefault();
myconfirm({
title: $(this).data("myconfirm-title") || _("Confirmation"),
question: "<p><strong>"+($(this).data("myconfirm-question") || _("Are you sure?"))+"</strong></p>",
onconfirm: function(data) {
data.btn.data('myconfirm-btn-confirmed', 1);
question:
"<p><strong>" +
($(this).data("myconfirm-question") || _("Are you sure?")) +
"</strong></p>",
onconfirm: function (data) {
data.btn.data("myconfirm-btn-confirmed", 1);
data.btn.click();
},
data: {
btn: $(this)
}
btn: $(this),
},
});
});
// Manage .myloading-btn
$('.myloading-btn').click(function(event) {
$(".myloading-btn").click(function (event) {
myloadingalert({
title: $(this).data("myloading-title"),
message: $(this).data("myloading-message"),

View file

@ -1,23 +1,25 @@
/*
* I18n
*/
* I18n
*/
var translations;
var translations_data;
function _(string) {
var translated = (translations?translations.gettext(string):string);
return (translated !== '') ? translated : string;
var translated = translations ? translations.gettext(string) : string;
return translated !== "" ? translated : string;
}
function ngettext(singular, plural, n) {
return (
translations?
translations.ngettext(singular, plural, n):
(n > 1?plural:singular)
);
return translations
? translations.ngettext(singular, plural, n)
: n > 1
? plural
: singular;
}
$(document).ready( function() {
$(document).ready(function () {
// Load Gettext translations
translations = babel.Translations.load(translations_data?translations_data:{}).install();
translations = babel.Translations.load(
translations_data ? translations_data : {}
).install();
});