Sindbad~EG File Manager

Current Path : /var/www/web3/modules/core/classes/
Upload File :
Current File : /var/www/web3/modules/core/classes/GallerySmarty.class

<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2007 Bharat Mediratta
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * We extend the original Smarty class
 * (if embedded in an application also using smarty it may be defined already)
 */
if (!class_exists('Smarty')) {
    GalleryCoreApi::requireOnce('lib/smarty/Smarty.class.php');
}

/**
 * A wrapper around Smarty that uses Gallery's error handling
 * @package GalleryCore
 * @subpackage Classes
 * @author Ernesto Baschny <ernst@baschny.de>
 * @version $Revision: 15513 $
 */
class GallerySmarty extends Smarty {

    /**
     * A GalleryStatus object from the last called fetch
     * @var object GalleryStatus
     * @access private
     */
    var $_firstGalleryStatus;


    /**
     * Fetch should also return a GalleryStatus object
     *
     * @see Smarty::fetch
     * @return array object GalleryStatus the return status
     *               string the output from the template
     */
    function fetch($_smarty_tpl_file, $_smarty_cache_id = null,
		   $_smarty_compile_id = null, $_smarty_display = false) {
	$this->_firstGalleryStatus = null;

	/* This could change the value of _firstError: */
	$result = parent::fetch($_smarty_tpl_file,
				$_smarty_cache_id,
				$_smarty_compile_id,
				$_smarty_display);

	return array($this->_firstGalleryStatus, $result);
    }

    /**
     * Make trigger_error behave more Gallery-like
     *
     * @see Smarty::trigger_error
     */
    function trigger_error($error_msg, $error_type = E_USER_WARNING) {
	/* Store this error for later usage */
	if (!$this->_firstGalleryStatus) {
	    $this->_firstGalleryStatus =
		GalleryCoreApi::error(ERROR_BAD_PARAMETER, null, null,
				      sprintf('Smarty error: %s', $error_msg, $error_type));
	}
    }
}
?>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists