Changeset 2423

Show
Ignore:
Timestamp:
08/31/08 18:51:06 (4 months ago)
Author:
ringmaster
Message:

Added some additional tags to the HiEngine.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/hiengine.php

    r2421 r2423  
    88 * The HiEngine is a subclass of the RawPHPEngine class 
    99 * which is intended for those theme designers who want to use 
    10  * simple <hi:*> tags four output instead of PHP 
     10 * simple {hi:*} tags four output instead of PHP 
    1111 * 
    1212 * To use this engine, specify "hiengine" in the theme.xml of a theme. 
     
    193193        } 
    194194 
     195        // Catch tags in the format {hi:command:parameter} 
     196        if(preg_match('%^(\w+):(.+)$%', $cmd, $cmd_matches)) { 
     197            switch(strtolower($cmd_matches[1])) { 
     198                case 'display': 
     199                    return '<?php $theme->display(\'' . $cmd_matches[2] . '\'); ?>'; 
     200                case 'option': 
     201                case 'options': 
     202                    return '<?php Options::out(\'' . $cmd_matches[2] . '\'); ?>'; 
     203                case 'siteurl': 
     204                    return '<?php Site::out_url( \'' . $cmd_matches[2] . '\' ); ?>'; 
     205                case 'url': 
     206                    return '<?php URL::out( \'' . $cmd_matches[2] . '\' ); ?>'; 
     207            } 
     208        } 
     209 
     210        // Use tags in the format {hi:@foo} as theme functions, ala $theme->foo(); 
     211        if($cmd[0] == '@') { 
     212            return '<?php $theme->' . substr($cmd, 1) . '(); ?>'; 
     213        } 
     214 
    195215        // Didn't match anything we support so far 
    196216        return $matches[0];