Procedural File: textfunc.php
Source Location: /lodel/scripts/textfunc.php
Page Details
Fichier utilitaire proposant des fonctions sur les textes 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 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: | Jean Lamy |
| Author: | Ghislain Picard |
| Version: | CVS:$Id: |
| Copyright: | 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse |
| Copyright: | 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou |
Includes
require_once
("textfunc_local.php")
[line 45]
Fichier utilitaire proposant des fonctions sur les textes 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 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.
Information Tags:
| Author: | Jean Lamy |
| Author: | Ghislain Picard |
| Version: | CVS:$Id: |
| Copyright: | 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse |
| Copyright: | 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou |
Functions
couper [line 86]
void couper(
$texte, $long
)
|
|
Parameters:
API Tags:
| Deprecated: | Ne plus utiliser en 0.8 |
couperpara [line 140]
void couperpara(
$texte, $long
)
|
|
Parameters:
cuttext [line 94]
void cuttext(
$text, $length
)
|
|
Cut text keeping whole words
Parameters:
cut_without_tags [line 119]
void cut_without_tags(
$text, $length
)
|
|
Parameters:
defaultvalue [line 765]
void defaultvalue(
$var1, $var2
)
|
|
Return the value in parameter if the variable si empty/null
Parameters:
falsefunction [line 399]
void falsefunction(
$text, $text2
)
|
|
Return the second argument if the first is false
Parameters:
format [line 556]
void format(
$text, [ $creationmethod = ""], [ $creationinfo = ""]
)
|
|
function to format the text given the creationmethod field
Parameters:
|
|
$text: |
|
|
|
$creationmethod: |
|
|
|
$creationinfo: |
|
formateddate [line 246]
void formateddate(
$date, $format
)
|
|
Parameters:
formatedtime [line 251]
void formatedtime(
$time, $format
)
|
|
Parameters:
formatstring [line 736]
void formatstring(
$text, $format
)
|
|
Bootstrap pour sprintf
affiche l'argument selon le format
Parameters:
getFileMime [line 1150]
void getFileMime(
string $filename
)
|
|
renvoie le type mime d'un fichier, soit par l'extension PEAR fileinfo, soit par le système
Parameters:
|
string |
$filename: |
le nom du fichier |
Information Tags:
getImageCredits [line 1132]
void getImageCredits(
string $text, string $source
)
|
|
Récupère les crédits d'une image lorsque ceux-là se trouvent au dessous de celle-ci
Parameters:
|
string |
$text: |
le texte à parser |
|
string |
$source: |
le nom du fichier image |
Information Tags:
getImageDesc [line 1113]
void getImageDesc(
string $text, string $source
)
|
|
Récupère la légende d'une image lorsque celle-là se trouve au dessous de celle-ci
Parameters:
|
string |
$text: |
le texte à parser |
|
string |
$source: |
le nom du fichier image |
Information Tags:
getImageTitle [line 1053]
void getImageTitle(
string $text, mixed $source, [string $titlePos = 'up'], [integer $posi = '0']
)
|
|
Récupère le titre d'une image lorsque celui-là se trouve au dessus ou au dessous de celle-ci
Parameters:
|
string |
$text: |
le texte à parser |
|
mixed |
$source: |
le nom du fichier image ou sa position dans le texte |
|
string |
$titlePos: |
la position du titre de l'image dans le doc stylé |
|
integer |
$posi: |
position de l'image suivante |
Information Tags:
| Author: | Bruno Cénou |
| Author: | Pierre-Alain Mignot |
hideifearlier [line 639]
void hideifearlier(
$text, $date
)
|
|
Retourne le texte si la date est dépassée, sinon retourne une chaine vide.
Parameters:
humanlang [line 619]
Renvoie la lang "human reading"
Parameters:
iconifier [line 1001]
void iconifier(
string $text, [integer $width = 150], [string $titlePos = 'up'], [integer $max = 640], [integer $min = 400]
)
|
|
Extrait les images au sein du texte pour en faire une version petite taille et fournir un lien vers une version haute résolution dans un popup
Parameters:
|
string |
$text: |
le texte à parser |
|
integer |
$width: |
la largeur souhaitée pour les images dans le texte |
|
string |
$titlePos: |
la position du titre de l'image dans le doc stylé |
|
integer |
$max: |
la largeur maximale du popup |
|
integer |
$min: |
la largeur minimale du popup |
Information Tags:
| Author: | Bruno Cénou |
| Author: | Pierre-Alain Mignot |
imageheight [line 665]
void imageheight(
$image
)
|
|
Retourne la hauteur de l'image.
Parameters:
imagewidth [line 652]
void imagewidth(
$image
)
|
|
Retourne la largeur de l'image.
Parameters:
isabsolute [line 597]
Permet de savoir si un lien est absolu
Parameters:
isadate [line 464]
Fonction qui dit si une date est vide ou non
Parameters:
ishtml [line 746]
Detect if the document is HTML
Bad heursitic
Parameters:
isrelative [line 585]
Permet de savoir si un lien est relatif
Parameters:
lodeltextcolor [line 755]
void lodeltextcolor(
$status
)
|
|
Parameters:
majuscule [line 69]
Upercase the first letter of Texte
Parameters:
multilingue [line 351]
void multilingue(
$text, $lang
)
|
|
Parameters:
nicefilesize [line 679]
void nicefilesize(
$lien
)
|
|
Renvoie la taille d'un fichier, mais formate joliment
avec des kilo et mega
Parameters:
notes [line 500]
void notes(
$texte, $type
)
|
|
fonction pour les notes
Parameters:
notesmarginales [line 861]
void notesmarginales(
&$texte, string $coupe, string $texte
)
|
|
Filtre pour l'ajout des notes marginales
Ajoute un <div class="textandnotes"> et encapsule les notes dans une liste : <ul class="sidenotes"> <li> ... </li> </ul> contient le numéro de la note et celle-ci tronquée (si trop longue) à 100 caractères. Le seul paramètre sera le seuil d'affichage des notes
Parameters:
|
string |
$texte: |
le texte à numéroter passé par référence |
|
string |
$coupe: |
un entier (définit dans le template) |
|
|
&$texte: |
|
Information Tags:
paranumber [line 798]
void paranumber(
&$texte, [string $styles = 'texte'], string $texte
)
|
|
Filtre de numerotation des paragraphes
Ajoute un <span class="paranumber"> contenant une ancre avec le numero du paragraphe aux paragraphes ayant le style texte par défaut. Les paramètres sont modifiables dans le template et écrasent les paramètres par défaut.
Parameters:
|
string |
$texte: |
le texte à numéroter passé par référence |
|
string |
$styles: |
chaine contenant les styles par défaut ou s'applique la numerotation (les styles sont separes par des ";") |
|
|
&$texte: |
|
Information Tags:
removeendnotes [line 416]
void removeendnotes(
$text
)
|
|
Supprimer les appels de notes de fin de document.
Parameters:
removefootnotes [line 408]
void removefootnotes(
$text
)
|
|
Supprimer les appels de notes de pied de page d'un texte.
Parameters:
removeimages [line 434]
void removeimages(
$text
)
|
|
Fonction qui enleve les images
Parameters:
removelinks [line 456]
void removelinks(
$text
)
|
|
Fonction permettant de supprimer les liens.
Parameters:
removenotes [line 425]
void removenotes(
$text
)
|
|
Fonction permettant de supprimer les appels de notes d'un texte.
Parameters:
removespace [line 726]
void removespace(
$text
)
|
|
Remove space for xml elements
Parameters:
removetags [line 443]
void removetags(
$text, $tags
)
|
|
Fonction qui enleve les tags spécifiés
Parameters:
replacement [line 775]
void replacement(
$arg0, $arg1, $arg2, $arg3, $arg4, $count
)
|
|
Fonction utilisée ci dessous pour la numérotation des paragraphes
Parameters:
|
|
$arg0: |
|
|
|
$arg1: |
|
|
|
$arg2: |
|
|
|
$arg3: |
|
|
|
$arg4: |
|
|
|
$count: |
|
replacequotationmark [line 472]
void replacequotationmark(
$text
)
|
|
Fonction qui remplace les guillemets d'un texte par leur name d'entité (")
Parameters:
sizeattributs [line 382]
void sizeattributs(
$text
)
|
|
Parameters:
strip_tags_keepnotes [line 606]
void strip_tags_keepnotes(
$text, [ $keeptags = ""]
)
|
|
Enleve les tags HTML qui garde les footnotes et les endnotes de OpenOffice
Parameters:
textebrut [line 74]
void textebrut(
$letexte
)
|
|
Parameters:
tocable [line 317]
string tocable(
string $text, [int $level = 10]
)
|
|
Transform headings into toc relative links
Parameters:
|
string |
$text: |
the text to transform |
|
int |
$level: |
an integer representing the max level which will be transformed |
API Tags:
| Return: | the transformed text |
tocss [line 533]
void tocss(
$text, [ $options = ""]
)
|
|
fonctions pour le nettoyage de base des champs importes
Parameters:
today [line 630]
Retourne la date courante sous la forme YYYY-MM-JJ
truefunction [line 391]
void truefunction(
$text, $text2
)
|
|
Return the second argument if the first is true
Parameters:
vignette [line 357]
void vignette(
$text, $width
)
|
|
Parameters:
wiki [line 708]
Bootstrap Lodel pour WikiRender
Assure la conversion texte Wiki en xhtml
Parameters:
|
|