@@ -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(dirname(__FILE__))) ; |
|
8 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
7 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
8 | +$mydirpath = dirname(dirname(__FILE__)); |
|
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(dirname(__FILE__))) ; |
|
8 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
7 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
8 | +$mydirpath = dirname(dirname(__FILE__)); |
|
9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
10 | -$mytrustdirname = 'altsys' ; |
|
10 | +$mytrustdirname = 'altsys'; |
|
11 | 11 | |
12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/include/Legacy_AltsysAdminRenderSystem.class.php' ; |
|
12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/include/Legacy_AltsysAdminRenderSystem.class.php'; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$xoopsOption['nocommon'] = 1 ; |
|
4 | -define('_LEGACY_PREVENT_LOAD_CORE_', true) ; |
|
5 | -require '../../mainfile.php' ; |
|
3 | +$xoopsOption['nocommon'] = 1; |
|
4 | +define('_LEGACY_PREVENT_LOAD_CORE_', true); |
|
5 | +require '../../mainfile.php'; |
|
6 | 6 | |
7 | -header('Location: '.XOOPS_URL.'/user.php') ; |
|
7 | +header('Location: '.XOOPS_URL.'/user.php'); |
@@ -1,2 +1,2 @@ |
||
1 | 1 | <?php |
2 | - $mytrustdirname = 'altsys' ; |
|
2 | + $mytrustdirname = 'altsys'; |
@@ -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(dirname(__FILE__))) ; |
|
8 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
7 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
8 | +$mydirpath = dirname(dirname(__FILE__)); |
|
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(__FILE__)) ; |
|
8 | -$mydirpath = dirname(__FILE__) ; |
|
7 | +$mydirname = basename(dirname(__FILE__)); |
|
8 | +$mydirpath = dirname(__FILE__); |
|
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,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! defined('XOOPS_ROOT_PATH')) { |
|
4 | - exit ; |
|
3 | +if (!defined('XOOPS_ROOT_PATH')) { |
|
4 | + exit; |
|
5 | 5 | } |
6 | 6 | |
7 | -if (! defined('XOOPS_TRUST_PATH') || XOOPS_TRUST_PATH == '') { |
|
8 | - header('Location: '.XOOPS_URL.'/modules/altsys/setup_xoops_trust_path.php') ; |
|
9 | - exit ; |
|
7 | +if (!defined('XOOPS_TRUST_PATH') || XOOPS_TRUST_PATH == '') { |
|
8 | + header('Location: '.XOOPS_URL.'/modules/altsys/setup_xoops_trust_path.php'); |
|
9 | + exit; |
|
10 | 10 | } |
11 | 11 | |
12 | -define('ALTSYS_MYLANGUAGE_ROOT_PATH', XOOPS_ROOT_PATH . '/my_language'); |
|
12 | +define('ALTSYS_MYLANGUAGE_ROOT_PATH', XOOPS_ROOT_PATH.'/my_language'); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | class SetupAltsysLangMgr extends XCube_ActionFilter |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | -require_once XOOPS_ROOT_PATH . "/core/XCube_LanguageManager.class.php"; |
|
30 | -require_once XOOPS_ROOT_PATH . "/modules/legacy/kernel/Legacy_LanguageManager.class.php"; |
|
29 | +require_once XOOPS_ROOT_PATH."/core/XCube_LanguageManager.class.php"; |
|
30 | +require_once XOOPS_ROOT_PATH."/modules/legacy/kernel/Legacy_LanguageManager.class.php"; |
|
31 | 31 | |
32 | 32 | class AltsysLangMgr_LanguageManager extends Legacy_LanguageManager |
33 | 33 | { |
34 | - public $langman = null ; |
|
35 | - public $theme_lang_checked = false ; |
|
34 | + public $langman = null; |
|
35 | + public $theme_lang_checked = false; |
|
36 | 36 | |
37 | 37 | public function prepare() |
38 | 38 | { |
39 | - $langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ; |
|
40 | - if (! file_exists($langmanpath)) { |
|
41 | - die('install the latest altsys') ; |
|
39 | + $langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php'; |
|
40 | + if (!file_exists($langmanpath)) { |
|
41 | + die('install the latest altsys'); |
|
42 | 42 | } |
43 | - require_once($langmanpath) ; |
|
44 | - $this->langman =& D3LanguageManager::getInstance() ; |
|
45 | - $this->langman->language = $this->mLanguageName ; |
|
43 | + require_once($langmanpath); |
|
44 | + $this->langman = & D3LanguageManager::getInstance(); |
|
45 | + $this->langman->language = $this->mLanguageName; |
|
46 | 46 | |
47 | 47 | parent::prepare(); |
48 | 48 | } |
@@ -50,40 +50,40 @@ discard block |
||
50 | 50 | public function _loadLanguage($dirname, $fileBodyName) |
51 | 51 | { |
52 | 52 | // read/check once (selected_theme)/language/(lang).php |
53 | - if (! $this->theme_lang_checked) { |
|
54 | - $root =& XCube_Root::getSingleton() ; |
|
55 | - if (! empty($root->mContext->mXoopsConfig['theme_set'])) { |
|
56 | - $langdir = XOOPS_THEME_PATH.'/'.$root->mContext->mXoopsConfig['theme_set'].'/language' ; |
|
53 | + if (!$this->theme_lang_checked) { |
|
54 | + $root = & XCube_Root::getSingleton(); |
|
55 | + if (!empty($root->mContext->mXoopsConfig['theme_set'])) { |
|
56 | + $langdir = XOOPS_THEME_PATH.'/'.$root->mContext->mXoopsConfig['theme_set'].'/language'; |
|
57 | 57 | if (file_exists($langdir)) { |
58 | - $langfile = $langdir.'/'.$this->mLanguageName.'.php' ; |
|
59 | - $engfile = $langdir.'/english.php' ; |
|
58 | + $langfile = $langdir.'/'.$this->mLanguageName.'.php'; |
|
59 | + $engfile = $langdir.'/english.php'; |
|
60 | 60 | if (file_exists($langfile)) { |
61 | - require_once $langfile ; |
|
61 | + require_once $langfile; |
|
62 | 62 | } elseif (file_exists($engfile)) { |
63 | - require_once $engfile ; |
|
63 | + require_once $engfile; |
|
64 | 64 | } |
65 | 65 | } |
66 | - $this->theme_lang_checked = true ; |
|
66 | + $this->theme_lang_checked = true; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | 70 | // read normal |
71 | - $this->langman->read($fileBodyName.'.php', $dirname) ; |
|
71 | + $this->langman->read($fileBodyName.'.php', $dirname); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function loadPageTypeMessageCatalog($type) |
75 | 75 | { |
76 | 76 | // I dare not to use langman... |
77 | 77 | if (strpos($type, '.') === false && $this->langman->my_language) { |
78 | - $mylang_file = $this->langman->my_language.'/'.$this->mLanguageName.'/'.$type.'.php' ; |
|
78 | + $mylang_file = $this->langman->my_language.'/'.$this->mLanguageName.'/'.$type.'.php'; |
|
79 | 79 | if (file_exists($mylang_file)) { |
80 | - require_once $mylang_file ; |
|
80 | + require_once $mylang_file; |
|
81 | 81 | } |
82 | 82 | } |
83 | - $original_error_level = error_reporting() ; |
|
84 | - error_reporting($original_error_level & ~ E_NOTICE) ; |
|
83 | + $original_error_level = error_reporting(); |
|
84 | + error_reporting($original_error_level & ~ E_NOTICE); |
|
85 | 85 | parent::loadPageTypeMessageCatalog($type); |
86 | - error_reporting($original_error_level) ; |
|
86 | + error_reporting($original_error_level); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function loadGlobalMessageCatalog() |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | /* if (!$this->_loadFile(XOOPS_ROOT_PATH . "/modules/legacy/language/" . $this->mLanguageName . "/global.php")) { |
92 | 92 | $this->_loadFile(XOOPS_ROOT_PATH . "/modules/legacy/language/english/global.php"); |
93 | 93 | } */ |
94 | - $this->_loadLanguage('legacy', 'global') ; |
|
95 | - $this->_loadLanguage('legacy', 'setting') ; |
|
94 | + $this->_loadLanguage('legacy', 'global'); |
|
95 | + $this->_loadLanguage('legacy', 'setting'); |
|
96 | 96 | |
97 | 97 | // |
98 | 98 | // Now, if XOOPS_USE_MULTIBYTES isn't defined, set zero to it. |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | //$langman->read( 'modinfo.php' , 'altsys' , 'altsys' ) ; |
6 | 6 | |
7 | 7 | if (file_exists(dirname(__FILE__).'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php')) { |
8 | - include_once dirname(__FILE__).'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php' ; |
|
8 | + include_once dirname(__FILE__).'/language/'.$GLOBALS['xoopsConfig']['language'].'/modinfo.php'; |
|
9 | 9 | } elseif (file_exists(dirname(__FILE__).'/language/english/modinfo.php')) { |
10 | - include_once dirname(__FILE__).'/language/english/modinfo.php' ; |
|
10 | + include_once dirname(__FILE__).'/language/english/modinfo.php'; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | $controllers = array( |
@@ -20,4 +20,4 @@ discard block |
||
20 | 20 | 'mytplsform', |
21 | 21 | 'put_templates', |
22 | 22 | 'mylangadmin', |
23 | -) ; |
|
23 | +); |
@@ -1,75 +1,75 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -eval(' function xoops_module_update_'.$mydirname.'( $module ) { return altsys_onupdate_base( $module , "'.$mydirname.'" ) ; } ') ; |
|
3 | +eval(' function xoops_module_update_'.$mydirname.'( $module ) { return altsys_onupdate_base( $module , "'.$mydirname.'" ) ; } '); |
|
4 | 4 | |
5 | 5 | |
6 | -if (! function_exists('altsys_onupdate_base')) { |
|
6 | +if (!function_exists('altsys_onupdate_base')) { |
|
7 | 7 | function altsys_onupdate_base($module, $mydirname) |
8 | 8 | { |
9 | 9 | // transations on module update |
10 | 10 | |
11 | - global $msgs ; // TODO :-D |
|
11 | + global $msgs; // TODO :-D |
|
12 | 12 | |
13 | 13 | // for Cube 2.1 |
14 | 14 | if (defined('XOOPS_CUBE_LEGACY')) { |
15 | - $root =& XCube_Root::getSingleton(); |
|
16 | - $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onupdate') ; |
|
17 | - $msgs = array() ; |
|
15 | + $root = & XCube_Root::getSingleton(); |
|
16 | + $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onupdate'); |
|
17 | + $msgs = array(); |
|
18 | 18 | } else { |
19 | - if (! is_array($msgs)) { |
|
20 | - $msgs = array() ; |
|
19 | + if (!is_array($msgs)) { |
|
20 | + $msgs = array(); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | - $db =& XoopsDatabaseFactory::getDatabaseConnection() ; |
|
25 | - $mid = $module->getVar('mid') ; |
|
24 | + $db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
25 | + $mid = $module->getVar('mid'); |
|
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | 29 | // TABLES (write here ALTER TABLE etc. if necessary) |
30 | 30 | |
31 | 31 | // configs (Though I know it is not a recommended way...) |
32 | - $check_sql = "SHOW COLUMNS FROM ".$db->prefix("config")." LIKE 'conf_title'" ; |
|
32 | + $check_sql = "SHOW COLUMNS FROM ".$db->prefix("config")." LIKE 'conf_title'"; |
|
33 | 33 | if (($result = $db->query($check_sql)) && ($myrow = $db->fetchArray($result)) && @$myrow['Type'] == 'varchar(30)') { |
34 | - $db->queryF("ALTER TABLE ".$db->prefix("config")." MODIFY `conf_title` varchar(255) NOT NULL default '', MODIFY `conf_desc` varchar(255) NOT NULL default ''") ; |
|
34 | + $db->queryF("ALTER TABLE ".$db->prefix("config")." MODIFY `conf_title` varchar(255) NOT NULL default '', MODIFY `conf_desc` varchar(255) NOT NULL default ''"); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | // 0.4 -> 0.5 |
38 | - $check_sql = "SELECT COUNT(*) FROM ".$db->prefix($mydirname."_language_constants") ; |
|
39 | - if (! $db->query($check_sql)) { |
|
40 | - $db->queryF("CREATE TABLE ".$db->prefix($mydirname."_language_constants")." (mid smallint(5) unsigned NOT NULL default 0,language varchar(32) NOT NULL default '',name varchar(255) NOT NULL default '',value text,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM") ; |
|
38 | + $check_sql = "SELECT COUNT(*) FROM ".$db->prefix($mydirname."_language_constants"); |
|
39 | + if (!$db->query($check_sql)) { |
|
40 | + $db->queryF("CREATE TABLE ".$db->prefix($mydirname."_language_constants")." (mid smallint(5) unsigned NOT NULL default 0,language varchar(32) NOT NULL default '',name varchar(255) NOT NULL default '',value text,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM"); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | 44 | // TEMPLATES (all templates have been already removed by modulesadmin) |
45 | - $tplfile_handler =& xoops_gethandler('tplfile') ; |
|
46 | - $tpl_path = dirname(__FILE__).'/templates' ; |
|
47 | - if ($handler = @opendir($tpl_path . '/')) { |
|
45 | + $tplfile_handler = & xoops_gethandler('tplfile'); |
|
46 | + $tpl_path = dirname(__FILE__).'/templates'; |
|
47 | + if ($handler = @opendir($tpl_path.'/')) { |
|
48 | 48 | while (($file = readdir($handler)) !== false) { |
49 | 49 | if (substr($file, 0, 1) == '.') { |
50 | - continue ; |
|
50 | + continue; |
|
51 | 51 | } |
52 | - $file_path = $tpl_path . '/' . $file ; |
|
52 | + $file_path = $tpl_path.'/'.$file; |
|
53 | 53 | if (is_file($file_path)) { |
54 | - $mtime = intval(@filemtime($file_path)) ; |
|
55 | - $tplfile =& $tplfile_handler->create() ; |
|
56 | - $tplfile->setVar('tpl_source', file_get_contents($file_path), true) ; |
|
57 | - $tplfile->setVar('tpl_refid', $mid) ; |
|
58 | - $tplfile->setVar('tpl_tplset', 'default') ; |
|
59 | - $tplfile->setVar('tpl_file', $mydirname . '_' . $file) ; |
|
60 | - $tplfile->setVar('tpl_desc', '', true) ; |
|
61 | - $tplfile->setVar('tpl_module', $mydirname) ; |
|
62 | - $tplfile->setVar('tpl_lastmodified', $mtime) ; |
|
63 | - $tplfile->setVar('tpl_lastimported', 0) ; |
|
64 | - $tplfile->setVar('tpl_type', 'module') ; |
|
65 | - if (! $tplfile_handler->insert($tplfile)) { |
|
54 | + $mtime = intval(@filemtime($file_path)); |
|
55 | + $tplfile = & $tplfile_handler->create(); |
|
56 | + $tplfile->setVar('tpl_source', file_get_contents($file_path), true); |
|
57 | + $tplfile->setVar('tpl_refid', $mid); |
|
58 | + $tplfile->setVar('tpl_tplset', 'default'); |
|
59 | + $tplfile->setVar('tpl_file', $mydirname.'_'.$file); |
|
60 | + $tplfile->setVar('tpl_desc', '', true); |
|
61 | + $tplfile->setVar('tpl_module', $mydirname); |
|
62 | + $tplfile->setVar('tpl_lastmodified', $mtime); |
|
63 | + $tplfile->setVar('tpl_lastimported', 0); |
|
64 | + $tplfile->setVar('tpl_type', 'module'); |
|
65 | + if (!$tplfile_handler->insert($tplfile)) { |
|
66 | 66 | $msgs[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> to the database.</span>'; |
67 | 67 | } else { |
68 | - $tplid = $tplfile->getVar('tpl_id') ; |
|
68 | + $tplid = $tplfile->getVar('tpl_id'); |
|
69 | 69 | $msgs[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> added to the database. (ID: <b>'.$tplid.'</b>)'; |
70 | 70 | // generate compiled file |
71 | - require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php' ; |
|
72 | - altsys_clear_templates_c() ; |
|
71 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php'; |
|
72 | + altsys_clear_templates_c(); |
|
73 | 73 | /*include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ; |
74 | 74 | if( ! xoops_template_touch( $tplid ) ) { |
75 | 75 | $msgs[] = '<span style="color:#ff0000;">ERROR: Failed compiling template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b>.</span>'; |
@@ -79,20 +79,20 @@ discard block |
||
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
82 | - closedir($handler) ; |
|
82 | + closedir($handler); |
|
83 | 83 | } |
84 | - include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ; |
|
85 | - include_once XOOPS_ROOT_PATH.'/class/template.php' ; |
|
86 | - xoops_template_clear_module_cache($mid) ; |
|
84 | + include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
85 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
86 | + xoops_template_clear_module_cache($mid); |
|
87 | 87 | |
88 | - return true ; |
|
88 | + return true; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | function altsys_message_append_onupdate(&$module_obj, &$log) |
92 | 92 | { |
93 | 93 | if (is_array(@$GLOBALS['msgs'])) { |
94 | 94 | foreach ($GLOBALS['msgs'] as $message) { |
95 | - $log->add(strip_tags($message)) ; |
|
95 | + $log->add(strip_tags($message)); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 |