Procedural File: func.php
Source Location: /lodel/scripts/func.php
Page Details
Fichier utilitaire proposant des fonctions souvent utilisées dans Lodel
PHP versions 4 et 5 LODEL - Logiciel d'Edition ELectronique. Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot Home page: http://www.lodel.org E-Mail: lodel@lodel.org All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 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., 675 Mass Ave, Cambridge, MA 02139, USA.
| Author: | Pierre-Alain Mignot |
| Author: | Ghislain Picard |
| Author: | Jean Lamy |
| Author: | Sophie Malafosse |
| Version: | CVS:$Id: |
| Copyright: | 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou |
| Copyright: | 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot |
| Copyright: | 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse |
| Filesource: | Source Code for this file |
Functions
void addmeta(
&$arr, [ $meta = ""]
)
|
|
Parameters:
array_merge_withprefix [line 290]
void array_merge_withprefix(
$arr1, $prefix, $arr2
)
|
|
Parameters:
canContainTypes [line 1076]
void canContainTypes(
idtype $idtype
)
|
|
Return true if a type can contains other types.
(this function is used in edition, to make entities clicable or not)
Parameters:
|
idtype |
$idtype: |
id of the type |
checkdocannexedir [line 670]
void checkdocannexedir(
string $dir
)
|
|
Vérifie que le répertoire $dir, un répertoire de docannexe existe. Dans le cas contraire le crée
Parameters:
|
string |
$dir: |
le nom du répertoire |
void chrank(
$table, $id, $critere, $dir, [ $inverse = ""], [ $jointables = ""]
)
|
|
Parameters:
|
|
$table: |
|
|
|
$id: |
|
|
|
$critere: |
|
|
|
$dir: |
|
|
|
$inverse: |
|
|
|
$jointables: |
|
clean_request_variable [line 95]
void clean_request_variable(
&$var
)
|
|
Parameters:
function returning the closing tag corresponding to the opening tag in the sequence this function could be smarter.
Parameters:
void download(
string $filename, [string $originalname = ""], [ $contents = ""]
)
|
|
sent the header and the file for downloading
Parameters:
|
string |
$filename: |
name of the real file. |
|
string |
$originalname: |
name to send to the browser. |
|
|
$contents: |
|
void extract_post(
[ $arr = -1]
)
|
|
Extrait toutes les variables passées par la méthode post puis les stocke dans
le tableau $context
Parameters:
file_get_contents [line 430]
void file_get_contents(
$file
)
|
|
Parameters:
fix_newlines_for_clean_html [line 1173]
void fix_newlines_for_clean_html(
$fixthistext
)
|
|
Parameters:
getGenericDAO [line 1059]
void &getGenericDAO(
$table, $idfield
)
|
|
generic DAO factory
Parameters:
getgenericfields [line 1349]
void getgenericfields(
&$context, array $context
)
|
|
Récupère les champs génériques définis pour une entité * Stocke les champs génériques définis pour une entité dans un sous tableau de $context : generic
Parameters:
|
array |
$context: |
le contexte passé par référence |
|
|
&$context: |
|
void getlodeltext(
$name, $group, &$id, &$contents, &$status, [ $lang = -1]
)
|
|
Parameters:
|
|
$name: |
|
|
|
$group: |
|
|
|
&$id: |
|
|
|
&$contents: |
|
|
|
&$status: |
|
|
|
$lang: |
|
getlodeltextcontents [line 377]
void getlodeltextcontents(
$name, [ $group = ""], [ $lang = -1]
)
|
|
Parameters:
string getPath(
integer $id, string $urltype, [ $base = 'index']
)
|
|
retourne le chemin complet vers une entitée *
Parameters:
|
integer |
$id: |
identifiant numérique de l'entitée * |
|
string |
$urltype: |
le type d'url utilisée(path,querystring) |
|
|
$base: |
|
API Tags:
Information Tags:
| Since: | fonction ajoutée en 0.8 |
get_dc_fields [line 1295]
le get_dc_fields(
integer $id, string $dcfield
)
|
|
Récupération des champs génériques dc.* associés aux entités
Parameters:
|
integer |
$id: |
identifiant numéique de l'entité dont on veut récupérer un champ dc |
|
string |
$dcfield: |
le nom du champ à récupérer (sans le dc.devant). Ex : .'description' pour 'dc.description' |
API Tags:
| Return: | contenu du champ passé dans le paramètre $dcfield |
void get_max_rank(
$table, [ $where = ""]
)
|
|
Parameters:
get_PMA_define [line 529]
le isUTF8(
string $string
)
|
|
Fonction qui indique si une chaine est en utf-8 ou non
Cette fonction est inspirée de Dotclear et de http://w3.org/International/questions/qa-forms-utf-8.html.
Parameters:
|
string |
$string: |
la chaîne à tester |
API Tags:
| Return: | résultat de la fonction preg_match c'est-a-dire false si la chaine n'est pas en UTF8 |
list_system_locales [line 1331]
void list_system_locales(
)
|
|
magic_addslashes [line 120]
void magic_addslashes(
$var
)
|
|
Parameters:
magic_stripslashes [line 130]
void magic_stripslashes(
$var
)
|
|
Parameters:
le makeSortKey(
string $text
)
|
|
Transforme une chaine de caractère UTF8 en minuscules désaccentuées
Cette fonction prends en entrée une chaîne en UTF8 et donne en sortie une chaîne - les accents ont été remplacés par leur équivalent désaccentué. De plus les caractères
sont mis en minuscules et les espaces en début et fin de chaine sont enlevés.Cette fonction est utilisée pour les entrees d'index ainsi que dans le moteur de recherche et pour le calcul des identifiants littéraux.
Parameters:
|
string |
$text: |
le texte à passer en entrée |
API Tags:
| Return: | texte transformé en minuscule |
void makeurlwithid(
$id, [ $base = 'index']
)
|
|
Parameters:
void myaddslashes(
&$var
)
|
|
Parameters:
void myfileexists(
string $file
)
|
|
Fonction permettant de vérifier l'existence d'un fichier correctement !
Parameters:
|
string |
$file: |
fichier à tester |
void myfilemtime(
string $filename
)
|
|
Retourne la dernière date de modif de $filename
Parameters:
|
string |
$filename: |
fichier à tester |
myhtmlentities [line 765]
void myhtmlentities(
$text
)
|
|
Parameters:
mystripslashes [line 1088]
void mystripslashes(
&$var
)
|
|
Parameters:
void postprocessing(
&$context
)
|
|
Parameters:
void prefix_keys(
$prefix, $arr
)
|
|
Parameters:
rewriteFilename [line 1441]
void rewriteFilename(
$string
)
|
|
Parameters:
boolean rightonentity(
string $action, array $context
)
|
|
rightonentity check if a user has the rights to perform an action on an entity
Parameters:
|
string |
$action: |
the action to be performed : create, edit, delete,... |
|
array |
$context: |
the current context |
API Tags:
| Return: | true if the user has the right, false ifnot |
void save_file(
dir $type, docAnnexe $dir, $file, $filename, $uploaded, $move, &$error, [ $docAnnexe = true]
)
|
|
Save the file or image files associated with a entites (annex file). Check it is a valid image.
Parameters:
|
dir |
$type: |
If $dir is numeric it is the id of the entites. In the other case, $dir should be a temporary directory. |
|
docAnnexe |
$dir: |
boolean = true if the file is saved in the directory "docannexe", else false |
|
|
$file: |
|
|
|
$filename: |
|
|
|
$uploaded: |
|
|
|
$move: |
|
|
|
&$error: |
|
|
|
$docAnnexe: |
|
boolean send_mail(
string $to, string $body, string $subject, string $fromaddress, string $fromname
)
|
|
Fonction permettant d'envoyer correctement un mail en html (utf8)
Parameters:
|
string |
$to: |
destinataire |
|
string |
$body: |
corps du message |
|
string |
$subject: |
sujet du mail |
|
string |
$fromaddress: |
adresse de l'expéditeur |
|
string |
$fromname: |
nom de l'expediteur |
Information Tags:
| Author: | Pierre-Alain Mignot |
void setrecord(
$table, $id, $set, [ $context = array()]
)
|
|
Parameters:
|
|
$table: |
|
|
|
$id: |
|
|
|
$set: |
|
|
|
$context: |
|
void sql_in_array(
$ids
)
|
|
generate the SQL criteria depending whether ids is an array or a number
Parameters:
translate_xmldata [line 252]
void translate_xmldata(
$data
)
|
|
Parameters:
le url_path(
string $url
)
|
|
Analyse une url et retourne le chemin en local qu'elle contient éventuellement Cf. parse_url : élément 'path' du tableau retourné
Parameters:
API Tags:
| Return: | chemin contenu dans l'URL |
void writefile(
$filename, $text
)
|
|
Fichier utilitaire proposant des fonctions souvent utilisées dans Lodel
PHP versions 4 et 5 LODEL - Logiciel d'Edition ELectronique. Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot Home page: http://www.lodel.org E-Mail: lodel@lodel.org All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 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., 675 Mass Ave, Cambridge, MA 02139, USA.
Parameters:
API Tags:
Information Tags:
| Author: | Pierre-Alain Mignot |
| Author: | Ghislain Picard |
| Author: | Jean Lamy |
| Author: | Sophie Malafosse |
| Version: | CVS:$Id: |
| Copyright: | 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou |
| Copyright: | 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot |
| Copyright: | 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse |
le _indent(
string $source, [string $indenter = ' ']
)
|
|
Indentation de code HTML, XML
Parameters:
|
string |
$source: |
le code a indenter |
|
string |
$indenter: |
les caractères à utiliser pour l'indentation. Par défaut deux espaces. |
API Tags:
| Return: | code indenté proprement |
_indent_xhtml [line 1210]
le _indent_xhtml(
string $uncleanhtml, [string $indent = " "]
)
|
|
Indentation de code XHTML
Parameters:
|
string |
$uncleanhtml: |
le code a indenter |
|
string |
$indent: |
les caractères à utiliser pour l'indentation. Par déffaut deux espaces. |
API Tags:
| Return: | code indenté proprement |
|
|