- <?php
- /**
- * <b>Utility Class : Smarty</b><br />
- * A collection of utility functions for setting up variables for use with Smarty.
- * @author Kristen O'Brien <kristen_paristemi-com>
- * @copyright Copyright 2004, Kristen O'Brien
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @link http://www.paristemi.com Paristemi Main Site
- * @link http://smarty.php.net Smarty Template Engine
- * @package paristemi
- * @subpackage paristemi_util
- * @since Build 0.7
- * @version Build 0.7
- * @filesource
- */
- /**
- * Include the constants file and all of the files in the include list
- */
- if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
- if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
- else { require_once("../constants.php"); }
- }
- else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
- foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
-
- /**
- * Utility Class : Smarty
- * A collection of utility functions for setting up variables for use with Smarty.
- * @author Kristen O'Brien <kristen_paristemi-com>
- * @copyright Copyright © 2004, Kristen O'Brien
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @link http://www.paristemi.com Paristemi Main Site
- * @link http://smarty.php.net Smarty Template Engine
- * @package paristemi
- * @subpackage paristemi_util
- * @since Build 0.7
- * @version Build 0.7
- * @filesource
- */
- class UtilSmarty {
-
- function &createSmarty()
- {
- $smarty = new Smarty;
- $smarty->template_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
- $GLOBALS['SMARTY_TEMPLATE_DIR'];
- $smarty->compile_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
- $GLOBALS['SMARTY_DIR'].$GLOBALS['SMARTY_TEMPLATEC_DIR'];
- $smarty->config_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
- $GLOBALS['SMARTY_DIR'].$GLOBALS['SMARTY_CONFIG_DIR'];
- $smarty->cache_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
- $GLOBALS['SMARTY_DIR'].$GLOBALS['SMARTY_CACHE_DIR'];
- return $smarty;
- }
-
- function &setupSearchVars(&$smarty)
- {
- $smarty->assign('BIBLE_LANGUAGE',$GLOBALS['BIBLE_LANGUAGE']);
- $smarty->assign('BIBLE_VERSION',$GLOBALS['BIBLE_VERSION']);
- $smarty->assign('BIBLE_SHOW_FOOTNOTE',$GLOBALS['BIBLE_SHOW_FOOTNOTE']);
- $smarty->assign('BIBLE_SHOW_CROSS_REFERENCE',$GLOBALS['BIBLE_SHOW_CROSS_REFERENCE']);
- $smarty->assign('SERVER_NAME',$GLOBALS['SERVER_NAME']);
- $smarty->assign('S_SEARCH_BIBLE_KEY',$GLOBALS['S_SEARCH_BIBLE_KEY']);
- $smarty->assign('S_SEARCH_BIBLE_REF',$GLOBALS['S_SEARCH_BIBLE_REF']);
- $smarty->assign('S_SEARCH_INTERNET',$GLOBALS['S_SEARCH_INTERNET']);
- $smarty->assign('searchboxsize',"40");
- return $smarty;
- }
-
- function displaySectionPage(&$smarty,$showleftnav="yes")
- {
- $smarty->assign('showleftnav',$showleftnav);
- $smarty->assign('leftnavfile',$GLOBALS['SMARTY_TPL_LEFT_NAV']);
- $smarty->assign('middlefile',$GLOBALS['SMARTY_TPL_MIDDLE']);
- $smarty->assign('formtemplate',$GLOBALS['SMARTY_TPL_FORM']);
- $smarty->assign('sidesearchtemplate',$GLOBALS['SMARTY_TPL_SIDE_SEARCH']);
- $smarty->display($GLOBALS['SMARTY_TPL_SECTION_PAGE']);
- }
-
- }
-
- ?>