[doc] switching comments to english for quenenni patches
This commit is contained in:
parent
b88b639b60
commit
b777f982e5
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$Id: m_messages.php,v 1.4 2004/05/19 14:23:06 benjamin Exp $
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
|
@ -17,36 +16,31 @@
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag, Franck Missoum
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe de gestion des messages apparaissant lors d'appels API.
|
* Handle messages (error, warning, info, ok) appearing in API calls.
|
||||||
*
|
*
|
||||||
* <p>Cette classe gère les messages qui peuvent apparaitre lors d'appels
|
* <p>This class handles messages appearing while calling API functions of AlternC
|
||||||
* à l'API d'AlternC. Ces msgs sont stockées sous la forme d'1 nombre
|
* Those messages are stored as a number (class-id) and a message
|
||||||
* (Classe ID) ainsi que du msg en associé.
|
* localized messages are available</p>
|
||||||
* Des messages localisés sont aussi disponibles.</p>
|
* <p>This class also handle inserting those messages into the logging
|
||||||
* <p>Cette classe se charge aussi d'insérer les appels à l'API d'AlternC
|
* system in /var/log/alternc/bureau.log
|
||||||
* dans les logs du système dans /var/log/alternc/bureau.log
|
|
||||||
* </p>
|
* </p>
|
||||||
* Copyleft {@link http://alternc.net/ AlternC Team}
|
|
||||||
*
|
*
|
||||||
* @copyright AlternC-Team 2002-11-01 http://alternc.net/
|
* @copyright AlternC-Team https://alternc.com/
|
||||||
*/
|
*/
|
||||||
class m_messages {
|
class m_messages {
|
||||||
|
|
||||||
/** Tableau qui va contenir les messages et leur id */
|
/** Contains the messages and their ID */
|
||||||
var $arrMessages = array();
|
var $arrMessages = array();
|
||||||
|
|
||||||
/** Emplacement du fichier de logs d'AlternC */
|
|
||||||
var $logfile = "/var/log/alternc/bureau.log";
|
var $logfile = "/var/log/alternc/bureau.log";
|
||||||
|
|
||||||
/** Liste of possible type */
|
/** List of possible message types */
|
||||||
var $ARRTYPES = array("ERROR", "ALERT", "INFO", "OK");
|
var $ARRTYPES = array("ERROR", "ALERT", "INFO", "OK");
|
||||||
|
|
||||||
/** Associate css classes */
|
/** CSS classes for each type */
|
||||||
var $ARRCSS = array(
|
var $ARRCSS = array(
|
||||||
"ERROR" => "alert-danger",
|
"ERROR" => "alert-danger",
|
||||||
"ALERT" => "alert-warning",
|
"ALERT" => "alert-warning",
|
||||||
|
@ -59,16 +53,16 @@ class m_messages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enregistre un message, signale celle-ci dans les logs
|
* Record a message, insert it into the logfile.
|
||||||
*
|
*
|
||||||
* Cette fonction enregistre un message, l'ajoute dans les logs d'AlternC,
|
* This function records a message, add it to the logfile,
|
||||||
* et la met à disposition pour le bureau virtuel pour affichage ultérieur.
|
* and make it available for the web panel to print it later.
|
||||||
*
|
*
|
||||||
* @param string $cat The category of the msg array to work with
|
* @param string $cat The category of the msg array to work with
|
||||||
* @param integer $clsid Classe qui lève le message
|
* @param integer $clsid Which class raises this message
|
||||||
* @param mixed $msg Message
|
* @param mixed $msg The message
|
||||||
* @param string $param Paramètre chaine associé au message (facultatif)
|
* @param string $param Non-mandatory string parameter for this message
|
||||||
* @return boolean TRUE si le msg est enregistré, FALSE sinon.
|
* @return boolean TRUE if the message got recorded, FALSE if not.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function raise($cat = "Error", $clsid, $msg, $param = "") {
|
function raise($cat = "Error", $clsid, $msg, $param = "") {
|
||||||
|
@ -89,19 +83,21 @@ class m_messages {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the stored messages array
|
||||||
|
*/
|
||||||
function init_msgs() {
|
function init_msgs() {
|
||||||
// Initialisation du tableau des message
|
|
||||||
foreach ($this->ARRTYPES as $v) {
|
foreach ($this->ARRTYPES as $v) {
|
||||||
$this->arrMessages[$v] = array();
|
$this->arrMessages[$v] = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique s'il y a ds msgs enregistrés pour une catégorie si le param $cat contient une catégorie
|
* Tell if there are stored messages for a specific level
|
||||||
* ou pour toutesl es catégories si $cat est vide
|
* or for all levels (if level is empty)
|
||||||
*
|
*
|
||||||
* @param string $cat The category of the msg array to work with
|
* @param string $cat The level of the msg array to work with
|
||||||
* @return boolean True if there is/are msg recorded.
|
* @return boolean TRUE if there is/are msg recorded.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function has_msgs($cat) {
|
function has_msgs($cat) {
|
||||||
|
@ -118,10 +114,10 @@ class m_messages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la chaine de message concaténés de l'ensemble des msgs enregistrés
|
* Return a string of concateneted messages of all recorded messages
|
||||||
* ou du dernièr message rencontré
|
* or only the last message
|
||||||
*
|
*
|
||||||
* @param string $cat The category of the msg array to work with
|
* @param string $cat The level of the msg array to work with
|
||||||
* @param string $sep The separator used to concatenate msgs
|
* @param string $sep The separator used to concatenate msgs
|
||||||
* @param boolean $all show all the messages or only the last one
|
* @param boolean $all show all the messages or only the last one
|
||||||
*
|
*
|
||||||
|
@ -176,9 +172,9 @@ class m_messages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourn le message au format Html avec la class Css associée
|
* Return a message in HTML form with associated CSS
|
||||||
*
|
*
|
||||||
* @param string $cat The category of the msg array to work with
|
* @param string $cat The level of the msg array to work with
|
||||||
* @param string $sep The separator used to concatenate msgs
|
* @param string $sep The separator used to concatenate msgs
|
||||||
* @param boolean $all show all the messages or only the last one
|
* @param boolean $all show all the messages or only the last one
|
||||||
*
|
*
|
||||||
|
@ -200,7 +196,7 @@ class m_messages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourn le message de toutes les catégories au format Html avec la class Css associée
|
* Return all the messages of all levels in HTML form with associated CSS
|
||||||
*
|
*
|
||||||
* @param string $sep The separator used to concatenate msgs
|
* @param string $sep The separator used to concatenate msgs
|
||||||
* @param boolean $all show all the messages or only the last one
|
* @param boolean $all show all the messages or only the last one
|
||||||
|
@ -222,11 +218,11 @@ class m_messages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Envoi un log dans /var/log/alternc/bureau.log
|
* Log a message into /var/log/alternc/bureau.log
|
||||||
*
|
*
|
||||||
* Cette fonction Loggue le dernier msg dans /var/log sur la machine,
|
* This function logs the last message in the /var/log/alternc folder
|
||||||
* permettant ainsi aux admins de savoir ce qu'il se passe...
|
* allowing sysadmins to know what's happened.
|
||||||
* Elle est appelée automatiquement par error
|
* automatically called by raise()
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function logAlternC($cat = "Error") {
|
function logAlternC($cat = "Error") {
|
||||||
|
@ -241,15 +237,14 @@ class m_messages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Envoi un log d'appel d'API dans /var/log/alternc/bureau.log
|
* Log an API function call into /var/log/alternc/bureau.log
|
||||||
*
|
*
|
||||||
* Cette fonction loggue dans /var/log l'appel à la fonction de l'API
|
* This function logs in /var/log/alternc an API function call of AlternC
|
||||||
* d'AlternC.
|
|
||||||
*
|
*
|
||||||
* @param integer $clsid Numéro de la classe dont on a appelé une fonction
|
* @param integer $clsid Number of the class doing the call
|
||||||
* @param string $function Nom de la fonction appelée
|
* @param string $function Name of the called function
|
||||||
* @param string $param Paramètre (facultatif) passés à la fonction de l'API.
|
* @param string $param non-mandatory parameters of the API call
|
||||||
* @return boolean TRUE si le log a été ajouté, FALSE sinon
|
* @return boolean TRUE if the log where successfull, FALSE if not
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function log($clsid, $function, $param = "") {
|
function log($clsid, $function, $param = "") {
|
||||||
|
@ -259,4 +254,4 @@ class m_messages {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Classe m_messages */
|
/* Class m_messages */
|
||||||
|
|
Loading…
Reference in New Issue