@@ -3,102 +3,102 @@ discard block |
||
| 3 | 3 | class D3LanguageManager |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | - public $default_language = 'english' ; |
|
| 7 | - public $language = 'english' ; |
|
| 8 | - public $salt ; |
|
| 9 | - public $cache_path ; |
|
| 10 | - public $cache_prefix = 'lang' ; |
|
| 11 | - public $my_language = false ; |
|
| 6 | + public $default_language = 'english'; |
|
| 7 | + public $language = 'english'; |
|
| 8 | + public $salt; |
|
| 9 | + public $cache_path; |
|
| 10 | + public $cache_prefix = 'lang'; |
|
| 11 | + public $my_language = false; |
|
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | //HACK by domifara |
| 15 | 15 | //public function D3LanguageManager() |
| 16 | 16 | public function __construct() |
| 17 | 17 | { |
| 18 | - $this->language = preg_replace('/[^0-9a-zA-Z_-]/', '', @$GLOBALS['xoopsConfig']['language']) ; |
|
| 19 | - $this->salt = substr(md5(XOOPS_ROOT_PATH . XOOPS_DB_USER . XOOPS_DB_PREFIX), 0, 6) ; |
|
| 20 | - $this->cache_path = XOOPS_TRUST_PATH.'/cache' ; |
|
| 18 | + $this->language = preg_replace('/[^0-9a-zA-Z_-]/', '', @$GLOBALS['xoopsConfig']['language']); |
|
| 19 | + $this->salt = substr(md5(XOOPS_ROOT_PATH.XOOPS_DB_USER.XOOPS_DB_PREFIX), 0, 6); |
|
| 20 | + $this->cache_path = XOOPS_TRUST_PATH.'/cache'; |
|
| 21 | 21 | |
| 22 | 22 | if (defined('ALTSYS_MYLANGUAGE_ROOT_PATH') && file_exists(ALTSYS_MYLANGUAGE_ROOT_PATH)) { |
| 23 | - $this->my_language = ALTSYS_MYLANGUAGE_ROOT_PATH ; |
|
| 23 | + $this->my_language = ALTSYS_MYLANGUAGE_ROOT_PATH; |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | //HACK by domifara for php5.3+ |
| 27 | 27 | //function &getInstance( $conn = null ) |
| 28 | 28 | public static function &getInstance($conn = null) |
| 29 | 29 | { |
| 30 | - static $instance ; |
|
| 31 | - if (! isset($instance)) { |
|
| 32 | - $instance = new D3LanguageManager() ; |
|
| 30 | + static $instance; |
|
| 31 | + if (!isset($instance)) { |
|
| 32 | + $instance = new D3LanguageManager(); |
|
| 33 | 33 | } |
| 34 | - return $instance ; |
|
| 34 | + return $instance; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function read($resource, $mydirname, $mytrustdirname = null, $read_once = true) |
| 39 | 39 | { |
| 40 | - $d3file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/mytrustdirname.php' ; |
|
| 40 | + $d3file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/mytrustdirname.php'; |
|
| 41 | 41 | |
| 42 | 42 | if (empty($mytrustdirname) && file_exists($d3file)) { |
| 43 | - require $d3file ; |
|
| 43 | + require $d3file; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if (empty($this->language)) { |
| 47 | - $this->language = preg_replace('/[^0-9a-zA-Z_-]/', '', @$GLOBALS['xoopsConfig']['language']) ; |
|
| 47 | + $this->language = preg_replace('/[^0-9a-zA-Z_-]/', '', @$GLOBALS['xoopsConfig']['language']); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $cache_file = $this->getCacheFileName($resource, $mydirname) ; |
|
| 51 | - $root_file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$this->language.'/'.$resource ; |
|
| 50 | + $cache_file = $this->getCacheFileName($resource, $mydirname); |
|
| 51 | + $root_file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$this->language.'/'.$resource; |
|
| 52 | 52 | |
| 53 | 53 | // language overriding by XOOPS_ROOT_PATH/my_language |
| 54 | 54 | if ($this->my_language) { |
| 55 | - $mylang_file = $this->my_language.'/modules/'.$mydirname.'/'.$this->language.'/'.$resource ; |
|
| 55 | + $mylang_file = $this->my_language.'/modules/'.$mydirname.'/'.$this->language.'/'.$resource; |
|
| 56 | 56 | if (file_exists($mylang_file)) { |
| 57 | - require_once $mylang_file ; |
|
| 57 | + require_once $mylang_file; |
|
| 58 | 58 | } |
| 59 | - $original_error_level = error_reporting() ; |
|
| 60 | - error_reporting($original_error_level & ~ E_NOTICE) ; |
|
| 59 | + $original_error_level = error_reporting(); |
|
| 60 | + error_reporting($original_error_level & ~ E_NOTICE); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if (empty($mytrustdirname)) { |
| 64 | 64 | // conventional module |
| 65 | - $default_file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$this->default_language.'/'.$resource ; |
|
| 65 | + $default_file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$this->default_language.'/'.$resource; |
|
| 66 | 66 | |
| 67 | 67 | if (file_exists($cache_file)) { |
| 68 | - require_once $cache_file ; |
|
| 68 | + require_once $cache_file; |
|
| 69 | 69 | } elseif (file_exists($root_file)) { |
| 70 | - require_once $root_file ; |
|
| 70 | + require_once $root_file; |
|
| 71 | 71 | } elseif (file_exists($default_file)) { |
| 72 | 72 | // fall back english |
| 73 | - require_once $default_file ; |
|
| 73 | + require_once $default_file; |
|
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | 76 | // D3 modules |
| 77 | - $trust_file = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname.'/language/'.$this->language.'/'.$resource ; |
|
| 78 | - $default_file = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname.'/language/'.$this->default_language.'/'.$resource ; |
|
| 77 | + $trust_file = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname.'/language/'.$this->language.'/'.$resource; |
|
| 78 | + $default_file = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname.'/language/'.$this->default_language.'/'.$resource; |
|
| 79 | 79 | |
| 80 | 80 | if (file_exists($cache_file)) { |
| 81 | - require_once $cache_file ; |
|
| 81 | + require_once $cache_file; |
|
| 82 | 82 | } elseif (file_exists($root_file)) { |
| 83 | - require_once $root_file ; |
|
| 83 | + require_once $root_file; |
|
| 84 | 84 | } elseif (file_exists($trust_file)) { |
| 85 | 85 | if ($read_once) { |
| 86 | - require_once $trust_file ; |
|
| 86 | + require_once $trust_file; |
|
| 87 | 87 | } else { |
| 88 | - require $trust_file ; |
|
| 88 | + require $trust_file; |
|
| 89 | 89 | } |
| 90 | 90 | } elseif (file_exists($default_file)) { |
| 91 | 91 | // fall back english |
| 92 | 92 | if ($read_once) { |
| 93 | - require_once $default_file ; |
|
| 93 | + require_once $default_file; |
|
| 94 | 94 | } else { |
| 95 | - require $default_file ; |
|
| 95 | + require $default_file; |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($this->my_language) { |
| 101 | - error_reporting($original_error_level) ; |
|
| 101 | + error_reporting($original_error_level); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | public function getCacheFileName($resource, $mydirname, $language = null) |
| 107 | 107 | { |
| 108 | 108 | if (empty($language)) { |
| 109 | - $language = $this->language ; |
|
| 109 | + $language = $this->language; |
|
| 110 | 110 | } |
| 111 | - return $this->cache_path . '/' . $this->cache_prefix . '_' . $this->salt . '_' . $mydirname . '_' . $language . '_' . $resource ; |
|
| 111 | + return $this->cache_path.'/'.$this->cache_prefix.'_'.$this->salt.'_'.$mydirname.'_'.$language.'_'.$resource; |
|
| 112 | 112 | } |
| 113 | 113 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once XOOPS_ROOT_PATH.'/class/template.php' ; |
|
| 4 | -require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php' ; |
|
| 3 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 4 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php'; |
|
| 5 | 5 | |
| 6 | 6 | class D3Tpl extends XoopsTpl |
| 7 | 7 | { |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | // public function D3Tpl() |
| 11 | 11 | public function __construct() |
| 12 | 12 | { |
| 13 | - parent::__construct() ; |
|
| 14 | - if (in_array(altsys_get_core_type(), array( ALTSYS_CORE_TYPE_X20S, ALTSYS_CORE_TYPE_X23P ))) { |
|
| 15 | - array_unshift($this->plugins_dir, XOOPS_TRUST_PATH.'/libs/altsys/smarty_plugins') ; |
|
| 13 | + parent::__construct(); |
|
| 14 | + if (in_array(altsys_get_core_type(), array(ALTSYS_CORE_TYPE_X20S, ALTSYS_CORE_TYPE_X23P))) { |
|
| 15 | + array_unshift($this->plugins_dir, XOOPS_TRUST_PATH.'/libs/altsys/smarty_plugins'); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // for RTL users |
| 19 | - @define('_GLOBAL_LEFT', @_ADM_USE_RTL == 1 ? 'right' : 'left') ; |
|
| 20 | - @define('_GLOBAL_RIGHT', @_ADM_USE_RTL == 1 ? 'left' : 'right') ; |
|
| 19 | + @define('_GLOBAL_LEFT', @_ADM_USE_RTL == 1 ? 'right' : 'left'); |
|
| 20 | + @define('_GLOBAL_RIGHT', @_ADM_USE_RTL == 1 ? 'left' : 'right'); |
|
| 21 | 21 | } |
| 22 | 22 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH in mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH in mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
| 8 | -$mydirpath = dirname(__DIR__) ; |
|
| 7 | +$mydirname = basename(dirname(__DIR__)); |
|
| 8 | +$mydirpath = dirname(__DIR__); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/admin_menu.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/admin_menu.php'; |
|
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require '../../../mainfile.php' ; |
|
| 4 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 5 | - die('set XOOPS_TRUST_PATH in mainfile.php') ; |
|
| 3 | +require '../../../mainfile.php'; |
|
| 4 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 5 | + die('set XOOPS_TRUST_PATH in mainfile.php'); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -$mydirname = basename(dirname(__DIR__)) ; |
|
| 9 | -$mydirpath = dirname(__DIR__) ; |
|
| 8 | +$mydirname = basename(dirname(__DIR__)); |
|
| 9 | +$mydirpath = dirname(__DIR__); |
|
| 10 | 10 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 11 | -$mytrustdirname = 'altsys' ; |
|
| 11 | +$mytrustdirname = 'altsys'; |
|
| 12 | 12 | |
| 13 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/index.php' ; |
|
| 13 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/index.php'; |
|
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(__DIR__) ; |
|
| 8 | -$mydirpath = __DIR__ ; |
|
| 7 | +$mydirname = basename(__DIR__); |
|
| 8 | +$mydirpath = __DIR__; |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/xoops_version.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/xoops_version.php'; |
|
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
| 8 | -$mydirpath = dirname(__DIR__) ; |
|
| 7 | +$mydirname = basename(dirname(__DIR__)); |
|
| 8 | +$mydirpath = dirname(__DIR__); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/blocks.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/blocks.php'; |
|
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
| 8 | -$mydirpath = dirname(__DIR__) ; |
|
| 7 | +$mydirname = basename(dirname(__DIR__)); |
|
| 8 | +$mydirpath = dirname(__DIR__); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onupdate.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onupdate.php'; |
|
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
| 8 | -$mydirpath = dirname(__DIR__) ; |
|
| 7 | +$mydirname = basename(dirname(__DIR__)); |
|
| 8 | +$mydirpath = dirname(__DIR__); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/oninstall.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/oninstall.php'; |
|
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(__DIR__)) ; |
|
| 8 | -$mydirpath = dirname(__DIR__) ; |
|
| 7 | +$mydirname = basename(dirname(__DIR__)); |
|
| 8 | +$mydirpath = dirname(__DIR__); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onuninstall.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onuninstall.php'; |
|