[Openfirst-cvscommit] SF.net SVN: openfirst: [194] trunk/src/includes/functions.php
Brought to you by:
xtimg
From: <ast...@us...> - 2006-06-23 04:55:29
|
Revision: 194 Author: astronouth7303 Date: 2006-06-22 21:55:23 -0700 (Thu, 22 Jun 2006) ViewCVS: http://svn.sourceforge.net/openfirst/?rev=194&view=rev Log Message: ----------- - Updated config variable references - Added ofSymbol() so that HTML entities can be inserted without needing to refer to UTF-8 (although it is currently not working right). Modified Paths: -------------- trunk/src/includes/functions.php Modified: trunk/src/includes/functions.php =================================================================== --- trunk/src/includes/functions.php 2006-06-23 04:52:32 UTC (rev 193) +++ trunk/src/includes/functions.php 2006-06-23 04:55:23 UTC (rev 194) @@ -34,11 +34,12 @@ */ function ofReplaceVariables($text, $ModuleDir = false) { if ($ModuleDir === false) { - global $CurrentModule; - if (is_object($CurrentModule)) $ModuleDir == $CurrentModule->getDir(); + global $ogCurrentModule; + if (is_object($ogCurrentModule)) + $ModuleDir == $ogCurrentModule->getDir(); } - global $BasePath, $fBasePath, $StylePath, $fStylePath; + global $ogBasePath, $ogfBasePath, $ogStylePath, $ogfStylePath; $find = array('$BasePath', '$fBasePath', @@ -49,12 +50,12 @@ '$DirName' ); - $replace = array($BasePath, - $fBasePath, - $StylePath, - $fStylePath, - "$BasePath/$ModuleDir", - "$fBasePath/$ModuleDir", + $replace = array($ogBasePath, + $ogfBasePath, + $ogStylePath, + $ogfStylePath, + "$ogBasePath/$ModuleDir", + "$ogfBasePath/$ModuleDir", "$ModuleDir" ); @@ -249,4 +250,18 @@ } } } + +/** + * Given an HTML entity, returns the appropriate text in the current encoding. + * Currently, that's UTF-8. Returns false if it is unable to translate. + */ +function ofSymbol($entity) { + $ent = "&{$entity};"; + $trans = html_entity_decode($ent); + if ($ent != $trans) { + return $trans; + } else { + return false; + } +} ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |