* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: xorg.page.inc.php,v 1.52 2004-11-22 10:42:52 x2000habouzit Exp $
+ $Id: xorg.page.inc.php,v 1.53 2004-11-23 12:01:31 x2000habouzit Exp $
***************************************************************************/
require_once("diogenes.core.page.inc.php");
* @category XOrgCore
* @package XOrgCore
* @author Jeremy Lainé <jeremy.laine@polytechnique.org>
- * @version $Id: xorg.page.inc.php,v 1.52 2004-11-22 10:42:52 x2000habouzit Exp $
+ * @version $Id: xorg.page.inc.php,v 1.53 2004-11-23 12:01:31 x2000habouzit Exp $
* @access public
* @see DiogenesCorePage
*/
$this->register_function('dyn', 'function_dyn', false);
$this->register_function('implode', 'function_implode');
$this->register_prefilter('triple_quote_to_gettext');
+ $this->register_prefilter('at_to_globals');
// if necessary, construct new session
if (empty($_SESSION['session']))
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: smarty.plugins.inc.php,v 1.1 2004-11-21 17:05:40 x2000habouzit Exp $
+ $Id: smarty.plugins.inc.php,v 1.2 2004-11-23 12:01:32 x2000habouzit Exp $
***************************************************************************/
// {{{ function block_dynamic()
}
// }}}
+// {{{ function at_to_globals()
+
+/**
+ * helper
+ */
+
+function _to_globals($s) {
+ global $globals;
+ $t = explode('.',$s);
+ if (count($t) == 1) {
+ return $globals->$t[0];
+ } else {
+ return $globals->$t[0]->$t[1];
+ }
+}
+
+/**
+ * compilation plugin used to import $globals confing through #globals.foo.bar# directives
+ */
+
+function at_to_globals($tpl_source, &$smarty)
+{
+ return preg_replace('/#globals\.([a-zA-Z0-9_.]+?)#/e', '_to_globals(\'\\1\')', $tpl_source);
+}
+
+// }}}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
?>