Exemplo n.º 1
0
 /**
  *
  *
  * @return Smarty The smarty object used for rendering.
  */
 public function smarty()
 {
     if (is_null($this->_Smarty)) {
         $Smarty = new SmartyBC();
         $Smarty->setCacheDir(PATH_CACHE . '/Smarty/cache');
         $Smarty->setCompileDir(PATH_CACHE . '/Smarty/compile');
         $Smarty->addPluginsDir(PATH_LIBRARY . '/SmartyPlugins');
         //         Gdn::PluginManager()->Trace = TRUE;
         Gdn::pluginManager()->callEventHandlers($Smarty, 'Gdn_Smarty', 'Init');
         $this->_Smarty = $Smarty;
     }
     return $this->_Smarty;
 }
Exemplo n.º 2
0
require $var['smarty_dir'] . '/libs/SmartyBC.class.php';
include 'PageView.php';
include 'PhpwebArray.php';
include 'Helper/Paypal.php';
include 'Helper/Cart.php';
include 'Helper/Krco.php';
include 'Helper/Xml.php';
include 'Helper/URL.php';
include 'Helper/String.php';
include 'Helper/Structure.php';
include 'Helper/Renderer.php';
include 'Helper/File.php';
include 'Renderer/Cart.php';
$smarty = new SmartyBC();
$smarty->force_compile = true;
$smarty->addPluginsDir('./plugins');
if (isset($var['temp_dir']) && strlen($var['temp_dir']) > 0) {
    $smarty->setCompileDir($var['temp_dir'] . DS . $_SERVER['SERVER_NAME'] . DS);
    $smarty->setCacheDir($var['temp_dir'] . DS . $_SERVER['SERVER_NAME'] . DS);
}
define("MAIN_TEST_DATA_FILE", 'tests/data.json');
/**
 * Handle '/' request
 * @return always true
 */
function HandlePageList()
{
    $pagenames = array_map(function ($page) {
        preg_match('|templates/(?P<pagename>[^\\.]+)\\.tpl|', $page, $matches);
        $pagename = $matches['pagename'];
        return $pagename != 'index' ? $pagename : null;