Completed
Push — master ( 0881bb...3a6ebc )
by Michael
04:47
created
xoops_trust_path/libs/altsys/class/MyBlocksAdminForX22.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/MyBlocksAdmin.class.php' ;
3
+require_once __DIR__.'/MyBlocksAdmin.class.php';
4 4
 
5 5
 class MyBlocksAdminForX22 extends MyBlocksAdmin
6 6
 {
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function construct()
14 14
     {
15
-        parent::construct() ;
15
+        parent::construct();
16 16
 
17
-        @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php' ;
17
+        @include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php';
18 18
     }
19 19
 
20 20
 //HACK by domifara for php5.3+
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     static $instance;
25 25
     if (!isset($instance)) {
26 26
         $instance = new MyBlocksAdminForX22();
27
-        $instance->construct() ;
27
+        $instance->construct();
28 28
     }
29 29
     return $instance;
30 30
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/oninstall.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,63 +1,63 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-eval(' function xoops_module_install_'.$mydirname.'( $module ) { return altsys_oninstall_base( $module , "'.$mydirname.'" ) ; } ') ;
3
+eval(' function xoops_module_install_'.$mydirname.'( $module ) { return altsys_oninstall_base( $module , "'.$mydirname.'" ) ; } ');
4 4
 
5 5
 
6
-if (! function_exists('altsys_oninstall_base')) {
6
+if (!function_exists('altsys_oninstall_base')) {
7 7
     function altsys_oninstall_base($module, $mydirname)
8 8
     {
9 9
         // transations on module install
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.ModuleInstall.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_oninstall') ;
17
-        $ret = array() ;
15
+        $root = & XCube_Root::getSingleton();
16
+        $root->mDelegateManager->add('Legacy.Admin.Event.ModuleInstall.'.ucfirst($mydirname).'.Success', 'altsys_message_append_oninstall');
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
     /*************** BEGIN ALTSYS SPECIFIC PART ******************/
28 28
     // set weight=0
29
-    $db->queryF('UPDATE ' . $db->prefix('modules') . " SET weight=0 WHERE mid=$mid") ;
29
+    $db->queryF('UPDATE '.$db->prefix('modules')." SET weight=0 WHERE mid=$mid");
30 30
     /*************** END ALTSYS SPECIFIC PART ******************/
31 31
 
32 32
     // TABLES (loading mysql.sql)
33
-    $sql_file_path = __DIR__.'/sql/mysql.sql' ;
34
-        $prefix_mod = $db->prefix() . '_' . $mydirname ;
33
+    $sql_file_path = __DIR__.'/sql/mysql.sql';
34
+        $prefix_mod = $db->prefix().'_'.$mydirname;
35 35
         if (file_exists($sql_file_path)) {
36
-            $ret[] = 'SQL file found at <b>' . htmlspecialchars($sql_file_path) . '</b>.<br /> Creating tables...';
36
+            $ret[] = 'SQL file found at <b>'.htmlspecialchars($sql_file_path).'</b>.<br /> Creating tables...';
37 37
 
38 38
             if (file_exists(XOOPS_ROOT_PATH.'/class/database/oldsqlutility.php')) {
39
-                include_once XOOPS_ROOT_PATH.'/class/database/oldsqlutility.php' ;
40
-                $sqlutil = new OldSqlUtility ;
39
+                include_once XOOPS_ROOT_PATH.'/class/database/oldsqlutility.php';
40
+                $sqlutil = new OldSqlUtility;
41 41
             } else {
42
-                include_once XOOPS_ROOT_PATH.'/class/database/sqlutility.php' ;
43
-                $sqlutil = new SqlUtility ;
42
+                include_once XOOPS_ROOT_PATH.'/class/database/sqlutility.php';
43
+                $sqlutil = new SqlUtility;
44 44
             }
45 45
 
46
-            $sql_query = trim(file_get_contents($sql_file_path)) ;
47
-            $sqlutil->splitMySqlFile($pieces, $sql_query) ;
48
-            $created_tables = array() ;
46
+            $sql_query = trim(file_get_contents($sql_file_path));
47
+            $sqlutil->splitMySqlFile($pieces, $sql_query);
48
+            $created_tables = array();
49 49
             foreach ($pieces as $piece) {
50
-                $prefixed_query = $sqlutil->prefixQuery($piece, $prefix_mod) ;
51
-                if (! $prefixed_query) {
52
-                    $ret[] = 'Invalid SQL <b>' . htmlspecialchars($piece) . '</b><br />';
53
-                    return false ;
50
+                $prefixed_query = $sqlutil->prefixQuery($piece, $prefix_mod);
51
+                if (!$prefixed_query) {
52
+                    $ret[] = 'Invalid SQL <b>'.htmlspecialchars($piece).'</b><br />';
53
+                    return false;
54 54
                 }
55
-                if (! $db->query($prefixed_query[0])) {
56
-                    $ret[] = '<b>'.htmlspecialchars($db->error()).'</b><br />' ;
55
+                if (!$db->query($prefixed_query[0])) {
56
+                    $ret[] = '<b>'.htmlspecialchars($db->error()).'</b><br />';
57 57
                 //var_dump( $db->error() ) ;
58
-                return false ;
58
+                return false;
59 59
                 } else {
60
-                    if (! in_array($prefixed_query[4], $created_tables)) {
60
+                    if (!in_array($prefixed_query[4], $created_tables)) {
61 61
                         $ret[] = 'Table <b>'.htmlspecialchars($prefix_mod.'_'.$prefixed_query[4]).'</b> created.<br />';
62 62
                         $created_tables[] = $prefixed_query[4];
63 63
                     } else {
@@ -68,33 +68,33 @@  discard block
 block discarded – undo
68 68
         }
69 69
 
70 70
     // TEMPLATES
71
-    $tplfile_handler =& xoops_gethandler('tplfile') ;
72
-        $tpl_path = __DIR__.'/templates' ;
73
-        if ($handler = @opendir($tpl_path . '/')) {
71
+    $tplfile_handler = & xoops_gethandler('tplfile');
72
+        $tpl_path = __DIR__.'/templates';
73
+        if ($handler = @opendir($tpl_path.'/')) {
74 74
             while (($file = readdir($handler)) !== false) {
75 75
                 if (substr($file, 0, 1) == '.') {
76
-                    continue ;
76
+                    continue;
77 77
                 }
78
-                $file_path = $tpl_path . '/' . $file ;
78
+                $file_path = $tpl_path.'/'.$file;
79 79
                 if (is_file($file_path)) {
80 80
                     $mtime = (int)(@filemtime($file_path));
81
-                    $tplfile =& $tplfile_handler->create() ;
82
-                    $tplfile->setVar('tpl_source', file_get_contents($file_path), true) ;
83
-                    $tplfile->setVar('tpl_refid', $mid) ;
84
-                    $tplfile->setVar('tpl_tplset', 'default') ;
85
-                    $tplfile->setVar('tpl_file', $mydirname . '_' . $file) ;
86
-                    $tplfile->setVar('tpl_desc', '', true) ;
87
-                    $tplfile->setVar('tpl_module', $mydirname) ;
88
-                    $tplfile->setVar('tpl_lastmodified', $mtime) ;
89
-                    $tplfile->setVar('tpl_lastimported', 0) ;
90
-                    $tplfile->setVar('tpl_type', 'module') ;
91
-                    if (! $tplfile_handler->insert($tplfile)) {
81
+                    $tplfile = & $tplfile_handler->create();
82
+                    $tplfile->setVar('tpl_source', file_get_contents($file_path), true);
83
+                    $tplfile->setVar('tpl_refid', $mid);
84
+                    $tplfile->setVar('tpl_tplset', 'default');
85
+                    $tplfile->setVar('tpl_file', $mydirname.'_'.$file);
86
+                    $tplfile->setVar('tpl_desc', '', true);
87
+                    $tplfile->setVar('tpl_module', $mydirname);
88
+                    $tplfile->setVar('tpl_lastmodified', $mtime);
89
+                    $tplfile->setVar('tpl_lastimported', 0);
90
+                    $tplfile->setVar('tpl_type', 'module');
91
+                    if (!$tplfile_handler->insert($tplfile)) {
92 92
                         $ret[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> to the database.</span><br />';
93 93
                     } else {
94
-                        $tplid = $tplfile->getVar('tpl_id') ;
94
+                        $tplid = $tplfile->getVar('tpl_id');
95 95
                         $ret[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> added to the database. (ID: <b>'.$tplid.'</b>)<br />';
96
-                        require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php' ;
97
-                        altsys_clear_templates_c() ;
96
+                        require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php';
97
+                        altsys_clear_templates_c();
98 98
                     // generate compiled file
99 99
                     /*include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
100 100
                     include_once XOOPS_ROOT_PATH.'/class/template.php' ;
@@ -106,20 +106,20 @@  discard block
 block discarded – undo
106 106
                     }
107 107
                 }
108 108
             }
109
-            closedir($handler) ;
109
+            closedir($handler);
110 110
         }
111
-        include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php' ;
112
-        include_once XOOPS_ROOT_PATH.'/class/template.php' ;
113
-        xoops_template_clear_module_cache($mid) ;
111
+        include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
112
+        include_once XOOPS_ROOT_PATH.'/class/template.php';
113
+        xoops_template_clear_module_cache($mid);
114 114
 
115
-        return true ;
115
+        return true;
116 116
     }
117 117
 
118 118
     function altsys_message_append_oninstall(&$module_obj, &$log)
119 119
     {
120 120
         if (is_array(@$GLOBALS['ret'])) {
121 121
             foreach ($GLOBALS['ret'] as $message) {
122
-                $log->add(strip_tags($message)) ;
122
+                $log->add(strip_tags($message));
123 123
             }
124 124
         }
125 125
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mymenusub/myblocksadmin.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,61 +1,61 @@
 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
-    $module_handler4menu =& xoops_gethandler('module');
15
+    $module_handler4menu = & xoops_gethandler('module');
16 16
     $criteria4menu = new CriteriaCompo(new Criteria('isactive', 1));
17 17
     //$criteria4menu->add(new Criteria('hasmain', 1));
18 18
     $criteria4menu->add(new Criteria('mid', '1', '>'));
19
-    $modules4menu =& $module_handler4menu->getObjects($criteria4menu, true);
20
-    $system_module =& $module_handler4menu->get(1) ;
19
+    $modules4menu = & $module_handler4menu->getObjects($criteria4menu, true);
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/mymenusub/mylangadmin.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,37 +1,37 @@
 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
-$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']) ;
7
+$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']);
8 8
 
9
-$db =& XoopsDatabaseFactory::getDatabaseConnection() ;
10
-$mrs = $db->query('SELECT m.name,m.dirname,COUNT(l.mid) FROM ' . $db->prefix('modules') . ' m LEFT JOIN ' . $db->prefix('altsys_language_constants') . ' l ON m.mid=l.mid WHERE m.isactive GROUP BY m.mid ORDER BY m.weight,m.mid') ;
9
+$db = & XoopsDatabaseFactory::getDatabaseConnection();
10
+$mrs = $db->query('SELECT m.name,m.dirname,COUNT(l.mid) FROM '.$db->prefix('modules').' m LEFT JOIN '.$db->prefix('altsys_language_constants').' l ON m.mid=l.mid WHERE m.isactive GROUP BY m.mid ORDER BY m.weight,m.mid');
11 11
 
12
-$adminmenu = array() ;
12
+$adminmenu = array();
13 13
 while (list($name, $dirname, $count) = $db->fetchRow($mrs)) {
14 14
     if ($dirname == $current_dirname) {
15 15
         $adminmenu[] = array(
16
-            'selected' => true ,
17
-            'title' => $name . " ($count)" ,
16
+            'selected' => true,
17
+            'title' => $name." ($count)",
18 18
             'link' => '?mode=admin&lib=altsys&page=mylangadmin&dirname='.$dirname
19
-        ) ;
19
+        );
20 20
         //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => htmlspecialchars( $name , ENT_QUOTES ) ) ;
21 21
     } else {
22 22
         $adminmenu[] = array(
23
-            'selected' => false ,
24
-            'title' => $name . " ($count)" ,
23
+            'selected' => false,
24
+            'title' => $name." ($count)",
25 25
             'link' => '?mode=admin&lib=altsys&page=mylangadmin&dirname='.$dirname
26
-        ) ;
26
+        );
27 27
     }
28 28
 }
29 29
 
30 30
 // display
31
-require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ;
32
-$tpl = new D3Tpl() ;
31
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
32
+$tpl = new D3Tpl();
33 33
 $tpl->assign(array(
34 34
     'adminmenu' => $adminmenu,
35 35
     'mypage' => 'mylangadmin'
36
-)) ;
37
-$tpl->display('db:altsys_inc_mymenusub.html') ;
36
+));
37
+$tpl->display('db:altsys_inc_mymenusub.html');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mymenusub/mytplsadmin.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,56 +1,56 @@
 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
-$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']) ;
7
+$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']);
8 8
 
9
-$db =& XoopsDatabaseFactory::getDatabaseConnection() ;
9
+$db = & XoopsDatabaseFactory::getDatabaseConnection();
10 10
 
11 11
 // get custom templates
12
-list($count) = $db->fetchRow($db->query('SELECT COUNT(t.tpl_module) AS tpl_count FROM ' . $db->prefix('tplfile') . " t WHERE t.tpl_type='custom'")) ;
12
+list($count) = $db->fetchRow($db->query('SELECT COUNT(t.tpl_module) AS tpl_count FROM '.$db->prefix('tplfile')." t WHERE t.tpl_type='custom'"));
13 13
 if ($current_dirname == '_custom') {
14 14
     //	$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => _MYTPLSADMIN_CUSTOMTEMPLATE ) ;
15
-    $custom_selected = true ;
15
+    $custom_selected = true;
16 16
 } else {
17
-    $custom_selected = false ;
17
+    $custom_selected = false;
18 18
 }
19 19
 
20 20
 $adminmenu = array(
21 21
     array(
22
-        'selected' => $custom_selected ,
23
-        'title' => _MYTPLSADMIN_CUSTOMTEMPLATE . " ($count)" ,
22
+        'selected' => $custom_selected,
23
+        'title' => _MYTPLSADMIN_CUSTOMTEMPLATE." ($count)",
24 24
         'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom'
25 25
     )
26
-) ;
26
+);
27 27
 
28 28
 // get modules/templates
29
-$mrs = $db->query('SELECT m.name,m.dirname,COUNT(t.tpl_module) AS tpl_count FROM ' . $db->prefix('modules') . ' m LEFT JOIN ' . $db->prefix('tplfile') . ' t ON m.dirname=t.tpl_module WHERE m.isactive GROUP BY m.mid HAVING tpl_count>0 ORDER BY m.weight,m.mid') ;
29
+$mrs = $db->query('SELECT m.name,m.dirname,COUNT(t.tpl_module) AS tpl_count FROM '.$db->prefix('modules').' m LEFT JOIN '.$db->prefix('tplfile').' t ON m.dirname=t.tpl_module WHERE m.isactive GROUP BY m.mid HAVING tpl_count>0 ORDER BY m.weight,m.mid');
30 30
 
31 31
 // module loop
32 32
 while (list($name, $dirname, $count) = $db->fetchRow($mrs)) {
33 33
     if ($dirname == $current_dirname) {
34 34
         $adminmenu[] = array(
35
-            'selected' => true ,
36
-            'title' => $name . " ($count)" ,
35
+            'selected' => true,
36
+            'title' => $name." ($count)",
37 37
             'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$dirname
38
-        ) ;
38
+        );
39 39
         //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => htmlspecialchars( $name , ENT_QUOTES ) ) ;
40 40
     } else {
41 41
         $adminmenu[] = array(
42
-            'selected' => false ,
43
-            'title' => $name . " ($count)" ,
42
+            'selected' => false,
43
+            'title' => $name." ($count)",
44 44
             'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$dirname
45
-        ) ;
45
+        );
46 46
     }
47 47
 }
48 48
 
49 49
 // display
50
-require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php' ;
51
-$tpl = new D3Tpl() ;
50
+require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php';
51
+$tpl = new D3Tpl();
52 52
 $tpl->assign(array(
53 53
     'adminmenu' => $adminmenu,
54 54
     'mypage' => 'mytplsadmin'
55
-)) ;
56
-$tpl->display('db:altsys_inc_mymenusub.html') ;
55
+));
56
+$tpl->display('db:altsys_inc_mymenusub.html');
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/put_templates.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -5,25 +5,25 @@  discard block
 block discarded – undo
5 5
 //                        GIJOE <http://www.peak.ne.jp/>                     //
6 6
 // ------------------------------------------------------------------------- //
7 7
 
8
-include_once __DIR__.'/include/gtickets.php' ;
9
-include_once __DIR__.'/include/altsys_functions.php' ;
10
-include_once __DIR__.'/include/tpls_functions.php' ;
8
+include_once __DIR__.'/include/gtickets.php';
9
+include_once __DIR__.'/include/altsys_functions.php';
10
+include_once __DIR__.'/include/tpls_functions.php';
11 11
 
12 12
 
13 13
 // this page can be called only from altsys
14 14
 if ($xoopsModule->getVar('dirname') != 'altsys') {
15
-    die('this page can be called only from altsys') ;
15
+    die('this page can be called only from altsys');
16 16
 }
17 17
 
18 18
 
19 19
 // language file
20
-altsys_include_language_file('compilehookadmin') ;
20
+altsys_include_language_file('compilehookadmin');
21 21
 
22 22
 
23
-$db =& XoopsDatabaseFactory::getDatabaseConnection() ;
23
+$db = & XoopsDatabaseFactory::getDatabaseConnection();
24 24
 
25
-if (empty($_FILES['tplset_archive']['tmp_name']) || ! is_uploaded_file($_FILES['tplset_archive']['tmp_name'])) {
26
-    die(_TPLSADMIN_ERR_NOTUPLOADED) ;
25
+if (empty($_FILES['tplset_archive']['tmp_name']) || !is_uploaded_file($_FILES['tplset_archive']['tmp_name'])) {
26
+    die(_TPLSADMIN_ERR_NOTUPLOADED);
27 27
 }
28 28
 //fix for mb_http_output setting and for add any browsers
29 29
     if (function_exists('mb_http_output')) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 //ob_buffer over flow
33 33
 //HACK by suin & nao-pon 2012/01/06
34 34
     while (ob_get_level() > 0) {
35
-        if (! ob_end_clean()) {
35
+        if (!ob_end_clean()) {
36 36
             break;
37 37
         }
38 38
     }
@@ -41,62 +41,62 @@  discard block
 block discarded – undo
41 41
 // EXTRACT STAGE
42 42
 //
43 43
 
44
-$orig_filename4check = strtolower($_FILES['tplset_archive']['name']) ;
44
+$orig_filename4check = strtolower($_FILES['tplset_archive']['name']);
45 45
 if (strtolower(substr($orig_filename4check, -4)) == '.zip') {
46 46
 
47 47
     // zip
48
-    require_once __DIR__.'/include/Archive_Zip.php' ;
49
-    $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']) ;
50
-    $files = $reader->extract(array( 'extract_as_string' => true )) ;
51
-    if (! is_array(@$files)) {
52
-        die($reader->errorName()) ;
48
+    require_once __DIR__.'/include/Archive_Zip.php';
49
+    $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']);
50
+    $files = $reader->extract(array('extract_as_string' => true));
51
+    if (!is_array(@$files)) {
52
+        die($reader->errorName());
53 53
     }
54
-    $do_upload = true ;
54
+    $do_upload = true;
55 55
 } elseif (substr($orig_filename4check, -4) == '.tgz' || substr($orig_filename4check, -7) == '.tar.gz') {
56 56
 
57 57
     // tar.gz
58
-    require_once XOOPS_ROOT_PATH.'/class/class.tar.php' ;
59
-    $tar = new tar() ;
60
-    $tar->openTAR($_FILES['tplset_archive']['tmp_name']) ;
61
-    $files = array() ;
58
+    require_once XOOPS_ROOT_PATH.'/class/class.tar.php';
59
+    $tar = new tar();
60
+    $tar->openTAR($_FILES['tplset_archive']['tmp_name']);
61
+    $files = array();
62 62
     foreach ($tar->files as $id => $info) {
63 63
         $files[] = array(
64
-            'filename' => $info['name'] ,
65
-            'mtime' => $info['time'] ,
64
+            'filename' => $info['name'],
65
+            'mtime' => $info['time'],
66 66
             'content' => $info['file']
67
-        ) ;
67
+        );
68 68
     }
69 69
     if (empty($files)) {
70
-        die(_TPLSADMIN_ERR_INVALIDARCHIVE) ;
70
+        die(_TPLSADMIN_ERR_INVALIDARCHIVE);
71 71
     }
72
-    $do_upload = true ;
72
+    $do_upload = true;
73 73
 }
74 74
 
75 75
 if (empty($do_upload)) {
76
-    die(_TPLSADMIN_ERR_EXTENSION) ;
76
+    die(_TPLSADMIN_ERR_EXTENSION);
77 77
 }
78 78
 
79 79
 //
80 80
 // IMPORT STAGE
81 81
 //
82 82
 
83
-$tplset = @$_POST['tplset'] ;
84
-if (! preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) {
85
-    die(_TPLSADMIN_ERR_INVALIDTPLSET) ;
83
+$tplset = @$_POST['tplset'];
84
+if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) {
85
+    die(_TPLSADMIN_ERR_INVALIDTPLSET);
86 86
 }
87 87
 
88
-$imported = 0 ;
88
+$imported = 0;
89 89
 foreach ($files as $file) {
90
-    if (! empty($file['folder'])) {
91
-        continue ;
90
+    if (!empty($file['folder'])) {
91
+        continue;
92 92
     }
93
-    $pos = strrpos($file['filename'], '/') ;
94
-    $tpl_file = $pos === false ? $file['filename'] : substr($file['filename'], $pos + 1) ;
93
+    $pos = strrpos($file['filename'], '/');
94
+    $tpl_file = $pos === false ? $file['filename'] : substr($file['filename'], $pos + 1);
95 95
 
96 96
     if (tplsadmin_import_data($tplset, $tpl_file, rtrim($file['content']), $file['mtime'])) {
97
-        $imported ++ ;
97
+        $imported++;
98 98
     }
99 99
 }
100 100
 
101
-redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, sprintf(_TPLSADMIN_FMT_MSG_PUTTEMPLATES, $imported)) ;
102
-exit ;
101
+redirect_header('?mode=admin&lib=altsys&page=compilehookadmin', 3, sprintf(_TPLSADMIN_FMT_MSG_PUTTEMPLATES, $imported));
102
+exit;
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/onuninstall.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,35 +1,35 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/mypreferences.php 2 patches
Switch Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -76,83 +76,83 @@
 block discarded – undo
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 77
         $title = '' ; // GIJ
78 78
         switch ($config[$i]->getVar('conf_formtype')) {
79
-        case 'textarea':
80
-            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
81
-            if ($config[$i]->getVar('conf_valuetype') == 'array') {
82
-                // this is exceptional.. only when value type is arrayneed a smarter way for this
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);
84
-            } else {
85
-                $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
86
-            }
87
-            break;
88
-        case 'select':
89
-        case 'radio':
90
-            if ($config[$i]->getVar('conf_formtype') === 'select') {
91
-                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
92
-                $addBr = '';
93
-            } else {
94
-                $ele = new XoopsFormRadio($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
95
-                $addBr = '<br />';
96
-            }
97
-            $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
98
-            $opcount = count($options);
99
-            for ($j = 0; $j < $opcount; $j++) {
100
-                $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
101
-                $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
102
-                $ele->addOption($optval, $optkey.$addBr);
103
-            }
104
-            break;
105
-        case 'select_multi':
106
-        case 'checkbox':
107
-            if ($config[$i]->getVar('conf_formtype') === 'select_multi') {
108
-                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
109
-                $addBr = '';
110
-            } else {
111
-                $ele = new XoopsFormCheckBox($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
112
-                $addBr = '<br />';
113
-            }
114
-            $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
115
-            $opcount = count($options);
116
-            for ($j = 0; $j < $opcount; $j++) {
117
-                $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
118
-                $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
79
+            case 'textarea':
80
+                (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
81
+                if ($config[$i]->getVar('conf_valuetype') == 'array') {
82
+                    // this is exceptional.. only when value type is arrayneed a smarter way for this
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);
84
+                } else {
85
+                    $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
86
+                }
87
+                break;
88
+            case 'select':
89
+            case 'radio':
90
+                if ($config[$i]->getVar('conf_formtype') === 'select') {
91
+                    $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
92
+                    $addBr = '';
93
+                } else {
94
+                    $ele = new XoopsFormRadio($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
95
+                    $addBr = '<br />';
96
+                }
97
+                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
98
+                $opcount = count($options);
99
+                for ($j = 0; $j < $opcount; $j++) {
100
+                    $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
101
+                    $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
102
+                    $ele->addOption($optval, $optkey.$addBr);
103
+                }
104
+                break;
105
+            case 'select_multi':
106
+            case 'checkbox':
107
+                if ($config[$i]->getVar('conf_formtype') === 'select_multi') {
108
+                    $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
109
+                    $addBr = '';
110
+                } else {
111
+                    $ele = new XoopsFormCheckBox($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
112
+                    $addBr = '<br />';
113
+                }
114
+                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
115
+                $opcount = count($options);
116
+                for ($j = 0; $j < $opcount; $j++) {
117
+                    $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
118
+                    $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
119 119
                 
120
-                $ele->addOption($optval, $optkey.$addBr);
121
-            }
122
-            break;
123
-        case 'yesno':
124
-            $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
125
-            break;
126
-        case 'group':
127
-            include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
128
-            $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
129
-            break;
130
-        case 'group_multi':
131
-            include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
132
-            $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
133
-            break;
134
-        case 'group_checkbox':
135
-            include_once __DIR__.'/include/formcheckboxgroup.php';
136
-            $ele = new AltsysFormCheckboxGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput());
137
-            break;
138
-        // RMV-NOTIFY: added 'user' and 'user_multi'
139
-        case 'user':
140
-            include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
141
-            $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
142
-            break;
143
-        case 'user_multi':
144
-            include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
145
-            $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
146
-            break;
147
-        case 'password':
148
-            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
149
-            $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
150
-            break;
151
-        case 'textbox':
152
-        default:
153
-            (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
154
-            $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
155
-            break;
120
+                    $ele->addOption($optval, $optkey.$addBr);
121
+                }
122
+                break;
123
+            case 'yesno':
124
+                $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
125
+                break;
126
+            case 'group':
127
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
128
+                $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
129
+                break;
130
+            case 'group_multi':
131
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
132
+                $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
133
+                break;
134
+            case 'group_checkbox':
135
+                include_once __DIR__.'/include/formcheckboxgroup.php';
136
+                $ele = new AltsysFormCheckboxGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput());
137
+                break;
138
+            // RMV-NOTIFY: added 'user' and 'user_multi'
139
+            case 'user':
140
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
141
+                $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
142
+                break;
143
+            case 'user_multi':
144
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
145
+                $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
146
+                break;
147
+            case 'password':
148
+                (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
149
+                $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
150
+                break;
151
+            case 'textbox':
152
+            default:
153
+                (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
154
+                $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
155
+                break;
156 156
         }
157 157
         $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
158 158
         $ele_tray = new XoopsFormElementTray($title4tray, '') ;
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -5,64 +5,64 @@  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
-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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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&amp;lib=altsys&amp;page=mypreferences', _PREFERENCES) ;
176
+        $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mypreferences', _PREFERENCES);
177 177
     }
178
-    echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getvar('name').' &nbsp; '._PREFERENCES."</h3>\n" ;
178
+    echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>".$module->getvar('name').' &nbsp; '._PREFERENCES."</h3>\n";
179 179
     // GIJ patch end
180 180
 
181 181
     $form->display();
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
xoops_trust_path/libs/altsys/admin_menu.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,35 +1,35 @@  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
 $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
 block discarded – undo
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
+);
Please login to merge, or discard this patch.