Massive upgrade
This commit is contained in:
parent
99a9ed919e
commit
c1a3437f9b
396 changed files with 29083 additions and 31939 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: BeCast Webengine - simple site engine
|
||||
* Project: astat - simple site engine
|
||||
* File: init_core.inc.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -17,10 +17,10 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* @link http://www.astat.org
|
||||
* @link http://www.astat.org SVN: $URL: http://svn.becast.at/astat/trunk/core/init_core.inc.php $
|
||||
* @copyright 2009 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package BeCast Webengine core
|
||||
* @package astat core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id: init_core.inc.php 148 2012-03-27 19:48:30Z genuineparts $
|
||||
*/
|
||||
|
@ -42,7 +42,8 @@ require dirname(dirname(__FILE__)).'/inc/config.inc.php';
|
|||
/**
|
||||
* Smarty
|
||||
*/
|
||||
require $basepath.'template/Smarty.class.php';
|
||||
require $basepath.'template/libs/Smarty.class.php';
|
||||
use Smarty\Smarty;
|
||||
|
||||
/**
|
||||
* Database
|
||||
|
@ -136,7 +137,6 @@ if(!isset($config['path'])){
|
|||
*
|
||||
*/
|
||||
$log=new logger($config['logtype'],dirname(dirname(__FILE__)).'/logs/'.$config['logfile'],$config['loglevel']);
|
||||
|
||||
$tpl = new Smarty();
|
||||
$error = new errorhandler();
|
||||
$functions = new functions();
|
||||
|
@ -156,18 +156,19 @@ $lang=new lang();
|
|||
*
|
||||
*/
|
||||
if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/themes/'.$config['theme'])){
|
||||
$tpl -> template_dir = $root . '/themes/'.$config['theme'];
|
||||
$tpl->setTemplateDir($root . '/themes/'.$config['theme']);
|
||||
}else{
|
||||
|
||||
/**
|
||||
* Fallback
|
||||
*/
|
||||
$tpl -> template_dir = $root . '/themes/default';
|
||||
$tpl->setTemplateDir($root . '/themes/default');
|
||||
}
|
||||
$tpl -> compile_dir = $root . '/core/template/templates_c';
|
||||
$tpl -> cache_dir = $root . '/core/template/cache';
|
||||
$tpl -> config_dir = $root . '/core/template/config';
|
||||
$tpl -> loadFilter('output','lang');
|
||||
$tpl->setCompileDir($root . '/core/template/templates_c');
|
||||
$tpl->setCacheDir($root . '/core/template/cache');
|
||||
$tpl->setConfigDir($root . '/core/template/config');
|
||||
$tpl->loadFilter(\Smarty\Smarty::FILTER_OUTPUT,'trimwhitespace');
|
||||
$tpl->registerFilter("output", "lang");
|
||||
//var_dump($tpl -> getAutoloadFilters());
|
||||
/**
|
||||
* Well... This should vanish with Thememanagement
|
||||
|
@ -226,6 +227,18 @@ foreach($core->mod_ as $key=>$val){
|
|||
|
||||
$plugin->run_hook('init_core');
|
||||
|
||||
|
||||
function lang($code, \Smarty\Template $template) {
|
||||
$source = $code;
|
||||
return preg_replace_callback ('/##(.+?)##/', 'langstr', $source);
|
||||
}
|
||||
|
||||
function langstr($treffer)
|
||||
{
|
||||
global $lang;
|
||||
return $lang->_($treffer[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* This loads *.class.php files from the /core/modules dir.
|
||||
* Its useful but "undocumented".
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue