gestion des li

This commit is contained in:
Michael RICOIS 2010-04-01 08:51:39 +00:00
parent 1797442e6c
commit d847133d26
6 changed files with 61 additions and 6 deletions

View File

@ -7,6 +7,32 @@ function commentaires_siren($content){
return $output;
}
function commentaires_liste($content){
$pattern = '/(.*?)<li([\+|-]?)>(.+?)/Usi';
if(preg_match($pattern, $content, $matches)){
FB::log($matches, 'li');
switch($matches[2]){
case '+':
$class = 'plus';
break;
case '-':
$class = 'moins';
break;
default:
$class = 'point';
break;
}
$replace = '$1<span class="'.$class.'">$3</span>';
}
$output = preg_replace($pattern, $replace, $content);
return $output;
}
function commentaires_image($content){
}
function commentaires_lien($content){
$path = array(
'pdf' => '/datafile.php?q=commentaires',

View File

@ -4,7 +4,7 @@
.page { page-break-before:always; }
#commentaires h1 {
clear:both;
margin:10px 0 5px 0;
margin:15px 0 5px 0;
padding:0;
background:none;
color:#000000;
@ -15,7 +15,7 @@
#commentaires h2 {
clear:both;
margin:5px 0 0 0;
margin:15px 0 0 0;
padding:0;
background:none;
color:#000000;
@ -26,7 +26,7 @@
#commentaires h3 {
clear:both;
margin:5px 0 0 0;
margin:15px 0 0 0;
padding:0;
background:none;
color:#000000;
@ -35,6 +35,17 @@
text-decoration:underline;
}
#commentaires h4 {
clear:both;
margin:15px 0 0 0;
padding:0;
background:none;
color:#000000;
font:normal 0.8em Arial, Verdana, Sans-serif;
border:0;
text-decoration:underline;
}
#commentaires table td, #commentaires table th {
border:1px solid #000000;
padding:5px;
@ -75,4 +86,21 @@
#commentaires table tr.JAUNE {
background:#ffff66;
color:#000000;
}
#commentaires span{
padding-left:10px;
}
#commentaires span.plus{
background: white url(../img/li-plus.gif) no-repeat left center;
}
#commentaires span.moins{
background: white url(../img/li-moins.gif) no-repeat left center;
}
#commentaires span.point{
background: white url(../img/li-point.gif) no-repeat left center;om;
}

BIN
www/img/li-moins.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

BIN
www/img/li-plus.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

BIN
www/img/li-point.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

View File

@ -212,7 +212,6 @@ if($element!==false){ echo dRow($element['lib'], $element['data'], $element['tit
require_once 'mappy/mappy.php';
$ville = ' '.trim(preg_replace('/([0-9]|ARRONDISSEMENT|_)/i',' ',$etab['Ville'])).' ';
$ville = trim(strtr($ville, array(' EME '=>'', ' ER '=>'')));
$firephp->log($ville, 'ville');
if ( hasPref('mappy') && in_array(strtoupper($ville), $tabVilleMappy) )
{
$rue = trim( strtr(
@ -1497,7 +1496,6 @@ else
?>
<h1 class="titre page">RATIOS</h1>
<?php
$firephp->log($_SESSION, 'SESSION');
if (count($bilansInfos)==0)
{
?>
@ -1673,11 +1671,14 @@ if(count($tabCommentaires)>0)
$commentaires = commentaires_siren($commentaires);
//Traitement des balises lien
$commentaires = commentaires_lien($commentaires);
//Traitement des balises li+, li-, li
$commentaires = commentaires_liste($commentaires);
//Traitement des graphiques
$pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*?#[a-zA-Z]{1})]/';
if( preg_match($pattern, $commentaires, $matches) ){
//Initialisation des éléments
FB::log($matches[0],'graphique');
//FB::log($matches[0],'graphique');
$image_id = $matches[1];
$graph_titre = $matches[2];
$ratio = array();