Passed
Pull Request — master (#2)
by Michael
07:48 queued 04:06
created
blocks/songlist_popular_albums.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     xoops_loadLanguage('blocks', 'songlist');
12 12
     $handler = Helper::getInstance()->getHandler('Albums');
13 13
     $objects = $handler->getTop($options[0]);
14
-    if (count($objects) > 0) {
14
+    if (count($objects)>0) {
15 15
         $ret = [];
16 16
         foreach ($objects as $id => $object) {
17 17
             $ret[$id] = $object->toArray(true);
@@ -33,5 +33,5 @@  discard block
 block discarded – undo
33 33
     xoops_loadLanguage('blocks', 'songlist');
34 34
     $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]);
35 35
 
36
-    return _BL_SONGLIST_NUMBEROFITEMS . $num->render();
36
+    return _BL_SONGLIST_NUMBEROFITEMS.$num->render();
37 37
 }
Please login to merge, or discard this patch.
blocks/songlist_popular_genres.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     xoops_loadLanguage('blocks', 'songlist');
12 12
     $handler = Helper::getInstance()->getHandler('Genre');
13 13
     $objects = $handler->getTop($options[0]);
14
-    if (count($objects) > 0) {
14
+    if (count($objects)>0) {
15 15
         $ret = [];
16 16
         foreach ($objects as $id => $object) {
17 17
             $ret[$id] = $object->toArray(true);
@@ -33,5 +33,5 @@  discard block
 block discarded – undo
33 33
     xoops_loadLanguage('blocks', 'songlist');
34 34
     $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]);
35 35
 
36
-    return _BL_SONGLIST_NUMBEROFITEMS . $num->render();
36
+    return _BL_SONGLIST_NUMBEROFITEMS.$num->render();
37 37
 }
Please login to merge, or discard this patch.
blocks/songlist_popular_songs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     xoops_loadLanguage('blocks', 'songlist');
12 12
     $handler = Helper::getInstance()->getHandler('Songs');
13 13
     $objects = $handler->getTop($options[0]);
14
-    if (count($objects) > 0) {
14
+    if (count($objects)>0) {
15 15
         $ret = [];
16 16
         foreach ($objects as $id => $object) {
17 17
             $ret[$id] = $object->toArray(true);
@@ -33,5 +33,5 @@  discard block
 block discarded – undo
33 33
     xoops_loadLanguage('blocks', 'songlist');
34 34
     $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]);
35 35
 
36
-    return _BL_SONGLIST_NUMBEROFITEMS . $num->render();
36
+    return _BL_SONGLIST_NUMBEROFITEMS.$num->render();
37 37
 }
Please login to merge, or discard this patch.
blocks/songlist_popular_artists.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     xoops_loadLanguage('blocks', 'songlist');
12 12
     $handler = Helper::getInstance()->getHandler('Artists');
13 13
     $objects = $handler->getTop($options[0]);
14
-    if (count($objects) > 0) {
14
+    if (count($objects)>0) {
15 15
         $ret = [];
16 16
         foreach ($objects as $id => $object) {
17 17
             $ret[$id] = $object->toArray(true); //TODO mb why do we need toArray()?
@@ -33,5 +33,5 @@  discard block
 block discarded – undo
33 33
     xoops_loadLanguage('blocks', 'songlist');
34 34
     $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]);
35 35
 
36
-    return _BL_SONGLIST_NUMBEROFITEMS . $num->render();
36
+    return _BL_SONGLIST_NUMBEROFITEMS.$num->render();
37 37
 }
Please login to merge, or discard this patch.
artists.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use XoopsModules\Songlist\CategoryHandler;
5 5
 use XoopsModules\Songlist\ArtistsHandler;
6 6
 
7
-require_once __DIR__ . '/header.php';
7
+require_once __DIR__.'/header.php';
8 8
 
9 9
 global $file, $op, $fct, $id, $value, $gid, $cid, $start, $limit;
10 10
 
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 $categoryHandler = Helper::getInstance()->getHandler('Category');
13 13
 $criteria_cat    = new \CriteriaCompo();
14 14
 $cids            = $categoryHandler->GetCatAndSubCat($_SESSION['cid']);
15
-if ($_SESSION['cid'] > 0) {
15
+if ($_SESSION['cid']>0) {
16 16
     $cids[$_SESSION['cid']] = $_SESSION['cid'];
17 17
 }
18
-if (count($cids) > 0 && 0 != $_SESSION['cid']) {
18
+if (count($cids)>0 && 0!=$_SESSION['cid']) {
19 19
     foreach ($cids as $cid) {
20
-        $criteria_cat->add(new \Criteria('`cids`', '%"' . $cid . '"%', 'LIKE'), 'OR');
20
+        $criteria_cat->add(new \Criteria('`cids`', '%"'.$cid.'"%', 'LIKE'), 'OR');
21 21
     }
22 22
 } else {
23 23
     $criteria_cat->add(new \Criteria(''), 'OR');
@@ -36,24 +36,24 @@  discard block
 block discarded – undo
36 36
 $row = 1;
37 37
 foreach ($categories as $category) {
38 38
     $cat[$row][$col]          = $category->toArray(true);
39
-    $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
39
+    $cat[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
40 40
     ++$col;
41
-    if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
41
+    if ($col>$GLOBALS['songlistModuleConfig']['cols']) {
42 42
         ++$row;
43 43
         $col = 1;
44 44
     }
45 45
 }
46
-if (1 != $col) {
46
+if (1!=$col) {
47 47
     $col--;
48
-    for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
48
+    for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) {
49 49
         $cat[$row][$j][$categoryHandler->keyName] = 0;
50
-        $cat[$row][$j]['width']                   = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
50
+        $cat[$row][$j]['width']                   = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
51 51
     }
52 52
 }
53 53
 
54 54
 /** @var ArtistsHandler $artistsHandler */
55 55
 $artistsHandler = Helper::getInstance()->getHandler('Artists');
56
-switch ((string)$GLOBALS['op']) {
56
+switch ((string) $GLOBALS['op']) {
57 57
     default:
58 58
     case 'item':
59 59
         switch ($fct) {
@@ -71,41 +71,41 @@  discard block
 block discarded – undo
71 71
                 $row = 1;
72 72
                 foreach ($artists as $artist) {
73 73
                     $ret[$row][$col]          = $artist->toArray(true);
74
-                    $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
74
+                    $ret[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
75 75
                     ++$col;
76
-                    if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
76
+                    if ($col>$GLOBALS['songlistModuleConfig']['cols']) {
77 77
                         ++$row;
78 78
                         $col = 1;
79 79
                     }
80 80
                 }
81
-                if (1 != $col) {
82
-                    for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
81
+                if (1!=$col) {
82
+                    for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) {
83 83
                         $ret[$row][$j][$artistsHandler->keyName] = 0;
84
-                        $ret[$row][$j]['width']                  = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
84
+                        $ret[$row][$j]['width']                  = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
85 85
                     }
86 86
                 }
87 87
 
88 88
                 $url = $artistsHandler->getURL(false);
89 89
                 if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
90 90
                     header('HTTP/1.1 301 Moved Permanently');
91
-                    header('Location: ' . $url);
91
+                    header('Location: '.$url);
92 92
                     exit(0);
93 93
                 }
94 94
 
95 95
                 $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl';
96 96
                 require $GLOBALS['xoops']->path('/header.php');
97 97
                 if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
98
-                    $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
98
+                    $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
99 99
                     $GLOBALS['loaded_jquery'] = true;
100 100
                 }
101
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
101
+                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
102 102
                 $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
103 103
                 $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
104 104
                 $GLOBALS['xoopsTpl']->assign('results', $ret);
105 105
                 $GLOBALS['xoopsTpl']->assign('categories', $cat);
106 106
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
107 107
                 $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']);
108
-                if (0 != $_SESSION['cid']) {
108
+                if (0!=$_SESSION['cid']) {
109 109
                     $category = $categoryHandler->get($_SESSION['cid']);
110 110
                     $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
111 111
                 }
@@ -118,17 +118,17 @@  discard block
 block discarded – undo
118 118
                 $url = $artist->getURL(true);
119 119
                 if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
120 120
                     header('HTTP/1.1 301 Moved Permanently');
121
-                    header('Location: ' . $url);
121
+                    header('Location: '.$url);
122 122
                     exit(0);
123 123
                 }
124 124
 
125 125
                 $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_item.tpl';
126 126
                 require $GLOBALS['xoops']->path('/header.php');
127 127
                 if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
128
-                    $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
128
+                    $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
129 129
                     $GLOBALS['loaded_jquery'] = true;
130 130
                 }
131
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
131
+                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
132 132
                 $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
133 133
                 $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
134 134
                 $GLOBALS['xoopsTpl']->assign('songs', false);
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
                 $browse_criteria = new \CriteriaCompo();
150 150
                 switch ($value) {
151 151
                     case '0':
152
-                        for ($u = 0; $u < 10; ++$u) {
153
-                            $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR');
152
+                        for ($u = 0; $u<10; ++$u) {
153
+                            $browse_criteria->add(new \Criteria('name', $u.'%', 'LIKE'), 'OR');
154 154
                         }
155 155
                         break;
156 156
                     default:
157
-                        $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR');
158
-                        $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR');
157
+                        $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value).'%', 'LIKE'), 'OR');
158
+                        $browse_criteria->add(new \Criteria('name', \mb_strtolower($value).'%', 'LIKE'), 'OR');
159 159
                         break;
160 160
                 }
161 161
                 $criteria = new \CriteriaCompo($criteria_cat, 'AND');
@@ -174,42 +174,42 @@  discard block
 block discarded – undo
174 174
         $row = 1;
175 175
         foreach ($artists as $artist) {
176 176
             $ret[$row][$col]          = $artist->toArray(true);
177
-            $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
177
+            $ret[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
178 178
             ++$col;
179
-            if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
179
+            if ($col>$GLOBALS['songlistModuleConfig']['cols']) {
180 180
                 ++$row;
181 181
                 $col = 1;
182 182
             }
183 183
         }
184
-        if (1 != $col) {
184
+        if (1!=$col) {
185 185
             $col--;
186
-            for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
186
+            for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) {
187 187
                 $ret[$row][$j][$artistsHandler->keyName] = 0;
188
-                $ret[$row][$j]['width']                  = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
188
+                $ret[$row][$j]['width']                  = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
189 189
             }
190 190
         }
191 191
 
192 192
         $url = $artistsHandler->getURL(false);
193 193
         if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
194 194
             header('HTTP/1.1 301 Moved Permanently');
195
-            header('Location: ' . $url);
195
+            header('Location: '.$url);
196 196
             exit(0);
197 197
         }
198 198
 
199 199
         $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl';
200 200
         require $GLOBALS['xoops']->path('/header.php');
201 201
         if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
202
-            $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
202
+            $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
203 203
             $GLOBALS['loaded_jquery'] = true;
204 204
         }
205
-        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
205
+        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
206 206
         $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
207 207
         $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
208 208
         $GLOBALS['xoopsTpl']->assign('results', $ret);
209 209
         $GLOBALS['xoopsTpl']->assign('categories', $cat);
210 210
         $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
211 211
         $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']);
212
-        if (0 != $_SESSION['cid']) {
212
+        if (0!=$_SESSION['cid']) {
213 213
             $category = $categoryHandler->get($_SESSION['cid']);
214 214
             $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
215 215
         }
@@ -227,5 +227,5 @@  discard block
 block discarded – undo
227 227
                 unset($_SESSION['cid']);
228 228
                 break;
229 229
         }
230
-        redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=0&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED);
230
+        redirect_header($_SERVER['SCRIPT_NAME']."?op=item&fct=list&id=0&value=%&start=0&limit=$limit&cid=".$_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED);
231 231
 }
Please login to merge, or discard this patch.
admin/songs.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use XoopsModules\Songlist\Form\FormController;
9 9
 
10 10
 
11
-require __DIR__ . '/header.php';
11
+require __DIR__.'/header.php';
12 12
 
13 13
 xoops_loadLanguage('admin', 'songlist');
14 14
 
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 $limit  = Request::getInt('limit', 30, 'REQUEST');
20 20
 $start  = Request::getInt('start', 0, 'REQUEST');
21 21
 $order  = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC';
22
-$sort   = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created';
23
-$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1';
22
+$sort   = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created';
23
+$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1';
24 24
 
25 25
 switch ($op) {
26 26
     default:
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
 
37 37
                 $criteria        = $songsHandler->getFilterCriteria($GLOBALS['filter']);
38 38
                 $ttl             = $songsHandler->getCount($criteria);
39
-                $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created';
39
+                $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created';
40 40
 
41
-                $pagenav = new \XoopsPageNav($ttl, $GLOBALS['limit'], $GLOBALS['start'], 'start', 'limit=' . $GLOBALS['limit'] . '&sort=' . $GLOBALS['sort'] . '&order=' . $GLOBALS['order'] . '&op=' . $GLOBALS['op'] . '&fct=' . $GLOBALS['fct'] . '&filter=' . $GLOBALS['filter']);
41
+                $pagenav = new \XoopsPageNav($ttl, $GLOBALS['limit'], $GLOBALS['start'], 'start', 'limit='.$GLOBALS['limit'].'&sort='.$GLOBALS['sort'].'&order='.$GLOBALS['order'].'&op='.$GLOBALS['op'].'&fct='.$GLOBALS['fct'].'&filter='.$GLOBALS['filter']);
42 42
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
43 43
 
44 44
                 foreach ($songsHandler->filterFields() as $id => $key) {
45 45
                     $GLOBALS['xoopsTpl']->assign(
46
-                        \mb_strtolower(str_replace('-', '_', $key) . '_th'),
46
+                        \mb_strtolower(str_replace('-', '_', $key).'_th'),
47 47
                         '<a href="'
48 48
                         . $_SERVER['SCRIPT_NAME']
49 49
                         . '?start='
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
                         . '&sort='
54 54
                         . $key
55 55
                         . '&order='
56
-                        . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order'])
56
+                        . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order'])
57 57
                         . '&op='
58 58
                         . $GLOBALS['op']
59 59
                         . '&filter='
60 60
                         . $GLOBALS['filter']
61 61
                         . '">'
62
-                        . (defined('_AM_SONGLIST_TH_' . \mb_strtoupper(str_replace('-', '_', $key))) ? constant('_AM_SONGLIST_TH_' . \mb_strtoupper(str_replace('-', '_', $key))) : '_AM_SONGLIST_TH_' . \mb_strtoupper(str_replace('-', '_', $key)))
62
+                        . (defined('_AM_SONGLIST_TH_'.\mb_strtoupper(str_replace('-', '_', $key))) ? constant('_AM_SONGLIST_TH_'.\mb_strtoupper(str_replace('-', '_', $key))) : '_AM_SONGLIST_TH_'.\mb_strtoupper(str_replace('-', '_', $key)))
63 63
                         . '</a>'
64 64
                     );
65
-                    $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $songsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct']));
65
+                    $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $songsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct']));
66 66
                 }
67 67
 
68 68
                 $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
                 $criteria->setStart($GLOBALS['start']);
76 76
                 $criteria->setLimit($GLOBALS['limit']);
77
-                $criteria->setSort('`' . $GLOBALS['sort'] . '`');
77
+                $criteria->setSort('`'.$GLOBALS['sort'].'`');
78 78
                 $criteria->setOrder($GLOBALS['order']);
79 79
 
80 80
                 $songss = $songsHandler->getObjects($criteria, true);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 }
118 118
                 $songs->setVars($_POST[$id]);
119 119
 
120
-                if (Request::hasVar('mp3' . $id, 'FILES') && !empty($_FILES['mp3' . $id]['title'])) {
120
+                if (Request::hasVar('mp3'.$id, 'FILES') && !empty($_FILES['mp3'.$id]['title'])) {
121 121
 //                    if (!is_dir($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']))) {
122 122
 //                        foreach (explode('\\', $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])) as $folders) {
123 123
 //                            foreach (explode('/', $folders) as $folder) {
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
                         explode('|', $GLOBALS['songlistModuleConfig']['mp3_extensions'])
140 140
                     );
141 141
                     try {
142
-                        $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13));
142
+                        $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13));
143 143
                     } catch (Exception $e) {
144 144
                     }
145 145
 
146
-                    if ($uploader->fetchMedia('mp3' . $id)) {
146
+                    if ($uploader->fetchMedia('mp3'.$id)) {
147 147
                         if (!$uploader->upload()) {
148 148
                             $adminObject = Admin::getInstance();
149 149
                             $adminObject->displayNavigation(basename(__FILE__));
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
                             exit(0);
153 153
                         }
154 154
                         if (mb_strlen($songs->getVar('mp3'))) {
155
-                            unlink($GLOBALS['xoops']->path($songs->getVar('path')) . basename($songs->getVar('mp3')));
155
+                            unlink($GLOBALS['xoops']->path($songs->getVar('path')).basename($songs->getVar('mp3')));
156 156
                         }
157 157
 
158
-                        $songs->setVar('mp3', XOOPS_URL . '/' . str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']) . $uploader->getSavedFileName());
158
+                        $songs->setVar('mp3', XOOPS_URL.'/'.str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']).$uploader->getSavedFileName());
159 159
                     } else {
160 160
                         $adminObject = Admin::getInstance();
161 161
                         $adminObject->displayNavigation(basename(__FILE__));
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                     }
166 166
                 }
167 167
                 if (!$id = $songsHandler->insert($songs)) {
168
-                    redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_FAILEDTOSAVE);
168
+                    redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_FAILEDTOSAVE);
169 169
                     exit(0);
170 170
                 }
171 171
                 $extra = $extrasHandler->get($id);
@@ -173,19 +173,19 @@  discard block
 block discarded – undo
173 173
                 $extra->setVar('sid', $id);
174 174
                 $extrasHandler->insert($extra);
175 175
 
176
-                if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
176
+                if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH.'/modules/tag/class/tag.php')) {
177 177
                     $tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag');
178 178
                     $tagHandler->updateByItem($_POST['tags'], $id, $GLOBALS['songlistModule']->getVar('dirname'), $songs->getVar('cid'));
179 179
                 }
180 180
 
181
-                if ('new' === isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']]:'') {
181
+                if ('new'===isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']] : '') {
182 182
                     redirect_header(
183
-                        $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=edit&id=' . $_REQUEST['id'] . '&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'],
183
+                        $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=edit&id='.$_REQUEST['id'].'&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'],
184 184
                         10,
185 185
                         _AM_SONGLIST_MSG_SONGS_SAVEDOKEY
186 186
                     );
187 187
                 } else {
188
-                    redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_SAVEDOKEY);
188
+                    redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_SAVEDOKEY);
189 189
                 }
190 190
                 exit(0);
191 191
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 foreach ($_REQUEST['id'] as $id) {
198 198
                     $songs = $songsHandler->get($id);
199 199
                     $songs->setVars($_POST[$id]);
200
-                    if (Request::hasVar('mp3' . $id, 'FILES') && !empty($_FILES['mp3' . $id]['title'])) {
200
+                    if (Request::hasVar('mp3'.$id, 'FILES') && !empty($_FILES['mp3'.$id]['title'])) {
201 201
 //                        if (!is_dir($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']))) {
202 202
 //                            foreach (explode('\\', $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])) as $folders) {
203 203
 //                                foreach (explode('/', $folders) as $folder) {
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
                             explode('|', $GLOBALS['songlistModuleConfig']['mp3_extensions'])
220 220
                         );
221 221
                         try {
222
-                            $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13));
222
+                            $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13));
223 223
                         } catch (Exception $e) {
224 224
                         }
225 225
 
226
-                        if ($uploader->fetchMedia('mp3' . $id)) {
226
+                        if ($uploader->fetchMedia('mp3'.$id)) {
227 227
                             if (!$uploader->upload()) {
228 228
                                 $adminObject = Admin::getInstance();
229 229
                                 $adminObject->displayNavigation(basename(__FILE__));
@@ -232,10 +232,10 @@  discard block
 block discarded – undo
232 232
                                 exit(0);
233 233
                             }
234 234
                             if (mb_strlen($songs->getVar('mp3'))) {
235
-                                unlink($GLOBALS['xoops']->path($songs->getVar('path')) . basename($songs->getVar('mp3')));
235
+                                unlink($GLOBALS['xoops']->path($songs->getVar('path')).basename($songs->getVar('mp3')));
236 236
                             }
237 237
 
238
-                            $songs->setVar('mp3', XOOPS_URL . '/' . str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']) . $uploader->getSavedFileName());
238
+                            $songs->setVar('mp3', XOOPS_URL.'/'.str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']).$uploader->getSavedFileName());
239 239
                         } else {
240 240
                             $adminObject = Admin::getInstance();
241 241
                             $adminObject->displayNavigation(basename(__FILE__));
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
                     }
247 247
                     if (!$songsHandler->insert($songs)) {
248 248
                         redirect_header(
249
-                            $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'],
249
+                            $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'],
250 250
                             10,
251 251
                             _AM_SONGLIST_MSG_SONGS_FAILEDTOSAVE
252 252
                         );
253 253
                         exit(0);
254 254
                     }
255 255
                 }
256
-                redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_SAVEDOKEY);
256
+                redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_SAVEDOKEY);
257 257
                 exit(0);
258 258
                 break;
259 259
             case 'delete':
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
                     $songs = $songsHandler->get($id);
264 264
                     if (!$songsHandler->delete($songs)) {
265 265
                         redirect_header(
266
-                            $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'],
266
+                            $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'],
267 267
                             10,
268 268
                             _AM_SONGLIST_MSG_SONGS_FAILEDTODELETE
269 269
                         );
270 270
                         exit(0);
271 271
                     }
272
-                    redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_DELETED);
272
+                    redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_SONGS_DELETED);
273 273
                     exit(0);
274 274
                 }
275 275
                 $songs = $songsHandler->get(Request::getInt('id', 0, 'REQUEST'));
Please login to merge, or discard this patch.
admin/field.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use XoopsModules\Songlist\Helper;
6 6
 use XoopsModules\Songlist\Form\FormController;
7 7
 
8
-require_once __DIR__ . '/header.php';
8
+require_once __DIR__.'/header.php';
9 9
 xoops_cp_header();
10 10
 
11 11
 $op           = (!empty($_GET['op']) ? $_GET['op'] : (!empty($_POST['op']) ? $_POST['op'] : (!empty($_REQUEST['id']) ? 'edit' : 'list')));
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             unset($criteria);
37 37
 
38 38
             $categories[0] = ['cid' => 0, 'name' => _AM_SONGLIST_FIELDS_DEFAULT];
39
-            if (count($category) > 0) {
39
+            if (count($category)>0) {
40 40
                 foreach (array_keys($category) as $i) {
41 41
                     $categories[$category[$i]->getVar('cid')] = ['cid' => $category[$i]->getVar('cid'), 'name' => $category[$i]->getVar('name')];
42 42
                 }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             redirect_header('field.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
142 142
         }
143 143
 
144
-        if (Request::hasVar('field_ids', 'POST') && count($_POST['field_ids']) > 0) {
144
+        if (Request::hasVar('field_ids', 'POST') && count($_POST['field_ids'])>0) {
145 145
             $oldweight     = $_POST['oldweight'];
146 146
             $oldcat        = $_POST['oldcat'];
147 147
             $oldcategories = $_POST['oldcategories'];
@@ -149,25 +149,25 @@  discard block
 block discarded – undo
149 149
             $weight        = $_POST['weight'];
150 150
             $ids           = [];
151 151
             foreach ($_POST['field_ids'] as $field_id) {
152
-                if ($oldweight[$field_id] != $weight[$field_id] || $oldcat[$field_id] != $category[$field_id] || count($oldcategories[$field_id]) != count(array_unique(array_merge($categories[$field_id], $oldcategories[$field_id])))) {
152
+                if ($oldweight[$field_id]!=$weight[$field_id] || $oldcat[$field_id]!=$category[$field_id] || count($oldcategories[$field_id])!=count(array_unique(array_merge($categories[$field_id], $oldcategories[$field_id])))) {
153 153
                     //if field has changed
154
-                    $ids[] = (int)$field_id;
154
+                    $ids[] = (int) $field_id;
155 155
                 }
156 156
             }
157
-            if (count($ids) > 0) {
157
+            if (count($ids)>0) {
158 158
                 $errors = [];
159 159
                 //if there are changed fields, fetch the fieldcategory objects
160 160
                 $fieldHandler = Helper::getInstance()
161 161
                                       ->getHandler('Field');
162
-                $fields       = $fieldHandler->getObjects(new \Criteria('field_id', '(' . implode(',', $ids) . ')', 'IN'), true);
162
+                $fields       = $fieldHandler->getObjects(new \Criteria('field_id', '('.implode(',', $ids).')', 'IN'), true);
163 163
                 foreach ($ids as $i) {
164
-                    $fields[$i]->setVar('field_weight', (int)$weight[$i]);
164
+                    $fields[$i]->setVar('field_weight', (int) $weight[$i]);
165 165
                     $fields[$i]->setVar('cids', $categories[$i]);
166 166
                     if (!$fieldHandler->insert($fields[$i])) {
167 167
                         $errors = array_merge($errors, $fields[$i]->getErrors());
168 168
                     }
169 169
                 }
170
-                if (0 == count($errors)) {
170
+                if (0==count($errors)) {
171 171
                     //no errors
172 172
                     redirect_header('field.php', 2, sprintf(_AM_SONGLIST_FIELDS_SAVEDSUCCESS, _AM_SONGLIST_FIELDS_FIELDS));
173 173
                 } else {
@@ -258,14 +258,14 @@  discard block
 block discarded – undo
258 258
             if ($obj->getVar('field_edit') || $obj->getVar('field_show')) {
259 259
                 $perm_arr[] = 'songlist_search';
260 260
             }
261
-            if (count($perm_arr) > 0) {
261
+            if (count($perm_arr)>0) {
262 262
                 foreach ($perm_arr as $perm) {
263 263
                     $criteria = new \CriteriaCompo(new \Criteria('gperm_name', $perm));
264
-                    $criteria->add(new \Criteria('gperm_itemid', (int)$obj->getVar('field_id')));
265
-                    $criteria->add(new \Criteria('gperm_modid', (int)$GLOBALS['songlistModule']->getVar('mid')));
264
+                    $criteria->add(new \Criteria('gperm_itemid', (int) $obj->getVar('field_id')));
265
+                    $criteria->add(new \Criteria('gperm_modid', (int) $GLOBALS['songlistModule']->getVar('mid')));
266 266
                     if (isset($_REQUEST[$perm]) && is_array($_REQUEST[$perm])) {
267 267
                         $perms = $grouppermHandler->getObjects($criteria);
268
-                        if (count($perms) > 0) {
268
+                        if (count($perms)>0) {
269 269
                             foreach (array_keys($perms) as $i) {
270 270
                                 $groups[$perms[$i]->getVar('gperm_groupid')] = $perms[$i];
271 271
                             }
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
                             $groups = [];
274 274
                         }
275 275
                         foreach ($_REQUEST[$perm] as $grouoid) {
276
-                            $grouoid = (int)$grouoid;
276
+                            $grouoid = (int) $grouoid;
277 277
                             if (!isset($groups[$grouoid])) {
278 278
                                 $perm_obj = $grouppermHandler->create();
279 279
                                 $perm_obj->setVar('gperm_name', $perm);
280
-                                $perm_obj->setVar('gperm_itemid', (int)$obj->getVar('field_id'));
280
+                                $perm_obj->setVar('gperm_itemid', (int) $obj->getVar('field_id'));
281 281
                                 $perm_obj->setVar('gperm_modid', $GLOBALS['songlistModule']->getVar('mid'));
282 282
                                 $perm_obj->setVar('gperm_groupid', $grouoid);
283 283
                                 $grouppermHandler->insert($perm_obj);
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
                             }
286 286
                         }
287 287
                         $removed_groups = array_diff(array_keys($groups), $_REQUEST[$perm]);
288
-                        if (count($removed_groups) > 0) {
289
-                            $criteria->add(new \Criteria('gperm_groupid', '(' . implode(',', $removed_groups) . ')', 'IN'));
288
+                        if (count($removed_groups)>0) {
289
+                            $criteria->add(new \Criteria('gperm_groupid', '('.implode(',', $removed_groups).')', 'IN'));
290 290
                             $grouppermHandler->deleteAll($criteria);
291 291
                         }
292 292
                         unset($groups);
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                     unset($criteria);
297 297
                 }
298 298
             }
299
-            $url = $redirect_to_edit ? 'field.php?op=edit&amp;id=' . $obj->getVar('field_id') : 'field.php';
299
+            $url = $redirect_to_edit ? 'field.php?op=edit&amp;id='.$obj->getVar('field_id') : 'field.php';
300 300
             redirect_header($url, 3, sprintf(_AM_SONGLIST_FIELDS_SAVEDSUCCESS, _AM_SONGLIST_FIELDS_FIELD));
301 301
         }
302 302
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         if (!$obj->getVar('field_config')) {
310 310
             redirect_header('index.php', 2, _AM_SONGLIST_FIELDS_FIELDNOTCONFIGURABLE);
311 311
         }
312
-        if (Request::hasVar('ok', 'REQUEST') && 1 == $_REQUEST['ok']) {
312
+        if (Request::hasVar('ok', 'REQUEST') && 1==$_REQUEST['ok']) {
313 313
             if (!$GLOBALS['xoopsSecurity']->check()) {
314 314
                 redirect_header('field.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
315 315
             }
Please login to merge, or discard this patch.
admin/migrate.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 /** @var Configurator $configurator */
33 33
 /** @var Migrate $migrator */
34 34
 
35
-require __DIR__ . '/admin_header.php';
35
+require __DIR__.'/admin_header.php';
36 36
 xoops_cp_header();
37 37
 
38 38
 $adminObject->displayNavigation(basename(__FILE__));
@@ -74,27 +74,27 @@  discard block
 block discarded – undo
74 74
         if (!empty($queue)) {
75 75
             echo "<pre>\n";
76 76
             foreach ($queue as $line) {
77
-                echo $line . ";\n";
77
+                echo $line.";\n";
78 78
             }
79 79
             echo "</pre>\n";
80 80
         }
81 81
         break;
82 82
     case 'migrate':
83 83
         $migrator->synchronizeSchema();
84
-        $message = constant('CO_' . $moduleDirNameUpper . '_' . 'MIGRATE_OK');
84
+        $message = constant('CO_'.$moduleDirNameUpper.'_'.'MIGRATE_OK');
85 85
         break;
86 86
     case 'schema':
87
-        xoops_confirm(['op' => 'confirmwrite'], 'migrate.php', constant('CO_' . $moduleDirNameUpper . '_' . 'MIGRATE_WARNING'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'));
87
+        xoops_confirm(['op' => 'confirmwrite'], 'migrate.php', constant('CO_'.$moduleDirNameUpper.'_'.'MIGRATE_WARNING'), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'));
88 88
         break;
89 89
     case 'confirmwrite':
90 90
         if ($GLOBALS['xoopsSecurity']->check()) {
91 91
             $migrator->saveCurrentSchema();
92 92
 
93
-            $message = constant('CO_' . $moduleDirNameUpper . '_' . 'MIGRATE_SCHEMA_OK');
93
+            $message = constant('CO_'.$moduleDirNameUpper.'_'.'MIGRATE_SCHEMA_OK');
94 94
         }
95 95
         break;
96 96
 }
97 97
 
98 98
 echo "<div>$message</div>";
99 99
 
100
-require_once __DIR__ . '/admin_footer.php';
100
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/artists.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use XoopsModules\Songlist\ArtistsHandler;
7 7
 use XoopsModules\Songlist\Form\FormController;
8 8
 
9
-require __DIR__ . '/header.php';
9
+require __DIR__.'/header.php';
10 10
 
11 11
 xoops_loadLanguage('admin', 'songlist');
12 12
 
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 $limit  = Request::getInt('limit', 30, 'REQUEST');
18 18
 $start  = Request::getInt('start', 0, 'REQUEST');
19 19
 $order  = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC';
20
-$sort   = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created';
21
-$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1';
20
+$sort   = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created';
21
+$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1';
22 22
 
23 23
 switch ($op) {
24 24
     default:
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
                 $criteria        = $artistsHandler->getFilterCriteria($GLOBALS['filter']);
36 36
                 $ttl             = $artistsHandler->getCount($criteria);
37
-                $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created';
37
+                $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created';
38 38
 
39
-                $pagenav = new \XoopsPageNav($ttl, $GLOBALS['limit'], $GLOBALS['start'], 'start', 'limit=' . $GLOBALS['limit'] . '&sort=' . $GLOBALS['sort'] . '&order=' . $GLOBALS['order'] . '&op=' . $GLOBALS['op'] . '&fct=' . $GLOBALS['fct'] . '&filter=' . $GLOBALS['filter']);
39
+                $pagenav = new \XoopsPageNav($ttl, $GLOBALS['limit'], $GLOBALS['start'], 'start', 'limit='.$GLOBALS['limit'].'&sort='.$GLOBALS['sort'].'&order='.$GLOBALS['order'].'&op='.$GLOBALS['op'].'&fct='.$GLOBALS['fct'].'&filter='.$GLOBALS['filter']);
40 40
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
41 41
 
42 42
                 foreach ($artistsHandler->filterFields() as $id => $key) {
43 43
                     $GLOBALS['xoopsTpl']->assign(
44
-                        \mb_strtolower(str_replace('-', '_', $key) . '_th'),
44
+                        \mb_strtolower(str_replace('-', '_', $key).'_th'),
45 45
                         '<a href="'
46 46
                         . $_SERVER['SCRIPT_NAME']
47 47
                         . '?start='
@@ -51,16 +51,16 @@  discard block
 block discarded – undo
51 51
                         . '&sort='
52 52
                         . $key
53 53
                         . '&order='
54
-                        . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order'])
54
+                        . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order'])
55 55
                         . '&op='
56 56
                         . $GLOBALS['op']
57 57
                         . '&filter='
58 58
                         . $GLOBALS['filter']
59 59
                         . '">'
60
-                        . (defined('_AM_SONGLIST_TH_' . \mb_strtoupper(str_replace('-', '_', $key))) ? constant('_AM_SONGLIST_TH_' . \mb_strtoupper(str_replace('-', '_', $key))) : '_AM_SONGLIST_TH_' . \mb_strtoupper(str_replace('-', '_', $key)))
60
+                        . (defined('_AM_SONGLIST_TH_'.\mb_strtoupper(str_replace('-', '_', $key))) ? constant('_AM_SONGLIST_TH_'.\mb_strtoupper(str_replace('-', '_', $key))) : '_AM_SONGLIST_TH_'.\mb_strtoupper(str_replace('-', '_', $key)))
61 61
                         . '</a>'
62 62
                     );
63
-                    $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $artistsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct']));
63
+                    $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $artistsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct']));
64 64
                 }
65 65
 
66 66
                 $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
                 $criteria->setStart($GLOBALS['start']);
74 74
                 $criteria->setLimit($GLOBALS['limit']);
75
-                $criteria->setSort('`' . $GLOBALS['sort'] . '`');
75
+                $criteria->setSort('`'.$GLOBALS['sort'].'`');
76 76
                 $criteria->setOrder($GLOBALS['order']);
77 77
 
78 78
                 $artistsArray = $artistsHandler->getObjects($criteria, true);
@@ -113,17 +113,17 @@  discard block
 block discarded – undo
113 113
                 $artist->setVars($_POST[$id]);
114 114
 
115 115
                 if (!$id = $artistsHandler->insert($artist)) {
116
-                    redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_FAILEDTOSAVE);
116
+                    redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_FAILEDTOSAVE);
117 117
                     exit(0);
118 118
                 }
119
-                if ('new' === isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']]:'') {
119
+                if ('new'===isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']] : '') {
120 120
                     redirect_header(
121
-                        $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=edit&id=' . $_REQUEST['id'] . '&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'],
121
+                        $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=edit&id='.$_REQUEST['id'].'&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'],
122 122
                         10,
123 123
                         _AM_SONGLIST_MSG_ARTISTS_SAVEDOKEY
124 124
                     );
125 125
                 } else {
126
-                    redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_SAVEDOKEY);
126
+                    redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_SAVEDOKEY);
127 127
                 }
128 128
                 exit(0);
129 129
 
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
                     $artist->setVars($_POST[$id]);
136 136
                     if (!$artistsHandler->insert($artist)) {
137 137
                         redirect_header(
138
-                            $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'],
138
+                            $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'],
139 139
                             10,
140 140
                             _AM_SONGLIST_MSG_ARTISTS_FAILEDTOSAVE
141 141
                         );
142 142
                         exit(0);
143 143
                     }
144 144
                 }
145
-                redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_SAVEDOKEY);
145
+                redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_SAVEDOKEY);
146 146
                 exit(0);
147 147
                 break;
148 148
             case 'delete':
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
                     $artist = $artistsHandler->get($id);
153 153
                     if (!$artistsHandler->delete($artist)) {
154 154
                         redirect_header(
155
-                            $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'],
155
+                            $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'],
156 156
                             10,
157 157
                             _AM_SONGLIST_MSG_ARTISTS_FAILEDTODELETE
158 158
                         );
159 159
                         exit(0);
160 160
                     }
161
-                    redirect_header($_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_DELETED);
161
+                    redirect_header($_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], 10, _AM_SONGLIST_MSG_ARTISTS_DELETED);
162 162
                     exit(0);
163 163
                 }
164 164
                 $artist = $artistsHandler->get(Request::getInt('id', 0, 'REQUEST'));
Please login to merge, or discard this patch.