Update of /cvsroot/phpmp/phpMP/includes
In directory usw-pr-cvs1:/tmp/cvs-serv12041/includes
Modified Files:
core.php template_ext.php
Log Message:
Moved language file into a class. Allows for easier access and better modularization.
Modified core to allow language prefs to be set before anything can possibly be parsed.
Index: core.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** core.php 25 Jul 2002 11:06:25 -0000 1.15
--- core.php 26 Jul 2002 05:25:06 -0000 1.16
***************
*** 87,91 ****
}
! global $DBA, $Auth, $Template;
$DBA = new DBA();
--- 87,91 ----
}
! global $DBA, $Auth, $Template, $Language;
$DBA = new DBA();
***************
*** 96,99 ****
--- 96,104 ----
$Auth = new Auth(); //Auth not yet written.
$MPCONF['USR'] = $Auth->AuthUser();
+
+ $default_lang = $MPCONF['TPL']['default_lang'];
+ require($MPCONF['GEN']['abs_path'] . '/languages/' . $default_lang . '/lang_main.php');
+
+ $Language = new Language();
$Template = new Template();
Index: template_ext.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/template_ext.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** template_ext.php 25 Jul 2002 20:50:07 -0000 1.2
--- template_ext.php 26 Jul 2002 05:25:06 -0000 1.3
***************
*** 55,59 ****
$this->config_dir = $MPCONF['GEN']['abs_path'] . '/templates/' . $MPCONF['TPL']['tpl_name'] . '/configs';
$this->cache_dir = '';
! $this->force_compile = 1;
$this->caching = false; //Hopefully we'll get caching working eventually.
--- 55,59 ----
$this->config_dir = $MPCONF['GEN']['abs_path'] . '/templates/' . $MPCONF['TPL']['tpl_name'] . '/configs';
$this->cache_dir = '';
! $this->compile_check = 1;
$this->caching = false; //Hopefully we'll get caching working eventually.
***************
*** 107,117 ****
function assign_language() {
// Very, very dirty. Change so that users can choose their language.
-
- global $MPCONF;
- $default_lang = $MPCONF['TPL']['default_lang'];
! require('./languages/' . $default_lang . '/lang_main.php');
! while (list ($key,$val) = each ($lang) ) {
if (!(empty($key))) {
$this->assign($key, $val);
--- 107,114 ----
function assign_language() {
// Very, very dirty. Change so that users can choose their language.
! global $Language;
! while (list ($key,$val) = each ($Language->lang) ) {
if (!(empty($key))) {
$this->assign($key, $val);
|