paristemi
[ class tree: paristemi ] [ index: paristemi ] [ all elements ]

Source for file util_smarty.php

Documentation is available at util_smarty.php

  1. <?php
  2. /**
  3. * <b>Utility Class : Smarty</b><br />
  4. * A collection of utility functions for setting up variables for use with Smarty.
  5. * @author Kristen O'Brien <kristen_paristemi-com>
  6. * @copyright Copyright 2004, Kristen O'Brien
  7. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8. * @link http://www.paristemi.com Paristemi Main Site
  9. * @link http://smarty.php.net Smarty Template Engine
  10. * @package paristemi
  11. * @subpackage paristemi_util
  12. * @since Build 0.7
  13. * @version Build 0.7
  14. * @filesource
  15. */
  16. /**
  17. * Include the constants file and all of the files in the include list
  18. */
  19. if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
  20. if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
  21. else { require_once("../constants.php"); }
  22. }
  23. else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
  24. foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
  25.  
  26. /**
  27. * Utility Class : Smarty
  28. * A collection of utility functions for setting up variables for use with Smarty.
  29. * @author Kristen O'Brien <kristen_paristemi-com>
  30. * @copyright Copyright &copy; 2004, Kristen O'Brien
  31. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  32. * @link http://www.paristemi.com Paristemi Main Site
  33. * @link http://smarty.php.net Smarty Template Engine
  34. * @package paristemi
  35. * @subpackage paristemi_util
  36. * @since Build 0.7
  37. * @version Build 0.7
  38. * @filesource
  39. */
  40. class UtilSmarty {
  41. function &createSmarty()
  42. {
  43. $smarty = new Smarty;
  44. $smarty->template_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
  45. $GLOBALS['SMARTY_TEMPLATE_DIR'];
  46. $smarty->compile_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
  47. $GLOBALS['SMARTY_DIR'].$GLOBALS['SMARTY_TEMPLATEC_DIR'];
  48. $smarty->config_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
  49. $GLOBALS['SMARTY_DIR'].$GLOBALS['SMARTY_CONFIG_DIR'];
  50. $smarty->cache_dir = $GLOBALS['SERVER_DIRECTORY'].$GLOBALS['INCLUDE_PATH'].
  51. $GLOBALS['SMARTY_DIR'].$GLOBALS['SMARTY_CACHE_DIR'];
  52. return $smarty;
  53. }
  54. function &setupSearchVars(&$smarty)
  55. {
  56. $smarty->assign('BIBLE_LANGUAGE',$GLOBALS['BIBLE_LANGUAGE']);
  57. $smarty->assign('BIBLE_VERSION',$GLOBALS['BIBLE_VERSION']);
  58. $smarty->assign('BIBLE_SHOW_FOOTNOTE',$GLOBALS['BIBLE_SHOW_FOOTNOTE']);
  59. $smarty->assign('BIBLE_SHOW_CROSS_REFERENCE',$GLOBALS['BIBLE_SHOW_CROSS_REFERENCE']);
  60. $smarty->assign('SERVER_NAME',$GLOBALS['SERVER_NAME']);
  61. $smarty->assign('S_SEARCH_BIBLE_KEY',$GLOBALS['S_SEARCH_BIBLE_KEY']);
  62. $smarty->assign('S_SEARCH_BIBLE_REF',$GLOBALS['S_SEARCH_BIBLE_REF']);
  63. $smarty->assign('S_SEARCH_INTERNET',$GLOBALS['S_SEARCH_INTERNET']);
  64. $smarty->assign('searchboxsize',"40");
  65. return $smarty;
  66. }
  67. function displaySectionPage(&$smarty,$showleftnav="yes")
  68. {
  69. $smarty->assign('showleftnav',$showleftnav);
  70. $smarty->assign('leftnavfile',$GLOBALS['SMARTY_TPL_LEFT_NAV']);
  71. $smarty->assign('middlefile',$GLOBALS['SMARTY_TPL_MIDDLE']);
  72. $smarty->assign('formtemplate',$GLOBALS['SMARTY_TPL_FORM']);
  73. $smarty->assign('sidesearchtemplate',$GLOBALS['SMARTY_TPL_SIDE_SEARCH']);
  74. $smarty->display($GLOBALS['SMARTY_TPL_SECTION_PAGE']);
  75. }
  76. }
  77.  
  78. ?>

Documentation generated on Mon, 10 May 2004 12:11:14 -0700 by phpDocumentor 1.3.0RC3