Revision 1888
Added by Dietmar over 11 years ago
include.php | ||
---|---|---|
206 | 206 |
// find and replace all keywords |
207 | 207 |
function format2(&$aCurrItem) { |
208 | 208 |
if (!is_string($aCurrItem)) return ''; |
209 |
return preg_replace( |
|
209 |
return preg_replace_callback(
|
|
210 | 210 |
'@\[('. |
211 | 211 |
'a|ac|/a|li|/li|ul|/ul|menu_title|menu_icon_0|menu_icon_1|'. |
212 |
'page_title|page_icon|url|target|page_id|tooltip|'.
|
|
212 |
'page_title|page_icon|url|target|page_id|tooltip|'.
|
|
213 | 213 |
'parent|level|sib|sibCount|class|description|keywords|'. |
214 | 214 |
SM2_CONDITIONAL. |
215 |
')\]@e', |
|
216 |
'$this->replace("\1")', $aCurrItem); |
|
215 |
')\]@', |
|
216 |
array($this, 'replace'), |
|
217 |
$aCurrItem); |
|
217 | 218 |
} |
218 | 219 |
|
219 | 220 |
// replace the keywords |
220 |
function replace($aMatch) { |
|
221 |
function replace($aMatches) { |
|
222 |
$aMatch = $aMatches[1]; |
|
221 | 223 |
$retval = '['.$aMatch.'=UNKNOWN]'; |
222 | 224 |
switch ($aMatch) { |
223 | 225 |
case 'a': |
... | ... | |
847 | 849 |
$aFormatter->finishList(); |
848 | 850 |
} |
849 | 851 |
} |
850 |
|
Also available in: Unified diff
The /e modifier is deprecated, replaced with preg_replace_callback