<?php
/**
 * phpaga
 *
 * smarty compiling template engine
 *
 * This file contains our little class derived from Smarty.

 * Smarty is an excellent template engine writte by Monte Ohrt and Andrei Zmievski.
 * You can find Smarty at http://www.phpinsider.com/php/code/Smarty/
 *
 * @author Florian Lanthaler <florian@phpaga.net>
 * @version $Id: smarty.php 736 2006-08-16 22:10:38Z florian $
 *
 * Copyright (c) 2002, Florian Lanthaler <florian@phpaga.net>
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *    * Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in
 *      the documentation and/or other materials provided with the
 *      distribution.
 *
 *    * Neither the name of Florian Lanthaler nor the names of his
 *      contributors may be used to endorse or promote products derived
 *      from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * This class extends the Smarty class and sets some default variables (paths).
 *
 * @author Florian Lanthaler <florian@phpaga.net>
 * @since phpaga 0.1
 */

/* include the original smarty class */
require_once(SMARTY_DIR."Smarty.class.php");
require_once(PHPAGA_EXTPATH."/smarty-gettext/block.t.php");

/* extend it to set some default variables */
class psmarty extends Smarty
{
    function psmarty ()
    {
        $this->template_dir = PHPAGA_TPLPATH;
        $this->compile_dir = PHPAGA_BASEPATH."templates_c";
        $this->config_dir = SMARTY_DIR."/configs";
        $this->plugins_dir = "plugins";
        $this->force_compile = true;

        $this->register_modifier("wash", "phpaga_sanitize_htmlout");
        $this->register_modifier("wash_popup", "phpaga_popup_sanitizestr");
        $this->register_modifier("wash_jsmsg", "phpaga_jsmessage_sanitizestr");

        $this->register_block("t", "smarty_block_t");
    }
}

?>
