@@ -5,33 +5,33 @@ discard block |
||
5 | 5 | // GIJOE <http://www.peak.ne.jp/> // |
6 | 6 | // ------------------------------------------------------------------------- // |
7 | 7 | |
8 | -require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ; |
|
9 | -include_once __DIR__.'/include/gtickets.php' ; |
|
10 | -include_once __DIR__.'/include/altsys_functions.php' ; |
|
8 | +require_once __DIR__.'/class/AltsysBreadcrumbs.class.php'; |
|
9 | +include_once __DIR__.'/include/gtickets.php'; |
|
10 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
11 | 11 | |
12 | 12 | // check access right (needs module_admin of this module) |
13 | -if (! is_object($xoopsUser) || ! is_object($xoopsModule) || ! $xoopsUser->isAdmin($xoopsModule->mid())) { |
|
14 | - die('Access Denied') ; |
|
13 | +if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
|
14 | + die('Access Denied'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | |
18 | 18 | // initials |
19 | 19 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
20 | -(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance() ; |
|
20 | +(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
|
21 | 21 | |
22 | 22 | // language file |
23 | -altsys_include_language_file('mypreferences') ; |
|
23 | +altsys_include_language_file('mypreferences'); |
|
24 | 24 | |
25 | 25 | |
26 | -$op = empty($_GET['op']) ? 'showmod' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['op']) ; |
|
26 | +$op = empty($_GET['op']) ? 'showmod' : preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['op']); |
|
27 | 27 | |
28 | 28 | if ($op == 'showmod') { |
29 | 29 | $config_handler = xoops_getHandler('config'); |
30 | - $mod = $xoopsModule->mid() ; |
|
30 | + $mod = $xoopsModule->mid(); |
|
31 | 31 | $config = $config_handler->getConfigs(new Criteria('conf_modid', $mod)); |
32 | 32 | $count = count($config); |
33 | 33 | if ($count < 1) { |
34 | - die('no configs') ; |
|
34 | + die('no configs'); |
|
35 | 35 | } |
36 | 36 | include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
37 | 37 | $form = new XoopsThemeForm(_MD_A_MYPREFERENCES_FORMTITLE, 'pref_form', 'index.php?mode=admin&lib=altsys&page=mypreferences&op=save'); |
@@ -39,30 +39,30 @@ discard block |
||
39 | 39 | $module = $module_handler->get($mod); |
40 | 40 | |
41 | 41 | // language |
42 | - $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'] ; |
|
42 | + $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language']; |
|
43 | 43 | |
44 | 44 | // load modinfo.php if necessary (judged by a specific constant is defined) |
45 | - if (! defined('_MYMENU_CONSTANT_IN_MODINFO') || ! defined(_MYMENU_CONSTANT_IN_MODINFO)) { |
|
45 | + if (!defined('_MYMENU_CONSTANT_IN_MODINFO') || !defined(_MYMENU_CONSTANT_IN_MODINFO)) { |
|
46 | 46 | if (file_exists("$mydirpath/language/$language/modinfo.php")) { |
47 | 47 | // user customized language file |
48 | - include_once "$mydirpath/language/$language/modinfo.php" ; |
|
48 | + include_once "$mydirpath/language/$language/modinfo.php"; |
|
49 | 49 | } elseif (file_exists("$mytrustdirpath/language/$language/modinfo.php")) { |
50 | 50 | // default language file |
51 | - include_once "$mytrustdirpath/language/$language/modinfo.php" ; |
|
51 | + include_once "$mytrustdirpath/language/$language/modinfo.php"; |
|
52 | 52 | } else { |
53 | 53 | // fallback english |
54 | - include_once "$mytrustdirpath/language/english/modinfo.php" ; |
|
54 | + include_once "$mytrustdirpath/language/english/modinfo.php"; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | // if has comments feature, need comment lang file |
59 | - if ($module->getVar('hascomments') == 1 && ! defined('_CM_TITLE')) { |
|
59 | + if ($module->getVar('hascomments') == 1 && !defined('_CM_TITLE')) { |
|
60 | 60 | include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php'; |
61 | 61 | } |
62 | 62 | |
63 | 63 | // RMV-NOTIFY |
64 | 64 | // if has notification feature, need notification lang file |
65 | - if ($module->getVar('hasnotification') == 1 && ! defined('_NOT_NOTIFICATIONOPTIONS')) { |
|
65 | + if ($module->getVar('hasnotification') == 1 && !defined('_NOT_NOTIFICATIONOPTIONS')) { |
|
66 | 66 | include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php'; |
67 | 67 | } |
68 | 68 | |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | // $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex'))); |
73 | 73 | // } |
74 | 74 | for ($i = 0; $i < $count; $i++) { |
75 | - $title_icon = ($config[$i]->getVar('conf_valuetype') === 'encrypt')? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype' |
|
75 | + $title_icon = ($config[$i]->getVar('conf_valuetype') === 'encrypt') ? '<img src="'.XOOPS_MODULE_URL.'/legacy/admin/theme/icons/textfield_key.png" alt="Encrypted">' : ''; // support XCL 2.2.3 'encrypt' of 'conf_valuetype' |
|
76 | 76 | $title4tray = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? (constant($config[$i]->getVar('conf_title')).$title_icon) : (constant($config[$i]->getVar('conf_title')).$title_icon.'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>'); // GIJ |
77 | - $title = '' ; // GIJ |
|
77 | + $title = ''; // GIJ |
|
78 | 78 | switch ($config[$i]->getVar('conf_formtype')) { |
79 | 79 | case 'textarea': |
80 | 80 | (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
@@ -155,25 +155,25 @@ discard block |
||
155 | 155 | break; |
156 | 156 | } |
157 | 157 | $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id')); |
158 | - $ele_tray = new XoopsFormElementTray($title4tray, '') ; |
|
158 | + $ele_tray = new XoopsFormElementTray($title4tray, ''); |
|
159 | 159 | $ele_tray->addElement($ele); |
160 | 160 | $ele_tray->addElement($hidden); |
161 | - $form->addElement($ele_tray) ; |
|
161 | + $form->addElement($ele_tray); |
|
162 | 162 | unset($ele_tray, $ele, $hidden); |
163 | 163 | } |
164 | 164 | // $button_tray->addElement(new XoopsFormHidden('op', 'save')); |
165 | - $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences') ; |
|
165 | + $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences'); |
|
166 | 166 | $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit')); |
167 | - $form->addElement($button_tray) ; |
|
167 | + $form->addElement($button_tray); |
|
168 | 168 | xoops_cp_header(); |
169 | 169 | |
170 | 170 | // GIJ patch start |
171 | - altsys_include_mymenu() ; |
|
172 | - $breadcrumbsObj = AltsysBreadcrumbs::getInstance() ; |
|
171 | + altsys_include_mymenu(); |
|
172 | + $breadcrumbsObj = AltsysBreadcrumbs::getInstance(); |
|
173 | 173 | if ($breadcrumbsObj->hasPaths()) { |
174 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mypreferences', _PREFERENCES) ; |
|
174 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mypreferences', _PREFERENCES); |
|
175 | 175 | } |
176 | - echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getVar('name').' '._PREFERENCES."</h3>\n" ; |
|
176 | + echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getVar('name').' '._PREFERENCES."</h3>\n"; |
|
177 | 177 | // GIJ patch end |
178 | 178 | |
179 | 179 | $form->display(); |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) { |
186 | 186 | // exit('Invalid referer'); |
187 | 187 | //} |
188 | - if (! $xoopsGTicket->check(true, 'mypreferences')) { |
|
188 | + if (!$xoopsGTicket->check(true, 'mypreferences')) { |
|
189 | 189 | redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
190 | 190 | } |
191 | - require_once XOOPS_ROOT_PATH.'/class/template.php' ; |
|
191 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
192 | 192 | $xoopsTpl = new XoopsTpl(); |
193 | 193 | //HACK by domifara for new XOOPS and XCL etc. |
194 | 194 | //old xoops |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | if ($count > 0) { |
210 | 210 | for ($i = 0; $i < $count; $i++) { |
211 | 211 | $config = $config_handler->getConfig($conf_ids[$i]); |
212 | - $new_value =& $_POST[$config->getVar('conf_name')]; |
|
212 | + $new_value = & $_POST[$config->getVar('conf_name')]; |
|
213 | 213 | if (is_array($new_value) || $new_value != $config->getVar('conf_value')) { |
214 | 214 | // if language has been changed |
215 | 215 | if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') { |
@@ -238,13 +238,13 @@ discard block |
||
238 | 238 | // generate compiled files for the new theme |
239 | 239 | // block files only for now.. |
240 | 240 | $tplfile_handler = xoops_getHandler('tplfile'); |
241 | - $dtemplates =& $tplfile_handler->find('default', 'block'); |
|
241 | + $dtemplates = & $tplfile_handler->find('default', 'block'); |
|
242 | 242 | $dcount = count($dtemplates); |
243 | 243 | |
244 | 244 | // need to do this to pass to xoops_template_touch function |
245 | 245 | $GLOBALS['xoopsConfig']['template_set'] = $newtplset; |
246 | 246 | |
247 | - altsys_clear_templates_c() ; |
|
247 | + altsys_clear_templates_c(); |
|
248 | 248 | |
249 | 249 | /* for ($i = 0; $i < $dcount; $i++) { |
250 | 250 | $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null); |
@@ -272,9 +272,9 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | // add read permission for the start module to all groups |
275 | - if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') { |
|
275 | + if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') { |
|
276 | 276 | $member_handler = xoops_getHandler('member'); |
277 | - $groups =& $member_handler->getGroupList(); |
|
277 | + $groups = & $member_handler->getGroupList(); |
|
278 | 278 | $moduleperm_handler = xoops_getHandler('groupperm'); |
279 | 279 | $module_handler = xoops_getHandler('module'); |
280 | 280 | $module = $module_handler->getByDirname($new_value); |
@@ -293,5 +293,5 @@ discard block |
||
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
296 | - redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED) ; |
|
296 | + redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED); |
|
297 | 297 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // notification handler for D3 modules |
4 | 4 | |
5 | -require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ; |
|
5 | +require_once XOOPS_ROOT_PATH.'/include/notification_functions.php'; |
|
6 | 6 | |
7 | 7 | class D3NotificationHandler |
8 | 8 | { |
@@ -10,59 +10,59 @@ discard block |
||
10 | 10 | //function &getInstance( $conn = null ) |
11 | 11 | public static function &getInstance($conn = null) |
12 | 12 | { |
13 | - static $instance ; |
|
14 | - if (! isset($instance)) { |
|
15 | - $instance = new D3NotificationHandler() ; |
|
13 | + static $instance; |
|
14 | + if (!isset($instance)) { |
|
15 | + $instance = new D3NotificationHandler(); |
|
16 | 16 | } |
17 | - return $instance ; |
|
17 | + return $instance; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
21 | 21 | public function getMailTemplateDir($mydirname, $mytrustdirname = '') |
22 | 22 | { |
23 | - global $xoopsConfig ; |
|
23 | + global $xoopsConfig; |
|
24 | 24 | |
25 | - $mydirpath = XOOPS_ROOT_PATH.'/modules/'.$mydirname ; |
|
26 | - $mytrustdirpath = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname ; |
|
27 | - $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language'] ; |
|
25 | + $mydirpath = XOOPS_ROOT_PATH.'/modules/'.$mydirname; |
|
26 | + $mytrustdirpath = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname; |
|
27 | + $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language']; |
|
28 | 28 | |
29 | 29 | $search_paths = array( |
30 | - "$mydirpath/language/$language/mail_template/" , |
|
31 | - "$mytrustdirpath/language/$language/mail_template/" , |
|
32 | - "$mydirpath/language/english/mail_template/" , |
|
30 | + "$mydirpath/language/$language/mail_template/", |
|
31 | + "$mytrustdirpath/language/$language/mail_template/", |
|
32 | + "$mydirpath/language/english/mail_template/", |
|
33 | 33 | "$mytrustdirpath/language/english/mail_template/" |
34 | - ) ; |
|
34 | + ); |
|
35 | 35 | |
36 | - $mail_template_dir = "$mytrustdirpath/language/english/mail_template/" ; |
|
36 | + $mail_template_dir = "$mytrustdirpath/language/english/mail_template/"; |
|
37 | 37 | foreach ($search_paths as $path) { |
38 | 38 | if (file_exists($path)) { |
39 | - $mail_template_dir = $path ; |
|
40 | - break ; |
|
39 | + $mail_template_dir = $path; |
|
40 | + break; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - return $mail_template_dir ; |
|
44 | + return $mail_template_dir; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | - public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null) |
|
48 | + public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, $extra_tags = array(), $user_list = array(), $omit_user_id = null) |
|
49 | 49 | { |
50 | - $module_handler = xoops_getHandler('module') ; |
|
51 | - $module = $module_handler->getByDirname($mydirname) ; |
|
50 | + $module_handler = xoops_getHandler('module'); |
|
51 | + $module = $module_handler->getByDirname($mydirname); |
|
52 | 52 | |
53 | - $notification_handler = xoops_getHandler('notification') ; |
|
54 | - $mail_template_dir = $this->getMailTemplateDir($mydirname, $mytrustdirname) ; |
|
53 | + $notification_handler = xoops_getHandler('notification'); |
|
54 | + $mail_template_dir = $this->getMailTemplateDir($mydirname, $mytrustdirname); |
|
55 | 55 | |
56 | 56 | // calling a delegate before |
57 | 57 | if (class_exists('XCube_DelegateUtils')) { |
58 | - $force_return = false ; |
|
59 | - XCube_DelegateUtils::raiseEvent('D3NotificationHandler.Trigger', new XCube_Ref($category), new XCube_Ref($event), new XCube_Ref($item_id), new XCube_Ref($extra_tags), new XCube_Ref($module), new XCube_Ref($user_list), new XCube_Ref($omit_user_id), $module->getInfo('notification'), new XCube_Ref($force_return), new XCube_Ref($mail_template_dir), $mydirname, $mytrustdirname) ; |
|
58 | + $force_return = false; |
|
59 | + XCube_DelegateUtils::raiseEvent('D3NotificationHandler.Trigger', new XCube_Ref($category), new XCube_Ref($event), new XCube_Ref($item_id), new XCube_Ref($extra_tags), new XCube_Ref($module), new XCube_Ref($user_list), new XCube_Ref($omit_user_id), $module->getInfo('notification'), new XCube_Ref($force_return), new XCube_Ref($mail_template_dir), $mydirname, $mytrustdirname); |
|
60 | 60 | if ($force_return) { |
61 | - return ; |
|
61 | + return; |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | - $mid = $module->getVar('mid') ; |
|
65 | + $mid = $module->getVar('mid'); |
|
66 | 66 | |
67 | 67 | // Check if event is enabled |
68 | 68 | $config_handler = xoops_getHandler('config'); |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | if (empty($mod_config['notification_enabled'])) { |
71 | 71 | return false; |
72 | 72 | } |
73 | - $category_info =& notificationCategoryInfo($category, $mid); |
|
74 | - $event_info =& notificationEventInfo($category, $event, $mid); |
|
73 | + $category_info = & notificationCategoryInfo($category, $mid); |
|
74 | + $event_info = & notificationEventInfo($category, $event, $mid); |
|
75 | 75 | if (!in_array(notificationGenerateConfig($category_info, $event_info, 'option_name'), $mod_config['notification_events']) && empty($event_info['invisible'])) { |
76 | 76 | return false; |
77 | 77 | } |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | $tags = array(); |
104 | 104 | // {X_ITEM_NAME} {X_ITEM_URL} {X_ITEM_TYPE} from lookup_func are disabled |
105 | 105 | $tags['X_MODULE'] = $module->getVar('name', 'n'); |
106 | - $tags['X_MODULE_URL'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/'; |
|
106 | + $tags['X_MODULE_URL'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'; |
|
107 | 107 | $tags['X_NOTIFY_CATEGORY'] = $category; |
108 | 108 | $tags['X_NOTIFY_EVENT'] = $event; |
109 | 109 | |
110 | - $template = $event_info['mail_template'] . '.tpl'; |
|
110 | + $template = $event_info['mail_template'].'.tpl'; |
|
111 | 111 | $subject = $event_info['mail_subject']; |
112 | 112 | |
113 | 113 | if ($user_list) { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | // user-specific tags |
122 | 122 | //$tags['X_UNSUBSCRIBE_URL'] = 'TODO'; |
123 | 123 | // TODO: don't show unsubscribe link if it is 'one-time' ?? |
124 | - $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL . '/notifications.php'; |
|
124 | + $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL.'/notifications.php'; |
|
125 | 125 | $tags = array_merge($tags, $extra_tags); |
126 | 126 | |
127 | 127 | $notification->notifyUser($mail_template_dir, $template, $subject, $tags); |
@@ -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. |