Passed
Pull Request — master (#2)
by Michael
07:10 queued 03:28
created
admin/blocksadmin.php 2 patches
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -33,112 +33,112 @@
 block discarded – undo
33 33
 $xoopsModule = XoopsModule::getByDirname($moduleDirName);
34 34
 
35 35
 if (!is_object($GLOBALS['xoopsUser']) || !is_object($xoopsModule)
36
-    || !$GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) {
37
-    exit(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403'));
36
+	|| !$GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) {
37
+	exit(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403'));
38 38
 }
39 39
 if ($GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) {
40
-    require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
41
-
42
-    $op = Request::getCmd('op', 'list');
43
-    if (!empty($_POST)) {
44
-        $ok             = Request::getInt('ok', 0, 'POST');
45
-        $confirm_submit = Request::getCmd('confirm_submit', '', 'POST');
46
-        $submit         = Request::getString('submit', '', 'POST');
47
-        $bside          = Request::getString('bside', '0', 'POST');
48
-        $bweight        = Request::getString('bweight', '0', 'POST');
49
-        $bvisible       = Request::getString('bvisible', '0', 'POST');
50
-        $bmodule        = Request::getArray('bmodule', [], 'POST');
51
-        $btitle         = Request::getString('btitle', '', 'POST');
52
-        $bcachetime     = Request::getString('bcachetime', '0', 'POST');
53
-        $groups         = Request::getArray('groups', [], 'POST');
54
-        $options        = Request::getArray('options', [], 'POST');
55
-        $submitblock    = Request::getString('submitblock', '', 'POST');
56
-        $fct            = Request::getString('fct', '', 'POST');
57
-        $title          = Request::getString('title', '', 'POST');
58
-        $side           = Request::getString('side', '0', 'POST');
59
-        $weight         = Request::getString('weight', '0', 'POST');
60
-        $visible        = Request::getString('visible', '0', 'POST');
61
-    }
62
-
63
-    if ('list' === $op) {
64
-        //        xoops_cp_header();
65
-        $blocksadmin->listBlocks();
66
-        require_once __DIR__ . '/admin_footer.php';
67
-        exit();
68
-    }
69
-
70
-    if (\in_array($op, ['edit', 'edit_ok', 'delete', 'delete_ok', 'clone', 'clone_ok'], true)) {
71
-        $bid = Request::getInt('bid', 0);
72
-        $ok  = Request::getInt('ok', 0);
73
-
74
-        if ('clone' === $op) {
75
-            $blocksadmin->cloneBlock($bid);
76
-        }
77
-
78
-        if ('delete' === $op) {
79
-            if (1 === $ok) {
80
-                //            if (!$GLOBALS['xoopsSecurity']->check()) {
81
-                //                redirect_header($helper->url('admin/blocksadmin.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
82
-                //            }
83
-                $blocksadmin->deleteBlock($bid);
84
-            } else {
85
-                //            xoops_cp_header();
86
-                xoops_confirm(['ok' => 1, 'op' => 'delete', 'bid' => $bid], 'blocksadmin.php', constant('CO_' . $moduleDirNameUpper . '_' . 'DELETE_BLOCK_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
87
-                xoops_cp_footer();
88
-            }
89
-        }
90
-
91
-        if ('edit' === $op) {
92
-            $blocksadmin->editBlock($bid);
93
-        }
94
-
95
-        if ('edit_ok' === $op) {
96
-            $blocksadmin->updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups);
97
-        }
98
-
99
-        if ('clone_ok' === $op) {
100
-            $blocksadmin->isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups);
101
-        }
102
-    }
103
-
104
-    if ('order' === $op) {
105
-        $bid = Request::getArray('bid', []);
106
-
107
-        $title      = Request::getArray('title', [], 'POST');
108
-        $side       = Request::getArray('side', [], 'POST');
109
-        $weight     = Request::getArray('weight', [], 'POST');
110
-        $visible    = Request::getArray('visible', [], 'POST');
111
-        $bcachetime = Request::getArray('bcachetime', [], 'POST');
112
-        $bmodule    = Request::getArray('bmodule', [], 'POST'); //mb
113
-
114
-        $oldtitle      = Request::getArray('oldtitle', [], 'POST');
115
-        $oldside       = Request::getArray('oldside', [], 'POST');
116
-        $oldweight     = Request::getArray('oldweight', [], 'POST');
117
-        $oldvisible    = Request::getArray('oldvisible', [], 'POST');
118
-        $oldgroups     = Request::getArray('oldgroups', [], 'POST');
119
-        $oldbcachetime = Request::getArray('oldcachetime', [], 'POST');
120
-        $oldbmodule    = Request::getArray('oldbmodule', [], 'POST'); //mb
121
-
122
-        $blocksadmin->orderBlock(
123
-            $bid,
124
-            $oldtitle,
125
-            $oldside,
126
-            $oldweight,
127
-            $oldvisible,
128
-            $oldgroups,
129
-            $oldbcachetime,
130
-            $oldbmodule,
131
-            $title,
132
-            $weight,
133
-            $visible,
134
-            $side,
135
-            $bcachetime,
136
-            $groups,
137
-            $bmodule
138
-        );
139
-    }
40
+	require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
41
+
42
+	$op = Request::getCmd('op', 'list');
43
+	if (!empty($_POST)) {
44
+		$ok             = Request::getInt('ok', 0, 'POST');
45
+		$confirm_submit = Request::getCmd('confirm_submit', '', 'POST');
46
+		$submit         = Request::getString('submit', '', 'POST');
47
+		$bside          = Request::getString('bside', '0', 'POST');
48
+		$bweight        = Request::getString('bweight', '0', 'POST');
49
+		$bvisible       = Request::getString('bvisible', '0', 'POST');
50
+		$bmodule        = Request::getArray('bmodule', [], 'POST');
51
+		$btitle         = Request::getString('btitle', '', 'POST');
52
+		$bcachetime     = Request::getString('bcachetime', '0', 'POST');
53
+		$groups         = Request::getArray('groups', [], 'POST');
54
+		$options        = Request::getArray('options', [], 'POST');
55
+		$submitblock    = Request::getString('submitblock', '', 'POST');
56
+		$fct            = Request::getString('fct', '', 'POST');
57
+		$title          = Request::getString('title', '', 'POST');
58
+		$side           = Request::getString('side', '0', 'POST');
59
+		$weight         = Request::getString('weight', '0', 'POST');
60
+		$visible        = Request::getString('visible', '0', 'POST');
61
+	}
62
+
63
+	if ('list' === $op) {
64
+		//        xoops_cp_header();
65
+		$blocksadmin->listBlocks();
66
+		require_once __DIR__ . '/admin_footer.php';
67
+		exit();
68
+	}
69
+
70
+	if (\in_array($op, ['edit', 'edit_ok', 'delete', 'delete_ok', 'clone', 'clone_ok'], true)) {
71
+		$bid = Request::getInt('bid', 0);
72
+		$ok  = Request::getInt('ok', 0);
73
+
74
+		if ('clone' === $op) {
75
+			$blocksadmin->cloneBlock($bid);
76
+		}
77
+
78
+		if ('delete' === $op) {
79
+			if (1 === $ok) {
80
+				//            if (!$GLOBALS['xoopsSecurity']->check()) {
81
+				//                redirect_header($helper->url('admin/blocksadmin.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
82
+				//            }
83
+				$blocksadmin->deleteBlock($bid);
84
+			} else {
85
+				//            xoops_cp_header();
86
+				xoops_confirm(['ok' => 1, 'op' => 'delete', 'bid' => $bid], 'blocksadmin.php', constant('CO_' . $moduleDirNameUpper . '_' . 'DELETE_BLOCK_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
87
+				xoops_cp_footer();
88
+			}
89
+		}
90
+
91
+		if ('edit' === $op) {
92
+			$blocksadmin->editBlock($bid);
93
+		}
94
+
95
+		if ('edit_ok' === $op) {
96
+			$blocksadmin->updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups);
97
+		}
98
+
99
+		if ('clone_ok' === $op) {
100
+			$blocksadmin->isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups);
101
+		}
102
+	}
103
+
104
+	if ('order' === $op) {
105
+		$bid = Request::getArray('bid', []);
106
+
107
+		$title      = Request::getArray('title', [], 'POST');
108
+		$side       = Request::getArray('side', [], 'POST');
109
+		$weight     = Request::getArray('weight', [], 'POST');
110
+		$visible    = Request::getArray('visible', [], 'POST');
111
+		$bcachetime = Request::getArray('bcachetime', [], 'POST');
112
+		$bmodule    = Request::getArray('bmodule', [], 'POST'); //mb
113
+
114
+		$oldtitle      = Request::getArray('oldtitle', [], 'POST');
115
+		$oldside       = Request::getArray('oldside', [], 'POST');
116
+		$oldweight     = Request::getArray('oldweight', [], 'POST');
117
+		$oldvisible    = Request::getArray('oldvisible', [], 'POST');
118
+		$oldgroups     = Request::getArray('oldgroups', [], 'POST');
119
+		$oldbcachetime = Request::getArray('oldcachetime', [], 'POST');
120
+		$oldbmodule    = Request::getArray('oldbmodule', [], 'POST'); //mb
121
+
122
+		$blocksadmin->orderBlock(
123
+			$bid,
124
+			$oldtitle,
125
+			$oldside,
126
+			$oldweight,
127
+			$oldvisible,
128
+			$oldgroups,
129
+			$oldbcachetime,
130
+			$oldbmodule,
131
+			$title,
132
+			$weight,
133
+			$visible,
134
+			$side,
135
+			$bcachetime,
136
+			$groups,
137
+			$bmodule
138
+		);
139
+	}
140 140
 } else {
141
-    echo constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403');
141
+	echo constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403');
142 142
 }
143 143
 
144 144
 require __DIR__ . '/admin_footer.php';
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 /** @var Admin $adminObject */
22 22
 /** @var Helper $helper */
23
-require __DIR__ . '/admin_header.php';
23
+require __DIR__.'/admin_header.php';
24 24
 xoops_cp_header();
25 25
 
26 26
 $moduleDirName      = $helper->getDirname();
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 
35 35
 if (!is_object($GLOBALS['xoopsUser']) || !is_object($xoopsModule)
36 36
     || !$GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) {
37
-    exit(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403'));
37
+    exit(constant('CO_'.$moduleDirNameUpper.'_'.'ERROR403'));
38 38
 }
39 39
 if ($GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) {
40
-    require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
40
+    require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
41 41
 
42 42
     $op = Request::getCmd('op', 'list');
43 43
     if (!empty($_POST)) {
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
         $visible        = Request::getString('visible', '0', 'POST');
61 61
     }
62 62
 
63
-    if ('list' === $op) {
63
+    if ('list'===$op) {
64 64
         //        xoops_cp_header();
65 65
         $blocksadmin->listBlocks();
66
-        require_once __DIR__ . '/admin_footer.php';
66
+        require_once __DIR__.'/admin_footer.php';
67 67
         exit();
68 68
     }
69 69
 
@@ -71,37 +71,37 @@  discard block
 block discarded – undo
71 71
         $bid = Request::getInt('bid', 0);
72 72
         $ok  = Request::getInt('ok', 0);
73 73
 
74
-        if ('clone' === $op) {
74
+        if ('clone'===$op) {
75 75
             $blocksadmin->cloneBlock($bid);
76 76
         }
77 77
 
78
-        if ('delete' === $op) {
79
-            if (1 === $ok) {
78
+        if ('delete'===$op) {
79
+            if (1===$ok) {
80 80
                 //            if (!$GLOBALS['xoopsSecurity']->check()) {
81 81
                 //                redirect_header($helper->url('admin/blocksadmin.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
82 82
                 //            }
83 83
                 $blocksadmin->deleteBlock($bid);
84 84
             } else {
85 85
                 //            xoops_cp_header();
86
-                xoops_confirm(['ok' => 1, 'op' => 'delete', 'bid' => $bid], 'blocksadmin.php', constant('CO_' . $moduleDirNameUpper . '_' . 'DELETE_BLOCK_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
86
+                xoops_confirm(['ok' => 1, 'op' => 'delete', 'bid' => $bid], 'blocksadmin.php', constant('CO_'.$moduleDirNameUpper.'_'.'DELETE_BLOCK_CONFIRM'), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true);
87 87
                 xoops_cp_footer();
88 88
             }
89 89
         }
90 90
 
91
-        if ('edit' === $op) {
91
+        if ('edit'===$op) {
92 92
             $blocksadmin->editBlock($bid);
93 93
         }
94 94
 
95
-        if ('edit_ok' === $op) {
95
+        if ('edit_ok'===$op) {
96 96
             $blocksadmin->updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups);
97 97
         }
98 98
 
99
-        if ('clone_ok' === $op) {
99
+        if ('clone_ok'===$op) {
100 100
             $blocksadmin->isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups);
101 101
         }
102 102
     }
103 103
 
104
-    if ('order' === $op) {
104
+    if ('order'===$op) {
105 105
         $bid = Request::getArray('bid', []);
106 106
 
107 107
         $title      = Request::getArray('title', [], 'POST');
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         );
139 139
     }
140 140
 } else {
141
-    echo constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR403');
141
+    echo constant('CO_'.$moduleDirNameUpper.'_'.'ERROR403');
142 142
 }
143 143
 
144
-require __DIR__ . '/admin_footer.php';
144
+require __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/field_permissions.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -38,28 +38,28 @@  discard block
 block discarded – undo
38 38
 
39 39
 $perm_desc = '';
40 40
 switch ($op) {
41
-    case 'visibility':
42
-        //header("Location: visibility.php");
43
-        redirect_header('field_visibility.php', 0, _AM_SONGLIST_PROF_VISIBLE);
44
-        break;
45
-    case 'edit':
46
-        $title_of_form = _AM_SONGLIST_PROF_EDITABLE;
47
-        $perm_name     = 'songlist_edit';
48
-        $restriction   = 'field_edit';
49
-        $anonymous     = false;
50
-        break;
51
-    case 'post':
52
-        $title_of_form = _AM_SONGLIST_PROF_POST;
53
-        $perm_name     = 'songlist_post';
54
-        $restriction   = '';
55
-        $anonymous     = true;
56
-        break;
57
-    case 'search':
58
-        $title_of_form = _AM_SONGLIST_PROF_SEARCH;
59
-        $perm_name     = 'songlist_search';
60
-        $restriction   = '';
61
-        $anonymous     = true;
62
-        break;
41
+	case 'visibility':
42
+		//header("Location: visibility.php");
43
+		redirect_header('field_visibility.php', 0, _AM_SONGLIST_PROF_VISIBLE);
44
+		break;
45
+	case 'edit':
46
+		$title_of_form = _AM_SONGLIST_PROF_EDITABLE;
47
+		$perm_name     = 'songlist_edit';
48
+		$restriction   = 'field_edit';
49
+		$anonymous     = false;
50
+		break;
51
+	case 'post':
52
+		$title_of_form = _AM_SONGLIST_PROF_POST;
53
+		$perm_name     = 'songlist_post';
54
+		$restriction   = '';
55
+		$anonymous     = true;
56
+		break;
57
+	case 'search':
58
+		$title_of_form = _AM_SONGLIST_PROF_SEARCH;
59
+		$perm_name     = 'songlist_search';
60
+		$restriction   = '';
61
+		$anonymous     = true;
62
+		break;
63 63
 }
64 64
 
65 65
 $module_id = $GLOBALS['songlistModule']->getVar('mid');
@@ -67,43 +67,43 @@  discard block
 block discarded – undo
67 67
 $form = new \XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/field_permissions.php', $anonymous);
68 68
 
69 69
 if ('access' === $op) {
70
-    /** @var \XoopsMemberHandler $memberHandler */
71
-    $memberHandler = xoops_getHandler('member');
72
-    $glist         = $memberHandler->getGroupList();
73
-    foreach (array_keys($glist) as $i) {
74
-        if (XOOPS_GROUP_ANONYMOUS != $i) {
75
-            $form->addItem($i, $glist[$i]);
76
-        }
77
-    }
70
+	/** @var \XoopsMemberHandler $memberHandler */
71
+	$memberHandler = xoops_getHandler('member');
72
+	$glist         = $memberHandler->getGroupList();
73
+	foreach (array_keys($glist) as $i) {
74
+		if (XOOPS_GROUP_ANONYMOUS != $i) {
75
+			$form->addItem($i, $glist[$i]);
76
+		}
77
+	}
78 78
 } else {
79
-    $extrasHandler = Helper::getInstance()->getHandler('Extras');
80
-    $tempFields    = $extrasHandler->loadFields();
81
-    if ($tempFields && is_array($tempFields)) {
82
-        $fields = array_merge([], $tempFields);
83
-        if ('search' !== $op) {
84
-            foreach (array_keys($fields) as $i) {
85
-                if ('' == $restriction || $fields[$i]->getVar($restriction)) {
86
-                    $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
87
-                }
88
-            }
89
-        } else {
90
-            $searchable_types = [
91
-                'textbox',
92
-                'select',
93
-                'radio',
94
-                'yesno',
95
-                'date',
96
-                'datetime',
97
-                'timezone',
98
-                'language',
99
-            ];
100
-            foreach (array_keys($fields) as $i) {
101
-                if (in_array($fields[$i]->getVar('field_type'), $searchable_types, true)) {
102
-                    $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
103
-                }
104
-            }
105
-        }
106
-    }
79
+	$extrasHandler = Helper::getInstance()->getHandler('Extras');
80
+	$tempFields    = $extrasHandler->loadFields();
81
+	if ($tempFields && is_array($tempFields)) {
82
+		$fields = array_merge([], $tempFields);
83
+		if ('search' !== $op) {
84
+			foreach (array_keys($fields) as $i) {
85
+				if ('' == $restriction || $fields[$i]->getVar($restriction)) {
86
+					$form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
87
+				}
88
+			}
89
+		} else {
90
+			$searchable_types = [
91
+				'textbox',
92
+				'select',
93
+				'radio',
94
+				'yesno',
95
+				'date',
96
+				'datetime',
97
+				'timezone',
98
+				'language',
99
+			];
100
+			foreach (array_keys($fields) as $i) {
101
+				if (in_array($fields[$i]->getVar('field_type'), $searchable_types, true)) {
102
+					$form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
103
+				}
104
+			}
105
+		}
106
+	}
107 107
 }
108 108
 $form->display();
109 109
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use Xmf\Module\Admin;
18 18
 use XoopsModules\Songlist\Helper;
19 19
 
20
-require_once __DIR__ . '/header.php';
20
+require_once __DIR__.'/header.php';
21 21
 xoops_cp_header();
22 22
 
23 23
 $adminObject = Admin::getInstance();
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 require_once $GLOBALS['xoops']->path('/class/xoopsform/grouppermform.php');
67 67
 $form = new \XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/field_permissions.php', $anonymous);
68 68
 
69
-if ('access' === $op) {
69
+if ('access'===$op) {
70 70
     /** @var \XoopsMemberHandler $memberHandler */
71 71
     $memberHandler = xoops_getHandler('member');
72 72
     $glist         = $memberHandler->getGroupList();
73 73
     foreach (array_keys($glist) as $i) {
74
-        if (XOOPS_GROUP_ANONYMOUS != $i) {
74
+        if (XOOPS_GROUP_ANONYMOUS!=$i) {
75 75
             $form->addItem($i, $glist[$i]);
76 76
         }
77 77
     }
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     $tempFields    = $extrasHandler->loadFields();
81 81
     if ($tempFields && is_array($tempFields)) {
82 82
         $fields = array_merge([], $tempFields);
83
-        if ('search' !== $op) {
83
+        if ('search'!==$op) {
84 84
             foreach (array_keys($fields) as $i) {
85
-                if ('' == $restriction || $fields[$i]->getVar($restriction)) {
85
+                if (''==$restriction || $fields[$i]->getVar($restriction)) {
86 86
                     $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
87 87
                 }
88 88
             }
Please login to merge, or discard this patch.
admin/clone.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 
21 21
 use Xmf\Request;
22 22
 use XoopsModules\Songlist\{
23
-    Common\Cloner,
24
-    Helper,
25
-    Utility
23
+	Common\Cloner,
24
+	Helper,
25
+	Utility
26 26
 };
27 27
 
28 28
 require_once __DIR__ . '/admin_header.php';
@@ -32,53 +32,53 @@  discard block
 block discarded – undo
32 32
 $helper = Helper::getInstance();
33 33
 
34 34
 if ('submit' === Request::getString('op', '', 'POST')) {
35
-    if (!$GLOBALS['xoopsSecurity']->check()) {
36
-        redirect_header('clone.php', 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
37
-    }
35
+	if (!$GLOBALS['xoopsSecurity']->check()) {
36
+		redirect_header('clone.php', 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
37
+	}
38 38
 
39
-    //    $clone = $_POST['clone'];
40
-    $clone = Request::getString('clone', '', 'POST');
39
+	//    $clone = $_POST['clone'];
40
+	$clone = Request::getString('clone', '', 'POST');
41 41
 
42
-    //check if name is valid
43
-    if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) {
44
-        redirect_header('clone.php', 3, sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_INVALIDNAME'), $clone));
45
-    }
42
+	//check if name is valid
43
+	if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) {
44
+		redirect_header('clone.php', 3, sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_INVALIDNAME'), $clone));
45
+	}
46 46
 
47
-    // Check wether the cloned module exists or not
48
-    if ($clone && is_dir($GLOBALS['xoops']->path('modules/' . $clone))) {
49
-        redirect_header('clone.php', 3, sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_EXISTS'), $clone));
50
-    }
47
+	// Check wether the cloned module exists or not
48
+	if ($clone && is_dir($GLOBALS['xoops']->path('modules/' . $clone))) {
49
+		redirect_header('clone.php', 3, sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_EXISTS'), $clone));
50
+	}
51 51
 
52
-    $patterns = [
53
-        \mb_strtolower($helper->dirname())          => \mb_strtolower($clone),
54
-        \mb_strtoupper($helper->dirname())          => \mb_strtoupper($clone),
55
-        ucfirst(mb_strtolower($helper->dirname())) => ucfirst(mb_strtolower($clone)),
56
-    ];
52
+	$patterns = [
53
+		\mb_strtolower($helper->dirname())          => \mb_strtolower($clone),
54
+		\mb_strtoupper($helper->dirname())          => \mb_strtoupper($clone),
55
+		ucfirst(mb_strtolower($helper->dirname())) => ucfirst(mb_strtolower($clone)),
56
+	];
57 57
 
58
-    $patKeys   = array_keys($patterns);
59
-    $patValues = array_values($patterns);
60
-    Cloner::cloneFileFolder($helper->path());
61
-    $logocreated = Cloner::createLogo(mb_strtolower($clone));
58
+	$patKeys   = array_keys($patterns);
59
+	$patValues = array_values($patterns);
60
+	Cloner::cloneFileFolder($helper->path());
61
+	$logocreated = Cloner::createLogo(mb_strtolower($clone));
62 62
 
63
-    $msg = '';
64
-    if (is_dir($GLOBALS['xoops']->path('modules/' . \mb_strtolower($clone)))) {
65
-        $msg .= sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_CONGRAT'), "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin'>" . ucfirst(mb_strtolower($clone)) . '</a>') . "<br>\n";
66
-        if (!$logocreated) {
67
-            $msg .= constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_IMAGEFAIL');
68
-        }
69
-    } else {
70
-        $msg .= constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_FAIL');
71
-    }
72
-    echo $msg;
63
+	$msg = '';
64
+	if (is_dir($GLOBALS['xoops']->path('modules/' . \mb_strtolower($clone)))) {
65
+		$msg .= sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_CONGRAT'), "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin'>" . ucfirst(mb_strtolower($clone)) . '</a>') . "<br>\n";
66
+		if (!$logocreated) {
67
+			$msg .= constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_IMAGEFAIL');
68
+		}
69
+	} else {
70
+		$msg .= constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_FAIL');
71
+	}
72
+	echo $msg;
73 73
 } else {
74
-    require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
75
-    $form  = new \XoopsThemeForm(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_TITLE'), (string)$helper->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true);
76
-    $clone = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME'), 'clone', 20, 20, '');
77
-    $clone->setDescription(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME_DSC'));
78
-    $form->addElement($clone, true);
79
-    $form->addElement(new \XoopsFormHidden('op', 'submit'));
80
-    $form->addElement(new \XoopsFormButton('', '', _SUBMIT, 'submit'));
81
-    $form->display();
74
+	require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
75
+	$form  = new \XoopsThemeForm(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_TITLE'), (string)$helper->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true);
76
+	$clone = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME'), 'clone', 20, 20, '');
77
+	$clone->setDescription(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME_DSC'));
78
+	$form->addElement($clone, true);
79
+	$form->addElement(new \XoopsFormHidden('op', 'submit'));
80
+	$form->addElement(new \XoopsFormButton('', '', _SUBMIT, 'submit'));
81
+	$form->display();
82 82
 }
83 83
 
84 84
 require_once __DIR__ . '/admin_footer.php';
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     Utility
26 26
 };
27 27
 
28
-require_once __DIR__ . '/admin_header.php';
28
+require_once __DIR__.'/admin_header.php';
29 29
 
30 30
 xoops_cp_header();
31 31
 
32 32
 $helper = Helper::getInstance();
33 33
 
34
-if ('submit' === Request::getString('op', '', 'POST')) {
34
+if ('submit'===Request::getString('op', '', 'POST')) {
35 35
     if (!$GLOBALS['xoopsSecurity']->check()) {
36 36
         redirect_header('clone.php', 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
37 37
     }
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 
42 42
     //check if name is valid
43 43
     if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) {
44
-        redirect_header('clone.php', 3, sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_INVALIDNAME'), $clone));
44
+        redirect_header('clone.php', 3, sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_INVALIDNAME'), $clone));
45 45
     }
46 46
 
47 47
     // Check wether the cloned module exists or not
48
-    if ($clone && is_dir($GLOBALS['xoops']->path('modules/' . $clone))) {
49
-        redirect_header('clone.php', 3, sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_EXISTS'), $clone));
48
+    if ($clone && is_dir($GLOBALS['xoops']->path('modules/'.$clone))) {
49
+        redirect_header('clone.php', 3, sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_EXISTS'), $clone));
50 50
     }
51 51
 
52 52
     $patterns = [
@@ -61,24 +61,24 @@  discard block
 block discarded – undo
61 61
     $logocreated = Cloner::createLogo(mb_strtolower($clone));
62 62
 
63 63
     $msg = '';
64
-    if (is_dir($GLOBALS['xoops']->path('modules/' . \mb_strtolower($clone)))) {
65
-        $msg .= sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_CONGRAT'), "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin'>" . ucfirst(mb_strtolower($clone)) . '</a>') . "<br>\n";
64
+    if (is_dir($GLOBALS['xoops']->path('modules/'.\mb_strtolower($clone)))) {
65
+        $msg .= sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_CONGRAT'), "<a href='".XOOPS_URL."/modules/system/admin.php?fct=modulesadmin'>".ucfirst(mb_strtolower($clone)).'</a>')."<br>\n";
66 66
         if (!$logocreated) {
67
-            $msg .= constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_IMAGEFAIL');
67
+            $msg .= constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_IMAGEFAIL');
68 68
         }
69 69
     } else {
70
-        $msg .= constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_FAIL');
70
+        $msg .= constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_FAIL');
71 71
     }
72 72
     echo $msg;
73 73
 } else {
74 74
     require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
75
-    $form  = new \XoopsThemeForm(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_TITLE'), (string)$helper->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true);
76
-    $clone = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME'), 'clone', 20, 20, '');
77
-    $clone->setDescription(constant('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME_DSC'));
75
+    $form  = new \XoopsThemeForm(sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_TITLE'), (string) $helper->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true);
76
+    $clone = new \XoopsFormText(constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_NAME'), 'clone', 20, 20, '');
77
+    $clone->setDescription(constant('CO_'.$moduleDirNameUpper.'_'.'CLONE_NAME_DSC'));
78 78
     $form->addElement($clone, true);
79 79
     $form->addElement(new \XoopsFormHidden('op', 'submit'));
80 80
     $form->addElement(new \XoopsFormButton('', '', _SUBMIT, 'submit'));
81 81
     $form->display();
82 82
 }
83 83
 
84
-require_once __DIR__ . '/admin_footer.php';
84
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
list.tag.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-require_once __DIR__ . '/header.php';
4
-require_once XOOPS_ROOT_PATH . '/modules/tag/list.tag.php';
3
+require_once __DIR__.'/header.php';
4
+require_once XOOPS_ROOT_PATH.'/modules/tag/list.tag.php';
Please login to merge, or discard this patch.
include/oninstall.php 2 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function xoops_module_pre_install_songlist(\XoopsModule $module): bool
31 31
 {
32
-    require_once \dirname(__DIR__) . '/preloads/autoloader.php';
33
-    $utility      = new Utility();
34
-    $xoopsSuccess = $utility::checkVerXoops($module);
35
-    $phpSuccess   = $utility::checkVerPhp($module);
32
+	require_once \dirname(__DIR__) . '/preloads/autoloader.php';
33
+	$utility      = new Utility();
34
+	$xoopsSuccess = $utility::checkVerXoops($module);
35
+	$phpSuccess   = $utility::checkVerPhp($module);
36 36
 
37
-    if ($xoopsSuccess && $phpSuccess) {
38
-        $moduleTables = &$module->getInfo('tables');
39
-        foreach ($moduleTables as $table) {
40
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
41
-        }
42
-    }
37
+	if ($xoopsSuccess && $phpSuccess) {
38
+		$moduleTables = &$module->getInfo('tables');
39
+		foreach ($moduleTables as $table) {
40
+			$GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
41
+		}
42
+	}
43 43
 
44
-    return $xoopsSuccess && $phpSuccess;
44
+	return $xoopsSuccess && $phpSuccess;
45 45
 }
46 46
 
47 47
 /**
@@ -52,48 +52,48 @@  discard block
 block discarded – undo
52 52
  */
53 53
 function xoops_module_install_songlist(\XoopsModule $module): bool
54 54
 {
55
-    require \dirname(__DIR__, 3) . '/mainfile.php';
55
+	require \dirname(__DIR__, 3) . '/mainfile.php';
56 56
 
57
-    $moduleDirName = \basename(\dirname(__DIR__));
58
-    $helper        = Helper::getInstance();
59
-    $utility       = new Utility();
60
-    $configurator  = new Songlist\Common\Configurator();
61
-    // Load language files
62
-    $helper->loadLanguage('admin');
63
-    $helper->loadLanguage('modinfo');
57
+	$moduleDirName = \basename(\dirname(__DIR__));
58
+	$helper        = Helper::getInstance();
59
+	$utility       = new Utility();
60
+	$configurator  = new Songlist\Common\Configurator();
61
+	// Load language files
62
+	$helper->loadLanguage('admin');
63
+	$helper->loadLanguage('modinfo');
64 64
 
65
-    // default Permission Settings ----------------------
66
-    global $xoopsModule;
67
-    $moduleId = $xoopsModule->getVar('mid');
68
-    // $moduleId2        = \XoopsModules\Songlist\Helper::getInstance()->getModule()->mid();
69
-    /** @var \XoopsGroupPermHandler $grouppermHandler */
70
-    $grouppermHandler = xoops_getHandler('groupperm');
71
-    // access rights ------------------------------------------
72
-    $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
73
-    $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
74
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
75
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
76
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
65
+	// default Permission Settings ----------------------
66
+	global $xoopsModule;
67
+	$moduleId = $xoopsModule->getVar('mid');
68
+	// $moduleId2        = \XoopsModules\Songlist\Helper::getInstance()->getModule()->mid();
69
+	/** @var \XoopsGroupPermHandler $grouppermHandler */
70
+	$grouppermHandler = xoops_getHandler('groupperm');
71
+	// access rights ------------------------------------------
72
+	$grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
73
+	$grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
74
+	$grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
75
+	$grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
76
+	$grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
77 77
 
78
-    //  ---  CREATE FOLDERS ---------------
79
-    if (count($configurator->uploadFolders) > 0) {
80
-        //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
81
-        foreach (array_keys($configurator->uploadFolders) as $i) {
82
-            $utility::createFolder($configurator->uploadFolders[$i]);
83
-        }
84
-    }
78
+	//  ---  CREATE FOLDERS ---------------
79
+	if (count($configurator->uploadFolders) > 0) {
80
+		//    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
81
+		foreach (array_keys($configurator->uploadFolders) as $i) {
82
+			$utility::createFolder($configurator->uploadFolders[$i]);
83
+		}
84
+	}
85 85
 
86
-    //  ---  COPY blank.png FILES ---------------
87
-    if (count($configurator->copyBlankFiles) > 0) {
88
-        $file = \dirname(__DIR__) . '/assets/images/blank.png';
89
-        foreach (array_keys($configurator->copyBlankFiles) as $i) {
90
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
91
-            $utility::copyFile($file, $dest);
92
-        }
93
-    }
94
-    //delete .html entries from the tpl table
95
-    $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.tpl%'";
96
-    $GLOBALS['xoopsDB']->queryF($sql);
86
+	//  ---  COPY blank.png FILES ---------------
87
+	if (count($configurator->copyBlankFiles) > 0) {
88
+		$file = \dirname(__DIR__) . '/assets/images/blank.png';
89
+		foreach (array_keys($configurator->copyBlankFiles) as $i) {
90
+			$dest = $configurator->copyBlankFiles[$i] . '/blank.png';
91
+			$utility::copyFile($file, $dest);
92
+		}
93
+	}
94
+	//delete .html entries from the tpl table
95
+	$sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.tpl%'";
96
+	$GLOBALS['xoopsDB']->queryF($sql);
97 97
 
98
-    return true;
98
+	return true;
99 99
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function xoops_module_pre_install_songlist(\XoopsModule $module): bool
31 31
 {
32
-    require_once \dirname(__DIR__) . '/preloads/autoloader.php';
32
+    require_once \dirname(__DIR__).'/preloads/autoloader.php';
33 33
     $utility      = new Utility();
34 34
     $xoopsSuccess = $utility::checkVerXoops($module);
35 35
     $phpSuccess   = $utility::checkVerPhp($module);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     if ($xoopsSuccess && $phpSuccess) {
38 38
         $moduleTables = &$module->getInfo('tables');
39 39
         foreach ($moduleTables as $table) {
40
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
40
+            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
41 41
         }
42 42
     }
43 43
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  */
53 53
 function xoops_module_install_songlist(\XoopsModule $module): bool
54 54
 {
55
-    require \dirname(__DIR__, 3) . '/mainfile.php';
55
+    require \dirname(__DIR__, 3).'/mainfile.php';
56 56
 
57 57
     $moduleDirName = \basename(\dirname(__DIR__));
58 58
     $helper        = Helper::getInstance();
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
     /** @var \XoopsGroupPermHandler $grouppermHandler */
70 70
     $grouppermHandler = xoops_getHandler('groupperm');
71 71
     // access rights ------------------------------------------
72
-    $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
73
-    $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
74
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
75
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
76
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
72
+    $grouppermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
73
+    $grouppermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
74
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
75
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId);
76
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
77 77
 
78 78
     //  ---  CREATE FOLDERS ---------------
79
-    if (count($configurator->uploadFolders) > 0) {
79
+    if (count($configurator->uploadFolders)>0) {
80 80
         //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
81 81
         foreach (array_keys($configurator->uploadFolders) as $i) {
82 82
             $utility::createFolder($configurator->uploadFolders[$i]);
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
     }
85 85
 
86 86
     //  ---  COPY blank.png FILES ---------------
87
-    if (count($configurator->copyBlankFiles) > 0) {
88
-        $file = \dirname(__DIR__) . '/assets/images/blank.png';
87
+    if (count($configurator->copyBlankFiles)>0) {
88
+        $file = \dirname(__DIR__).'/assets/images/blank.png';
89 89
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
90
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
90
+            $dest = $configurator->copyBlankFiles[$i].'/blank.png';
91 91
             $utility::copyFile($file, $dest);
92 92
         }
93 93
     }
94 94
     //delete .html entries from the tpl table
95
-    $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.tpl%'";
95
+    $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.tpl%'";
96 96
     $GLOBALS['xoopsDB']->queryF($sql);
97 97
 
98 98
     return true;
Please login to merge, or discard this patch.
include/songlist.object.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
 /** @var \XoopsConfigHandler $configHandler */
6 6
 $configHandler = xoops_getHandler('config');
7 7
 if (!isset($GLOBALS['songlistModule'])) {
8
-    $GLOBALS['songlistModule'] = $moduleHandler->getByDirname('songlist');
8
+	$GLOBALS['songlistModule'] = $moduleHandler->getByDirname('songlist');
9 9
 }
10 10
 if (is_object($GLOBALS['songlistModule'])) {
11
-    if (!isset($GLOBALS['songlistModuleConfig'])) {
12
-        $GLOBALS['songlistModuleConfig'] = $configHandler->getConfigList($GLOBALS['songlistModule']->getVar('mid'));
13
-    }
11
+	if (!isset($GLOBALS['songlistModuleConfig'])) {
12
+		$GLOBALS['songlistModuleConfig'] = $configHandler->getConfigList($GLOBALS['songlistModule']->getVar('mid'));
13
+	}
14 14
 }
15 15
 
16 16
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
Please login to merge, or discard this patch.
include/update.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@  discard block
 block discarded – undo
6 6
  */
7 7
 function xoops_module_update_songlist(&$module): bool
8 8
 {
9
-    $sql = [];
9
+	$sql = [];
10 10
 
11
-    $sql[] = 'CREATE TABLE `'
12
-             . $GLOBALS['xoopsDB']->prefix('songlist_voice')
13
-             . "` (  `vcid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,  `name` VARCHAR(128) DEFAULT NULL,  `artists` INT(12) UNSIGNED DEFAULT '0',  `albums` INT(12) UNSIGNED DEFAULT '0',  `songs` INT(12) UNSIGNED DEFAULT '0',  `rank` DECIMAL(10,3) UNSIGNED DEFAULT '0.000',  `votes` INT(10) UNSIGNED DEFAULT '0',  `created` INT(12) UNSIGNED DEFAULT '0',  `updated` INT(12) UNSIGNED DEFAULT '0',  PRIMARY KEY (`vcid`),  KEY `SORT` (`name`(32),`rank`,`votes`,`created`)) ENGINE=InnoDB DEFAULT CHARSET=utf8";
14
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . "` ADD COLUMN `vcid` INT(12) UNSIGNED DEFAULT '0'";
15
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . '` CHANGE COLUMN `lyrics` `lyrics` LONGTEXT';
16
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . "` ADD COLUMN `mp3` VARCHAR(500) DEFAULT ''";
17
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . '` CHANGE COLUMN `traxid` `traxid` INT(4) UNSIGNED ZEROFILL DEFAULT NULL';
11
+	$sql[] = 'CREATE TABLE `'
12
+			 . $GLOBALS['xoopsDB']->prefix('songlist_voice')
13
+			 . "` (  `vcid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,  `name` VARCHAR(128) DEFAULT NULL,  `artists` INT(12) UNSIGNED DEFAULT '0',  `albums` INT(12) UNSIGNED DEFAULT '0',  `songs` INT(12) UNSIGNED DEFAULT '0',  `rank` DECIMAL(10,3) UNSIGNED DEFAULT '0.000',  `votes` INT(10) UNSIGNED DEFAULT '0',  `created` INT(12) UNSIGNED DEFAULT '0',  `updated` INT(12) UNSIGNED DEFAULT '0',  PRIMARY KEY (`vcid`),  KEY `SORT` (`name`(32),`rank`,`votes`,`created`)) ENGINE=InnoDB DEFAULT CHARSET=utf8";
14
+	$sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . "` ADD COLUMN `vcid` INT(12) UNSIGNED DEFAULT '0'";
15
+	$sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . '` CHANGE COLUMN `lyrics` `lyrics` LONGTEXT';
16
+	$sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . "` ADD COLUMN `mp3` VARCHAR(500) DEFAULT ''";
17
+	$sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . '` CHANGE COLUMN `traxid` `traxid` INT(4) UNSIGNED ZEROFILL DEFAULT NULL';
18 18
 
19
-    return xoops_module_update_vs_executesql($sql);
19
+	return xoops_module_update_vs_executesql($sql);
20 20
 }
21 21
 
22 22
 /**
@@ -25,31 +25,31 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function xoops_module_update_vs_executesql($sql): bool
27 27
 {
28
-    if (is_string($sql)) {
29
-        if ($GLOBALS['xoopsDB']->queryF($sql)) {
30
-            xoops_error($sql, 'SQL Executed Successfully!!!');
31
-        }
32
-    } elseif (is_array($sql)) {
33
-        foreach ($sql as $id => $question) {
34
-            if (is_array($question)) {
35
-                foreach ($question as $kquestion => $questionb) {
36
-                    if ($GLOBALS['xoopsDB']->queryF($kquestion)) {
37
-                        xoops_error($kquestion, 'SQL Executed Successfully!!!');
38
-                        xoops_module_update_vs_executesql($questionb);
39
-                    }
40
-                }
41
-            } elseif ($GLOBALS['xoopsDB']->queryF($id)) {
42
-                    xoops_error($id, 'SQL Executed Successfully!!!');
43
-                    if ($GLOBALS['xoopsDB']->queryF($question)) {
44
-                        xoops_error($question, 'SQL Executed Successfully!!!');
45
-                    }
46
-                } elseif ($GLOBALS['xoopsDB']->queryF($question)) {
47
-                    xoops_error($question, 'SQL Executed Successfully!!!');
48
-            }
49
-        }
50
-    } else {
51
-        return false;
52
-    }
28
+	if (is_string($sql)) {
29
+		if ($GLOBALS['xoopsDB']->queryF($sql)) {
30
+			xoops_error($sql, 'SQL Executed Successfully!!!');
31
+		}
32
+	} elseif (is_array($sql)) {
33
+		foreach ($sql as $id => $question) {
34
+			if (is_array($question)) {
35
+				foreach ($question as $kquestion => $questionb) {
36
+					if ($GLOBALS['xoopsDB']->queryF($kquestion)) {
37
+						xoops_error($kquestion, 'SQL Executed Successfully!!!');
38
+						xoops_module_update_vs_executesql($questionb);
39
+					}
40
+				}
41
+			} elseif ($GLOBALS['xoopsDB']->queryF($id)) {
42
+					xoops_error($id, 'SQL Executed Successfully!!!');
43
+					if ($GLOBALS['xoopsDB']->queryF($question)) {
44
+						xoops_error($question, 'SQL Executed Successfully!!!');
45
+					}
46
+				} elseif ($GLOBALS['xoopsDB']->queryF($question)) {
47
+					xoops_error($question, 'SQL Executed Successfully!!!');
48
+			}
49
+		}
50
+	} else {
51
+		return false;
52
+	}
53 53
 
54
-    return true;
54
+	return true;
55 55
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
     $sql[] = 'CREATE TABLE `'
12 12
              . $GLOBALS['xoopsDB']->prefix('songlist_voice')
13 13
              . "` (  `vcid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,  `name` VARCHAR(128) DEFAULT NULL,  `artists` INT(12) UNSIGNED DEFAULT '0',  `albums` INT(12) UNSIGNED DEFAULT '0',  `songs` INT(12) UNSIGNED DEFAULT '0',  `rank` DECIMAL(10,3) UNSIGNED DEFAULT '0.000',  `votes` INT(10) UNSIGNED DEFAULT '0',  `created` INT(12) UNSIGNED DEFAULT '0',  `updated` INT(12) UNSIGNED DEFAULT '0',  PRIMARY KEY (`vcid`),  KEY `SORT` (`name`(32),`rank`,`votes`,`created`)) ENGINE=InnoDB DEFAULT CHARSET=utf8";
14
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . "` ADD COLUMN `vcid` INT(12) UNSIGNED DEFAULT '0'";
15
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . '` CHANGE COLUMN `lyrics` `lyrics` LONGTEXT';
16
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . "` ADD COLUMN `mp3` VARCHAR(500) DEFAULT ''";
17
-    $sql[] = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix('songlist_songs') . '` CHANGE COLUMN `traxid` `traxid` INT(4) UNSIGNED ZEROFILL DEFAULT NULL';
14
+    $sql[] = 'ALTER TABLE `'.$GLOBALS['xoopsDB']->prefix('songlist_songs')."` ADD COLUMN `vcid` INT(12) UNSIGNED DEFAULT '0'";
15
+    $sql[] = 'ALTER TABLE `'.$GLOBALS['xoopsDB']->prefix('songlist_songs').'` CHANGE COLUMN `lyrics` `lyrics` LONGTEXT';
16
+    $sql[] = 'ALTER TABLE `'.$GLOBALS['xoopsDB']->prefix('songlist_songs')."` ADD COLUMN `mp3` VARCHAR(500) DEFAULT ''";
17
+    $sql[] = 'ALTER TABLE `'.$GLOBALS['xoopsDB']->prefix('songlist_songs').'` CHANGE COLUMN `traxid` `traxid` INT(4) UNSIGNED ZEROFILL DEFAULT NULL';
18 18
 
19 19
     return xoops_module_update_vs_executesql($sql);
20 20
 }
Please login to merge, or discard this patch.
include/onuninstall.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
  */
21 21
 function xoops_module_pre_uninstall_songlist(\XoopsModule $module): bool
22 22
 {
23
-    // Do some synchronization
24
-    return true;
23
+	// Do some synchronization
24
+	return true;
25 25
 }
26 26
 
27 27
 /**
@@ -32,26 +32,26 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function xoops_module_uninstall_songlist(\XoopsModule $module): bool
34 34
 {
35
-    $moduleDirName      = \basename(\dirname(__DIR__));
36
-    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
37
-    $helper             = Helper::getInstance();
35
+	$moduleDirName      = \basename(\dirname(__DIR__));
36
+	$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
37
+	$helper             = Helper::getInstance();
38 38
 
39
-    $success = true;
40
-    $helper->loadLanguage('admin');
39
+	$success = true;
40
+	$helper->loadLanguage('admin');
41 41
 
42
-    // Rename uploads folder to BAK and add date to name
43
-    $uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName");
44
-    $dirInfo = new \SplFileInfo($uploadDirectory);
45
-    if ($dirInfo->isDir()) {
46
-        // The directory exists so rename it
47
-        $date = date('Y-m-d');
48
-        if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) {
49
-            $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR_FOLDER_RENAME_FAILED'), $uploadDirectory));
50
-            $success = false;
51
-        }
52
-    }
53
-    unset($dirInfo);
54
-    /*
42
+	// Rename uploads folder to BAK and add date to name
43
+	$uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName");
44
+	$dirInfo = new \SplFileInfo($uploadDirectory);
45
+	if ($dirInfo->isDir()) {
46
+		// The directory exists so rename it
47
+		$date = date('Y-m-d');
48
+		if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) {
49
+			$module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR_FOLDER_RENAME_FAILED'), $uploadDirectory));
50
+			$success = false;
51
+		}
52
+	}
53
+	unset($dirInfo);
54
+	/*
55 55
     //------------ START ----------------
56 56
     //------------------------------------------------------------------
57 57
     // Remove xsitemap.xml from XOOPS root folder if it exists
@@ -65,6 +65,6 @@  discard block
 block discarded – undo
65 65
 //    return $success && $delOk; // use this if you're using this routine
66 66
 */
67 67
 
68
-    return $success;
69
-    //------------ END  ----------------
68
+	return $success;
69
+	//------------ END  ----------------
70 70
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@
 block discarded – undo
45 45
     if ($dirInfo->isDir()) {
46 46
         // The directory exists so rename it
47 47
         $date = date('Y-m-d');
48
-        if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) {
49
-            $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ERROR_FOLDER_RENAME_FAILED'), $uploadDirectory));
48
+        if (!rename($uploadDirectory, $uploadDirectory."_bak_$date")) {
49
+            $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'ERROR_FOLDER_RENAME_FAILED'), $uploadDirectory));
50 50
             $success = false;
51 51
         }
52 52
     }
Please login to merge, or discard this patch.
include/common.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -39,19 +39,19 @@  discard block
 block discarded – undo
39 39
 //$downloadHandler     = new Songlist\DownloadHandler($db);
40 40
 
41 41
 if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) {
42
-    define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
43
-    define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
44
-    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
45
-    define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
46
-    define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
47
-    define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
48
-    define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
49
-    define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
50
-    define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
51
-    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
52
-    define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
53
-    define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
54
-    define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
42
+	define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
43
+	define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
44
+	define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
45
+	define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
46
+	define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
47
+	define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
48
+	define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
49
+	define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
50
+	define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
51
+	define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
52
+	define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
53
+	define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
54
+	define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
55 55
 }
56 56
 
57 57
 $pathIcon16 = Admin::iconUrl('', '16');
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
 //$pathModIcon32 = \XoopsModules\Songlist\Helper::getInstance()->getModule()->getInfo('modicons32');
61 61
 
62 62
 $icons = [
63
-    'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
64
-    'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
65
-    'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
66
-    'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
67
-    'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
68
-    'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
69
-    'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
70
-    '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
71
-    '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
63
+	'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
64
+	'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
65
+	'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
66
+	'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
67
+	'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
68
+	'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
69
+	'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
70
+	'0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
71
+	'1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
72 72
 ];
73 73
 
74 74
 $debug = false;
@@ -77,23 +77,23 @@  discard block
 block discarded – undo
77 77
 $myts = \MyTextSanitizer::getInstance();
78 78
 
79 79
 if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) {
80
-    require_once $GLOBALS['xoops']->path('class/template.php');
81
-    $GLOBALS['xoopsTpl'] = new \XoopsTpl();
80
+	require_once $GLOBALS['xoops']->path('class/template.php');
81
+	$GLOBALS['xoopsTpl'] = new \XoopsTpl();
82 82
 }
83 83
 
84 84
 $GLOBALS['xoopsTpl']->assign('mod_url', $helper->url());
85 85
 // Local icons path
86 86
 if (is_object($helper->getModule())) {
87
-    $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
88
-    $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
87
+	$pathModIcon16 = $helper->getModule()->getInfo('modicons16');
88
+	$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
89 89
 
90
-    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
91
-    $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
90
+	$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
91
+	$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
92 92
 }
93 93
 
94 94
 xoops_loadLanguage('main', $moduleDirName);
95 95
 if (class_exists('D3LanguageManager')) {
96
-    require_once XOOPS_TRUST_PATH . "/libs/altsys/class/D3LanguageManager.class.php";
97
-    $langman = D3LanguageManager::getInstance();
98
-    $langman->read('main.php', $moduleDirName);
96
+	require_once XOOPS_TRUST_PATH . "/libs/altsys/class/D3LanguageManager.class.php";
97
+	$langman = D3LanguageManager::getInstance();
98
+	$langman->read('main.php', $moduleDirName);
99 99
 }
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 use XoopsModules\Songlist;
20 20
 use XoopsModules\Songlist\Helper;
21 21
 
22
-require_once \dirname(__DIR__) . '/preloads/autoloader.php';
22
+require_once \dirname(__DIR__).'/preloads/autoloader.php';
23 23
 
24 24
 $moduleDirName      = \basename(\dirname(__DIR__));
25 25
 $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
 //$categoryHandler     = new Songlist\CategoryHandler($db);
39 39
 //$downloadHandler     = new Songlist\DownloadHandler($db);
40 40
 
41
-if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) {
42
-    define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
43
-    define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
44
-    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
45
-    define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
46
-    define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
47
-    define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
48
-    define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
49
-    define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
50
-    define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
51
-    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
52
-    define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
53
-    define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
54
-    define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
41
+if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) {
42
+    define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__)));
43
+    define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/');
44
+    define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/');
45
+    define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/');
46
+    define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/');
47
+    define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images');
48
+    define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/');
49
+    define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/');
50
+    define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php');
51
+    define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png');
52
+    define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash
53
+    define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash
54
+    define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1);
55 55
 }
56 56
 
57 57
 $pathIcon16 = Admin::iconUrl('', '16');
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
 //$pathModIcon32 = \XoopsModules\Songlist\Helper::getInstance()->getModule()->getInfo('modicons32');
61 61
 
62 62
 $icons = [
63
-    'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
64
-    'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
65
-    'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
66
-    'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
67
-    'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
68
-    'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
69
-    'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
70
-    '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
71
-    '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
63
+    'edit'    => "<img src='".$pathIcon16."/edit.png'  alt="._EDIT."' align='middle'>",
64
+    'delete'  => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>",
65
+    'clone'   => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>",
66
+    'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>",
67
+    'print'   => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>",
68
+    'pdf'     => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>",
69
+    'add'     => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>",
70
+    '0'       => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>",
71
+    '1'       => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>",
72 72
 ];
73 73
 
74 74
 $debug = false;
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
     $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
88 88
     $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
89 89
 
90
-    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
90
+    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16);
91 91
     $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
92 92
 }
93 93
 
94 94
 xoops_loadLanguage('main', $moduleDirName);
95 95
 if (class_exists('D3LanguageManager')) {
96
-    require_once XOOPS_TRUST_PATH . "/libs/altsys/class/D3LanguageManager.class.php";
96
+    require_once XOOPS_TRUST_PATH."/libs/altsys/class/D3LanguageManager.class.php";
97 97
     $langman = D3LanguageManager::getInstance();
98 98
     $langman->read('main.php', $moduleDirName);
99 99
 }
Please login to merge, or discard this patch.