[ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * Displays message signatures marked by a '-- ' in the style of the 4 * CSS class "signature". Class names inside the signature are 5 * prefixed with "signature-". 6 * 7 * $Horde: framework/Text_Filter/Filter/dimsignature.php,v 1.2.10.6 2006/08/17 12:29:55 jan Exp $ 8 * 9 * Copyright 2004-2006 Jan Schneider <jan@horde.org> 10 * 11 * See the enclosed file COPYING for license information (LGPL). If you did 12 * not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 13 * 14 * @author Jan Schneider <jan@horde.org> 15 * @since Horde 3.0 16 * @package Horde_Text 17 */ 18 class Text_Filter_dimsignature extends Text_Filter { 19 20 /** 21 * Executes any code necessaray after applying the filter 22 * patterns. 23 * 24 * @param string $text The text after the filtering. 25 * 26 * @return string The modified text. 27 */ 28 function postProcess($text) 29 { 30 $parts = preg_split('|(\n--\s*(<br />)?\r?\n)|', $text, 2, PREG_SPLIT_DELIM_CAPTURE); 31 if (count($parts) > 3) { 32 $text = array_shift($parts); 33 $text .= '<span class="signature">' . $parts[0]; 34 $text .= preg_replace('|class="([^"]+)"|', 'class="signature-\1"', $parts[2]); 35 $text .= '</span>'; 36 } 37 38 return $text; 39 } 40 41 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |