@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -require_once __DIR__ . '/preloads/autoloader.php'; |
|
3 | +require_once __DIR__.'/preloads/autoloader.php'; |
|
4 | 4 | |
5 | 5 | error_reporting(E_ALL); |
6 | 6 | $moduleDirName = basename(__DIR__); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $modversion['releasedate'] = 'Thursday, 03rd July, 2022'; |
30 | 30 | $modversion['website'] = 'www.chronolabs.coop'; |
31 | 31 | $modversion['release_info'] = 'Stable 2012/08/16'; |
32 | -$modversion['release_file'] = XOOPS_URL . '/modules/songlist/docs/changelog.txt'; |
|
32 | +$modversion['release_file'] = XOOPS_URL.'/modules/songlist/docs/changelog.txt'; |
|
33 | 33 | $modversion['author_realname'] = 'Wishcraft'; |
34 | 34 | $modversion['author_website_url'] = 'https://www.chronolabs.coop'; |
35 | 35 | $modversion['author_website_name'] = 'Chronolabs'; |
@@ -52,18 +52,18 @@ discard block |
||
52 | 52 | |
53 | 53 | // ------------------- Tables ------------------ // |
54 | 54 | $modversion['tables'] = [ |
55 | - $moduleDirName . '_' . 'albums', |
|
56 | - $moduleDirName . '_' . 'artists', |
|
57 | - $moduleDirName . '_' . 'category', |
|
58 | - $moduleDirName . '_' . 'extra', |
|
59 | - $moduleDirName . '_' . 'field', |
|
60 | - $moduleDirName . '_' . 'genre', |
|
61 | - $moduleDirName . '_' . 'voice', |
|
62 | - $moduleDirName . '_' . 'requests', |
|
63 | - $moduleDirName . '_' . 'songs', |
|
64 | - $moduleDirName . '_' . 'utf8map', |
|
65 | - $moduleDirName . '_' . 'visibility', |
|
66 | - $moduleDirName . '_' . 'votes', |
|
55 | + $moduleDirName.'_'.'albums', |
|
56 | + $moduleDirName.'_'.'artists', |
|
57 | + $moduleDirName.'_'.'category', |
|
58 | + $moduleDirName.'_'.'extra', |
|
59 | + $moduleDirName.'_'.'field', |
|
60 | + $moduleDirName.'_'.'genre', |
|
61 | + $moduleDirName.'_'.'voice', |
|
62 | + $moduleDirName.'_'.'requests', |
|
63 | + $moduleDirName.'_'.'songs', |
|
64 | + $moduleDirName.'_'.'utf8map', |
|
65 | + $moduleDirName.'_'.'visibility', |
|
66 | + $moduleDirName.'_'.'votes', |
|
67 | 67 | ]; |
68 | 68 | |
69 | 69 | // Admin things |
@@ -272,20 +272,20 @@ discard block |
||
272 | 272 | 'description' => '_MI_SONGLIST_SALT_DESC', |
273 | 273 | 'formtype' => 'text', |
274 | 274 | 'valuetype' => 'text', |
275 | - 'default' => (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
276 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
277 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
278 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
279 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
280 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
281 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
282 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
283 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
284 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
285 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
286 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
287 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
288 | - . (2 != random_int(0, 4) ? chr(random_int(32, 190)) : ''), |
|
275 | + 'default' => (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
276 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
277 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
278 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
279 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
280 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
281 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
282 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
283 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
284 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
285 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
286 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
287 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : '') |
|
288 | + . (2!=random_int(0, 4) ? chr(random_int(32, 190)) : ''), |
|
289 | 289 | |
290 | 290 | 'options' => [], |
291 | 291 | ]; |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | */ |
528 | 528 | $modversion['config'][] = [ |
529 | 529 | 'name' => 'displaySampleButton', |
530 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
|
531 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
|
530 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', |
|
531 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', |
|
532 | 532 | 'formtype' => 'yesno', |
533 | 533 | 'valuetype' => 'int', |
534 | 534 | 'default' => 1, |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | */ |
540 | 540 | $modversion['config'][] = [ |
541 | 541 | 'name' => 'displayDeveloperTools', |
542 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS', |
|
543 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS_DESC', |
|
542 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_DEV_TOOLS', |
|
543 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_DEV_TOOLS_DESC', |
|
544 | 544 | 'formtype' => 'yesno', |
545 | 545 | 'valuetype' => 'int', |
546 | 546 | 'default' => 0, |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** @var Songs $songs */ |
14 | 14 | |
15 | -require __DIR__ . '/header.php'; |
|
15 | +require __DIR__.'/header.php'; |
|
16 | 16 | |
17 | 17 | xoops_loadLanguage('admin', 'songlist'); |
18 | 18 | |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
24 | 24 | $start = Request::getInt('start', 0, 'REQUEST'); |
25 | 25 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
26 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
27 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
26 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
27 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
28 | 28 | |
29 | 29 | switch ($op) { |
30 | 30 | default: |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | |
41 | 41 | $criteria = $songsHandler->getFilterCriteria($GLOBALS['filter']); |
42 | 42 | $ttl = $songsHandler->getCount($criteria); |
43 | - $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
43 | + $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
44 | 44 | |
45 | - $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']); |
|
45 | + $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']); |
|
46 | 46 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
47 | 47 | |
48 | 48 | foreach ($songsHandler->filterFields() as $id => $key) { |
49 | 49 | $GLOBALS['xoopsTpl']->assign( |
50 | - \mb_strtolower(str_replace('-', '_', $key) . '_th'), |
|
50 | + \mb_strtolower(str_replace('-', '_', $key).'_th'), |
|
51 | 51 | '<a href="' |
52 | 52 | . $_SERVER['SCRIPT_NAME'] |
53 | 53 | . '?start=' |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | . '&sort=' |
58 | 58 | . $key |
59 | 59 | . '&order=' |
60 | - . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
60 | + . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
61 | 61 | . '&op=' |
62 | 62 | . $GLOBALS['op'] |
63 | 63 | . '&filter=' |
64 | 64 | . $GLOBALS['filter'] |
65 | 65 | . '">' |
66 | - . (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))) |
|
66 | + . (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))) |
|
67 | 67 | . '</a>' |
68 | 68 | ); |
69 | - $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $songsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
69 | + $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $songsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $criteria->setStart($GLOBALS['start']); |
80 | 80 | $criteria->setLimit($GLOBALS['limit']); |
81 | - $criteria->setSort('`' . $GLOBALS['sort'] . '`'); |
|
81 | + $criteria->setSort('`'.$GLOBALS['sort'].'`'); |
|
82 | 82 | $criteria->setOrder($GLOBALS['order']); |
83 | 83 | |
84 | 84 | $songss = $songsHandler->getObjects($criteria, true); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | $songs->setVars($_POST[$id]); |
123 | 123 | |
124 | - if (Request::hasVar('mp3' . $id, 'FILES') && !empty($_FILES['mp3' . $id]['title'])) { |
|
124 | + if (Request::hasVar('mp3'.$id, 'FILES') && !empty($_FILES['mp3'.$id]['title'])) { |
|
125 | 125 | // if (!is_dir($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']))) { |
126 | 126 | // foreach (explode('\\', $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])) as $folders) { |
127 | 127 | // foreach (explode('/', $folders) as $folder) { |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | explode('|', $GLOBALS['songlistModuleConfig']['mp3_extensions']) |
144 | 144 | ); |
145 | 145 | try { |
146 | - $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13)); |
|
146 | + $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13)); |
|
147 | 147 | } catch (Exception $e) { |
148 | 148 | } |
149 | 149 | |
150 | - if ($uploader->fetchMedia('mp3' . $id)) { |
|
150 | + if ($uploader->fetchMedia('mp3'.$id)) { |
|
151 | 151 | if (!$uploader->upload()) { |
152 | 152 | $adminObject = Admin::getInstance(); |
153 | 153 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | exit(0); |
157 | 157 | } |
158 | 158 | if (mb_strlen($songs->getVar('mp3'))) { |
159 | - unlink($GLOBALS['xoops']->path($songs->getVar('path')) . basename($songs->getVar('mp3'))); |
|
159 | + unlink($GLOBALS['xoops']->path($songs->getVar('path')).basename($songs->getVar('mp3'))); |
|
160 | 160 | } |
161 | 161 | |
162 | - $songs->setVar('mp3', XOOPS_URL . '/' . str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']) . $uploader->getSavedFileName()); |
|
162 | + $songs->setVar('mp3', XOOPS_URL.'/'.str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']).$uploader->getSavedFileName()); |
|
163 | 163 | } else { |
164 | 164 | $adminObject = Admin::getInstance(); |
165 | 165 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | } |
171 | 171 | if (!$id = $songsHandler->insert($songs)) { |
172 | - 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); |
|
172 | + 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); |
|
173 | 173 | exit(0); |
174 | 174 | } |
175 | 175 | $extra = $extrasHandler->get($id); |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | $extra->setVar('sid', $id); |
178 | 178 | $extrasHandler->insert($extra); |
179 | 179 | |
180 | - if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) { |
|
180 | + if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH.'/modules/tag/class/tag.php')) { |
|
181 | 181 | $tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag'); |
182 | 182 | $tagHandler->updateByItem($_POST['tags'], $id, $GLOBALS['songlistModule']->getVar('dirname'), $songs->getVar('cid')); |
183 | 183 | } |
184 | 184 | |
185 | - if ('new' === isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']]:'') { |
|
185 | + if ('new'===isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']] : '') { |
|
186 | 186 | redirect_header( |
187 | - $_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'], |
|
187 | + $_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'], |
|
188 | 188 | 10, |
189 | 189 | _AM_SONGLIST_MSG_SONGS_SAVEDOKEY |
190 | 190 | ); |
191 | 191 | } else { |
192 | - 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); |
|
192 | + 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); |
|
193 | 193 | } |
194 | 194 | exit(0); |
195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | foreach ($_REQUEST['id'] as $id) { |
202 | 202 | $songs = $songsHandler->get($id); |
203 | 203 | $songs->setVars($_POST[$id]); |
204 | - if (Request::hasVar('mp3' . $id, 'FILES') && !empty($_FILES['mp3' . $id]['title'])) { |
|
204 | + if (Request::hasVar('mp3'.$id, 'FILES') && !empty($_FILES['mp3'.$id]['title'])) { |
|
205 | 205 | // if (!is_dir($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']))) { |
206 | 206 | // foreach (explode('\\', $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])) as $folders) { |
207 | 207 | // foreach (explode('/', $folders) as $folder) { |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | explode('|', $GLOBALS['songlistModuleConfig']['mp3_extensions']) |
224 | 224 | ); |
225 | 225 | try { |
226 | - $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13)); |
|
226 | + $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13)); |
|
227 | 227 | } catch (Exception $e) { |
228 | 228 | } |
229 | 229 | |
230 | - if ($uploader->fetchMedia('mp3' . $id)) { |
|
230 | + if ($uploader->fetchMedia('mp3'.$id)) { |
|
231 | 231 | if (!$uploader->upload()) { |
232 | 232 | $adminObject = Admin::getInstance(); |
233 | 233 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | exit(0); |
237 | 237 | } |
238 | 238 | if (mb_strlen($songs->getVar('mp3'))) { |
239 | - unlink($GLOBALS['xoops']->path($songs->getVar('path')) . basename($songs->getVar('mp3'))); |
|
239 | + unlink($GLOBALS['xoops']->path($songs->getVar('path')).basename($songs->getVar('mp3'))); |
|
240 | 240 | } |
241 | 241 | |
242 | - $songs->setVar('mp3', XOOPS_URL . '/' . str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']) . $uploader->getSavedFileName()); |
|
242 | + $songs->setVar('mp3', XOOPS_URL.'/'.str_replace(DS, '/', $GLOBALS['songlistModuleConfig']['upload_areas']).$uploader->getSavedFileName()); |
|
243 | 243 | } else { |
244 | 244 | $adminObject = Admin::getInstance(); |
245 | 245 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | } |
251 | 251 | if (!$songsHandler->insert($songs)) { |
252 | 252 | redirect_header( |
253 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
253 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
254 | 254 | 10, |
255 | 255 | _AM_SONGLIST_MSG_SONGS_FAILEDTOSAVE |
256 | 256 | ); |
257 | 257 | exit(0); |
258 | 258 | } |
259 | 259 | } |
260 | - 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); |
|
260 | + 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); |
|
261 | 261 | exit(0); |
262 | 262 | break; |
263 | 263 | case 'delete': |
@@ -267,13 +267,13 @@ discard block |
||
267 | 267 | $songs = $songsHandler->get($id); |
268 | 268 | if (!$songsHandler->delete($songs)) { |
269 | 269 | redirect_header( |
270 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
270 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
271 | 271 | 10, |
272 | 272 | _AM_SONGLIST_MSG_SONGS_FAILEDTODELETE |
273 | 273 | ); |
274 | 274 | exit(0); |
275 | 275 | } |
276 | - 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); |
|
276 | + 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); |
|
277 | 277 | exit(0); |
278 | 278 | } |
279 | 279 | $songs = $songsHandler->get(Request::getInt('id', 0, 'REQUEST')); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** @var Artists $artist */ |
13 | 13 | |
14 | -require __DIR__ . '/header.php'; |
|
14 | +require __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | xoops_loadLanguage('admin', 'songlist'); |
17 | 17 | |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
23 | 23 | $start = Request::getInt('start', 0, 'REQUEST'); |
24 | 24 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
25 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
26 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
25 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
26 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
27 | 27 | |
28 | 28 | switch ($op) { |
29 | 29 | default: |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | |
40 | 40 | $criteria = $artistsHandler->getFilterCriteria($GLOBALS['filter']); |
41 | 41 | $ttl = $artistsHandler->getCount($criteria); |
42 | - $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
42 | + $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
43 | 43 | |
44 | - $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']); |
|
44 | + $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']); |
|
45 | 45 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
46 | 46 | |
47 | 47 | foreach ($artistsHandler->filterFields() as $id => $key) { |
48 | 48 | $GLOBALS['xoopsTpl']->assign( |
49 | - \mb_strtolower(str_replace('-', '_', $key) . '_th'), |
|
49 | + \mb_strtolower(str_replace('-', '_', $key).'_th'), |
|
50 | 50 | '<a href="' |
51 | 51 | . $_SERVER['SCRIPT_NAME'] |
52 | 52 | . '?start=' |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | . '&sort=' |
57 | 57 | . $key |
58 | 58 | . '&order=' |
59 | - . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
59 | + . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
60 | 60 | . '&op=' |
61 | 61 | . $GLOBALS['op'] |
62 | 62 | . '&filter=' |
63 | 63 | . $GLOBALS['filter'] |
64 | 64 | . '">' |
65 | - . (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))) |
|
65 | + . (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))) |
|
66 | 66 | . '</a>' |
67 | 67 | ); |
68 | - $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $artistsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
68 | + $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $artistsHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $criteria->setStart($GLOBALS['start']); |
79 | 79 | $criteria->setLimit($GLOBALS['limit']); |
80 | - $criteria->setSort('`' . $GLOBALS['sort'] . '`'); |
|
80 | + $criteria->setSort('`'.$GLOBALS['sort'].'`'); |
|
81 | 81 | $criteria->setOrder($GLOBALS['order']); |
82 | 82 | |
83 | 83 | $artistsArray = $artistsHandler->getObjects($criteria, true); |
@@ -118,17 +118,17 @@ discard block |
||
118 | 118 | $artist->setVars($_POST[$id]); |
119 | 119 | |
120 | 120 | if (!$id = $artistsHandler->insert($artist)) { |
121 | - 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); |
|
121 | + 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); |
|
122 | 122 | exit(0); |
123 | 123 | } |
124 | - if ('new' === isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']]:'') { |
|
124 | + if ('new'===isset($_REQUEST['state']) ? $_REQUEST['state'][$_REQUEST['id']] : '') { |
|
125 | 125 | redirect_header( |
126 | - $_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'], |
|
126 | + $_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'], |
|
127 | 127 | 10, |
128 | 128 | _AM_SONGLIST_MSG_ARTISTS_SAVEDOKEY |
129 | 129 | ); |
130 | 130 | } else { |
131 | - 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); |
|
131 | + 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); |
|
132 | 132 | } |
133 | 133 | exit(0); |
134 | 134 | |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | $artist->setVars($_POST[$id]); |
141 | 141 | if (!$artistsHandler->insert($artist)) { |
142 | 142 | redirect_header( |
143 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
143 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
144 | 144 | 10, |
145 | 145 | _AM_SONGLIST_MSG_ARTISTS_FAILEDTOSAVE |
146 | 146 | ); |
147 | 147 | exit(0); |
148 | 148 | } |
149 | 149 | } |
150 | - 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); |
|
150 | + 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); |
|
151 | 151 | exit(0); |
152 | 152 | break; |
153 | 153 | case 'delete': |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | $artist = $artistsHandler->get($id); |
158 | 158 | if (!$artistsHandler->delete($artist)) { |
159 | 159 | redirect_header( |
160 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
160 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
161 | 161 | 10, |
162 | 162 | _AM_SONGLIST_MSG_ARTISTS_FAILEDTODELETE |
163 | 163 | ); |
164 | 164 | exit(0); |
165 | 165 | } |
166 | - 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); |
|
166 | + 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); |
|
167 | 167 | exit(0); |
168 | 168 | } |
169 | 169 | $artist = $artistsHandler->get(Request::getInt('id', 0, 'REQUEST')); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** @var Utf8map $utf8map */ |
13 | 13 | |
14 | -require __DIR__ . '/header.php'; |
|
14 | +require __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | xoops_loadLanguage('admin', 'songlist'); |
17 | 17 | |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
23 | 23 | $start = Request::getInt('start', 0, 'REQUEST'); |
24 | 24 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
25 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
26 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
25 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
26 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
27 | 27 | |
28 | 28 | switch ($op) { |
29 | 29 | default: |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | |
40 | 40 | $criteria = $utf8mapHandler->getFilterCriteria($GLOBALS['filter']); |
41 | 41 | $ttl = $utf8mapHandler->getCount($criteria); |
42 | - $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
42 | + $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
43 | 43 | |
44 | - $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']); |
|
44 | + $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']); |
|
45 | 45 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
46 | 46 | |
47 | 47 | foreach ($utf8mapHandler->filterFields() as $id => $key) { |
48 | 48 | $GLOBALS['xoopsTpl']->assign( |
49 | - \mb_strtolower(str_replace('-', '_', $key) . '_th'), |
|
49 | + \mb_strtolower(str_replace('-', '_', $key).'_th'), |
|
50 | 50 | '<a href="' |
51 | 51 | . $_SERVER['SCRIPT_NAME'] |
52 | 52 | . '?start=' |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | . '&sort=' |
57 | 57 | . $key |
58 | 58 | . '&order=' |
59 | - . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
59 | + . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
60 | 60 | . '&op=' |
61 | 61 | . $GLOBALS['op'] |
62 | 62 | . '&filter=' |
63 | 63 | . $GLOBALS['filter'] |
64 | 64 | . '">' |
65 | - . (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))) |
|
65 | + . (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))) |
|
66 | 66 | . '</a>' |
67 | 67 | ); |
68 | - $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $utf8mapHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
68 | + $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $utf8mapHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $criteria->setStart($GLOBALS['start']); |
79 | 79 | $criteria->setLimit($GLOBALS['limit']); |
80 | - $criteria->setSort('`' . $GLOBALS['sort'] . '`'); |
|
80 | + $criteria->setSort('`'.$GLOBALS['sort'].'`'); |
|
81 | 81 | $criteria->setOrder($GLOBALS['order']); |
82 | 82 | |
83 | 83 | $utf8maps = $utf8mapHandler->getObjects($criteria, true); |
@@ -118,17 +118,17 @@ discard block |
||
118 | 118 | $utf8map->setVars($_POST[$id]); |
119 | 119 | |
120 | 120 | if (!$id = $utf8mapHandler->insert($utf8map)) { |
121 | - 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_UTF8MAP_FAILEDTOSAVE); |
|
121 | + 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_UTF8MAP_FAILEDTOSAVE); |
|
122 | 122 | exit(0); |
123 | 123 | } |
124 | - if ('new' === $_REQUEST['state'][$_REQUEST['id']]) { |
|
124 | + if ('new'===$_REQUEST['state'][$_REQUEST['id']]) { |
|
125 | 125 | redirect_header( |
126 | - $_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'], |
|
126 | + $_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'], |
|
127 | 127 | 10, |
128 | 128 | _AM_SONGLIST_MSG_UTF8MAP_SAVEDOKEY |
129 | 129 | ); |
130 | 130 | } else { |
131 | - 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_UTF8MAP_SAVEDOKEY); |
|
131 | + 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_UTF8MAP_SAVEDOKEY); |
|
132 | 132 | } |
133 | 133 | exit(0); |
134 | 134 | |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | $utf8map->setVars($_POST[$id]); |
141 | 141 | if (!$utf8mapHandler->insert($utf8map)) { |
142 | 142 | redirect_header( |
143 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
143 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
144 | 144 | 10, |
145 | 145 | _AM_SONGLIST_MSG_UTF8MAP_FAILEDTOSAVE |
146 | 146 | ); |
147 | 147 | exit(0); |
148 | 148 | } |
149 | 149 | } |
150 | - 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_UTF8MAP_SAVEDOKEY); |
|
150 | + 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_UTF8MAP_SAVEDOKEY); |
|
151 | 151 | exit(0); |
152 | 152 | break; |
153 | 153 | case 'delete': |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | $utf8map = $utf8mapHandler->get($id); |
158 | 158 | if (!$utf8mapHandler->delete($utf8map)) { |
159 | 159 | redirect_header( |
160 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
160 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
161 | 161 | 10, |
162 | 162 | _AM_SONGLIST_MSG_UTF8MAP_FAILEDTODELETE |
163 | 163 | ); |
164 | 164 | exit(0); |
165 | 165 | } |
166 | - 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_UTF8MAP_DELETED); |
|
166 | + 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_UTF8MAP_DELETED); |
|
167 | 167 | exit(0); |
168 | 168 | } |
169 | 169 | $utf8map = $utf8mapHandler->get(Request::getInt('id', 0, 'REQUEST')); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use XoopsModules\Songlist\AlbumsHandler; |
8 | 8 | use XoopsModules\Songlist\Form\FormController; |
9 | 9 | |
10 | -require __DIR__ . '/header.php'; |
|
10 | +require __DIR__.'/header.php'; |
|
11 | 11 | |
12 | 12 | xoops_loadLanguage('admin', 'songlist'); |
13 | 13 | |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
19 | 19 | $start = Request::getInt('start', 0, 'REQUEST'); |
20 | 20 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
21 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
22 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
21 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
22 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
23 | 23 | |
24 | 24 | $albumsHandler = Helper::getInstance()->getHandler('Albums'); |
25 | 25 | $songsHandler = Helper::getInstance()->getHandler('Songs'); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | default: |
35 | 35 | case 'actiona': |
36 | 36 | if (Request::hasVar('xmlfile', 'SESSION')) { |
37 | - redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $_SESSION['xmlfile'] . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
37 | + redirect_header($_SERVER['SCRIPT_NAME'].'?file='.$_SESSION['xmlfile'].'&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
38 | 38 | } |
39 | 39 | $adminObject = Admin::getInstance(); |
40 | 40 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -61,27 +61,27 @@ discard block |
||
61 | 61 | $uploader = new Uploader( |
62 | 62 | $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']), |
63 | 63 | ['application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity', 'text/xml xml xsl', 'text/xml-external-parsed-entity'], |
64 | - 1024 * 1024 * 32, |
|
64 | + 1024*1024*32, |
|
65 | 65 | 0, |
66 | 66 | 0, |
67 | 67 | ['xml'] |
68 | 68 | ); |
69 | 69 | try { |
70 | - $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13)); |
|
70 | + $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13)); |
|
71 | 71 | } catch (Exception $e) { |
72 | 72 | } |
73 | 73 | |
74 | 74 | if ($uploader->fetchMedia('xmlfile')) { |
75 | 75 | if (!$uploader->upload()) { |
76 | 76 | echo $uploader->getErrors(); |
77 | - require __DIR__ . '/admin_footer.php'; |
|
77 | + require __DIR__.'/admin_footer.php'; |
|
78 | 78 | exit(0); |
79 | 79 | } |
80 | 80 | $_SESSION['xmlfile'] = $uploader->getSavedFileName(); |
81 | - redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $uploader->getSavedFileName() . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
81 | + redirect_header($_SERVER['SCRIPT_NAME'].'?file='.$uploader->getSavedFileName().'&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
82 | 82 | } else { |
83 | 83 | echo $uploader->getErrors(); |
84 | - require __DIR__ . '/admin_footer.php'; |
|
84 | + require __DIR__.'/admin_footer.php'; |
|
85 | 85 | exit(0); |
86 | 86 | } |
87 | 87 | } |
@@ -96,22 +96,22 @@ discard block |
||
96 | 96 | break; |
97 | 97 | case 'import': |
98 | 98 | |
99 | - $filesize = filesize($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])); |
|
100 | - $mb = floor($filesize / 1024 / 1024); |
|
101 | - if ($mb > 32) { |
|
102 | - ini_set('memory_limit', ($mb + 128) . 'M'); |
|
99 | + $filesize = filesize($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'].$_SESSION['xmlfile'])); |
|
100 | + $mb = floor($filesize/1024/1024); |
|
101 | + if ($mb>32) { |
|
102 | + ini_set('memory_limit', ($mb+128).'M'); |
|
103 | 103 | } |
104 | 104 | set_time_limit(3600); |
105 | 105 | |
106 | - $xmlarray = Utility::xml2array(file_get_contents($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])), false, 'tag'); |
|
106 | + $xmlarray = Utility::xml2array(file_get_contents($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'].$_SESSION['xmlfile'])), false, 'tag'); |
|
107 | 107 | |
108 | - if (mb_strlen($_POST['collection']) > 0) { |
|
108 | + if (mb_strlen($_POST['collection'])>0) { |
|
109 | 109 | foreach ($xmlarray[$_POST['collection']] as $id => $record) { |
110 | 110 | foreach ($record as $recid => $data) { |
111 | 111 | $gid = 0; |
112 | - if (mb_strlen($_POST['genre']) > 0 && !empty($data[$_POST['genre']])) { |
|
112 | + if (mb_strlen($_POST['genre'])>0 && !empty($data[$_POST['genre']])) { |
|
113 | 113 | $criteria = new \Criteria('name', $data[$_POST['genre']]); |
114 | - if ($genreHandler->getCount($criteria) > 0) { |
|
114 | + if ($genreHandler->getCount($criteria)>0) { |
|
115 | 115 | $objects = $genreHandler->getObjects($criteria, false); |
116 | 116 | $gid = $objects[0]->getVar('gid'); |
117 | 117 | } else { |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | $vid = 0; |
125 | - if (mb_strlen($_POST['voice']) > 0 && !empty($data[$_POST['voice']])) { |
|
125 | + if (mb_strlen($_POST['voice'])>0 && !empty($data[$_POST['voice']])) { |
|
126 | 126 | $criteria = new \Criteria('name', $data[$_POST['voice']]); |
127 | - if ($voiceHandler->getCount($criteria) > 0) { |
|
127 | + if ($voiceHandler->getCount($criteria)>0) { |
|
128 | 128 | $objects = $voiceHandler->getObjects($criteria, false); |
129 | 129 | $gid = $objects[0]->getVar('vid'); |
130 | 130 | } else { |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | $cid = 0; |
138 | - if (mb_strlen($_POST['category']) > 0 && !empty($data[$_POST['category']])) { |
|
138 | + if (mb_strlen($_POST['category'])>0 && !empty($data[$_POST['category']])) { |
|
139 | 139 | $criteria = new \Criteria('name', $data[$_POST['category']]); |
140 | - if ($categoryHandler->getCount($criteria) > 0) { |
|
140 | + if ($categoryHandler->getCount($criteria)>0) { |
|
141 | 141 | $objects = $categoryHandler->getObjects($criteria, false); |
142 | 142 | $cid = $objects[0]->getVar('cid'); |
143 | 143 | } else { |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | $aids = []; |
150 | - if (mb_strlen($_POST['artist']) > 0 && !empty($data[$_POST['artist']])) { |
|
150 | + if (mb_strlen($_POST['artist'])>0 && !empty($data[$_POST['artist']])) { |
|
151 | 151 | foreach (explode(',', $data[$_POST['artist']]) as $artist) { |
152 | 152 | $criteria = new \Criteria('name', $artist); |
153 | - if ($artistsHandler->getCount($criteria) > 0) { |
|
153 | + if ($artistsHandler->getCount($criteria)>0) { |
|
154 | 154 | $objects = $artistsHandler->getObjects($criteria, false); |
155 | 155 | $aids[$objects[0]->getVar('aid')] = $objects[0]->getVar('aid'); |
156 | 156 | } else { |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | $abid = 0; |
174 | - if (mb_strlen($_POST['album']) > 0 && !empty($data[$_POST['album']])) { |
|
174 | + if (mb_strlen($_POST['album'])>0 && !empty($data[$_POST['album']])) { |
|
175 | 175 | $criteria = new \Criteria('name', $data[$_POST['album']]); |
176 | - if ($albumsHandler->getCount($criteria) > 0) { |
|
176 | + if ($albumsHandler->getCount($criteria)>0) { |
|
177 | 177 | $objects = $albumsHandler->getObjects($criteria, false); |
178 | 178 | $abid = $objects[0]->getVar('aid'); |
179 | 179 | } else { |
@@ -185,30 +185,30 @@ discard block |
||
185 | 185 | } |
186 | 186 | } |
187 | 187 | $sid = 0; |
188 | - if (mb_strlen($_POST['songid']) > 0 && !empty($data[$_POST['songid']])) { |
|
188 | + if (mb_strlen($_POST['songid'])>0 && !empty($data[$_POST['songid']])) { |
|
189 | 189 | $criteria = new \Criteria('songid', $data[$_POST['songid']]); |
190 | - if ($songsHandler->getCount($criteria) > 0) { |
|
190 | + if ($songsHandler->getCount($criteria)>0) { |
|
191 | 191 | $objects = $songsHandler->getObjects($criteria, false); |
192 | 192 | $object = $objects[0]->getVar('sid'); |
193 | 193 | } else { |
194 | 194 | $object = $songsHandler->create(); |
195 | 195 | } |
196 | - if ($object->getVar('cid') > 0 && $cid > 0) { |
|
196 | + if ($object->getVar('cid')>0 && $cid>0) { |
|
197 | 197 | $object->setVar('cid', $cid); |
198 | 198 | } else { |
199 | 199 | $object->setVar('cid', $cid); |
200 | 200 | } |
201 | - if ($object->getVar('gid') > 0 && $gid > 0) { |
|
201 | + if ($object->getVar('gid')>0 && $gid>0) { |
|
202 | 202 | $object->setVar('gid', $gid); |
203 | 203 | } else { |
204 | 204 | $object->setVar('gid', $gid); |
205 | 205 | } |
206 | - if (count($object->getVar('aids')) > 0 && count($aids) > 0) { |
|
206 | + if (count($object->getVar('aids'))>0 && count($aids)>0) { |
|
207 | 207 | $object->setVar('aids', $aids); |
208 | 208 | } else { |
209 | 209 | $object->setVar('aids', $aids); |
210 | 210 | } |
211 | - if ($object->getVar('abid') > 0 && $abid > 0) { |
|
211 | + if ($object->getVar('abid')>0 && $abid>0) { |
|
212 | 212 | $object->setVar('abid', $abid); |
213 | 213 | } else { |
214 | 214 | $object->setVar('abid', $abid); |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | } else { |
224 | 224 | foreach ($xmlarray as $recid => $data) { |
225 | 225 | $gid = 0; |
226 | - if (mb_strlen($_POST['genre']) > 0 && !empty($data[$_POST['genre']])) { |
|
226 | + if (mb_strlen($_POST['genre'])>0 && !empty($data[$_POST['genre']])) { |
|
227 | 227 | $criteria = new \Criteria('name', $data[$_POST['genre']]); |
228 | - if ($genreHandler->getCount($criteria) > 0) { |
|
228 | + if ($genreHandler->getCount($criteria)>0) { |
|
229 | 229 | $objects = $genreHandler->getObjects($criteria, false); |
230 | 230 | $gid = $objects[0]->getVar('gid'); |
231 | 231 | } else { |
@@ -235,9 +235,9 @@ discard block |
||
235 | 235 | } |
236 | 236 | } |
237 | 237 | $vid = 0; |
238 | - if (mb_strlen($_POST['voice']) > 0 && !empty($data[$_POST['voice']])) { |
|
238 | + if (mb_strlen($_POST['voice'])>0 && !empty($data[$_POST['voice']])) { |
|
239 | 239 | $criteria = new \Criteria('name', $data[$_POST['voice']]); |
240 | - if ($voiceHandler->getCount($criteria) > 0) { |
|
240 | + if ($voiceHandler->getCount($criteria)>0) { |
|
241 | 241 | $objects = $voiceHandler->getObjects($criteria, false); |
242 | 242 | $gid = $objects[0]->getVar('vid'); |
243 | 243 | } else { |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | } |
248 | 248 | } |
249 | 249 | $cid = 0; |
250 | - if (mb_strlen($_POST['category']) > 0 && !empty($data[$_POST['category']])) { |
|
250 | + if (mb_strlen($_POST['category'])>0 && !empty($data[$_POST['category']])) { |
|
251 | 251 | $criteria = new \Criteria('name', $data[$_POST['category']]); |
252 | - if ($categoryHandler->getCount($criteria) > 0) { |
|
252 | + if ($categoryHandler->getCount($criteria)>0) { |
|
253 | 253 | $objects = $categoryHandler->getObjects($criteria, false); |
254 | 254 | $cid = $objects[0]->getVar('cid'); |
255 | 255 | } else { |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | } |
260 | 260 | } |
261 | 261 | $aids = []; |
262 | - if (mb_strlen($_POST['artist']) > 0 && !empty($data[$_POST['artist']])) { |
|
262 | + if (mb_strlen($_POST['artist'])>0 && !empty($data[$_POST['artist']])) { |
|
263 | 263 | foreach (explode(',', $data[$_POST['artist']]) as $artist) { |
264 | 264 | $criteria = new \Criteria('name', $artist); |
265 | - if ($artistsHandler->getCount($criteria) > 0) { |
|
265 | + if ($artistsHandler->getCount($criteria)>0) { |
|
266 | 266 | $objects = $artistsHandler->getObjects($criteria, false); |
267 | 267 | $aids[$objects[0]->getVar('aid')] = $objects[0]->getVar('aid'); |
268 | 268 | } else { |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | } |
284 | 284 | } |
285 | 285 | $abid = 0; |
286 | - if (mb_strlen($_POST['album']) > 0 && !empty($data[$_POST['album']])) { |
|
286 | + if (mb_strlen($_POST['album'])>0 && !empty($data[$_POST['album']])) { |
|
287 | 287 | $criteria = new \Criteria('name', $data[$_POST['album']]); |
288 | - if ($albumsHandler->getCount($criteria) > 0) { |
|
288 | + if ($albumsHandler->getCount($criteria)>0) { |
|
289 | 289 | $objects = $albumsHandler->getObjects($criteria, false); |
290 | 290 | $abid = $objects[0]->getVar('aid'); |
291 | 291 | } else { |
@@ -297,30 +297,30 @@ discard block |
||
297 | 297 | } |
298 | 298 | } |
299 | 299 | $sid = 0; |
300 | - if (mb_strlen($_POST['songid']) > 0 && !empty($data[$_POST['songid']])) { |
|
300 | + if (mb_strlen($_POST['songid'])>0 && !empty($data[$_POST['songid']])) { |
|
301 | 301 | $criteria = new \Criteria('songid', $data[$_POST['songid']]); |
302 | - if ($songsHandler->getCount($criteria) > 0) { |
|
302 | + if ($songsHandler->getCount($criteria)>0) { |
|
303 | 303 | $objects = $songsHandler->getObjects($criteria, false); |
304 | 304 | $object = $objects[0]->getVar('sid'); |
305 | 305 | } else { |
306 | 306 | $object = $songsHandler->create(); |
307 | 307 | } |
308 | - if ($object->getVar('cid') > 0 && $cid > 0) { |
|
308 | + if ($object->getVar('cid')>0 && $cid>0) { |
|
309 | 309 | $object->setVar('cid', $cid); |
310 | 310 | } else { |
311 | 311 | $object->setVar('cid', $cid); |
312 | 312 | } |
313 | - if ($object->getVar('gid') > 0 && $gid > 0) { |
|
313 | + if ($object->getVar('gid')>0 && $gid>0) { |
|
314 | 314 | $object->setVar('gid', $gid); |
315 | 315 | } else { |
316 | 316 | $object->setVar('gid', $gid); |
317 | 317 | } |
318 | - if (count($object->getVar('aids')) > 0 && count($aids) > 0) { |
|
318 | + if (count($object->getVar('aids'))>0 && count($aids)>0) { |
|
319 | 319 | $object->setVar('aids', $aids); |
320 | 320 | } else { |
321 | 321 | $object->setVar('aids', $aids); |
322 | 322 | } |
323 | - if ($object->getVar('abid') > 0 && $abid > 0) { |
|
323 | + if ($object->getVar('abid')>0 && $abid>0) { |
|
324 | 324 | $object->setVar('abid', $abid); |
325 | 325 | } else { |
326 | 326 | $object->setVar('abid', $abid); |
@@ -332,9 +332,9 @@ discard block |
||
332 | 332 | } |
333 | 333 | } |
334 | 334 | } |
335 | - unlink($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])); |
|
335 | + unlink($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'].$_SESSION['xmlfile'])); |
|
336 | 336 | unset($_SESSION['xmlfile']); |
337 | - redirect_header($_SERVER['SCRIPT_NAME'] . '&op=import&fct=actiona', 10, _AM_SONGLIST_XMLFILE_COMPLETE); |
|
337 | + redirect_header($_SERVER['SCRIPT_NAME'].'&op=import&fct=actiona', 10, _AM_SONGLIST_XMLFILE_COMPLETE); |
|
338 | 338 | break; |
339 | 339 | } |
340 | 340 | break; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** @var Category $category */ |
14 | 14 | |
15 | -require __DIR__ . '/header.php'; |
|
15 | +require __DIR__.'/header.php'; |
|
16 | 16 | |
17 | 17 | xoops_loadLanguage('admin', 'songlist'); |
18 | 18 | |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
24 | 24 | $start = Request::getInt('start', 0, 'REQUEST'); |
25 | 25 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
26 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
27 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
26 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
27 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
28 | 28 | |
29 | 29 | switch ($op) { |
30 | 30 | default: |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | |
41 | 41 | $criteria = $categoryHandler->getFilterCriteria($GLOBALS['filter']); |
42 | 42 | $ttl = $categoryHandler->getCount($criteria); |
43 | - $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
43 | + $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
44 | 44 | |
45 | - $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']); |
|
45 | + $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']); |
|
46 | 46 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
47 | 47 | |
48 | 48 | foreach ($categoryHandler->filterFields() as $id => $key) { |
49 | 49 | $GLOBALS['xoopsTpl']->assign( |
50 | - \mb_strtolower(str_replace('-', '_', $key) . '_th'), |
|
50 | + \mb_strtolower(str_replace('-', '_', $key).'_th'), |
|
51 | 51 | '<a href="' |
52 | 52 | . $_SERVER['SCRIPT_NAME'] |
53 | 53 | . '?start=' |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | . '&sort=' |
58 | 58 | . $key |
59 | 59 | . '&order=' |
60 | - . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
60 | + . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
61 | 61 | . '&op=' |
62 | 62 | . $GLOBALS['op'] |
63 | 63 | . '&filter=' |
64 | 64 | . $GLOBALS['filter'] |
65 | 65 | . '">' |
66 | - . (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))) |
|
66 | + . (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))) |
|
67 | 67 | . '</a>' |
68 | 68 | ); |
69 | - $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $categoryHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
69 | + $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $categoryHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $criteria->setStart($GLOBALS['start']); |
80 | 80 | $criteria->setLimit($GLOBALS['limit']); |
81 | - $criteria->setSort('`' . $GLOBALS['sort'] . '`'); |
|
81 | + $criteria->setSort('`'.$GLOBALS['sort'].'`'); |
|
82 | 82 | $criteria->setOrder($GLOBALS['order']); |
83 | 83 | |
84 | 84 | $categorys = $categoryHandler->getObjects($criteria, true); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $category->setVars($_POST[$id]); |
120 | 120 | |
121 | 121 | if (!$id = $categoryHandler->insert($category)) { |
122 | - 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_CATEGORY_FAILEDTOSAVE); |
|
122 | + 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_CATEGORY_FAILEDTOSAVE); |
|
123 | 123 | exit(0); |
124 | 124 | } |
125 | 125 | if (Request::hasVar('image', 'FILES') && !empty($_FILES['image']['name'])) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | explode('|', $GLOBALS['songlistModuleConfig']['allowed_extensions']) |
146 | 146 | ); |
147 | 147 | try { |
148 | - $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13)); |
|
148 | + $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13)); |
|
149 | 149 | } catch (Exception $e) { |
150 | 150 | } |
151 | 151 | |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | $adminObject = Admin::getInstance(); |
155 | 155 | $adminObject->displayNavigation(basename(__FILE__)); |
156 | 156 | echo $uploader->getErrors(); |
157 | - require __DIR__ . '/admin_footer.php'; |
|
157 | + require __DIR__.'/admin_footer.php'; |
|
158 | 158 | exit(0); |
159 | 159 | } |
160 | 160 | if (mb_strlen($category->getVar('image'))) { |
161 | - unlink($GLOBALS['xoops']->path($category->getVar('path')) . $category->getVar('image')); |
|
161 | + unlink($GLOBALS['xoops']->path($category->getVar('path')).$category->getVar('image')); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $category->setVar('path', $GLOBALS['songlistModuleConfig']['upload_areas']); |
@@ -168,19 +168,19 @@ discard block |
||
168 | 168 | $adminObject = Admin::getInstance(); |
169 | 169 | $adminObject->displayNavigation(basename(__FILE__)); |
170 | 170 | echo $uploader->getErrors(); |
171 | - require __DIR__ . '/admin_footer.php'; |
|
171 | + require __DIR__.'/admin_footer.php'; |
|
172 | 172 | exit(0); |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - if ('new' === $_REQUEST['state'][$_REQUEST['id']]) { |
|
176 | + if ('new'===$_REQUEST['state'][$_REQUEST['id']]) { |
|
177 | 177 | redirect_header( |
178 | - $_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'], |
|
178 | + $_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'], |
|
179 | 179 | 10, |
180 | 180 | _AM_SONGLIST_MSG_CATEGORY_SAVEDOKEY |
181 | 181 | ); |
182 | 182 | } else { |
183 | - 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_CATEGORY_SAVEDOKEY); |
|
183 | + 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_CATEGORY_SAVEDOKEY); |
|
184 | 184 | } |
185 | 185 | exit(0); |
186 | 186 | |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | $category->setVars($_POST[$id]); |
193 | 193 | if (!$categoryHandler->insert($category)) { |
194 | 194 | redirect_header( |
195 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
195 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
196 | 196 | 10, |
197 | 197 | _AM_SONGLIST_MSG_CATEGORY_FAILEDTOSAVE |
198 | 198 | ); |
199 | 199 | exit(0); |
200 | 200 | } |
201 | 201 | } |
202 | - 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_CATEGORY_SAVEDOKEY); |
|
202 | + 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_CATEGORY_SAVEDOKEY); |
|
203 | 203 | exit(0); |
204 | 204 | break; |
205 | 205 | case 'delete': |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | $category = $categoryHandler->get($id); |
210 | 210 | if (!$categoryHandler->delete($category)) { |
211 | 211 | redirect_header( |
212 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
212 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
213 | 213 | 10, |
214 | 214 | _AM_SONGLIST_MSG_CATEGORY_FAILEDTODELETE |
215 | 215 | ); |
216 | 216 | exit(0); |
217 | 217 | } |
218 | - 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_CATEGORY_DELETED); |
|
218 | + 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_CATEGORY_DELETED); |
|
219 | 219 | exit(0); |
220 | 220 | } |
221 | 221 | $category = $categoryHandler->get(Request::getInt('id', 0, 'REQUEST')); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** @var Voice $voice */ |
13 | 13 | |
14 | -require __DIR__ . '/header.php'; |
|
14 | +require __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | xoops_loadLanguage('admin', 'songlist'); |
17 | 17 | |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
23 | 23 | $start = Request::getInt('start', 0, 'REQUEST'); |
24 | 24 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
25 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
26 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
25 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
26 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
27 | 27 | |
28 | 28 | switch ($op) { |
29 | 29 | default: |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | |
40 | 40 | $criteria = $voiceHandler->getFilterCriteria($GLOBALS['filter']); |
41 | 41 | $ttl = $voiceHandler->getCount($criteria); |
42 | - $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
42 | + $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
43 | 43 | |
44 | - $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']); |
|
44 | + $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']); |
|
45 | 45 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
46 | 46 | |
47 | 47 | foreach ($voiceHandler->filterFields() as $id => $key) { |
48 | 48 | $GLOBALS['xoopsTpl']->assign( |
49 | - \mb_strtolower(str_replace('-', '_', $key) . '_th'), |
|
49 | + \mb_strtolower(str_replace('-', '_', $key).'_th'), |
|
50 | 50 | '<a href="' |
51 | 51 | . $_SERVER['SCRIPT_NAME'] |
52 | 52 | . '?start=' |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | . '&sort=' |
57 | 57 | . $key |
58 | 58 | . '&order=' |
59 | - . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
59 | + . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
60 | 60 | . '&op=' |
61 | 61 | . $GLOBALS['op'] |
62 | 62 | . '&filter=' |
63 | 63 | . $GLOBALS['filter'] |
64 | 64 | . '">' |
65 | - . (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))) |
|
65 | + . (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))) |
|
66 | 66 | . '</a>' |
67 | 67 | ); |
68 | - $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $voiceHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
68 | + $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $voiceHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $criteria->setStart($GLOBALS['start']); |
79 | 79 | $criteria->setLimit($GLOBALS['limit']); |
80 | - $criteria->setSort('`' . $GLOBALS['sort'] . '`'); |
|
80 | + $criteria->setSort('`'.$GLOBALS['sort'].'`'); |
|
81 | 81 | $criteria->setOrder($GLOBALS['order']); |
82 | 82 | |
83 | 83 | $voices = $voiceHandler->getObjects($criteria, true); |
@@ -118,17 +118,17 @@ discard block |
||
118 | 118 | $voice->setVars($_POST[$id]); |
119 | 119 | |
120 | 120 | if (!$id = $voiceHandler->insert($voice)) { |
121 | - 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_VOICE_FAILEDTOSAVE); |
|
121 | + 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_VOICE_FAILEDTOSAVE); |
|
122 | 122 | exit(0); |
123 | 123 | } |
124 | - if ('new' === $_REQUEST['state'][$_REQUEST['id']]) { |
|
124 | + if ('new'===$_REQUEST['state'][$_REQUEST['id']]) { |
|
125 | 125 | redirect_header( |
126 | - $_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'], |
|
126 | + $_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'], |
|
127 | 127 | 10, |
128 | 128 | _AM_SONGLIST_MSG_VOICE_SAVEDOKEY |
129 | 129 | ); |
130 | 130 | } else { |
131 | - 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_VOICE_SAVEDOKEY); |
|
131 | + 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_VOICE_SAVEDOKEY); |
|
132 | 132 | } |
133 | 133 | exit(0); |
134 | 134 | |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | $voice->setVars($_POST[$id]); |
141 | 141 | if (!$voiceHandler->insert($voice)) { |
142 | 142 | redirect_header( |
143 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
143 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
144 | 144 | 10, |
145 | 145 | _AM_SONGLIST_MSG_VOICE_FAILEDTOSAVE |
146 | 146 | ); |
147 | 147 | exit(0); |
148 | 148 | } |
149 | 149 | } |
150 | - 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_VOICE_SAVEDOKEY); |
|
150 | + 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_VOICE_SAVEDOKEY); |
|
151 | 151 | exit(0); |
152 | 152 | break; |
153 | 153 | case 'delete': |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | $voice = $voiceHandler->get($id); |
158 | 158 | if (!$voiceHandler->delete($voice)) { |
159 | 159 | redirect_header( |
160 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
160 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
161 | 161 | 10, |
162 | 162 | _AM_SONGLIST_MSG_VOICE_FAILEDTODELETE |
163 | 163 | ); |
164 | 164 | exit(0); |
165 | 165 | } |
166 | - 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_VOICE_DELETED); |
|
166 | + 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_VOICE_DELETED); |
|
167 | 167 | exit(0); |
168 | 168 | } |
169 | 169 | $voice = $voiceHandler->get(Request::getInt('id', 0, 'REQUEST')); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | use XoopsModules\Songlist\Uploader; |
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 |
||
17 | 17 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
18 | 18 | $start = Request::getInt('start', 0, 'REQUEST'); |
19 | 19 | $order = $_REQUEST['order'] ?? 'DESC'; |
20 | -$sort = isset($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
21 | -$filter = isset($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
20 | +$sort = isset($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
21 | +$filter = isset($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
22 | 22 | $file = ''; |
23 | 23 | |
24 | 24 | switch ($op) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | default: |
29 | 29 | case 'actiona': |
30 | 30 | if (Request::hasVar('xmlfile', 'SESSION')) { |
31 | - redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $_SESSION['xmlfile'] . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
31 | + redirect_header($_SERVER['SCRIPT_NAME'].'?file='.$_SESSION['xmlfile'].'&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
32 | 32 | } |
33 | 33 | $adminObject = Admin::getInstance(); |
34 | 34 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | $GLOBALS['xoopsTpl']->display('db:songlist_cpanel_import_actiona.tpl'); |
39 | 39 | break; |
40 | 40 | case 'upload': |
41 | - if ('' != $_POST['file']) { |
|
41 | + if (''!=$_POST['file']) { |
|
42 | 42 | try { |
43 | - $file = mb_substr(md5((string)microtime(true)), random_int(0, 20), 13) . '.xml'; |
|
43 | + $file = mb_substr(md5((string) microtime(true)), random_int(0, 20), 13).'.xml'; |
|
44 | 44 | } catch (Exception $e) { |
45 | 45 | } |
46 | - copy($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']) . $_POST['file'], $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']) . $file); |
|
46 | + copy($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']).$_POST['file'], $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']).$file); |
|
47 | 47 | $_SESSION['xmlfile'] = $file; |
48 | - redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $file . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_COPIED); |
|
48 | + redirect_header($_SERVER['SCRIPT_NAME'].'?file='.$file.'&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_COPIED); |
|
49 | 49 | } elseif (Request::hasVar('xmlfile', 'FILES') && mb_strlen($_FILES['xmlfile']['name'])) { |
50 | 50 | // if (!is_dir($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']))) { |
51 | 51 | // foreach (explode('\\', $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])) as $folders) { |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | $uploader = new Uploader( |
63 | 63 | $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']), |
64 | 64 | ['application/xml', 'text/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity', 'text/xml xml xsl', 'text/xml-external-parsed-entity'], |
65 | - 1024 * 1024 * 1024 * 32, |
|
65 | + 1024*1024*1024*32, |
|
66 | 66 | 0, |
67 | 67 | 0, |
68 | 68 | ['xml'] |
69 | 69 | ); |
70 | 70 | try { |
71 | - $uploader->setPrefix(mb_substr(md5((string)microtime(true)), random_int(0, 20), 13)); |
|
71 | + $uploader->setPrefix(mb_substr(md5((string) microtime(true)), random_int(0, 20), 13)); |
|
72 | 72 | } catch (Exception $e) { |
73 | 73 | } |
74 | 74 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | exit(0); |
82 | 82 | } |
83 | 83 | $_SESSION['xmlfile'] = $uploader->getSavedFileName(); |
84 | - redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $uploader->getSavedFileName() . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
84 | + redirect_header($_SERVER['SCRIPT_NAME'].'?file='.$uploader->getSavedFileName().'&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED); |
|
85 | 85 | } else { |
86 | 86 | $adminObject = Admin::getInstance(); |
87 | 87 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | $voiceHandler = Helper::getInstance()->getHandler('Voice'); |
114 | 114 | $categoryHandler = Helper::getInstance()->getHandler('Category'); |
115 | 115 | |
116 | - $filesize = filesize($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])); |
|
117 | - $mb = floor($filesize / 1024 / 1024); |
|
118 | - if ($mb > 32) { |
|
119 | - ini_set('memory_limit', ($mb + 128) . 'M'); |
|
116 | + $filesize = filesize($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'].$_SESSION['xmlfile'])); |
|
117 | + $mb = floor($filesize/1024/1024); |
|
118 | + if ($mb>32) { |
|
119 | + ini_set('memory_limit', ($mb+128).'M'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $record = 0; |
123 | 123 | |
124 | 124 | set_time_limit(3600); |
125 | 125 | |
126 | - $xmlarray = Utility::xml2array(file_get_contents($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])), false, 'tag'); |
|
126 | + $xmlarray = Utility::xml2array(file_get_contents($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'].$_SESSION['xmlfile'])), false, 'tag'); |
|
127 | 127 | |
128 | - if (!empty($_POST['collection']) && mb_strlen($_POST['collection']) > 0) { |
|
129 | - if (!empty($_POST['record']) && mb_strlen($_POST['record']) > 0) { |
|
128 | + if (!empty($_POST['collection']) && mb_strlen($_POST['collection'])>0) { |
|
129 | + if (!empty($_POST['record']) && mb_strlen($_POST['record'])>0) { |
|
130 | 130 | foreach ($xmlarray[$_POST['collection']][$_POST['record']] as $recid => $data) { |
131 | 131 | if (Request::hasVar('limiting', 'POST')) { |
132 | - if (true === Request::getInt('limiting', 0, 'POST')) { |
|
132 | + if (true===Request::getInt('limiting', 0, 'POST')) { |
|
133 | 133 | ++$record; |
134 | - if ($record > Request::getInt('records', 0, 'POST')) { |
|
134 | + if ($record>Request::getInt('records', 0, 'POST')) { |
|
135 | 135 | $start = time(); |
136 | - while (time() - $start < Request::getInt('wait', 0, 'POST')) { |
|
136 | + while (time()-$start<Request::getInt('wait', 0, 'POST')) { |
|
137 | 137 | } |
138 | 138 | $records = 0; |
139 | 139 | } |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | } |
142 | 142 | $gid = 0; |
143 | 143 | $gids = []; |
144 | - if (!empty($_POST['genre']) && mb_strlen($_POST['genre']) > 1) { |
|
145 | - if (isset($data[$_POST['genre']]) && '' != trim($_POST['genre'])) { |
|
144 | + if (!empty($_POST['genre']) && mb_strlen($_POST['genre'])>1) { |
|
145 | + if (isset($data[$_POST['genre']]) && ''!=trim($_POST['genre'])) { |
|
146 | 146 | foreach (explode(',', trim($data[$_POST['genre']])) as $genre) { |
147 | 147 | $criteria = new \Criteria('name', trim($genre)); |
148 | - if ($genreHandler->getCount($criteria) > 0) { |
|
148 | + if ($genreHandler->getCount($criteria)>0) { |
|
149 | 149 | $objects = $genreHandler->getObjects($criteria, false); |
150 | 150 | $gid = $objects[0]->getVar('gid'); |
151 | 151 | } else { |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | } |
159 | 159 | } |
160 | 160 | $vcid = 0; |
161 | - if (!empty($_POST['voice']) && mb_strlen($_POST['voice']) > 1) { |
|
162 | - if (isset($data[$_POST['voice']]) && '' != trim($_POST['voice'])) { |
|
161 | + if (!empty($_POST['voice']) && mb_strlen($_POST['voice'])>1) { |
|
162 | + if (isset($data[$_POST['voice']]) && ''!=trim($_POST['voice'])) { |
|
163 | 163 | $criteria = new \Criteria('name', trim($data[$_POST['voice']])); |
164 | - if ($voiceHandler->getCount($criteria) > 0) { |
|
164 | + if ($voiceHandler->getCount($criteria)>0) { |
|
165 | 165 | $objects = $voiceHandler->getObjects($criteria, false); |
166 | 166 | $vcid = $objects[0]->getVar('vcid'); |
167 | 167 | } else { |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | $cid = 0; |
176 | - if (!empty($_POST['category']) && mb_strlen($_POST['category']) > 1) { |
|
177 | - if (isset($data[$_POST['category']]) && '' != trim($_POST['category'])) { |
|
176 | + if (!empty($_POST['category']) && mb_strlen($_POST['category'])>1) { |
|
177 | + if (isset($data[$_POST['category']]) && ''!=trim($_POST['category'])) { |
|
178 | 178 | $criteria = new \Criteria('name', trim($data[$_POST['category']])); |
179 | - if ($categoryHandler->getCount($criteria) > 0) { |
|
179 | + if ($categoryHandler->getCount($criteria)>0) { |
|
180 | 180 | $objects = $categoryHandler->getObjects($criteria, false); |
181 | 181 | $cid = $objects[0]->getVar('cid'); |
182 | 182 | } else { |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | $aids = []; |
190 | - if (!empty($_POST['artist']) && mb_strlen($_POST['artist']) > 1) { |
|
191 | - if (isset($data[$_POST['artist']]) && '' != $_POST['artist']) { |
|
190 | + if (!empty($_POST['artist']) && mb_strlen($_POST['artist'])>1) { |
|
191 | + if (isset($data[$_POST['artist']]) && ''!=$_POST['artist']) { |
|
192 | 192 | foreach (explode(',', trim($data[$_POST['artist']])) as $artist) { |
193 | 193 | $criteria = new \Criteria('name', trim($artist)); |
194 | - if ($artistsHandler->getCount($criteria) > 0) { |
|
194 | + if ($artistsHandler->getCount($criteria)>0) { |
|
195 | 195 | $objects = $artistsHandler->getObjects($criteria, false); |
196 | 196 | $aids[$objects[0]->getVar('aid')] = $objects[0]->getVar('aid'); |
197 | 197 | } else { |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | } |
205 | 205 | } |
206 | 206 | $abid = 0; |
207 | - if (!empty($_POST['album']) && mb_strlen($_POST['album']) > 1) { |
|
208 | - if (isset($data[$_POST['album']]) && '' != trim($_POST['album'])) { |
|
207 | + if (!empty($_POST['album']) && mb_strlen($_POST['album'])>1) { |
|
208 | + if (isset($data[$_POST['album']]) && ''!=trim($_POST['album'])) { |
|
209 | 209 | $criteria = new \Criteria('title', trim($data[$_POST['album']])); |
210 | - if ($albumsHandler->getCount($criteria) > 0) { |
|
210 | + if ($albumsHandler->getCount($criteria)>0) { |
|
211 | 211 | $objects = $albumsHandler->getObjects($criteria, false); |
212 | 212 | $abid = $objects[0]->getVar('abid'); |
213 | 213 | } else { |
@@ -220,16 +220,16 @@ discard block |
||
220 | 220 | } |
221 | 221 | } |
222 | 222 | $sid = 0; |
223 | - if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) { |
|
224 | - if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) { |
|
223 | + if ((!empty($_POST['songid']) && mb_strlen($_POST['songid'])>1) || (!empty($_POST['title']) && mb_strlen($_POST['title'])>1)) { |
|
224 | + if ((isset($data[$_POST['songid']]) && ''!=$_POST['songid']) || (isset($data[$_POST['title']]) && ''!=$_POST['title'])) { |
|
225 | 225 | $criteria = new \CriteriaCompo(); |
226 | - if ('' != trim($data[$_POST['songid']])) { |
|
226 | + if (''!=trim($data[$_POST['songid']])) { |
|
227 | 227 | $criteria->add(new \Criteria('songid', trim($data[$_POST['songid']]))); |
228 | 228 | } |
229 | - if ('' != trim($data[$_POST['title']])) { |
|
229 | + if (''!=trim($data[$_POST['title']])) { |
|
230 | 230 | $criteria->add(new \Criteria('title', trim($data[$_POST['title']]))); |
231 | 231 | } |
232 | - if ($songsHandler->getCount($criteria) > 0) { |
|
232 | + if ($songsHandler->getCount($criteria)>0) { |
|
233 | 233 | $objects = $songsHandler->getObjects($criteria, false); |
234 | 234 | $object = $objects[0]; |
235 | 235 | } else { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $object->setVar('lyrics', str_replace("\n", "<br>\n", trim($data[$_POST['lyrics']]))); |
249 | 249 | $sid = $songsHandler->insert($object); |
250 | 250 | |
251 | - if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) { |
|
251 | + if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH.'/modules/tag/class/tag.php')) { |
|
252 | 252 | $tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag'); |
253 | 253 | $tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid); |
254 | 254 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $extrasHandler = Helper::getInstance()->getHandler('Extras'); |
257 | 257 | $fields = $extrasHandler->getFields(null); |
258 | 258 | $criteria = new \CriteriaCompo(new \Criteria('sid', $sid)); |
259 | - if ($extrasHandler->getCount($criteria) > 0) { |
|
259 | + if ($extrasHandler->getCount($criteria)>0) { |
|
260 | 260 | $extras = $extrasHandler->getObjects($criteria, false); |
261 | 261 | $extra = $extras[0]; |
262 | 262 | } else { |
@@ -264,13 +264,13 @@ discard block |
||
264 | 264 | } |
265 | 265 | $extra->setVar('sid', $sid); |
266 | 266 | foreach ($fields as $field) { |
267 | - if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) { |
|
268 | - if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) { |
|
267 | + if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')])>1) { |
|
268 | + if (isset($data[$_POST[$field->getVar('field_name')]]) && ''!=trim($_POST[$field->getVar('field_name')])) { |
|
269 | 269 | $extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]])); |
270 | 270 | } |
271 | 271 | } |
272 | 272 | } |
273 | - foreach ($artistsHandler->getObjects(new \Criteria('aid', '(' . implode(',', $aids) . ')', 'IN'), true) as $aid => $artist) { |
|
273 | + foreach ($artistsHandler->getObjects(new \Criteria('aid', '('.implode(',', $aids).')', 'IN'), true) as $aid => $artist) { |
|
274 | 274 | $artist->setVar('sids', array_merge($artist->getVar('sids'), [$sid => $sid])); |
275 | 275 | $artistsHandler->insert($artist, true); |
276 | 276 | } |
@@ -280,11 +280,11 @@ discard block |
||
280 | 280 | } else { |
281 | 281 | foreach ($xmlarray[$_POST['collection']] as $id => $records) { |
282 | 282 | if (Request::hasVar('limiting', 'POST')) { |
283 | - if (true === Request::getInt('limiting', 0, 'POST')) { |
|
283 | + if (true===Request::getInt('limiting', 0, 'POST')) { |
|
284 | 284 | ++$record; |
285 | - if ($record > Request::getInt('records', 0, 'POST')) { |
|
285 | + if ($record>Request::getInt('records', 0, 'POST')) { |
|
286 | 286 | $start = time(); |
287 | - while (time() - $start < Request::getInt('wait', 0, 'POST')) { |
|
287 | + while (time()-$start<Request::getInt('wait', 0, 'POST')) { |
|
288 | 288 | } |
289 | 289 | $records = 0; |
290 | 290 | } |
@@ -292,11 +292,11 @@ discard block |
||
292 | 292 | } |
293 | 293 | $gid = 0; |
294 | 294 | $gids = []; |
295 | - if (!empty($_POST['genre']) && mb_strlen($_POST['genre']) > 1) { |
|
296 | - if (isset($data[$_POST['genre']]) && '' != trim($_POST['genre'])) { |
|
295 | + if (!empty($_POST['genre']) && mb_strlen($_POST['genre'])>1) { |
|
296 | + if (isset($data[$_POST['genre']]) && ''!=trim($_POST['genre'])) { |
|
297 | 297 | foreach (explode(',', trim($data[$_POST['genre']])) as $genre) { |
298 | 298 | $criteria = new \Criteria('name', trim($genre)); |
299 | - if ($genreHandler->getCount($criteria) > 0) { |
|
299 | + if ($genreHandler->getCount($criteria)>0) { |
|
300 | 300 | $objects = $genreHandler->getObjects($criteria, false); |
301 | 301 | $gid = $objects[0]->getVar('gid'); |
302 | 302 | } else { |
@@ -308,10 +308,10 @@ discard block |
||
308 | 308 | } |
309 | 309 | } |
310 | 310 | } |
311 | - if (!empty($_POST['voice']) && mb_strlen($_POST['voice']) > 1) { |
|
312 | - if (isset($data[$_POST['voice']]) && '' != trim($_POST['voice'])) { |
|
311 | + if (!empty($_POST['voice']) && mb_strlen($_POST['voice'])>1) { |
|
312 | + if (isset($data[$_POST['voice']]) && ''!=trim($_POST['voice'])) { |
|
313 | 313 | $criteria = new \Criteria('name', trim($data[$_POST['voice']])); |
314 | - if ($voiceHandler->getCount($criteria) > 0) { |
|
314 | + if ($voiceHandler->getCount($criteria)>0) { |
|
315 | 315 | $objects = $voiceHandler->getObjects($criteria, false); |
316 | 316 | $vcid = $objects[0]->getVar('vcid'); |
317 | 317 | } else { |
@@ -322,10 +322,10 @@ discard block |
||
322 | 322 | } |
323 | 323 | } |
324 | 324 | $cid = 0; |
325 | - if (!empty($_POST['category']) && mb_strlen($_POST['category']) > 1) { |
|
326 | - if (isset($data[$_POST['category']]) && '' != trim($_POST['category'])) { |
|
325 | + if (!empty($_POST['category']) && mb_strlen($_POST['category'])>1) { |
|
326 | + if (isset($data[$_POST['category']]) && ''!=trim($_POST['category'])) { |
|
327 | 327 | $criteria = new \Criteria('name', trim($data[$_POST['category']])); |
328 | - if ($categoryHandler->getCount($criteria) > 0) { |
|
328 | + if ($categoryHandler->getCount($criteria)>0) { |
|
329 | 329 | $objects = $categoryHandler->getObjects($criteria, false); |
330 | 330 | $cid = $objects[0]->getVar('cid'); |
331 | 331 | } else { |
@@ -336,11 +336,11 @@ discard block |
||
336 | 336 | } |
337 | 337 | } |
338 | 338 | $aids = []; |
339 | - if (!empty($_POST['artist']) && mb_strlen($_POST['artist']) > 1) { |
|
340 | - if (isset($data[$_POST['artist']]) && '' != $_POST['artist']) { |
|
339 | + if (!empty($_POST['artist']) && mb_strlen($_POST['artist'])>1) { |
|
340 | + if (isset($data[$_POST['artist']]) && ''!=$_POST['artist']) { |
|
341 | 341 | foreach (explode(',', trim($data[$_POST['artist']])) as $artist) { |
342 | 342 | $criteria = new \Criteria('name', trim($artist)); |
343 | - if ($artistsHandler->getCount($criteria) > 0) { |
|
343 | + if ($artistsHandler->getCount($criteria)>0) { |
|
344 | 344 | $objects = $artistsHandler->getObjects($criteria, false); |
345 | 345 | $aids[$objects[0]->getVar('aid')] = $objects[0]->getVar('aid'); |
346 | 346 | } else { |
@@ -354,10 +354,10 @@ discard block |
||
354 | 354 | } |
355 | 355 | } |
356 | 356 | $abid = 0; |
357 | - if (!empty($_POST['album']) && mb_strlen($_POST['album']) > 1) { |
|
358 | - if (isset($data[$_POST['album']]) && '' != trim($_POST['album'])) { |
|
357 | + if (!empty($_POST['album']) && mb_strlen($_POST['album'])>1) { |
|
358 | + if (isset($data[$_POST['album']]) && ''!=trim($_POST['album'])) { |
|
359 | 359 | $criteria = new \Criteria('title', trim($data[$_POST['album']])); |
360 | - if ($albumsHandler->getCount($criteria) > 0) { |
|
360 | + if ($albumsHandler->getCount($criteria)>0) { |
|
361 | 361 | $objects = $albumsHandler->getObjects($criteria, false); |
362 | 362 | $abid = $objects[0]->getVar('abid'); |
363 | 363 | } else { |
@@ -370,16 +370,16 @@ discard block |
||
370 | 370 | } |
371 | 371 | } |
372 | 372 | $sid = 0; |
373 | - if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) { |
|
374 | - if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) { |
|
373 | + if ((!empty($_POST['songid']) && mb_strlen($_POST['songid'])>1) || (!empty($_POST['title']) && mb_strlen($_POST['title'])>1)) { |
|
374 | + if ((isset($data[$_POST['songid']]) && ''!=$_POST['songid']) || (isset($data[$_POST['title']]) && ''!=$_POST['title'])) { |
|
375 | 375 | $criteria = new \CriteriaCompo(); |
376 | - if ('' != trim($data[$_POST['songid']])) { |
|
376 | + if (''!=trim($data[$_POST['songid']])) { |
|
377 | 377 | $criteria->add(new \Criteria('songid', trim($data[$_POST['songid']]))); |
378 | 378 | } |
379 | - if ('' != trim($data[$_POST['title']])) { |
|
379 | + if (''!=trim($data[$_POST['title']])) { |
|
380 | 380 | $criteria->add(new \Criteria('title', trim($data[$_POST['title']]))); |
381 | 381 | } |
382 | - if ($songsHandler->getCount($criteria) > 0) { |
|
382 | + if ($songsHandler->getCount($criteria)>0) { |
|
383 | 383 | $objects = $songsHandler->getObjects($criteria, false); |
384 | 384 | $object = $objects[0]; |
385 | 385 | } else { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $object->setVar('lyrics', str_replace("\n", "<br>\n", trim($data[$_POST['lyrics']]))); |
399 | 399 | $sid = $songsHandler->insert($object); |
400 | 400 | |
401 | - if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) { |
|
401 | + if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH.'/modules/tag/class/tag.php')) { |
|
402 | 402 | $tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag'); |
403 | 403 | $tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid); |
404 | 404 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $extrasHandler = Helper::getInstance()->getHandler('Extras'); |
407 | 407 | $fields = $extrasHandler->getFields(null); |
408 | 408 | $criteria = new \CriteriaCompo(new \Criteria('sid', $sid)); |
409 | - if ($extrasHandler->getCount($criteria) > 0) { |
|
409 | + if ($extrasHandler->getCount($criteria)>0) { |
|
410 | 410 | $extras = $extrasHandler->getObjects($criteria, false); |
411 | 411 | $extra = $extras[0]; |
412 | 412 | } else { |
@@ -414,14 +414,14 @@ discard block |
||
414 | 414 | } |
415 | 415 | $extra->setVar('sid', $sid); |
416 | 416 | foreach ($fields as $field) { |
417 | - if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) { |
|
418 | - if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) { |
|
417 | + if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')])>1) { |
|
418 | + if (isset($data[$_POST[$field->getVar('field_name')]]) && ''!=trim($_POST[$field->getVar('field_name')])) { |
|
419 | 419 | $extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]])); |
420 | 420 | } |
421 | 421 | } |
422 | 422 | } |
423 | 423 | $extrasHandler->insert($extra, true); |
424 | - foreach ($artistsHandler->getObjects(new \Criteria('aid', '(' . implode(',', $aids) . ')', 'IN'), true) as $aid => $artist) { |
|
424 | + foreach ($artistsHandler->getObjects(new \Criteria('aid', '('.implode(',', $aids).')', 'IN'), true) as $aid => $artist) { |
|
425 | 425 | $artist->setVar('sids', array_merge($artist->getVar('sids'), [$sid => $sid])); |
426 | 426 | $artistsHandler->insert($artist, true); |
427 | 427 | } |
@@ -437,11 +437,11 @@ discard block |
||
437 | 437 | $aids = []; |
438 | 438 | $abid = []; |
439 | 439 | if (Request::hasVar('limiting', 'POST')) { |
440 | - if (true === Request::getInt('limiting', 0, 'POST')) { |
|
440 | + if (true===Request::getInt('limiting', 0, 'POST')) { |
|
441 | 441 | ++$record; |
442 | - if ($record > Request::getInt('records', 0, 'POST')) { |
|
442 | + if ($record>Request::getInt('records', 0, 'POST')) { |
|
443 | 443 | $start = time(); |
444 | - while (time() - $start < Request::getInt('wait', 0, 'POST')) { |
|
444 | + while (time()-$start<Request::getInt('wait', 0, 'POST')) { |
|
445 | 445 | } |
446 | 446 | $records = 0; |
447 | 447 | } |
@@ -449,11 +449,11 @@ discard block |
||
449 | 449 | } |
450 | 450 | $gid = 0; |
451 | 451 | $gids = []; |
452 | - if (!empty($_POST['genre']) && mb_strlen($_POST['genre']) > 1) { |
|
453 | - if (isset($data[$_POST['genre']]) && '' != trim($_POST['genre'])) { |
|
452 | + if (!empty($_POST['genre']) && mb_strlen($_POST['genre'])>1) { |
|
453 | + if (isset($data[$_POST['genre']]) && ''!=trim($_POST['genre'])) { |
|
454 | 454 | foreach (explode(',', trim($data[$_POST['genre']])) as $genre) { |
455 | 455 | $criteria = new \Criteria('name', trim($genre)); |
456 | - if ($genreHandler->getCount($criteria) > 0) { |
|
456 | + if ($genreHandler->getCount($criteria)>0) { |
|
457 | 457 | $objects = $genreHandler->getObjects($criteria, false); |
458 | 458 | $gid = $objects[0]->getVar('gid'); |
459 | 459 | } else { |
@@ -467,10 +467,10 @@ discard block |
||
467 | 467 | } |
468 | 468 | |
469 | 469 | $vcid = 0; |
470 | - if (!empty($_POST['voice']) && mb_strlen($_POST['voice']) > 1) { |
|
471 | - if (isset($data[$_POST['voice']]) && '' != trim($_POST['voice'])) { |
|
470 | + if (!empty($_POST['voice']) && mb_strlen($_POST['voice'])>1) { |
|
471 | + if (isset($data[$_POST['voice']]) && ''!=trim($_POST['voice'])) { |
|
472 | 472 | $criteria = new \Criteria('name', trim($data[$_POST['voice']])); |
473 | - if ($voiceHandler->getCount($criteria) > 0) { |
|
473 | + if ($voiceHandler->getCount($criteria)>0) { |
|
474 | 474 | $objects = $voiceHandler->getObjects($criteria, false); |
475 | 475 | $vcid = $objects[0]->getVar('vcid'); |
476 | 476 | } else { |
@@ -481,10 +481,10 @@ discard block |
||
481 | 481 | } |
482 | 482 | } |
483 | 483 | $cid = 0; |
484 | - if (!empty($_POST['category']) && mb_strlen($_POST['category']) > 1) { |
|
485 | - if (isset($data[$_POST['category']]) && '' != trim($_POST['category'])) { |
|
484 | + if (!empty($_POST['category']) && mb_strlen($_POST['category'])>1) { |
|
485 | + if (isset($data[$_POST['category']]) && ''!=trim($_POST['category'])) { |
|
486 | 486 | $criteria = new \Criteria('name', trim($data[$_POST['category']])); |
487 | - if ($categoryHandler->getCount($criteria) > 0) { |
|
487 | + if ($categoryHandler->getCount($criteria)>0) { |
|
488 | 488 | $objects = $categoryHandler->getObjects($criteria, false); |
489 | 489 | $cid = $objects[0]->getVar('cid'); |
490 | 490 | } else { |
@@ -495,11 +495,11 @@ discard block |
||
495 | 495 | } |
496 | 496 | } |
497 | 497 | $aids = []; |
498 | - if (!empty($_POST['artist']) && mb_strlen($_POST['artist']) > 1) { |
|
499 | - if (isset($data[$_POST['artist']]) && '' != $_POST['artist']) { |
|
498 | + if (!empty($_POST['artist']) && mb_strlen($_POST['artist'])>1) { |
|
499 | + if (isset($data[$_POST['artist']]) && ''!=$_POST['artist']) { |
|
500 | 500 | foreach (explode(',', trim($data[$_POST['artist']])) as $artist) { |
501 | 501 | $criteria = new \Criteria('name', trim($artist)); |
502 | - if ($artistsHandler->getCount($criteria) > 0) { |
|
502 | + if ($artistsHandler->getCount($criteria)>0) { |
|
503 | 503 | $objects = $artistsHandler->getObjects($criteria, false); |
504 | 504 | $aids[$objects[0]->getVar('aid')] = $objects[0]->getVar('aid'); |
505 | 505 | } else { |
@@ -513,10 +513,10 @@ discard block |
||
513 | 513 | } |
514 | 514 | } |
515 | 515 | $abid = 0; |
516 | - if (!empty($_POST['album']) && mb_strlen($_POST['album']) > 1) { |
|
517 | - if (isset($data[$_POST['album']]) && '' != trim($_POST['album'])) { |
|
516 | + if (!empty($_POST['album']) && mb_strlen($_POST['album'])>1) { |
|
517 | + if (isset($data[$_POST['album']]) && ''!=trim($_POST['album'])) { |
|
518 | 518 | $criteria = new \Criteria('title', trim($data[$_POST['album']])); |
519 | - if ($albumsHandler->getCount($criteria) > 0) { |
|
519 | + if ($albumsHandler->getCount($criteria)>0) { |
|
520 | 520 | $objects = $albumsHandler->getObjects($criteria, false); |
521 | 521 | $abid = $objects[0]->getVar('abid'); |
522 | 522 | } else { |
@@ -529,16 +529,16 @@ discard block |
||
529 | 529 | } |
530 | 530 | } |
531 | 531 | $sid = 0; |
532 | - if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) { |
|
533 | - if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) { |
|
532 | + if ((!empty($_POST['songid']) && mb_strlen($_POST['songid'])>1) || (!empty($_POST['title']) && mb_strlen($_POST['title'])>1)) { |
|
533 | + if ((isset($data[$_POST['songid']]) && ''!=$_POST['songid']) || (isset($data[$_POST['title']]) && ''!=$_POST['title'])) { |
|
534 | 534 | $criteria = new \CriteriaCompo(); |
535 | - if ('' != trim($data[$_POST['songid']])) { |
|
535 | + if (''!=trim($data[$_POST['songid']])) { |
|
536 | 536 | $criteria->add(new \Criteria('songid', trim($data[$_POST['songid']]))); |
537 | 537 | } |
538 | - if ('' != trim($data[$_POST['title']])) { |
|
538 | + if (''!=trim($data[$_POST['title']])) { |
|
539 | 539 | $criteria->add(new \Criteria('title', trim($data[$_POST['title']]))); |
540 | 540 | } |
541 | - if ($songsHandler->getCount($criteria) > 0) { |
|
541 | + if ($songsHandler->getCount($criteria)>0) { |
|
542 | 542 | $objects = $songsHandler->getObjects($criteria, false); |
543 | 543 | $object = $objects[0]; |
544 | 544 | } else { |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $object->setVar('lyrics', str_replace("\n", "<br>\n", trim($data[$_POST['lyrics']]))); |
558 | 558 | $sid = $songsHandler->insert($object); |
559 | 559 | |
560 | - if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) { |
|
560 | + if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH.'/modules/tag/class/tag.php')) { |
|
561 | 561 | $tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag'); |
562 | 562 | $tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid); |
563 | 563 | } |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | $extrasHandler = Helper::getInstance()->getHandler('Extras'); |
566 | 566 | $fields = $extrasHandler->getFields(null); |
567 | 567 | $criteria = new \CriteriaCompo(new \Criteria('sid', $sid)); |
568 | - if ($extrasHandler->getCount($criteria) > 0) { |
|
568 | + if ($extrasHandler->getCount($criteria)>0) { |
|
569 | 569 | $extras = $extrasHandler->getObjects($criteria, false); |
570 | 570 | $extra = $extras[0]; |
571 | 571 | } else { |
@@ -573,13 +573,13 @@ discard block |
||
573 | 573 | } |
574 | 574 | $extra->setVar('sid', $sid); |
575 | 575 | foreach ($fields as $field) { |
576 | - if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) { |
|
577 | - if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) { |
|
576 | + if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')])>1) { |
|
577 | + if (isset($data[$_POST[$field->getVar('field_name')]]) && ''!=trim($_POST[$field->getVar('field_name')])) { |
|
578 | 578 | $extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]])); |
579 | 579 | } |
580 | 580 | } |
581 | 581 | } |
582 | - foreach ($artistsHandler->getObjects(new \Criteria('aid', '(' . implode(',', $aids) . ')', 'IN'), true) as $aid => $artist) { |
|
582 | + foreach ($artistsHandler->getObjects(new \Criteria('aid', '('.implode(',', $aids).')', 'IN'), true) as $aid => $artist) { |
|
583 | 583 | $artist->setVar('sids', array_merge($artist->getVar('sids'), [$sid => $sid])); |
584 | 584 | $artistsHandler->insert($artist, true); |
585 | 585 | } |
@@ -587,9 +587,9 @@ discard block |
||
587 | 587 | } |
588 | 588 | } |
589 | 589 | } |
590 | - unlink($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])); |
|
590 | + unlink($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'].$_SESSION['xmlfile'])); |
|
591 | 591 | unset($_SESSION['xmlfile']); |
592 | - redirect_header($_SERVER['SCRIPT_NAME'] . '?op=import&fct=actiona', 10, _AM_SONGLIST_XMLFILE_COMPLETE); |
|
592 | + redirect_header($_SERVER['SCRIPT_NAME'].'?op=import&fct=actiona', 10, _AM_SONGLIST_XMLFILE_COMPLETE); |
|
593 | 593 | break; |
594 | 594 | } |
595 | 595 | break; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** @var Genre $genre */ |
13 | 13 | |
14 | -require __DIR__ . '/header.php'; |
|
14 | +require __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | xoops_loadLanguage('admin', 'songlist'); |
17 | 17 | |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $limit = Request::getInt('limit', 30, 'REQUEST'); |
23 | 23 | $start = Request::getInt('start', 0, 'REQUEST'); |
24 | 24 | $order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC'; |
25 | -$sort = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
26 | -$filter = !empty($_REQUEST['filter']) ? '' . $_REQUEST['filter'] . '' : '1,1'; |
|
25 | +$sort = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
26 | +$filter = !empty($_REQUEST['filter']) ? ''.$_REQUEST['filter'].'' : '1,1'; |
|
27 | 27 | |
28 | 28 | switch ($op) { |
29 | 29 | default: |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | |
40 | 40 | $criteria = $genreHandler->getFilterCriteria($GLOBALS['filter']); |
41 | 41 | $ttl = $genreHandler->getCount($criteria); |
42 | - $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? '' . $_REQUEST['sort'] . '' : 'created'; |
|
42 | + $GLOBALS['sort'] = !empty($_REQUEST['sort']) ? ''.$_REQUEST['sort'].'' : 'created'; |
|
43 | 43 | |
44 | - $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']); |
|
44 | + $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']); |
|
45 | 45 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
46 | 46 | |
47 | 47 | foreach ($genreHandler->filterFields() as $id => $key) { |
48 | 48 | $GLOBALS['xoopsTpl']->assign( |
49 | - \mb_strtolower(str_replace('-', '_', $key) . '_th'), |
|
49 | + \mb_strtolower(str_replace('-', '_', $key).'_th'), |
|
50 | 50 | '<a href="' |
51 | 51 | . $_SERVER['SCRIPT_NAME'] |
52 | 52 | . '?start=' |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | . '&sort=' |
57 | 57 | . $key |
58 | 58 | . '&order=' |
59 | - . (($key == $GLOBALS['sort']) ? ('DESC' === $GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
59 | + . (($key==$GLOBALS['sort']) ? ('DESC'===$GLOBALS['order'] ? 'ASC' : 'DESC') : $GLOBALS['order']) |
|
60 | 60 | . '&op=' |
61 | 61 | . $GLOBALS['op'] |
62 | 62 | . '&filter=' |
63 | 63 | . $GLOBALS['filter'] |
64 | 64 | . '">' |
65 | - . (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))) |
|
65 | + . (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))) |
|
66 | 66 | . '</a>' |
67 | 67 | ); |
68 | - $GLOBALS['xoopsTpl']->assign('filter_' . \mb_strtolower(str_replace('-', '_', $key)) . '_th', $genreHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
68 | + $GLOBALS['xoopsTpl']->assign('filter_'.\mb_strtolower(str_replace('-', '_', $key)).'_th', $genreHandler->getFilterForm($GLOBALS['filter'], $key, $GLOBALS['sort'], $GLOBALS['op'], $GLOBALS['fct'])); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $GLOBALS['xoopsTpl']->assign('limit', $GLOBALS['limit']); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $criteria->setStart($GLOBALS['start']); |
79 | 79 | $criteria->setLimit($GLOBALS['limit']); |
80 | - $criteria->setSort('`' . $GLOBALS['sort'] . '`'); |
|
80 | + $criteria->setSort('`'.$GLOBALS['sort'].'`'); |
|
81 | 81 | $criteria->setOrder($GLOBALS['order']); |
82 | 82 | |
83 | 83 | $genres = $genreHandler->getObjects($criteria, true); |
@@ -118,17 +118,17 @@ discard block |
||
118 | 118 | $genre->setVars($_POST[$id]); |
119 | 119 | |
120 | 120 | if (!$id = $genreHandler->insert($genre)) { |
121 | - 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_GENRE_FAILEDTOSAVE); |
|
121 | + 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_GENRE_FAILEDTOSAVE); |
|
122 | 122 | exit(0); |
123 | 123 | } |
124 | - if ('new' === $_REQUEST['state'][$_REQUEST['id']]) { |
|
124 | + if ('new'===$_REQUEST['state'][$_REQUEST['id']]) { |
|
125 | 125 | redirect_header( |
126 | - $_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'], |
|
126 | + $_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'], |
|
127 | 127 | 10, |
128 | 128 | _AM_SONGLIST_MSG_GENRE_SAVEDOKEY |
129 | 129 | ); |
130 | 130 | } else { |
131 | - 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_GENRE_SAVEDOKEY); |
|
131 | + 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_GENRE_SAVEDOKEY); |
|
132 | 132 | } |
133 | 133 | exit(0); |
134 | 134 | |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | $genre->setVars($_POST[$id]); |
141 | 141 | if (!$genreHandler->insert($genre)) { |
142 | 142 | redirect_header( |
143 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
143 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
144 | 144 | 10, |
145 | 145 | _AM_SONGLIST_MSG_GENRE_FAILEDTOSAVE |
146 | 146 | ); |
147 | 147 | exit(0); |
148 | 148 | } |
149 | 149 | } |
150 | - 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_GENRE_SAVEDOKEY); |
|
150 | + 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_GENRE_SAVEDOKEY); |
|
151 | 151 | exit(0); |
152 | 152 | break; |
153 | 153 | case 'delete': |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | $genre = $genreHandler->get($id); |
158 | 158 | if (!$genreHandler->delete($genre)) { |
159 | 159 | redirect_header( |
160 | - $_SERVER['SCRIPT_NAME'] . '?op=' . $GLOBALS['op'] . '&fct=list&limit=' . $GLOBALS['limit'] . '&start=' . $GLOBALS['start'] . '&order=' . $GLOBALS['order'] . '&sort=' . $GLOBALS['sort'] . '&filter=' . $GLOBALS['filter'], |
|
160 | + $_SERVER['SCRIPT_NAME'].'?op='.$GLOBALS['op'].'&fct=list&limit='.$GLOBALS['limit'].'&start='.$GLOBALS['start'].'&order='.$GLOBALS['order'].'&sort='.$GLOBALS['sort'].'&filter='.$GLOBALS['filter'], |
|
161 | 161 | 10, |
162 | 162 | _AM_SONGLIST_MSG_GENRE_FAILEDTODELETE |
163 | 163 | ); |
164 | 164 | exit(0); |
165 | 165 | } |
166 | - 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_GENRE_DELETED); |
|
166 | + 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_GENRE_DELETED); |
|
167 | 167 | exit(0); |
168 | 168 | } |
169 | 169 | $genre = $genreHandler->get(Request::getInt('id', 0, 'REQUEST')); |