Completed
Push — master ( 99eb82...6dab8b )
by Michael
19s
created
xoops_trust_path/libs/altsys/mymenusub/myblocksadmin.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
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
-$core_type = altsys_get_core_type() ;
8
-$db = XoopsDatabaseFactory::getDatabaseConnection() ;
7
+$core_type = altsys_get_core_type();
8
+$db = XoopsDatabaseFactory::getDatabaseConnection();
9 9
 
10
-$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']) ;
10
+$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']);
11 11
 if ($current_dirname == '__CustomBlocks__') {
12
-    return ;
12
+    return;
13 13
 }
14 14
 
15 15
     $module_handler4menu = xoops_getHandler('module');
@@ -17,45 +17,45 @@  discard block
 block discarded – undo
17 17
     //$criteria4menu->add(new Criteria('hasmain', 1));
18 18
     $criteria4menu->add(new Criteria('mid', '1', '>'));
19 19
     $modules4menu = $module_handler4menu->getObjects($criteria4menu, true);
20
-    $system_module = $module_handler4menu->get(1) ;
20
+    $system_module = $module_handler4menu->get(1);
21 21
     if (is_object($system_module)) {
22
-        array_unshift($modules4menu, $system_module) ;
22
+        array_unshift($modules4menu, $system_module);
23 23
     }
24 24
 
25
-$adminmenu = array() ;
25
+$adminmenu = array();
26 26
 foreach ($modules4menu as $m4menu) {
27 27
     // get block info
28 28
     if ($core_type != ALTSYS_CORE_TYPE_X22) {
29
-        list($block_count_all) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('newblocks') . ' WHERE mid=' . $m4menu->getVar('mid'))) ;
30
-        list($block_count_visible) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('newblocks') . ' WHERE mid=' . $m4menu->getVar('mid') . ' AND visible>0')) ;
29
+        list($block_count_all) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('newblocks').' WHERE mid='.$m4menu->getVar('mid')));
30
+        list($block_count_visible) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('newblocks').' WHERE mid='.$m4menu->getVar('mid').' AND visible>0'));
31 31
         // $block_desc = " $block_count_all($block_count_visible)" ;
32
-        $block_desc = " ($block_count_visible/$block_count_all)" ;
32
+        $block_desc = " ($block_count_visible/$block_count_all)";
33 33
     } else {
34
-        $block_desc = '' ;
34
+        $block_desc = '';
35 35
     }
36 36
 
37 37
     if ($m4menu->getVar('dirname') == $current_dirname) {
38 38
         $adminmenu[] = array(
39
-            'selected' => true ,
40
-            'title' => $m4menu->getVar('name', 'n') . $block_desc ,
39
+            'selected' => true,
40
+            'title' => $m4menu->getVar('name', 'n').$block_desc,
41 41
             'link' => '?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$m4menu->getVar('dirname', 'n')
42
-        ) ;
42
+        );
43 43
         //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => $m4menu->getVar('name') ) ;
44 44
     } else {
45 45
         $adminmenu[] = array(
46
-            'selected' => false ,
47
-            'title' => $m4menu->getVar('name', 'n') . $block_desc ,
46
+            'selected' => false,
47
+            'title' => $m4menu->getVar('name', 'n').$block_desc,
48 48
             'link' => '?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$m4menu->getVar('dirname', 'n')
49
-        ) ;
49
+        );
50 50
     }
51 51
 }
52 52
 
53 53
 
54 54
 // display
55
-require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ;
56
-$tpl = new D3Tpl() ;
55
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
56
+$tpl = new D3Tpl();
57 57
 $tpl->assign(array(
58 58
     'adminmenu' => $adminmenu,
59 59
     'mypage' => 'myblocksadmin'
60
-)) ;
61
-$tpl->display('db:altsys_inc_mymenusub.html') ;
60
+));
61
+$tpl->display('db:altsys_inc_mymenusub.html');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/preload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 //admin page
7 7
 if ($root->mController->_mStrategy) {
8 8
     if (strtolower(get_class($root->mController->_mStrategy)) == strtolower('Legacy_AdminControllerStrategy')) {
9
-        include_once __DIR__.'/include/altsys_functions.php' ;
9
+        include_once __DIR__.'/include/altsys_functions.php';
10 10
         // language file (modinfo.php)
11
-        altsys_include_language_file('modinfo') ;
11
+        altsys_include_language_file('modinfo');
12 12
     }
13 13
 }
14 14
 // load altsys newly gticket class for other modules
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/onupdate.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1,75 +1,75 @@  discard block
 block discarded – undo
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 15
         $root = XCube_Root::getSingleton();
16
-        $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onupdate') ;
17
-        $msgs = array() ;
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 = __DIR__.'/templates' ;
47
-        if ($handler = @opendir($tpl_path . '/')) {
45
+    $tplfile_handler = xoops_getHandler('tplfile');
46
+        $tpl_path = __DIR__.'/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 54
                     $mtime = (int)(@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)) {
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/mygroupperm.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
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
 function myDeleteByModule($DB, $gperm_modid, $gperm_name = null, $gperm_itemid = null)
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
             $criteria->add(new Criteria('gperm_itemid', (int)$gperm_itemid));
14 14
         }
15 15
     }
16
-    $sql = 'DELETE FROM ' . $DB->prefix('group_permission') . ' ' . $criteria->renderWhere();
16
+    $sql = 'DELETE FROM '.$DB->prefix('group_permission').' '.$criteria->renderWhere();
17 17
     if (!$result = $DB->query($sql)) {
18 18
         return false;
19 19
     }
@@ -27,27 +27,27 @@  discard block
 block discarded – undo
27 27
 
28 28
 if ($modid == 1) {
29 29
     // check by the permission of eather 'altsys' or 'system'
30
-    $module_handler = xoops_getHandler('module') ;
31
-    $module = $module_handler->getByDirname('altsys') ;
32
-    if (! is_object($module)) {
33
-        $module = $module_handler->getByDirname('system') ;
34
-        if (! is_object($module)) {
35
-            die('there is no altsys nor system.') ;
30
+    $module_handler = xoops_getHandler('module');
31
+    $module = $module_handler->getByDirname('altsys');
32
+    if (!is_object($module)) {
33
+        $module = $module_handler->getByDirname('system');
34
+        if (!is_object($module)) {
35
+            die('there is no altsys nor system.');
36 36
         }
37 37
     }
38
-    $moduleperm_handler = xoops_getHandler('groupperm') ;
39
-    if (! is_object(@$GLOBALS['xoopsUser']) || ! $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $GLOBALS['xoopsUser']->getGroups())) {
40
-        die('only admin of altsys can access this area') ;
38
+    $moduleperm_handler = xoops_getHandler('groupperm');
39
+    if (!is_object(@$GLOBALS['xoopsUser']) || !$moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), $GLOBALS['xoopsUser']->getGroups())) {
40
+        die('only admin of altsys can access this area');
41 41
     }
42 42
 } else {
43 43
     // check the permission of 'module_admin' of the module
44 44
     if ($modid <= 0 || !is_object($GLOBALS['xoopsUser']) || !$GLOBALS['xoopsUser']->isAdmin($modid)) {
45
-        die(_NOPERM) ;
45
+        die(_NOPERM);
46 46
     }
47 47
     $module_handler = xoops_getHandler('module');
48 48
     $module = $module_handler->get($modid);
49 49
     if (!is_object($module) || !$module->getVar('isactive')) {
50
-        die(_MODULENOEXIST) ;
50
+        die(_MODULENOEXIST);
51 51
     }
52 52
 }
53 53
 
@@ -56,18 +56,18 @@  discard block
 block discarded – undo
56 56
 if (!empty($_POST['perms']) && is_array($_POST['perms'])) {
57 57
     $gperm_handler = xoops_getHandler('groupperm');
58 58
     foreach ($_POST['perms'] as $perm_name => $perm_data) {
59
-        foreach ($perm_data['itemname' ] as $item_id => $item_name) {
59
+        foreach ($perm_data['itemname'] as $item_id => $item_name) {
60 60
             // checking code
61 61
             // echo "<pre>" ;
62 62
             // var_dump( $_POST['perms'] ) ;
63 63
             // exit ;
64 64
             if (false != myDeleteByModule($gperm_handler->db, $modid, $perm_name, $item_id)) {
65 65
                 if (empty($perm_data['groups'])) {
66
-                    continue ;
66
+                    continue;
67 67
                 }
68 68
                 foreach ($perm_data['groups'] as $group_id => $item_ids) {
69 69
                     //              foreach ($item_ids as $item_id => $selected) {
70
-                    $selected = isset($item_ids[ $item_id ]) ? $item_ids[ $item_id ] : 0 ;
70
+                    $selected = isset($item_ids[$item_id]) ? $item_ids[$item_id] : 0;
71 71
                     if ($selected == 1) {
72 72
                         // make sure that all parent ids are selected as well
73 73
                         if ($perm_data['parents'][$item_id] != '') {
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/lang_functions.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -2,91 +2,91 @@
 block discarded – undo
2 2
 
3 3
 function altsys_mylangadmin_get_constant_names($langfile_unique_path, $mydirname)
4 4
 {
5
-    $constpref = '' ;
6
-    $langfile_names = array() ;
7
-    $reqonce_ret = 0 ;
8
-    $already_read = false ;
9
-    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path) ;
5
+    $constpref = '';
6
+    $langfile_names = array();
7
+    $reqonce_ret = 0;
8
+    $already_read = false;
9
+    $langfile_fingerprint = '_MYLANGADMIN_'.md5($langfile_unique_path);
10 10
 
11 11
     // for debug
12 12
     //require_once XOOPS_TRUST_PATH.'/modules/pico/language/japanese/modinfo.php' ;
13 13
 
14 14
     // get constant_names by "require"
15
-    if (! defined($langfile_fingerprint)) {
16
-        $system_constants = array_keys(get_defined_constants()) ;
15
+    if (!defined($langfile_fingerprint)) {
16
+        $system_constants = array_keys(get_defined_constants());
17 17
         $reqonce_ret = require_once $langfile_unique_path;
18
-        $langfile_names = array_diff(array_keys(get_defined_constants()), $system_constants) ;
18
+        $langfile_names = array_diff(array_keys(get_defined_constants()), $system_constants);
19 19
     }
20 20
 
21 21
     // We have to parse the file if it has been already included ...
22 22
     if (empty($langfile_names) && ($reqonce_ret === true || defined($langfile_fingerprint))) {
23
-        $already_read = true ;
24
-        $langfile_names = altsys_mylangadmin_get_constant_names_by_pcre($langfile_unique_path) ;
23
+        $already_read = true;
24
+        $langfile_names = altsys_mylangadmin_get_constant_names_by_pcre($langfile_unique_path);
25 25
     }
26 26
 
27 27
     // modinfo.php of D3 module
28 28
     if (empty($langfile_names) && file_exists(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/mytrustdirname.php') /* && substr( $langfile_unique_path , -11 ) == 'modinfo.php' */) {
29 29
         // get $constpref
30
-        $constpref = '' ;
31
-        require $langfile_unique_path ;
32
-        $langfile_names = array() ;
30
+        $constpref = '';
31
+        require $langfile_unique_path;
32
+        $langfile_names = array();
33 33
         if ($constpref) {
34 34
             foreach (array_keys(get_defined_constants()) as $name) {
35 35
                 if (strncmp($name, $constpref, strlen($constpref)) == 0) {
36
-                    $langfile_names[] = $name ;
36
+                    $langfile_names[] = $name;
37 37
                 }
38 38
             }
39 39
         }
40 40
     }
41 41
 
42 42
 
43
-    return array( $langfile_names , $constpref , $already_read ) ;
43
+    return array($langfile_names, $constpref, $already_read);
44 44
 }
45 45
 
46 46
 
47 47
 function altsys_mylangadmin_get_constant_names_by_pcre($langfile_path)
48 48
 {
49
-    if (! file_exists($langfile_path)) {
50
-        return array() ;
49
+    if (!file_exists($langfile_path)) {
50
+        return array();
51 51
     }
52
-    $file_contents = file_get_contents($langfile_path) ;
53
-    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1/iU', $file_contents, $matches) ;
54
-    $langfile_names = array() ;
52
+    $file_contents = file_get_contents($langfile_path);
53
+    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1/iU', $file_contents, $matches);
54
+    $langfile_names = array();
55 55
     foreach ($matches[2] as $name) {
56 56
         // if( defined( $name ) )
57
-        $langfile_names[] = $name ;
57
+        $langfile_names[] = $name;
58 58
     }
59 59
 
60
-    return $langfile_names ;
60
+    return $langfile_names;
61 61
 }
62 62
 
63 63
 
64 64
 function altsys_mylangadmin_get_constants_by_pcre($langfile_path)
65 65
 {
66
-    if (! file_exists($langfile_path)) {
67
-        return array() ;
66
+    if (!file_exists($langfile_path)) {
67
+        return array();
68 68
     }
69 69
 
70
-    $file_contents = file_get_contents($langfile_path) ;
71
-    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1\s*\,\s*(["\'])([^\\3]+)\\3/iU', $file_contents, $matches) ;
72
-    $constants = array() ;
70
+    $file_contents = file_get_contents($langfile_path);
71
+    preg_match_all('/\n\s*define\(\s*(["\'])([0-9a-zA-Z_]+)\\1\s*\,\s*(["\'])([^\\3]+)\\3/iU', $file_contents, $matches);
72
+    $constants = array();
73 73
     foreach ($matches[2] as $i => $name) {
74
-        $constants[ $name ] = $matches[4][$i] ;
74
+        $constants[$name] = $matches[4][$i];
75 75
     }
76 76
 
77
-    return $constants ;
77
+    return $constants;
78 78
 }
79 79
 
80 80
 
81 81
 function altsys_mylangadmin_errordie($target_mname, $message4disp)
82 82
 {
83
-    xoops_cp_header() ;
84
-    altsys_include_mymenu() ;
85
-    $breadcrumbsObj = AltsysBreadcrumbs::getInstance() ;
86
-    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN) ;
87
-    $breadcrumbsObj->appendPath('', $target_mname) ;
88
-    echo '<h3>' . _MYLANGADMIN_H3_MODULE . ' : ' . $target_mname . '</h3>' ;
89
-    echo '<p>'.$message4disp.'</p>' ;
90
-    xoops_cp_footer() ;
91
-    exit ;
83
+    xoops_cp_header();
84
+    altsys_include_mymenu();
85
+    $breadcrumbsObj = AltsysBreadcrumbs::getInstance();
86
+    $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN);
87
+    $breadcrumbsObj->appendPath('', $target_mname);
88
+    echo '<h3>'._MYLANGADMIN_H3_MODULE.' : '.$target_mname.'</h3>';
89
+    echo '<p>'.$message4disp.'</p>';
90
+    xoops_cp_footer();
91
+    exit;
92 92
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/formcheckboxgroup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 /**
33 33
  * Parent
34 34
  */
35
-include_once XOOPS_ROOT_PATH . '/class/xoopsform/formcheckbox.php';
35
+include_once XOOPS_ROOT_PATH.'/class/xoopsform/formcheckbox.php';
36 36
 
37 37
 /**
38 38
  * A checkbox field with a choice of available groups
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param   bool    $include_anon   Include group "anonymous"?
54 54
      * @param   mixed   $value          Pre-selected value (or array of them).
55 55
      */
56
-    public function __construct($caption, $name, $include_anon=false, $value=null)
56
+    public function __construct($caption, $name, $include_anon = false, $value = null)
57 57
     {
58 58
         parent::__construct($caption, $name, $value);
59 59
         $member_handler = xoops_getHandler('member');
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $options = $member_handler->getGroupList();
64 64
         }
65 65
         foreach ($options as $k => $v) {
66
-            $options[$k] = $v . '<br />';
66
+            $options[$k] = $v.'<br />';
67 67
         }
68 68
         $this->addOptionArray($options);
69 69
     }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/include/adminmenu_functions.php 1 patch
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once dirname(__DIR__).'/class/altsysUtils.class.php' ;
2
+require_once dirname(__DIR__).'/class/altsysUtils.class.php';
3 3
 
4
-define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php') ;
5
-define('ALTSYS_ADMINMENU_HACK_NONE', 0) ;
6
-define('ALTSYS_ADMINMENU_HACK_2COL', 1) ;
7
-define('ALTSYS_ADMINMENU_HACK_NOIMG', 2) ;
8
-define('ALTSYS_ADMINMENU_HACK_XCSTY', 3) ;
4
+define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php');
5
+define('ALTSYS_ADMINMENU_HACK_NONE', 0);
6
+define('ALTSYS_ADMINMENU_HACK_2COL', 1);
7
+define('ALTSYS_ADMINMENU_HACK_NOIMG', 2);
8
+define('ALTSYS_ADMINMENU_HACK_XCSTY', 3);
9 9
 
10 10
 
11 11
 //
@@ -13,73 +13,73 @@  discard block
 block discarded – undo
13 13
 //
14 14
 function altsys_adminmenu_insert_mymenu(&$module)
15 15
 {
16
-    global $altsysModuleConfig ;
16
+    global $altsysModuleConfig;
17 17
 
18 18
     if (empty($altsysModuleConfig['adminmenu_insert_mymenu'])) {
19
-        return ;
19
+        return;
20 20
     }
21 21
 
22 22
     if (altsys_get_core_type() < ALTSYS_CORE_TYPE_ORE) {
23
-        altsys_adminmenu_insert_mymenu_x20($module) ;
23
+        altsys_adminmenu_insert_mymenu_x20($module);
24 24
     }
25 25
 }
26 26
 
27 27
 function altsys_adminmenu_insert_mymenu_x20(&$module)
28 28
 {
29 29
     // read
30
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
31
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
32
-        exit ;
30
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
31
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
32
+        exit;
33 33
     }
34
-    $not_inside_cp_functions = true ;
35
-    include ALTSYS_ADMINMENU_FILE ;
34
+    $not_inside_cp_functions = true;
35
+    include ALTSYS_ADMINMENU_FILE;
36 36
 
37
-    $dirname = $module->getVar('dirname') ;
38
-    $mid = $module->getVar('mid') ;
39
-    $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->' ;
37
+    $dirname = $module->getVar('dirname');
38
+    $mid = $module->getVar('mid');
39
+    $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->';
40 40
 
41 41
     // fetch popup_no
42 42
     if (empty($xoops_admin_menu_ft[$mid])) {
43
-        return ;
43
+        return;
44 44
     }
45
-    if (! preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) {
46
-        return ;
45
+    if (!preg_match('/popUpL(\d+)/', $xoops_admin_menu_ft[$mid], $regs)) {
46
+        return;
47 47
     }
48 48
     $popup_no = (int)$regs[1];
49 49
 
50 50
     // replace
51
-    $search  = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mid.'\'' ;
52
-    $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences\'' ;
51
+    $search  = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mid.'\'';
52
+    $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences\'';
53 53
 
54 54
     // do replacement
55
-    $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv) ;
55
+    $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv);
56 56
 
57 57
     if ($xoops_admin_menu_dv == $new_xoops_admin_menu_dv) {
58
-        return ;
58
+        return;
59 59
     }
60
-    $xoops_admin_menu_dv = $new_xoops_admin_menu_dv ;
60
+    $xoops_admin_menu_dv = $new_xoops_admin_menu_dv;
61 61
 
62
-    $insert = '' ;
62
+    $insert = '';
63 63
 
64 64
     // insert blocksadmin
65 65
     if ($dirname != 'altsys') {
66
-        $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ;
67
-        $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n" ;
66
+        $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin';
67
+        $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=myblocksadmin\'>'.$blocksadmin_title.'</a><br />'."\n";
68 68
     }
69 69
 
70 70
     // insert tplsadmin
71
-    $db = XoopsDatabaseFactory::getDatabaseConnection() ;
72
-    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_module='$dirname'")) ;
71
+    $db = XoopsDatabaseFactory::getDatabaseConnection();
72
+    list($count) = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_module='$dirname'"));
73 73
     if ($count > 0) {
74
-        $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ;
75
-        $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert ;
74
+        $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin';
75
+        $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\' />&nbsp;<a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mytplsadmin\'>'.$tplsadmin_title.'</a><br />'."\n".$insert;
76 76
     }
77 77
 
78 78
     // do insertion
79
-    $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv) ;
79
+    $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv);
80 80
 
81 81
     // write back
82
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true )) ;
82
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), 'altsys_adminmenu_dv_updated' => true));
83 83
 }
84 84
 
85 85
 //
@@ -87,184 +87,184 @@  discard block
 block discarded – undo
87 87
 //
88 88
 function altsys_adminmenu_hack_ft()
89 89
 {
90
-    global $altsysModuleConfig ;
90
+    global $altsysModuleConfig;
91 91
 
92 92
     if (altsys_get_core_type() >= ALTSYS_CORE_TYPE_ORE) {
93
-        return ;
93
+        return;
94 94
     }
95 95
     if (empty($altsysModuleConfig['adminmenu_hack_ft'])) {
96
-        return ;
96
+        return;
97 97
     }
98 98
 
99 99
     if ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_2COL) {
100
-        altsys_adminmenu_hack_ft_2col_x20() ;
100
+        altsys_adminmenu_hack_ft_2col_x20();
101 101
     } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_NOIMG) {
102
-        altsys_adminmenu_hack_ft_noimg_x20() ;
102
+        altsys_adminmenu_hack_ft_noimg_x20();
103 103
     } elseif ($altsysModuleConfig['adminmenu_hack_ft'] == ALTSYS_ADMINMENU_HACK_XCSTY) {
104
-        altsys_adminmenu_hack_ft_xcsty_x20() ;
104
+        altsys_adminmenu_hack_ft_xcsty_x20();
105 105
     }
106 106
 }
107 107
 
108 108
 function altsys_adminmenu_hack_ft_2col_x20()
109 109
 {
110 110
     // read
111
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
112
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
113
-        exit ;
111
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
112
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
113
+        exit;
114 114
     }
115
-    $not_inside_cp_functions = true ;
116
-    include ALTSYS_ADMINMENU_FILE ;
115
+    $not_inside_cp_functions = true;
116
+    include ALTSYS_ADMINMENU_FILE;
117 117
 
118 118
     // check previous hack
119
-    if (! empty($altsys_adminmenu_ft_hacked)) {
119
+    if (!empty($altsys_adminmenu_ft_hacked)) {
120 120
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_2COL) {
121 121
             // skip
122
-            return ;
122
+            return;
123 123
         } else {
124 124
             // rebuild adminmenu
125
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
126
-            xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ;
125
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
126
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
127 127
             // backup $xoops_admin_menu_dv
128
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
128
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
129 129
             // include new adminmenu
130
-            include ALTSYS_ADMINMENU_FILE ;
130
+            include ALTSYS_ADMINMENU_FILE;
131 131
             // restore $xoops_admin_menu_dv
132
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
132
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
133 133
         }
134 134
     }
135 135
 
136
-    $search  = ' alt=\'\' /></a><br />' ;
137
-    $replace_fmt = ' alt="%s" /></a>' ;
136
+    $search  = ' alt=\'\' /></a><br />';
137
+    $replace_fmt = ' alt="%s" /></a>';
138 138
 
139
-    $is_left = true ;
140
-    $module_handler = xoops_getHandler('module') ;
141
-    $mids = array_keys($xoops_admin_menu_ft) ;
142
-    $last_mid = $mids[count($mids) - 1 ] ;
139
+    $is_left = true;
140
+    $module_handler = xoops_getHandler('module');
141
+    $mids = array_keys($xoops_admin_menu_ft);
142
+    $last_mid = $mids[count($mids) - 1];
143 143
     foreach ($mids as $mid) {
144
-        $module = $module_handler->get($mid) ;
145
-        $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]) ;
144
+        $module = $module_handler->get($mid);
145
+        $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]);
146 146
         if ($is_left) {
147 147
             if ($mid == $last_mid) {
148
-                $xoops_admin_menu_ft[$mid] = $new_menu_ft . '</td><td>' ;
148
+                $xoops_admin_menu_ft[$mid] = $new_menu_ft.'</td><td>';
149 149
             } else {
150
-                $left_body = $new_menu_ft ;
151
-                $left_key = $mid ;
152
-                $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]) ;
150
+                $left_body = $new_menu_ft;
151
+                $left_key = $mid;
152
+                $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]);
153 153
             }
154 154
         } else {
155
-            $xoops_admin_menu_ft[$mid] = $left_body . '</td><td>' . $new_menu_ft ;
156
-            unset($xoops_admin_menu_ft[$left_key]) ;
157
-            $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]) ;
155
+            $xoops_admin_menu_ft[$mid] = $left_body.'</td><td>'.$new_menu_ft;
156
+            unset($xoops_admin_menu_ft[$left_key]);
157
+            $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',185);', $xoops_admin_menu_ml[$mid]);
158 158
         }
159
-        $is_left = ! $is_left ;
159
+        $is_left = !$is_left;
160 160
     }
161 161
 
162 162
     // write back
163
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL )) ;
163
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL));
164 164
 }
165 165
 
166 166
 
167 167
 function altsys_adminmenu_hack_ft_noimg_x20()
168 168
 {
169 169
     // read
170
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
171
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
172
-        exit ;
170
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
171
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
172
+        exit;
173 173
     }
174
-    $not_inside_cp_functions = true ;
175
-    include ALTSYS_ADMINMENU_FILE ;
174
+    $not_inside_cp_functions = true;
175
+    include ALTSYS_ADMINMENU_FILE;
176 176
 
177 177
     // check previous hack
178
-    if (! empty($altsys_adminmenu_ft_hacked)) {
178
+    if (!empty($altsys_adminmenu_ft_hacked)) {
179 179
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_NOIMG) {
180 180
             // skip
181
-            return ;
181
+            return;
182 182
         } else {
183 183
             // rebuild adminmenu
184
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
185
-            xoops_module_write_admin_menu(xoops_module_get_admin_menu()) ;
184
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
185
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
186 186
             // backup $xoops_admin_menu_dv
187
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
187
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
188 188
             // include new adminmenu
189
-            include ALTSYS_ADMINMENU_FILE ;
189
+            include ALTSYS_ADMINMENU_FILE;
190 190
             // restore $xoops_admin_menu_dv
191
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
191
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
192 192
         }
193 193
     }
194 194
 
195
-    $module_handler = xoops_getHandler('module') ;
196
-    $mids = array_keys($xoops_admin_menu_ft) ;
195
+    $module_handler = xoops_getHandler('module');
196
+    $mids = array_keys($xoops_admin_menu_ft);
197 197
     foreach ($mids as $mid) {
198
-        $module = $module_handler->get($mid) ;
199
-        $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]) ;
200
-        $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>' ;
201
-        $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]) ;
198
+        $module = $module_handler->get($mid);
199
+        $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]);
200
+        $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>';
201
+        $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]);
202 202
     }
203 203
 
204 204
     // write back
205
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG )) ;
205
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG));
206 206
 }
207 207
 
208 208
 
209 209
 function altsys_adminmenu_hack_ft_xcsty_x20()
210 210
 {
211 211
     // read
212
-    if (! file_exists(ALTSYS_ADMINMENU_FILE)) {
213
-        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu') ;
214
-        exit ;
212
+    if (!file_exists(ALTSYS_ADMINMENU_FILE)) {
213
+        redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu');
214
+        exit;
215 215
     }
216
-    $not_inside_cp_functions = true ;
217
-    include ALTSYS_ADMINMENU_FILE ;
216
+    $not_inside_cp_functions = true;
217
+    include ALTSYS_ADMINMENU_FILE;
218 218
 
219 219
     // check previous hack
220
-    if (! empty($altsys_adminmenu_ft_hacked)) {
220
+    if (!empty($altsys_adminmenu_ft_hacked)) {
221 221
         if ($altsys_adminmenu_ft_hacked == ALTSYS_ADMINMENU_HACK_XCSTY && empty($altsys_adminmenu_dv_updated)) {
222 222
             // skip
223
-            return ;
223
+            return;
224 224
         } else {
225 225
             // rebuild adminmenu
226
-            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php' ;
227
-            $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ;
228
-            fwrite($fp, xoops_module_get_admin_menu()) ;
229
-            fclose($fp) ;
226
+            require_once XOOPS_ROOT_PATH.'/include/cp_functions.php';
227
+            $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb');
228
+            fwrite($fp, xoops_module_get_admin_menu());
229
+            fclose($fp);
230 230
             // backup $xoops_admin_menu_dv
231
-            $backup_admin_menu_dv = $xoops_admin_menu_dv ;
231
+            $backup_admin_menu_dv = $xoops_admin_menu_dv;
232 232
             // include new adminmenu
233
-            include ALTSYS_ADMINMENU_FILE ;
233
+            include ALTSYS_ADMINMENU_FILE;
234 234
             // restore $xoops_admin_menu_dv
235
-            $xoops_admin_menu_dv = $backup_admin_menu_dv ;
235
+            $xoops_admin_menu_dv = $backup_admin_menu_dv;
236 236
         }
237 237
     }
238 238
 
239
-    $module_handler = xoops_getHandler('module') ;
240
-    $mids = array_keys($xoops_admin_menu_ft) ;
239
+    $module_handler = xoops_getHandler('module');
240
+    $mids = array_keys($xoops_admin_menu_ft);
241 241
     foreach ($mids as $mid) {
242
-        $module = $module_handler->get($mid) ;
243
-        $submenuitems = array() ;
242
+        $module = $module_handler->get($mid);
243
+        $submenuitems = array();
244 244
         if (preg_match('/popUpL\d+/', $xoops_admin_menu_ft[$mid], $regs)) {
245
-            $popup = $regs[0] ;
246
-            preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs) ;
245
+            $popup = $regs[0];
246
+            preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs);
247 247
             foreach ($regs[0] as $submenuitem) {
248
-                $submenuitems[] = str_replace($popup.'();', '', $submenuitem) ;
248
+                $submenuitems[] = str_replace($popup.'();', '', $submenuitem);
249 249
             }
250 250
         } else {
251
-            return ;
251
+            return;
252 252
         }
253 253
         // module icon
254 254
         if (preg_match('#\<img .*/\>#U', $xoops_admin_menu_ft[$mid], $regs)) {
255
-            $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]) ;
255
+            $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]);
256 256
         } else {
257
-            $icon_img = '' ;
257
+            $icon_img = '';
258 258
         }
259 259
         // version number
260
-        $icon_img .= '<span class="version" style="">' . sprintf('%.2f', $module->getVar('version') / 100.0) . '</span>' ;
261
-        $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]) ;
262
-        $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>' ;
260
+        $icon_img .= '<span class="version" style="">'.sprintf('%.2f', $module->getVar('version') / 100.0).'</span>';
261
+        $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]);
262
+        $newline = "\n".'<!-- '.$popup.' --><div id="adminmenu_ft'.$mid.'" style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'"><a id="adminmenu_ftpoint'.$mid.'" href="javascript:void(0);" onclick="submenuToggle('.$mid.');">+</a> '.$newline.'>'.$module->getVar('name').'</a></div><div id="adminmenu_ftsub'.$mid.'" style="display:none;"><ul>';
263 263
         foreach ($submenuitems as $submenuitem) {
264
-            $newline .= '<li>'.$submenuitem.'</li>' ;
264
+            $newline .= '<li>'.$submenuitem.'</li>';
265 265
         }
266
-        $newline .= '</ul>'.$icon_img.'</div>' ;
267
-        $xoops_admin_menu_ft[$mid] = $newline ;
266
+        $newline .= '</ul>'.$icon_img.'</div>';
267
+        $xoops_admin_menu_ft[$mid] = $newline;
268 268
     }
269 269
 
270 270
     $xoops_admin_menu_js = "
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	}" ;
281 281
 
282 282
     // write back
283
-    altsys_adminmenu_save_x20(array( 'xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY )) ;
283
+    altsys_adminmenu_save_x20(array('xoops_admin_menu_js' => $xoops_admin_menu_js, 'xoops_admin_menu_ml' => array(), 'xoops_admin_menu_sd' => array(), 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY));
284 284
 }
285 285
 
286 286
 
@@ -291,18 +291,18 @@  discard block
 block discarded – undo
291 291
 function altsys_adminmenu_save_x20($xoops_admin_vars)
292 292
 {
293 293
     // variable definitions
294
-    ob_start() ;
295
-    echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n" ;
294
+    ob_start();
295
+    echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n";
296 296
     foreach ($xoops_admin_vars as $key => $val) {
297
-        echo '$' . $key . " = \n" ;
298
-        @var_export($val) ;
299
-        echo " ;\n" ;
297
+        echo '$'.$key." = \n";
298
+        @var_export($val);
299
+        echo " ;\n";
300 300
     }
301
-    $output = ob_get_contents() ;
302
-    ob_end_clean() ;
301
+    $output = ob_get_contents();
302
+    ob_end_clean();
303 303
 
304 304
     // embedding logics
305
-    if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array( ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY ))) {
305
+    if (in_array(@$xoops_admin_vars['altsys_adminmenu_ft_hacked'], array(ALTSYS_ADMINMENU_HACK_NOIMG, ALTSYS_ADMINMENU_HACK_XCSTY))) {
306 306
         $output .= '
307 307
 
308 308
 if( is_object( @$GLOBALS["xoopsModule"] ) && empty( $not_inside_cp_functions ) ) {
@@ -317,13 +317,13 @@  discard block
 block discarded – undo
317 317
     }
318 318
 
319 319
     // termination
320
-    $output .= "\n\n?>" ;
320
+    $output .= "\n\n?>";
321 321
 
322 322
     // replace into XOOPS_URL
323
-    $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output) ;
323
+    $output = str_replace(XOOPS_URL, "'.XOOPS_URL.'", $output);
324 324
 
325 325
     // output
326
-    $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb') ;
327
-    fwrite($fp, $output) ;
328
-    fclose($fp) ;
326
+    $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb');
327
+    fwrite($fp, $output);
328
+    fclose($fp);
329 329
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/myblocksadmin.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -5,56 +5,56 @@  discard block
 block discarded – undo
5 5
 //                       GIJOE <http://www.peak.ne.jp/>                      //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-require_once __DIR__.'/class/AltsysBreadcrumbs.class.php' ;
9
-require_once __DIR__.'/include/gtickets.php' ;
10
-include_once __DIR__.'/include/altsys_functions.php' ;
11
-include_once __DIR__.'/include/mygrouppermform.php' ;
12
-include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
8
+require_once __DIR__.'/class/AltsysBreadcrumbs.class.php';
9
+require_once __DIR__.'/include/gtickets.php';
10
+include_once __DIR__.'/include/altsys_functions.php';
11
+include_once __DIR__.'/include/mygrouppermform.php';
12
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
13 13
 
14 14
 // language file
15
-altsys_include_language_file('myblocksadmin') ;
15
+altsys_include_language_file('myblocksadmin');
16 16
 
17 17
 // fork by core types
18 18
 switch (altsys_get_core_type()) {
19 19
     case ALTSYS_CORE_TYPE_X22:
20
-        include_once __DIR__.'/class/MyBlocksAdminForX22.class.php' ;
21
-        $myba = MyBlocksAdminForX22::getInstance() ;
22
-        break ;
20
+        include_once __DIR__.'/class/MyBlocksAdminForX22.class.php';
21
+        $myba = MyBlocksAdminForX22::getInstance();
22
+        break;
23 23
     case ALTSYS_CORE_TYPE_X25:
24
-        include_once __DIR__.'/class/MyBlocksAdminForX25.class.php' ;
25
-        $myba = MyBlocksAdminForX25::getInstance() ;
26
-        break ;
24
+        include_once __DIR__.'/class/MyBlocksAdminForX25.class.php';
25
+        $myba = MyBlocksAdminForX25::getInstance();
26
+        break;
27 27
     case ALTSYS_CORE_TYPE_XCL21:
28
-        include_once __DIR__.'/class/MyBlocksAdminForXCL21.class.php' ;
29
-        $myba = MyBlocksAdminForXCL21::getInstance() ;
30
-        break ;
28
+        include_once __DIR__.'/class/MyBlocksAdminForXCL21.class.php';
29
+        $myba = MyBlocksAdminForXCL21::getInstance();
30
+        break;
31 31
     case ALTSYS_CORE_TYPE_ICMS:
32
-        include_once __DIR__.'/class/MyBlocksAdminForICMS.class.php' ;
33
-        $myba = MyBlocksAdminForICMS::getInstance() ;
34
-        break ;
32
+        include_once __DIR__.'/class/MyBlocksAdminForICMS.class.php';
33
+        $myba = MyBlocksAdminForICMS::getInstance();
34
+        break;
35 35
     case ALTSYS_CORE_TYPE_X20S:
36 36
     case ALTSYS_CORE_TYPE_X23P:
37
-        include_once __DIR__.'/class/MyBlocksAdminForX20S.class.php' ;
38
-        $myba = MyBlocksAdminForX20S::getInstance() ;
39
-        break ;
37
+        include_once __DIR__.'/class/MyBlocksAdminForX20S.class.php';
38
+        $myba = MyBlocksAdminForX20S::getInstance();
39
+        break;
40 40
     default:
41
-        include_once __DIR__.'/class/MyBlocksAdmin.class.php' ;
42
-        $myba = MyBlocksAdmin::getInstance() ;
43
-        break ;
41
+        include_once __DIR__.'/class/MyBlocksAdmin.class.php';
42
+        $myba = MyBlocksAdmin::getInstance();
43
+        break;
44 44
 }
45 45
 // permission
46
-$myba->checkPermission() ;
46
+$myba->checkPermission();
47 47
 
48 48
 // set parameters target_mid , target_dirname etc.
49
-$myba->init($xoopsModule) ;
49
+$myba->init($xoopsModule);
50 50
 
51 51
 
52 52
 //
53 53
 // transaction stage
54 54
 //
55 55
 
56
-if (! empty($_POST)) {
57
-    $myba->processPost() ;
56
+if (!empty($_POST)) {
57
+    $myba->processPost();
58 58
 }
59 59
 
60 60
 //
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 //
63 63
 
64 64
 // header
65
-xoops_cp_header() ;
65
+xoops_cp_header();
66 66
 
67 67
 // mymenu
68
-altsys_include_mymenu() ;
68
+altsys_include_mymenu();
69 69
 
70
-$myba->processGet() ;
70
+$myba->processGet();
71 71
 
72 72
 // footer
73
-xoops_cp_footer() ;
73
+xoops_cp_footer();
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/index.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.