phpDocumentor lodel
[ class tree: lodel ] [ index: lodel ] [ all elements ]

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
addmeta  [line 233]

void addmeta( &$arr, [ $meta = ""]  )
Parameters:
   &$arr: 
   $meta: 


[ Top ]
array_merge_withprefix  [line 290]

void array_merge_withprefix( $arr1, $prefix, $arr2  )
Parameters:
   $arr1: 
   $prefix: 
   $arr2: 


[ Top ]
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


[ Top ]
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


[ Top ]
chrank  [line 150]

void chrank( $table, $id, $critere, $dir, [ $inverse = ""], [ $jointables = ""]  )
Parameters:
   $table: 
   $id: 
   $critere: 
   $dir: 
   $inverse: 
   $jointables: 


[ Top ]
clean_request_variable  [line 95]

void clean_request_variable( &$var  )
Parameters:
   &$var: 


[ Top ]
closetags  [line 184]

void closetags( $text  )

function returning the closing tag corresponding to the opening tag in the sequence this function could be smarter.

Parameters:
   $text: 


[ Top ]
download  [line 476]

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: 


[ Top ]
extract_post  [line 82]

void extract_post( [ $arr = -1]  )

Extrait toutes les variables passées par la méthode post puis les stocke dans

le tableau $context

Parameters:
   $arr: 


[ Top ]
file_get_contents  [line 430]

void file_get_contents( $file  )
Parameters:
   $file: 


[ Top ]
fix_newlines_for_clean_html  [line 1173]

void fix_newlines_for_clean_html( $fixthistext  )
Parameters:
   $fixthistext: 


[ Top ]
getDAO  [line 1042]

void &getDAO( $table  )

DAO factory

Parameters:
   $table: 


[ Top ]
getGenericDAO  [line 1059]

void &getGenericDAO( $table, $idfield  )

generic DAO factory

Parameters:
   $table: 
   $idfield: 


[ Top ]
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: 


[ Top ]
getlodeltext  [line 328]

void getlodeltext( $name, $group, &$id, &$contents, &$status, [ $lang = -1]  )
Parameters:
   $name: 
   $group: 
   &$id: 
   &$contents: 
   &$status: 
   $lang: 


[ Top ]
getlodeltextcontents  [line 377]

void getlodeltextcontents( $name, [ $group = ""], [ $lang = -1]  )
Parameters:
   $name: 
   $group: 
   $lang: 


[ Top ]
getoption  [line 301]

void getoption( $name  )
Parameters:
   $name: 


[ Top ]
getPath  [line 445]

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:
Return:  le chemin

Information Tags:
Since:  fonction ajoutée en 0.8

[ Top ]
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


[ Top ]
get_max_rank  [line 139]

void get_max_rank( $table, [ $where = ""]  )
Parameters:
   $table: 
   $where: 


[ Top ]
get_PMA_define  [line 529]

void get_PMA_define( )


[ Top ]
isUTF8  [line 831]

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


[ Top ]
list_system_locales  [line 1331]

void list_system_locales( )


[ Top ]
lock_write  [line 270]

void lock_write( )


[ Top ]
magic_addslashes  [line 120]

void magic_addslashes( $var  )
Parameters:
   $var: 


[ Top ]
magic_stripslashes  [line 130]

void magic_stripslashes( $var  )
Parameters:
   $var: 


[ Top ]
makeSortKey  [line 859]

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


[ Top ]
makeurlwithid  [line 389]

void makeurlwithid( $id, [ $base = 'index']  )
Parameters:
   $id: 
   $base: 


[ Top ]
myaddslashes  [line 193]

void myaddslashes( &$var  )
Parameters:
   &$var: 


[ Top ]
myfileexists  [line 210]

void myfileexists( string $file  )

Fonction permettant de vérifier l'existence d'un fichier correctement !

Parameters:
string   $file:  fichier à tester


[ Top ]
myfilemtime  [line 221]

void myfilemtime( string $filename  )

Retourne la dernière date de modif de $filename

Parameters:
string   $filename:  fichier à tester


[ Top ]
myhtmlentities  [line 765]

void myhtmlentities( $text  )
Parameters:
   $text: 


[ Top ]
mystripslashes  [line 1088]

void mystripslashes( &$var  )
Parameters:
   &$var: 


[ Top ]
postprocessing  [line 62]

void postprocessing( &$context  )
Parameters:
   &$context: 


[ Top ]
prefix_keys  [line 279]

void prefix_keys( $prefix, $arr  )
Parameters:
   $prefix: 
   $arr: 


[ Top ]
rewriteFilename  [line 1441]

void rewriteFilename( $string  )
Parameters:
   $string: 


[ Top ]
rightonentity  [line 975]

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


[ Top ]
save_file  [line 601]

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: 


[ Top ]
send_mail  [line 1467]

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

[ Top ]
setrecord  [line 774]

void setrecord( $table, $id, $set, [ $context = array()]  )
Parameters:
   $table: 
   $id: 
   $set: 
   $context: 


[ Top ]
sql_in_array  [line 1032]

void sql_in_array( $ids  )

generate the SQL criteria depending whether ids is an array or a number

Parameters:
   $ids: 


[ Top ]
tmpdir  [line 755]

void tmpdir( )


[ Top ]
translate_xmldata  [line 252]

void translate_xmldata( $data  )
Parameters:
   $data: 


[ Top ]
unlock  [line 259]

void unlock( )


[ Top ]
update  [line 227]

void update( )


[ Top ]
url_path  [line 1435]

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:
string   $url: 

API Tags:
Return:  chemin contenu dans l'URL


[ Top ]
writefile  [line 49]

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:
   $filename: 
   $text: 

API Tags:
Filesource:  Source Code for this file

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

[ Top ]
_indent  [line 1105]

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


[ Top ]
_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


[ Top ]


Documentation generated on Thu, 19 Jun 2008 05:07:32 +0200 by phpDocumentor 1.4.0a2