@@ -1,35 +1,35 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -eval(' function xoops_module_uninstall_'.$mydirname.'( $module ) { return altsys_onuninstall_base( $module , "'.$mydirname.'" ) ; } ') ; |
|
| 3 | +eval(' function xoops_module_uninstall_'.$mydirname.'( $module ) { return altsys_onuninstall_base( $module , "'.$mydirname.'" ) ; } '); |
|
| 4 | 4 | |
| 5 | 5 | |
| 6 | -if (! function_exists('altsys_onuninstall_base')) { |
|
| 6 | +if (!function_exists('altsys_onuninstall_base')) { |
|
| 7 | 7 | function altsys_onuninstall_base($module, $mydirname) |
| 8 | 8 | { |
| 9 | 9 | // transations on module uninstall |
| 10 | 10 | |
| 11 | - global $ret ; // TODO :-D |
|
| 11 | + global $ret; // 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.ModuleUninstall.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onuninstall') ; |
|
| 17 | - $ret = array() ; |
|
| 15 | + $root = & XCube_Root::getSingleton(); |
|
| 16 | + $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUninstall.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onuninstall'); |
|
| 17 | + $ret = array(); |
|
| 18 | 18 | } else { |
| 19 | - if (! is_array($ret)) { |
|
| 20 | - $ret = array() ; |
|
| 19 | + if (!is_array($ret)) { |
|
| 20 | + $ret = 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 | // TABLES (loading mysql.sql) |
| 28 | - $sql_file_path = __DIR__.'/sql/mysql.sql' ; |
|
| 29 | - $prefix_mod = $db->prefix() . '_' . $mydirname ; |
|
| 28 | + $sql_file_path = __DIR__.'/sql/mysql.sql'; |
|
| 29 | + $prefix_mod = $db->prefix().'_'.$mydirname; |
|
| 30 | 30 | if (file_exists($sql_file_path)) { |
| 31 | - $ret[] = 'SQL file found at <b>' . htmlspecialchars($sql_file_path) . '</b>.<br /> Deleting tables...<br />'; |
|
| 32 | - $sql_lines = file($sql_file_path) ; |
|
| 31 | + $ret[] = 'SQL file found at <b>'.htmlspecialchars($sql_file_path).'</b>.<br /> Deleting tables...<br />'; |
|
| 32 | + $sql_lines = file($sql_file_path); |
|
| 33 | 33 | foreach ($sql_lines as $sql_line) { |
| 34 | 34 | if (preg_match('/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i', $sql_line, $regs)) { |
| 35 | 35 | $sql = 'DROP TABLE '.addslashes($prefix_mod.'_'.$regs[1]); |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | unset($templates); */ |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - return true ; |
|
| 62 | + return true; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | function altsys_message_append_onuninstall(&$module_obj, &$log) |
| 66 | 66 | { |
| 67 | 67 | if (is_array(@$GLOBALS['ret'])) { |
| 68 | 68 | foreach ($GLOBALS['ret'] as $message) { |
| 69 | - $log->add(strip_tags($message)) ; |
|
| 69 | + $log->add(strip_tags($message)); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
@@ -5,64 +5,64 @@ 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 | -$db =& XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 20 | -(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ; |
|
| 19 | +$db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 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 | - $config_handler =& xoops_gethandler('config'); |
|
| 30 | - $mod = $xoopsModule->mid() ; |
|
| 31 | - $config =& $config_handler->getConfigs(new Criteria('conf_modid', $mod)); |
|
| 29 | + $config_handler = & xoops_gethandler('config'); |
|
| 30 | + $mod = $xoopsModule->mid(); |
|
| 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'); |
| 38 | - $module_handler =& xoops_gethandler('module'); |
|
| 39 | - $module =& $module_handler->get($mod); |
|
| 38 | + $module_handler = & xoops_gethandler('module'); |
|
| 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,12 +72,12 @@ 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 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance(); |
|
| 80 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance(); |
|
| 81 | 81 | if ($config[$i]->getVar('conf_valuetype') == 'array') { |
| 82 | 82 | // this is exceptional.. only when value type is arrayneed a smarter way for this |
| 83 | 83 | $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $ele = new XoopsFormRadio($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
| 95 | 95 | $addBr = '<br />'; |
| 96 | 96 | } |
| 97 | - $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
| 97 | + $options = & $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
| 98 | 98 | $opcount = count($options); |
| 99 | 99 | for ($j = 0; $j < $opcount; $j++) { |
| 100 | 100 | $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value'); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $ele = new XoopsFormCheckBox($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); |
| 112 | 112 | $addBr = '<br />'; |
| 113 | 113 | } |
| 114 | - $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
| 114 | + $options = & $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id'))); |
|
| 115 | 115 | $opcount = count($options); |
| 116 | 116 | for ($j = 0; $j < $opcount; $j++) { |
| 117 | 117 | $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value'); |
@@ -145,37 +145,37 @@ discard block |
||
| 145 | 145 | $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); |
| 146 | 146 | break; |
| 147 | 147 | case 'password': |
| 148 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance(); |
|
| 148 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance(); |
|
| 149 | 149 | $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
| 150 | 150 | break; |
| 151 | 151 | case 'textbox': |
| 152 | 152 | default: |
| 153 | - (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance(); |
|
| 153 | + (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance(); |
|
| 154 | 154 | $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput())); |
| 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); |
| 163 | 163 | unset($ele); |
| 164 | 164 | unset($hidden); |
| 165 | 165 | } |
| 166 | 166 | // $button_tray->addElement(new XoopsFormHidden('op', 'save')); |
| 167 | - $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences') ; |
|
| 167 | + $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'mypreferences'); |
|
| 168 | 168 | $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit')); |
| 169 | - $form->addElement($button_tray) ; |
|
| 169 | + $form->addElement($button_tray); |
|
| 170 | 170 | xoops_cp_header(); |
| 171 | 171 | |
| 172 | 172 | // GIJ patch start |
| 173 | - altsys_include_mymenu() ; |
|
| 174 | - $breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
| 173 | + altsys_include_mymenu(); |
|
| 174 | + $breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
| 175 | 175 | if ($breadcrumbsObj->hasPaths()) { |
| 176 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mypreferences', _PREFERENCES) ; |
|
| 176 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mypreferences', _PREFERENCES); |
|
| 177 | 177 | } |
| 178 | - echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getvar('name').' '._PREFERENCES."</h3>\n" ; |
|
| 178 | + echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getvar('name').' '._PREFERENCES."</h3>\n"; |
|
| 179 | 179 | // GIJ patch end |
| 180 | 180 | |
| 181 | 181 | $form->display(); |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) { |
| 188 | 188 | // exit('Invalid referer'); |
| 189 | 189 | //} |
| 190 | - if (! $xoopsGTicket->check(true, 'mypreferences')) { |
|
| 190 | + if (!$xoopsGTicket->check(true, 'mypreferences')) { |
|
| 191 | 191 | redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
| 192 | 192 | } |
| 193 | - require_once XOOPS_ROOT_PATH.'/class/template.php' ; |
|
| 193 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 194 | 194 | $xoopsTpl = new XoopsTpl(); |
| 195 | 195 | //HACK by domifara for new XOOPS and XCL etc. |
| 196 | 196 | //old xoops |
@@ -210,8 +210,8 @@ discard block |
||
| 210 | 210 | $lang_updated = false; |
| 211 | 211 | if ($count > 0) { |
| 212 | 212 | for ($i = 0; $i < $count; $i++) { |
| 213 | - $config =& $config_handler->getConfig($conf_ids[$i]); |
|
| 214 | - $new_value =& $_POST[$config->getVar('conf_name')]; |
|
| 213 | + $config = & $config_handler->getConfig($conf_ids[$i]); |
|
| 214 | + $new_value = & $_POST[$config->getVar('conf_name')]; |
|
| 215 | 215 | if (is_array($new_value) || $new_value != $config->getVar('conf_value')) { |
| 216 | 216 | // if language has been changed |
| 217 | 217 | if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | // if default theme has been changed |
| 225 | 225 | if (!$theme_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'theme_set') { |
| 226 | - $member_handler =& xoops_gethandler('member'); |
|
| 226 | + $member_handler = & xoops_gethandler('member'); |
|
| 227 | 227 | $member_handler->updateUsersByField('theme', $_POST[$config->getVar('conf_name')]); |
| 228 | 228 | $theme_updated = true; |
| 229 | 229 | } |
@@ -239,14 +239,14 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | // generate compiled files for the new theme |
| 241 | 241 | // block files only for now.. |
| 242 | - $tplfile_handler =& xoops_gethandler('tplfile'); |
|
| 243 | - $dtemplates =& $tplfile_handler->find('default', 'block'); |
|
| 242 | + $tplfile_handler = & xoops_gethandler('tplfile'); |
|
| 243 | + $dtemplates = & $tplfile_handler->find('default', 'block'); |
|
| 244 | 244 | $dcount = count($dtemplates); |
| 245 | 245 | |
| 246 | 246 | // need to do this to pass to xoops_template_touch function |
| 247 | 247 | $GLOBALS['xoopsConfig']['template_set'] = $newtplset; |
| 248 | 248 | |
| 249 | - altsys_clear_templates_c() ; |
|
| 249 | + altsys_clear_templates_c(); |
|
| 250 | 250 | |
| 251 | 251 | /* for ($i = 0; $i < $dcount; $i++) { |
| 252 | 252 | $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null); |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | }*/ |
| 261 | 261 | |
| 262 | 262 | // generate image cache files from image binary data, save them under cache/ |
| 263 | - $image_handler =& xoops_gethandler('imagesetimg'); |
|
| 264 | - $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true); |
|
| 263 | + $image_handler = & xoops_gethandler('imagesetimg'); |
|
| 264 | + $imagefiles = & $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true); |
|
| 265 | 265 | foreach (array_keys($imagefiles) as $i) { |
| 266 | 266 | if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) { |
| 267 | 267 | } else { |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | // add read permission for the start module to all groups |
| 277 | - if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') { |
|
| 278 | - $member_handler =& xoops_gethandler('member'); |
|
| 279 | - $groups =& $member_handler->getGroupList(); |
|
| 280 | - $moduleperm_handler =& xoops_gethandler('groupperm'); |
|
| 281 | - $module_handler =& xoops_gethandler('module'); |
|
| 282 | - $module =& $module_handler->getByDirname($new_value); |
|
| 277 | + if (!$startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') { |
|
| 278 | + $member_handler = & xoops_gethandler('member'); |
|
| 279 | + $groups = & $member_handler->getGroupList(); |
|
| 280 | + $moduleperm_handler = & xoops_gethandler('groupperm'); |
|
| 281 | + $module_handler = & xoops_gethandler('module'); |
|
| 282 | + $module = & $module_handler->getByDirname($new_value); |
|
| 283 | 283 | foreach ($groups as $groupid => $groupname) { |
| 284 | 284 | if (!$moduleperm_handler->checkRight('module_read', $module->getVar('mid'), $groupid)) { |
| 285 | 285 | $moduleperm_handler->addRight('module_read', $module->getVar('mid'), $groupid); |
@@ -295,5 +295,5 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED) ; |
|
| 298 | + redirect_header('index.php?mode=admin&lib=altsys&page=mypreferences', 2, _MD_A_MYPREFERENCES_UPDATED); |
|
| 299 | 299 | } |
@@ -1,35 +1,35 @@ 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 | 7 | $adminmenu = array( |
| 8 | 8 | array( |
| 9 | - 'title' => _MI_ALTSYS_MENU_CUSTOMBLOCKS , |
|
| 9 | + 'title' => _MI_ALTSYS_MENU_CUSTOMBLOCKS, |
|
| 10 | 10 | 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname=__CustomBlocks__' |
| 11 | - ) , |
|
| 11 | + ), |
|
| 12 | 12 | array( |
| 13 | - 'title' => _MI_ALTSYS_MENU_NEWCUSTOMBLOCK , |
|
| 14 | - 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname=__CustomBlocks__&op=edit' , |
|
| 13 | + 'title' => _MI_ALTSYS_MENU_NEWCUSTOMBLOCK, |
|
| 14 | + 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname=__CustomBlocks__&op=edit', |
|
| 15 | 15 | 'show' => false |
| 16 | - ) , |
|
| 16 | + ), |
|
| 17 | 17 | array( |
| 18 | - 'title' => _MI_ALTSYS_MENU_MYBLOCKSADMIN , |
|
| 18 | + 'title' => _MI_ALTSYS_MENU_MYBLOCKSADMIN, |
|
| 19 | 19 | 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' |
| 20 | - ) , |
|
| 20 | + ), |
|
| 21 | 21 | array( |
| 22 | - 'title' => _MI_ALTSYS_MENU_MYTPLSADMIN , |
|
| 22 | + 'title' => _MI_ALTSYS_MENU_MYTPLSADMIN, |
|
| 23 | 23 | 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mytplsadmin' |
| 24 | - ) , |
|
| 24 | + ), |
|
| 25 | 25 | array( |
| 26 | - 'title' => _MI_ALTSYS_MENU_COMPILEHOOKADMIN , |
|
| 26 | + 'title' => _MI_ALTSYS_MENU_COMPILEHOOKADMIN, |
|
| 27 | 27 | 'link' => 'admin/index.php?mode=admin&lib=altsys&page=compilehookadmin' |
| 28 | - ) , |
|
| 28 | + ), |
|
| 29 | 29 | array( |
| 30 | - 'title' => _MI_ALTSYS_MENU_MYLANGADMIN , |
|
| 30 | + 'title' => _MI_ALTSYS_MENU_MYLANGADMIN, |
|
| 31 | 31 | 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mylangadmin' |
| 32 | - ) , |
|
| 32 | + ), |
|
| 33 | 33 | /* array( |
| 34 | 34 | 'title' => _MI_ALTSYS_MENU_MYAVATAR , |
| 35 | 35 | 'link' => 'index.php?mode=admin&lib=altsys&page=myavatar' , |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | 'title' => _MI_ALTSYS_MENU_MYSMILEY , |
| 39 | 39 | 'link' => 'index.php?mode=admin&lib=altsys&page=mysmiley' , |
| 40 | 40 | ) ,*/ |
| 41 | -) ; |
|
| 41 | +); |
|
| 42 | 42 | |
| 43 | 43 | $adminmenu4altsys = array( |
| 44 | 44 | array( |
| 45 | - 'title' => 'ALTSYS '._PREFERENCES , |
|
| 45 | + 'title' => 'ALTSYS '._PREFERENCES, |
|
| 46 | 46 | 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mypreferences' |
| 47 | 47 | ) |
| 48 | -) ; |
|
| 48 | +); |
|
@@ -1,14 +1,14 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once __DIR__.'/include/altsys_functions.php' ; |
|
| 3 | +include_once __DIR__.'/include/altsys_functions.php'; |
|
| 4 | 4 | |
| 5 | 5 | // language file (modinfo.php) |
| 6 | -altsys_include_language_file('modinfo') ; |
|
| 6 | +altsys_include_language_file('modinfo'); |
|
| 7 | 7 | |
| 8 | -$modversion['name'] = _MI_ALTSYS_MODULENAME ; |
|
| 9 | -$modversion['version'] = '0.82' ; |
|
| 10 | -$modversion['detailed_version'] = '0.82.5' ; |
|
| 11 | -$modversion['description'] = _MI_ALTSYS_MODULEDESC ; |
|
| 8 | +$modversion['name'] = _MI_ALTSYS_MODULENAME; |
|
| 9 | +$modversion['version'] = '0.82'; |
|
| 10 | +$modversion['detailed_version'] = '0.82.5'; |
|
| 11 | +$modversion['description'] = _MI_ALTSYS_MODULEDESC; |
|
| 12 | 12 | $modversion['credits'] = 'PEAK Corp.'; |
| 13 | 13 | $modversion['author'] = 'GIJ=CHECKMATE<br />PEAK Corp.(http://www.peak.ne.jp/), XOOPS X Distribution(https://github.com/XoopsX)'; |
| 14 | 14 | $modversion['license'] = 'GPL see LICENSE'; |
@@ -22,18 +22,18 @@ discard block |
||
| 22 | 22 | $modversion['adminmenu'] = 'admin/admin_menu.php'; |
| 23 | 23 | |
| 24 | 24 | // All Templates can't be touched by modulesadmin. |
| 25 | -$modversion['templates'] = array() ; |
|
| 25 | +$modversion['templates'] = array(); |
|
| 26 | 26 | |
| 27 | 27 | // Blocks |
| 28 | 28 | $modversion['blocks'][1] = array( |
| 29 | - 'file' => 'blocks.php' , |
|
| 30 | - 'name' => _MI_ALTSYS_BNAME_ADMIN_MENU , |
|
| 31 | - 'description' => '' , |
|
| 32 | - 'show_func' => 'b_altsys_admin_menu_show' , |
|
| 33 | - 'edit_func' => 'b_altsys_admin_menu_edit' , |
|
| 34 | - 'options' => "$mydirname" , |
|
| 35 | - 'template' => '' , // use "module" template instead |
|
| 36 | -) ; |
|
| 29 | + 'file' => 'blocks.php', |
|
| 30 | + 'name' => _MI_ALTSYS_BNAME_ADMIN_MENU, |
|
| 31 | + 'description' => '', |
|
| 32 | + 'show_func' => 'b_altsys_admin_menu_show', |
|
| 33 | + 'edit_func' => 'b_altsys_admin_menu_edit', |
|
| 34 | + 'options' => "$mydirname", |
|
| 35 | + 'template' => '', // use "module" template instead |
|
| 36 | +); |
|
| 37 | 37 | |
| 38 | 38 | // Menu |
| 39 | 39 | $modversion['hasMain'] = 1; |
@@ -46,64 +46,64 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // Configurations |
| 48 | 48 | $modversion['config'][1] = array( |
| 49 | - 'name' => 'adminmenu_hack_ft' , |
|
| 50 | - 'title' => '_MI_ALTSYS_ADMINMENU_HFT' , |
|
| 51 | - 'description' => '_MI_ALTSYS_ADMINMENU_HFTDSC' , |
|
| 52 | - 'formtype' => 'select' , |
|
| 53 | - 'valuetype' => 'int' , |
|
| 54 | - 'default' => 0 , |
|
| 55 | - 'options' => array( '_NONE' => 0 , '_MI_ALTSYS_AMHFT_OPT_2COL' => 1 , '_MI_ALTSYS_AMHFT_OPT_NOIMG' => 2 , '_MI_ALTSYS_AMHFT_OPT_XCSTY' => 3 ) |
|
| 56 | -) ; |
|
| 49 | + 'name' => 'adminmenu_hack_ft', |
|
| 50 | + 'title' => '_MI_ALTSYS_ADMINMENU_HFT', |
|
| 51 | + 'description' => '_MI_ALTSYS_ADMINMENU_HFTDSC', |
|
| 52 | + 'formtype' => 'select', |
|
| 53 | + 'valuetype' => 'int', |
|
| 54 | + 'default' => 0, |
|
| 55 | + 'options' => array('_NONE' => 0, '_MI_ALTSYS_AMHFT_OPT_2COL' => 1, '_MI_ALTSYS_AMHFT_OPT_NOIMG' => 2, '_MI_ALTSYS_AMHFT_OPT_XCSTY' => 3) |
|
| 56 | +); |
|
| 57 | 57 | |
| 58 | 58 | $modversion['config'][] = array( |
| 59 | - 'name' => 'adminmenu_insert_mymenu' , |
|
| 60 | - 'title' => '_MI_ALTSYS_ADMINMENU_IM' , |
|
| 61 | - 'description' => '_MI_ALTSYS_ADMINMENU_IMDSC' , |
|
| 62 | - 'formtype' => 'yesno' , |
|
| 63 | - 'valuetype' => 'int' , |
|
| 64 | - 'default' => 0 , |
|
| 59 | + 'name' => 'adminmenu_insert_mymenu', |
|
| 60 | + 'title' => '_MI_ALTSYS_ADMINMENU_IM', |
|
| 61 | + 'description' => '_MI_ALTSYS_ADMINMENU_IMDSC', |
|
| 62 | + 'formtype' => 'yesno', |
|
| 63 | + 'valuetype' => 'int', |
|
| 64 | + 'default' => 0, |
|
| 65 | 65 | 'options' => array() |
| 66 | -) ; |
|
| 66 | +); |
|
| 67 | 67 | |
| 68 | 68 | $modversion['config'][] = array( |
| 69 | - 'name' => 'admin_in_theme' , |
|
| 70 | - 'title' => '_MI_ALTSYS_ADMIN_IN_THEME' , |
|
| 71 | - 'description' => '_MI_ALTSYS_ADMIN_IN_THEMEDSC' , |
|
| 72 | - 'formtype' => 'textbox' , |
|
| 73 | - 'valuetype' => 'text' , |
|
| 74 | - 'default' => 'default' , |
|
| 69 | + 'name' => 'admin_in_theme', |
|
| 70 | + 'title' => '_MI_ALTSYS_ADMIN_IN_THEME', |
|
| 71 | + 'description' => '_MI_ALTSYS_ADMIN_IN_THEMEDSC', |
|
| 72 | + 'formtype' => 'textbox', |
|
| 73 | + 'valuetype' => 'text', |
|
| 74 | + 'default' => 'default', |
|
| 75 | 75 | 'options' => array() |
| 76 | -) ; |
|
| 76 | +); |
|
| 77 | 77 | |
| 78 | 78 | $modversion['config'][] = array( |
| 79 | - 'name' => 'enable_force_clone' , |
|
| 80 | - 'title' => '_MI_ALTSYS_ENABLEFORCECLONE' , |
|
| 81 | - 'description' => '_MI_ALTSYS_ENABLEFORCECLONEDSC' , |
|
| 82 | - 'formtype' => 'yesno' , |
|
| 83 | - 'valuetype' => 'int' , |
|
| 84 | - 'default' => 1 , |
|
| 79 | + 'name' => 'enable_force_clone', |
|
| 80 | + 'title' => '_MI_ALTSYS_ENABLEFORCECLONE', |
|
| 81 | + 'description' => '_MI_ALTSYS_ENABLEFORCECLONEDSC', |
|
| 82 | + 'formtype' => 'yesno', |
|
| 83 | + 'valuetype' => 'int', |
|
| 84 | + 'default' => 1, |
|
| 85 | 85 | 'options' => array() |
| 86 | -) ; |
|
| 86 | +); |
|
| 87 | 87 | |
| 88 | 88 | $modversion['config'][] = array( |
| 89 | - 'name' => 'images_dir' , |
|
| 90 | - 'title' => '_MI_ALTSYS_IMAGES_DIR' , |
|
| 91 | - 'description' => '_MI_ALTSYS_IMAGES_DIRDSC' , |
|
| 92 | - 'formtype' => 'textbox' , |
|
| 93 | - 'valuetype' => 'text' , |
|
| 94 | - 'default' => 'images' , |
|
| 89 | + 'name' => 'images_dir', |
|
| 90 | + 'title' => '_MI_ALTSYS_IMAGES_DIR', |
|
| 91 | + 'description' => '_MI_ALTSYS_IMAGES_DIRDSC', |
|
| 92 | + 'formtype' => 'textbox', |
|
| 93 | + 'valuetype' => 'text', |
|
| 94 | + 'default' => 'images', |
|
| 95 | 95 | 'options' => array() |
| 96 | -) ; |
|
| 96 | +); |
|
| 97 | 97 | |
| 98 | 98 | // Notification |
| 99 | 99 | |
| 100 | 100 | $modversion['hasNotification'] = 0; |
| 101 | 101 | |
| 102 | -$modversion['onInstall'] = 'include/oninstall.php' ; |
|
| 103 | -$modversion['onUpdate'] = 'include/onupdate.php' ; |
|
| 104 | -$modversion['onUninstall'] = 'include/onuninstall.php' ; |
|
| 102 | +$modversion['onInstall'] = 'include/oninstall.php'; |
|
| 103 | +$modversion['onUpdate'] = 'include/onupdate.php'; |
|
| 104 | +$modversion['onUninstall'] = 'include/onuninstall.php'; |
|
| 105 | 105 | |
| 106 | 106 | // keep block's options |
| 107 | -if (! defined('XOOPS_CUBE_LEGACY') && substr(XOOPS_VERSION, 6, 3) < 2.1 && ! empty($_POST['fct']) && ! empty($_POST['op']) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname']) { |
|
| 108 | - include __DIR__.'/include/x20_keepblockoptions.inc.php' ; |
|
| 107 | +if (!defined('XOOPS_CUBE_LEGACY') && substr(XOOPS_VERSION, 6, 3) < 2.1 && !empty($_POST['fct']) && !empty($_POST['op']) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname']) { |
|
| 108 | + include __DIR__.'/include/x20_keepblockoptions.inc.php'; |
|
| 109 | 109 | } |
@@ -1,29 +1,29 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once dirname(__DIR__).'/include/altsys_functions.php' ; |
|
| 3 | +require_once dirname(__DIR__).'/include/altsys_functions.php'; |
|
| 4 | 4 | |
| 5 | 5 | function b_altsys_admin_menu_show($options) |
| 6 | 6 | { |
| 7 | - global $xoopsUser ; |
|
| 7 | + global $xoopsUser; |
|
| 8 | 8 | |
| 9 | - $mydirname = empty($options[0]) ? 'altsys' : $options[0] ; |
|
| 10 | - $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]) ; |
|
| 9 | + $mydirname = empty($options[0]) ? 'altsys' : $options[0]; |
|
| 10 | + $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.html' : trim($options[1]); |
|
| 11 | 11 | |
| 12 | 12 | if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { |
| 13 | - die('Invalid mydirname') ; |
|
| 13 | + die('Invalid mydirname'); |
|
| 14 | 14 | } |
| 15 | - if (! is_object(@$xoopsUser)) { |
|
| 16 | - return array() ; |
|
| 15 | + if (!is_object(@$xoopsUser)) { |
|
| 16 | + return array(); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // coretype |
| 20 | - $coretype = altsys_get_core_type() ; |
|
| 20 | + $coretype = altsys_get_core_type(); |
|
| 21 | 21 | |
| 22 | 22 | // mid_selected |
| 23 | 23 | if (is_object(@$GLOBALS['xoopsModule'])) { |
| 24 | - $mid_selected = $GLOBALS['xoopsModule']->getVar('mid') ; |
|
| 24 | + $mid_selected = $GLOBALS['xoopsModule']->getVar('mid'); |
|
| 25 | 25 | // for system->preferences |
| 26 | -<<<<<<< HEAD |
|
| 26 | +<< << <<< HEAD |
|
| 27 | 27 | if ($mid_selected == 1 && @$_GET['fct'] == 'preferences' && @$_GET['op'] == 'showmod' && ! empty($_GET['mod'])) { |
| 28 | 28 | $mid_selected = intval($_GET['mod']) ; |
| 29 | 29 | ======= |
@@ -156,5 +156,4 @@ discard block |
||
| 156 | 156 | <br /> |
| 157 | 157 | \n" ; |
| 158 | 158 | |
| 159 | - return $form; |
|
| 160 | -} |
|
| 159 | + return $form |
|
| 161 | 160 | \ No newline at end of file |
@@ -2,30 +2,30 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | /********* mymenu only for ALTSYS ********/ |
| 4 | 4 | |
| 5 | -if (! defined('XOOPS_ROOT_PATH')) { |
|
| 6 | - exit ; |
|
| 5 | +if (!defined('XOOPS_ROOT_PATH')) { |
|
| 6 | + exit; |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // Skip for ORETEKI XOOPS |
| 10 | 10 | if (defined('XOOPS_ORETEKI')) { |
| 11 | - return ; |
|
| 11 | + return; |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -if (! isset($module) || ! is_object($module)) { |
|
| 15 | - $module = $xoopsModule ; |
|
| 16 | -} elseif (! is_object($xoopsModule)) { |
|
| 17 | - die('$xoopsModule is not set') ; |
|
| 14 | +if (!isset($module) || !is_object($module)) { |
|
| 15 | + $module = $xoopsModule; |
|
| 16 | +} elseif (!is_object($xoopsModule)) { |
|
| 17 | + die('$xoopsModule is not set'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // language files (modinfo.php) |
| 21 | -altsys_include_language_file('modinfo') ; |
|
| 21 | +altsys_include_language_file('modinfo'); |
|
| 22 | 22 | |
| 23 | -include __DIR__.'/admin_menu.php' ; |
|
| 23 | +include __DIR__.'/admin_menu.php'; |
|
| 24 | 24 | |
| 25 | -$adminmenu = array_merge($adminmenu, $adminmenu4altsys) ; |
|
| 25 | +$adminmenu = array_merge($adminmenu, $adminmenu4altsys); |
|
| 26 | 26 | |
| 27 | -$mymenu_uri = empty($mymenu_fake_uri) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ; |
|
| 28 | -$mymenu_link = substr(strstr($mymenu_uri, '/admin/'), 1) ; |
|
| 27 | +$mymenu_uri = empty($mymenu_fake_uri) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri; |
|
| 28 | +$mymenu_link = substr(strstr($mymenu_uri, '/admin/'), 1); |
|
| 29 | 29 | |
| 30 | 30 | // xoops_breadcrumbs |
| 31 | 31 | // $GLOBALS['altsysXoopsBreadcrumbs'] = array( array( 'url' => XOOPS_URL.'/modules/altsys/admin/index.php' , 'name' => $xoopsModule->getVar('name') ) ) ; |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | // highlight |
| 34 | 34 | foreach (array_keys($adminmenu) as $i) { |
| 35 | 35 | if ($mymenu_link == $adminmenu[$i]['link']) { |
| 36 | - $adminmenu[$i]['selected'] = true ; |
|
| 37 | - $adminmenu_hilighted = true ; |
|
| 36 | + $adminmenu[$i]['selected'] = true; |
|
| 37 | + $adminmenu_hilighted = true; |
|
| 38 | 38 | // $GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'url' => XOOPS_URL."/modules/altsys/".htmlspecialchars($adminmenu[$i]['link'],ENT_QUOTES) , 'name' => htmlspecialchars( $adminmenu[$i]['title'] , ENT_QUOTES ) ) ; |
| 39 | 39 | } else { |
| 40 | - $adminmenu[$i]['selected'] = false ; |
|
| 40 | + $adminmenu[$i]['selected'] = false; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | if (empty($adminmenu_hilighted)) { |
| 44 | 44 | foreach (array_keys($adminmenu) as $i) { |
| 45 | 45 | if (stristr($mymenu_uri, $adminmenu[$i]['link'])) { |
| 46 | - $adminmenu[$i]['selected'] = true ; |
|
| 46 | + $adminmenu[$i]['selected'] = true; |
|
| 47 | 47 | // $GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'url' => XOOPS_URL."/modules/altsys/".htmlspecialchars($adminmenu[$i]['link'],ENT_QUOTES) , 'name' => htmlspecialchars( $adminmenu[$i]['title'] , ENT_QUOTES ) ) ; |
| 48 | - break ; |
|
| 48 | + break; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -53,20 +53,20 @@ discard block |
||
| 53 | 53 | // link conversion from relative to absolute |
| 54 | 54 | foreach (array_keys($adminmenu) as $i) { |
| 55 | 55 | if (stristr($adminmenu[$i]['link'], XOOPS_URL) === false) { |
| 56 | - $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/" . $adminmenu[$i]['link'] ; |
|
| 56 | + $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/".$adminmenu[$i]['link']; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // display |
| 61 | -require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ; |
|
| 62 | -$tpl = new D3Tpl() ; |
|
| 61 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
| 62 | +$tpl = new D3Tpl(); |
|
| 63 | 63 | $tpl->assign(array( |
| 64 | 64 | 'adminmenu' => $adminmenu |
| 65 | -)) ; |
|
| 66 | -$tpl->display('db:altsys_inc_mymenu.html') ; |
|
| 65 | +)); |
|
| 66 | +$tpl->display('db:altsys_inc_mymenu.html'); |
|
| 67 | 67 | |
| 68 | 68 | // submenu |
| 69 | -$page = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['page']) ; |
|
| 69 | +$page = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['page']); |
|
| 70 | 70 | if (file_exists(__DIR__.'/mymenusub/'.$page.'.php')) { |
| 71 | - include __DIR__.'/mymenusub/'.$page.'.php' ; |
|
| 71 | + include __DIR__.'/mymenusub/'.$page.'.php'; |
|
| 72 | 72 | } |
@@ -5,170 +5,170 @@ 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' ; |
|
| 11 | -include_once __DIR__.'/include/lang_functions.php' ; |
|
| 12 | -include_once __DIR__.'/class/D3LanguageManager.class.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 | +include_once __DIR__.'/include/lang_functions.php'; |
|
| 12 | +include_once __DIR__.'/class/D3LanguageManager.class.php'; |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | // only groups have 'module_admin' of 'altsys' can do that. |
| 16 | -$module_handler =& xoops_gethandler('module') ; |
|
| 17 | -$module =& $module_handler->getByDirname('altsys') ; |
|
| 18 | -if (! is_object($module)) { |
|
| 19 | - die('install altsys') ; |
|
| 16 | +$module_handler = & xoops_gethandler('module'); |
|
| 17 | +$module = & $module_handler->getByDirname('altsys'); |
|
| 18 | +if (!is_object($module)) { |
|
| 19 | + die('install altsys'); |
|
| 20 | 20 | } |
| 21 | -$moduleperm_handler =& xoops_gethandler('groupperm') ; |
|
| 22 | -if (! is_object(@$xoopsUser) || ! $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $xoopsUser->getGroups())) { |
|
| 23 | - die('only admin of altsys can access this area') ; |
|
| 21 | +$moduleperm_handler = & xoops_gethandler('groupperm'); |
|
| 22 | +if (!is_object(@$xoopsUser) || !$moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $xoopsUser->getGroups())) { |
|
| 23 | + die('only admin of altsys can access this area'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | // initials |
| 28 | -$db =& XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 29 | -(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ; |
|
| 30 | -$langman =& D3LanguageManager::getInstance() ; |
|
| 28 | +$db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 29 | +(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = & MyTextSanitizer::sGetInstance()) || $myts = & MyTextSanitizer::getInstance(); |
|
| 30 | +$langman = & D3LanguageManager::getInstance(); |
|
| 31 | 31 | |
| 32 | 32 | // language file of this controller |
| 33 | -altsys_include_language_file('mylangadmin') ; |
|
| 33 | +altsys_include_language_file('mylangadmin'); |
|
| 34 | 34 | |
| 35 | 35 | // check $xoopsModule |
| 36 | -if (! is_object($xoopsModule)) { |
|
| 37 | - redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM) ; |
|
| 36 | +if (!is_object($xoopsModule)) { |
|
| 37 | + redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | // set target_module if specified by $_GET['dirname'] |
| 41 | -$module_handler =& xoops_gethandler('module'); |
|
| 42 | -if (! empty($_GET['dirname'])) { |
|
| 43 | - $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']) ; |
|
| 44 | - $target_module =& $module_handler->getByDirname($dirname) ; |
|
| 41 | +$module_handler = & xoops_gethandler('module'); |
|
| 42 | +if (!empty($_GET['dirname'])) { |
|
| 43 | + $dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', $_GET['dirname']); |
|
| 44 | + $target_module = & $module_handler->getByDirname($dirname); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -if (! empty($target_module) && is_object($target_module)) { |
|
| 47 | +if (!empty($target_module) && is_object($target_module)) { |
|
| 48 | 48 | // specified by dirname (for langadmin as an independent module) |
| 49 | - $target_mid = $target_module->getVar('mid') ; |
|
| 50 | - $target_dirname = $target_module->getVar('dirname') ; |
|
| 51 | - $target_dirname4sql = addslashes($target_dirname) ; |
|
| 52 | - $target_mname = $target_module->getVar('name') . ' ' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0) ; |
|
| 49 | + $target_mid = $target_module->getVar('mid'); |
|
| 50 | + $target_dirname = $target_module->getVar('dirname'); |
|
| 51 | + $target_dirname4sql = addslashes($target_dirname); |
|
| 52 | + $target_mname = $target_module->getVar('name').' '.sprintf('(%2.2f)', $target_module->getVar('version') / 100.0); |
|
| 53 | 53 | //$query4redirect = '?dirname='.urlencode(strip_tags($_GET['dirname'])) ; |
| 54 | 54 | } else { |
| 55 | 55 | // not specified by dirname (for 3rd party modules as mylangadmin) |
| 56 | - $target_mid = $xoopsModule->getVar('mid') ; |
|
| 57 | - $target_dirname = $xoopsModule->getVar('dirname') ; |
|
| 58 | - $target_dirname4sql = addslashes($target_dirname) ; |
|
| 59 | - $target_mname = $xoopsModule->getVar('name') ; |
|
| 56 | + $target_mid = $xoopsModule->getVar('mid'); |
|
| 57 | + $target_dirname = $xoopsModule->getVar('dirname'); |
|
| 58 | + $target_dirname4sql = addslashes($target_dirname); |
|
| 59 | + $target_mname = $xoopsModule->getVar('name'); |
|
| 60 | 60 | //$query4redirect = '' ; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // basic GET variables |
| 64 | -$target_lang = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['target_lang']) ; |
|
| 64 | +$target_lang = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['target_lang']); |
|
| 65 | 65 | if (empty($target_lang)) { |
| 66 | - $target_lang = $GLOBALS['xoopsConfig']['language'] ; |
|
| 66 | + $target_lang = $GLOBALS['xoopsConfig']['language']; |
|
| 67 | 67 | } |
| 68 | -$target_lang4sql = addslashes($target_lang) ; |
|
| 69 | -$target_file = preg_replace('/[^0-9a-zA-Z_.-]/', '', @$_GET['target_file']) ; |
|
| 68 | +$target_lang4sql = addslashes($target_lang); |
|
| 69 | +$target_file = preg_replace('/[^0-9a-zA-Z_.-]/', '', @$_GET['target_file']); |
|
| 70 | 70 | if (empty($target_file)) { |
| 71 | - $target_file = 'main.php' ; |
|
| 71 | + $target_file = 'main.php'; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // get $target_trustdirname |
| 75 | -$mytrustdirname = '' ; |
|
| 75 | +$mytrustdirname = ''; |
|
| 76 | 76 | if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php')) { |
| 77 | - require XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php' ; |
|
| 77 | + require XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/mytrustdirname.php'; |
|
| 78 | 78 | } |
| 79 | -$target_trustdirname = $mytrustdirname ; |
|
| 79 | +$target_trustdirname = $mytrustdirname; |
|
| 80 | 80 | |
| 81 | 81 | // get base directory |
| 82 | 82 | if (empty($target_trustdirname)) { |
| 83 | 83 | // conventinal module |
| 84 | - $base_dir = XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/language' ; |
|
| 84 | + $base_dir = XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/language'; |
|
| 85 | 85 | } else { |
| 86 | 86 | // D3 module |
| 87 | - $base_dir = XOOPS_TRUST_PATH.'/modules/'.$target_trustdirname.'/language' ; |
|
| 87 | + $base_dir = XOOPS_TRUST_PATH.'/modules/'.$target_trustdirname.'/language'; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | // make list of language and check $target_lang |
| 91 | -$languages = array() ; |
|
| 92 | -$languages4disp = array() ; |
|
| 93 | -if (! is_dir($base_dir)) { |
|
| 94 | - altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODNOLANGUAGE) ; |
|
| 91 | +$languages = array(); |
|
| 92 | +$languages4disp = array(); |
|
| 93 | +if (!is_dir($base_dir)) { |
|
| 94 | + altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODNOLANGUAGE); |
|
| 95 | 95 | } |
| 96 | -$dh = opendir($base_dir) ; |
|
| 96 | +$dh = opendir($base_dir); |
|
| 97 | 97 | if ($dh) { |
| 98 | 98 | while ($file = readdir($dh)) { |
| 99 | 99 | if (substr($file, 0, 1) == '.') { |
| 100 | - continue ; |
|
| 100 | + continue; |
|
| 101 | 101 | } |
| 102 | 102 | if (is_dir("$base_dir/$file")) { |
| 103 | - list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='" . addslashes($file) . "'")) ; |
|
| 104 | - $languages[] = $file ; |
|
| 105 | - $languages4disp[] = $file . " ($count)" ; |
|
| 103 | + list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='".addslashes($file)."'")); |
|
| 104 | + $languages[] = $file; |
|
| 105 | + $languages4disp[] = $file." ($count)"; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | -closedir($dh) ; |
|
| 110 | -if (! in_array($target_lang, $languages)) { |
|
| 111 | - $target_lang = $languages[0] ; |
|
| 109 | +closedir($dh); |
|
| 110 | +if (!in_array($target_lang, $languages)) { |
|
| 111 | + $target_lang = $languages[0]; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // get base directory seleced language |
| 115 | -$lang_base_dir = $base_dir.'/'.$target_lang ; |
|
| 116 | -if (! is_dir($lang_base_dir)) { |
|
| 117 | - altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODLANGINCOMPATIBLE) ; |
|
| 115 | +$lang_base_dir = $base_dir.'/'.$target_lang; |
|
| 116 | +if (!is_dir($lang_base_dir)) { |
|
| 117 | + altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODLANGINCOMPATIBLE); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // make list of files and check $target_file |
| 121 | -$lang_files = array() ; |
|
| 122 | -$dh = opendir($lang_base_dir) ; |
|
| 121 | +$lang_files = array(); |
|
| 122 | +$dh = opendir($lang_base_dir); |
|
| 123 | 123 | if ($dh) { |
| 124 | 124 | while ($file = readdir($dh)) { |
| 125 | 125 | if (substr($file, 0, 1) == '.') { |
| 126 | - continue ; |
|
| 126 | + continue; |
|
| 127 | 127 | } |
| 128 | 128 | if ($file == 'index.html') { |
| 129 | - continue ; |
|
| 129 | + continue; |
|
| 130 | 130 | } |
| 131 | 131 | //if( $file == 'modinfo.php' ) continue ; // TODO(?) |
| 132 | 132 | //if( $file == 'global.php' ) continue ; // TODO(?) |
| 133 | 133 | if (is_file("$lang_base_dir/$file")) { |
| 134 | - $lang_files[] = $file ; |
|
| 134 | + $lang_files[] = $file; |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | -closedir($dh) ; |
|
| 138 | +closedir($dh); |
|
| 139 | 139 | if (empty($lang_files)) { |
| 140 | - altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODEMPTYLANGDIR) ; |
|
| 140 | + altsys_mylangadmin_errordie($target_mname, _MYLANGADMIN_ERR_MODEMPTYLANGDIR); |
|
| 141 | 141 | } |
| 142 | -if (! in_array($target_file, $lang_files)) { |
|
| 143 | - $target_file = $lang_files[0] ; |
|
| 142 | +if (!in_array($target_file, $lang_files)) { |
|
| 143 | + $target_file = $lang_files[0]; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // get unique path of language_file |
| 147 | -$langfile_unique_path = "$lang_base_dir/$target_file" ; |
|
| 147 | +$langfile_unique_path = "$lang_base_dir/$target_file"; |
|
| 148 | 148 | |
| 149 | 149 | // get constants defined by the target_file |
| 150 | -list($langfile_names, $constpref, $already_read) = altsys_mylangadmin_get_constant_names($langfile_unique_path, $target_dirname) ; |
|
| 150 | +list($langfile_names, $constpref, $already_read) = altsys_mylangadmin_get_constant_names($langfile_unique_path, $target_dirname); |
|
| 151 | 151 | |
| 152 | 152 | // get user_values should be overridden |
| 153 | -$langfile_constants = array() ; |
|
| 153 | +$langfile_constants = array(); |
|
| 154 | 154 | foreach ($langfile_names as $name) { |
| 155 | - list($value) = $db->fetchRow($db->query('SELECT value FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='$target_lang4sql' AND name='" . addslashes($name) . "'")) ; |
|
| 156 | - $langfile_constants[ $name ] = $value ; |
|
| 155 | + list($value) = $db->fetchRow($db->query('SELECT value FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='$target_lang4sql' AND name='".addslashes($name)."'")); |
|
| 156 | + $langfile_constants[$name] = $value; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // constants defined in XOOPS_ROOT_PATH/my_language/(dirname)/... |
| 160 | 160 | if ($langman->my_language) { |
| 161 | - $mylang_unique_path = $langman->my_language.'/modules/'.$target_dirname.'/'.$target_lang.'/'.$target_file ; |
|
| 162 | - $mylang_constants = array_map('htmlspecialchars', altsys_mylangadmin_get_constants_by_pcre($mylang_unique_path)) ; |
|
| 161 | + $mylang_unique_path = $langman->my_language.'/modules/'.$target_dirname.'/'.$target_lang.'/'.$target_file; |
|
| 162 | + $mylang_constants = array_map('htmlspecialchars', altsys_mylangadmin_get_constants_by_pcre($mylang_unique_path)); |
|
| 163 | 163 | foreach ($mylang_constants as $key => $val) { |
| 164 | - if (! in_array($key, array_keys($langfile_constants))) { |
|
| 165 | - $langfile_constants[ $key ] = null ; |
|
| 166 | - define($key, _MYLANGADMIN_NOTE_ADDEDBYMYLANG) ; |
|
| 164 | + if (!in_array($key, array_keys($langfile_constants))) { |
|
| 165 | + $langfile_constants[$key] = null; |
|
| 166 | + define($key, _MYLANGADMIN_NOTE_ADDEDBYMYLANG); |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | } else { |
| 170 | - $mylang_unique_path = '' ; |
|
| 171 | - $mylang_constants = array() ; |
|
| 170 | + $mylang_unique_path = ''; |
|
| 171 | + $mylang_constants = array(); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
@@ -177,57 +177,57 @@ discard block |
||
| 177 | 177 | // |
| 178 | 178 | |
| 179 | 179 | // Update language table and cache file |
| 180 | -if (! empty($_POST['do_update'])) { |
|
| 180 | +if (!empty($_POST['do_update'])) { |
|
| 181 | 181 | // Ticket Check |
| 182 | - if (! $xoopsGTicket->check(true, 'altsys')) { |
|
| 182 | + if (!$xoopsGTicket->check(true, 'altsys')) { |
|
| 183 | 183 | redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | // read original file |
| 187 | - $file_contents = file_get_contents($langfile_unique_path) ; |
|
| 187 | + $file_contents = file_get_contents($langfile_unique_path); |
|
| 188 | 188 | |
| 189 | 189 | // insert fingerprint of langfile_unique_path |
| 190 | - $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path) ; |
|
| 191 | - $file_contents = str_replace('<?php', "<?php\nif(!defined('$langfile_fingerprint'))define('$langfile_fingerprint',1);", $file_contents) ; |
|
| 190 | + $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path); |
|
| 191 | + $file_contents = str_replace('<?php', "<?php\nif(!defined('$langfile_fingerprint'))define('$langfile_fingerprint',1);", $file_contents); |
|
| 192 | 192 | |
| 193 | 193 | // constants loop |
| 194 | - $overrides_counter = 0 ; |
|
| 194 | + $overrides_counter = 0; |
|
| 195 | 195 | foreach (array_reverse($langfile_names) as $name) { |
| 196 | - $user_value = $myts->stripSlashesGPC(@$_POST[$name]) ; |
|
| 197 | - $db->query('DELETE FROM ' . $db->prefix('altsys_language_constants') . " WHERE mid=$target_mid AND language='$target_lang4sql' AND name='" . addslashes($name) . "'") ; |
|
| 196 | + $user_value = $myts->stripSlashesGPC(@$_POST[$name]); |
|
| 197 | + $db->query('DELETE FROM '.$db->prefix('altsys_language_constants')." WHERE mid=$target_mid AND language='$target_lang4sql' AND name='".addslashes($name)."'"); |
|
| 198 | 198 | if ($user_value !== '') { |
| 199 | - $overrides_counter ++ ; |
|
| 199 | + $overrides_counter++; |
|
| 200 | 200 | // Update table |
| 201 | - $db->query('INSERT INTO ' . $db->prefix('altsys_language_constants') . " (mid,language,name,value) VALUES ($target_mid,'$target_lang4sql','" . addslashes($name) . "','" . addslashes($user_value) . "')") ; |
|
| 201 | + $db->query('INSERT INTO '.$db->prefix('altsys_language_constants')." (mid,language,name,value) VALUES ($target_mid,'$target_lang4sql','".addslashes($name)."','".addslashes($user_value)."')"); |
|
| 202 | 202 | // rewrite script for cache |
| 203 | 203 | // comment-out the line of define() |
| 204 | 204 | if (empty($constpref)) { |
| 205 | - $from = '/.*define\s?\(\s*(["\'])'.preg_quote($name).'(\\1).*\;.*/' ; |
|
| 205 | + $from = '/.*define\s?\(\s*(["\'])'.preg_quote($name).'(\\1).*\;.*/'; |
|
| 206 | 206 | } else { |
| 207 | - $from = '/.*define\s?\(\s*\$constpref\s*\.\s*(["\'])'.preg_quote(substr($name, strlen($constpref))).'(\\1).*\;.*/' ; |
|
| 207 | + $from = '/.*define\s?\(\s*\$constpref\s*\.\s*(["\'])'.preg_quote(substr($name, strlen($constpref))).'(\\1).*\;.*/'; |
|
| 208 | 208 | } |
| 209 | - $to = '//$0'."\ndefine('".addslashes($name)."','".addslashes($user_value)."');" ; |
|
| 210 | - $file_contents = preg_replace($from, $to, $file_contents) ; |
|
| 209 | + $to = '//$0'."\ndefine('".addslashes($name)."','".addslashes($user_value)."');"; |
|
| 210 | + $file_contents = preg_replace($from, $to, $file_contents); |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | // get the file name for caching |
| 215 | - $cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang) ; |
|
| 215 | + $cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang); |
|
| 216 | 216 | |
| 217 | 217 | // Create language cache file |
| 218 | 218 | if ($overrides_counter > 0) { |
| 219 | - $fp = fopen($cache_file_name, 'wb') ; |
|
| 220 | - if (! $fp) { |
|
| 221 | - die('Invalid Cache Directory. (Set XOOPS_TRUST_PATH/cache writable)') ; |
|
| 219 | + $fp = fopen($cache_file_name, 'wb'); |
|
| 220 | + if (!$fp) { |
|
| 221 | + die('Invalid Cache Directory. (Set XOOPS_TRUST_PATH/cache writable)'); |
|
| 222 | 222 | } |
| 223 | - fwrite($fp, $file_contents) ; |
|
| 224 | - fclose($fp) ; |
|
| 223 | + fwrite($fp, $file_contents); |
|
| 224 | + fclose($fp); |
|
| 225 | 225 | } else { |
| 226 | - unlink($cache_file_name) ; |
|
| 226 | + unlink($cache_file_name); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - redirect_header('?mode=admin&lib=altsys&page=mylangadmin&dirname='.$target_dirname.'&target_lang='.rawurlencode($target_lang).'&target_file='.rawurlencode($target_file), 1, _MYLANGADMIN_CACHEUPDATED) ; |
|
| 230 | - exit ; |
|
| 229 | + redirect_header('?mode=admin&lib=altsys&page=mylangadmin&dirname='.$target_dirname.'&target_lang='.rawurlencode($target_lang).'&target_file='.rawurlencode($target_file), 1, _MYLANGADMIN_CACHEUPDATED); |
|
| 230 | + exit; |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
@@ -236,22 +236,22 @@ discard block |
||
| 236 | 236 | // |
| 237 | 237 | |
| 238 | 238 | // check cache file |
| 239 | -$cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang) ; |
|
| 240 | -$cache_file_mtime = file_exists($cache_file_name) ? filemtime($cache_file_name) : 0 ; |
|
| 239 | +$cache_file_name = $langman->getCacheFileName($target_file, $target_dirname, $target_lang); |
|
| 240 | +$cache_file_mtime = file_exists($cache_file_name) ? filemtime($cache_file_name) : 0; |
|
| 241 | 241 | |
| 242 | 242 | // check core version and generate message to enable D3LanguageManager |
| 243 | 243 | if (altsys_get_core_type() == ALTSYS_CORE_TYPE_XCL21) { |
| 244 | 244 | // XoopsCube Legacy without preload |
| 245 | 245 | if (class_exists('AltsysLangMgr_LanguageManager')) { |
| 246 | 246 | // the preload enabled |
| 247 | - $notice4disp = _MYLANGADMIN_MSG_D3LANGMANENABLED ; |
|
| 247 | + $notice4disp = _MYLANGADMIN_MSG_D3LANGMANENABLED; |
|
| 248 | 248 | } else { |
| 249 | 249 | // the preload disabled |
| 250 | - $notice4disp = sprintf(_MYLANGADMIN_FMT_HOWTOENABLED3LANGMAN4XCL, 'SetupAltsysLangMgr.class.php', 'XOOPS_ROOT_PATH/preload') ; |
|
| 250 | + $notice4disp = sprintf(_MYLANGADMIN_FMT_HOWTOENABLED3LANGMAN4XCL, 'SetupAltsysLangMgr.class.php', 'XOOPS_ROOT_PATH/preload'); |
|
| 251 | 251 | } |
| 252 | 252 | } else { |
| 253 | 253 | // X2 core etc. |
| 254 | - $notice4disp = _MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2.'<br />' ; |
|
| 254 | + $notice4disp = _MYLANGADMIN_MSG_HOWTOENABLED3LANGMAN4X2.'<br />'; |
|
| 255 | 255 | $notice4disp .= ' |
| 256 | 256 | <h4>include/common.php</h4> |
| 257 | 257 | <pre> |
@@ -275,20 +275,20 @@ discard block |
||
| 275 | 275 | // |
| 276 | 276 | |
| 277 | 277 | |
| 278 | -xoops_cp_header() ; |
|
| 278 | +xoops_cp_header(); |
|
| 279 | 279 | |
| 280 | 280 | // mymenu |
| 281 | -altsys_include_mymenu() ; |
|
| 281 | +altsys_include_mymenu(); |
|
| 282 | 282 | |
| 283 | 283 | // breadcrumbs |
| 284 | -$breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
| 284 | +$breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
| 285 | 285 | if ($breadcrumbsObj->hasPaths()) { |
| 286 | - $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN) ; |
|
| 287 | - $breadcrumbsObj->appendPath('', $target_mname) ; |
|
| 286 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN); |
|
| 287 | + $breadcrumbsObj->appendPath('', $target_mname); |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | -require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ; |
|
| 291 | -$tpl = new D3Tpl() ; |
|
| 290 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
| 291 | +$tpl = new D3Tpl(); |
|
| 292 | 292 | $tpl->assign(array( |
| 293 | 293 | 'target_dirname' => $target_dirname, |
| 294 | 294 | 'target_mname' => $target_mname, |
@@ -307,8 +307,8 @@ discard block |
||
| 307 | 307 | 'notice' => $notice4disp, |
| 308 | 308 | 'already_read' => $already_read, |
| 309 | 309 | 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys') |
| 310 | -)) ; |
|
| 311 | -$tpl->display('db:altsys_main_mylangadmin.html') ; |
|
| 310 | +)); |
|
| 311 | +$tpl->display('db:altsys_main_mylangadmin.html'); |
|
| 312 | 312 | |
| 313 | -xoops_cp_footer() ; |
|
| 314 | -exit ; |
|
| 313 | +xoops_cp_footer(); |
|
| 314 | +exit; |
|
@@ -1,51 +1,51 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_MODULE_PATH')) { |
|
| 4 | - define('XOOPS_MODULE_PATH', XOOPS_ROOT_PATH . '/modules'); |
|
| 3 | +if (!defined('XOOPS_MODULE_PATH')) { |
|
| 4 | + define('XOOPS_MODULE_PATH', XOOPS_ROOT_PATH.'/modules'); |
|
| 5 | 5 | } |
| 6 | -if (! defined('XOOPS_MODULE_URL')) { |
|
| 7 | - define('XOOPS_MODULE_URL', XOOPS_URL . '/modules'); |
|
| 6 | +if (!defined('XOOPS_MODULE_URL')) { |
|
| 7 | + define('XOOPS_MODULE_URL', XOOPS_URL.'/modules'); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ; |
|
| 12 | -require_once __DIR__.'/include/altsys_functions.php' ; |
|
| 11 | +require_once __DIR__.'/class/AltsysBreadcrumbs.class.php'; |
|
| 12 | +require_once __DIR__.'/include/altsys_functions.php'; |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | if (empty($xoopsModule)) { |
| 16 | - $moduleperm_handler =& xoops_gethandler('module') ; |
|
| 17 | - $xoopsModule =& $moduleperm_handler->getByDirname('altsys') ; |
|
| 16 | + $moduleperm_handler = & xoops_gethandler('module'); |
|
| 17 | + $xoopsModule = & $moduleperm_handler->getByDirname('altsys'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -require XOOPS_ROOT_PATH.'/include/cp_functions.php' ; |
|
| 20 | +require XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
| 21 | 21 | |
| 22 | 22 | // breadcrumbs |
| 23 | -$breadcrumbsObj =& AltsysBreadcrumbs::getInstance() ; |
|
| 24 | -$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php', $GLOBALS['xoopsModule']->getVar('name')) ; |
|
| 23 | +$breadcrumbsObj = & AltsysBreadcrumbs::getInstance(); |
|
| 24 | +$breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php', $GLOBALS['xoopsModule']->getVar('name')); |
|
| 25 | 25 | |
| 26 | 26 | // get page |
| 27 | -$page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']) ; |
|
| 28 | -require __DIR__.'/controllers.php' ; |
|
| 29 | -if (! in_array($page, $controllers)) { |
|
| 30 | - $_GET['page'] = $page = 'myblocksadmin' ; |
|
| 31 | - $_SERVER['REQUEST_URI'] = '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ; |
|
| 27 | +$page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']); |
|
| 28 | +require __DIR__.'/controllers.php'; |
|
| 29 | +if (!in_array($page, $controllers)) { |
|
| 30 | + $_GET['page'] = $page = 'myblocksadmin'; |
|
| 31 | + $_SERVER['REQUEST_URI'] = '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin'; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | // half measure ... (TODO) |
| 36 | 36 | if (empty($_GET['dirname'])) { |
| 37 | - $module_handler =& xoops_gethandler('module') ; |
|
| 38 | - list($top_module) = $module_handler->getObjects(new Criteria('isactive', 1)) ; |
|
| 39 | - $_GET['dirname'] = $top_module->getVar('dirname') ; |
|
| 37 | + $module_handler = & xoops_gethandler('module'); |
|
| 38 | + list($top_module) = $module_handler->getObjects(new Criteria('isactive', 1)); |
|
| 39 | + $_GET['dirname'] = $top_module->getVar('dirname'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // language file |
| 43 | -altsys_include_language_file($page) ; |
|
| 43 | +altsys_include_language_file($page); |
|
| 44 | 44 | |
| 45 | 45 | // branch to each pages |
| 46 | -$mytrustdirpath = __DIR__ ; |
|
| 46 | +$mytrustdirpath = __DIR__; |
|
| 47 | 47 | if (file_exists(XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php')) { |
| 48 | - include XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php' ; |
|
| 48 | + include XOOPS_TRUST_PATH.'/libs/altsys/'.$page.'.php'; |
|
| 49 | 49 | } else { |
| 50 | - die('wrong request') ; |
|
| 50 | + die('wrong request'); |
|
| 51 | 51 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * Parent |
| 46 | 46 | */ |
| 47 | -include_once XOOPS_ROOT_PATH . '/class/xoopsform/formcheckbox.php'; |
|
| 47 | +include_once XOOPS_ROOT_PATH.'/class/xoopsform/formcheckbox.php'; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * A checkbox field with a choice of available groups |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | * @param bool $include_anon Include group "anonymous"? |
| 66 | 66 | * @param mixed $value Pre-selected value (or array of them). |
| 67 | 67 | */ |
| 68 | - public function __construct($caption, $name, $include_anon=false, $value=null) |
|
| 68 | + public function __construct($caption, $name, $include_anon = false, $value = null) |
|
| 69 | 69 | { |
| 70 | 70 | parent::__construct($caption, $name, $value); |
| 71 | - $member_handler =& xoops_gethandler('member'); |
|
| 71 | + $member_handler = & xoops_gethandler('member'); |
|
| 72 | 72 | if (!$include_anon) { |
| 73 | 73 | $options = $member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!=')); |
| 74 | 74 | } else { |
| 75 | 75 | $options = $member_handler->getGroupList(); |
| 76 | 76 | } |
| 77 | 77 | foreach ($options as $k => $v) { |
| 78 | - $options[$k] = $v . '<br />'; |
|
| 78 | + $options[$k] = $v.'<br />'; |
|
| 79 | 79 | } |
| 80 | 80 | $this->addOptionArray($options); |
| 81 | 81 | } |