@@ -8,19 +8,19 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_albums_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Albums'); |
|
| 13 | - $objects = $handler->getTop($options[0]); |
|
| 14 | - if (count($objects) > 0) { |
|
| 15 | - $ret = []; |
|
| 16 | - foreach ($objects as $id => $object) { |
|
| 17 | - $ret[$id] = $object->toArray(true); |
|
| 18 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Albums'); |
|
| 13 | + $objects = $handler->getTop($options[0]); |
|
| 14 | + if (count($objects) > 0) { |
|
| 15 | + $ret = []; |
|
| 16 | + foreach ($objects as $id => $object) { |
|
| 17 | + $ret[$id] = $object->toArray(true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - return $ret; |
|
| 21 | - } |
|
| 20 | + return $ret; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - return null; |
|
| 23 | + return null; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | function b_songlist_popular_albums_edit($options): string |
| 31 | 31 | { |
| 32 | - xoops_load('XoopsFormLoader'); |
|
| 33 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | - $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 32 | + xoops_load('XoopsFormLoader'); |
|
| 33 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | + $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 37 | 37 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | xoops_loadLanguage('blocks', 'songlist'); |
| 12 | 12 | $handler = Helper::getInstance()->getHandler('Albums'); |
| 13 | 13 | $objects = $handler->getTop($options[0]); |
| 14 | - if (count($objects) > 0) { |
|
| 14 | + if (count($objects)>0) { |
|
| 15 | 15 | $ret = []; |
| 16 | 16 | foreach ($objects as $id => $object) { |
| 17 | 17 | $ret[$id] = $object->toArray(true); |
@@ -33,5 +33,5 @@ discard block |
||
| 33 | 33 | xoops_loadLanguage('blocks', 'songlist'); |
| 34 | 34 | $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS.$num->render(); |
|
| 37 | 37 | } |
@@ -8,14 +8,14 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_artist_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Artists'); |
|
| 13 | - $objects = $handler->getTop(1); |
|
| 14 | - if (is_object($objects[0])) { |
|
| 15 | - return $objects[0]->toArray(true); |
|
| 16 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Artists'); |
|
| 13 | + $objects = $handler->getTop(1); |
|
| 14 | + if (is_object($objects[0])) { |
|
| 15 | + return $objects[0]->toArray(true); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - return null; |
|
| 18 | + return null; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -8,14 +8,14 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_genre_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Genre'); |
|
| 13 | - $objects = $handler->getTop(1); |
|
| 14 | - if (is_object($objects[0])) { |
|
| 15 | - return $objects[0]->toArray(true); |
|
| 16 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Genre'); |
|
| 13 | + $objects = $handler->getTop(1); |
|
| 14 | + if (is_object($objects[0])) { |
|
| 15 | + return $objects[0]->toArray(true); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - return null; |
|
| 18 | + return null; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -8,14 +8,14 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_song_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Songs'); |
|
| 13 | - $objects = $handler->getTop(1); |
|
| 14 | - if (is_object($objects[0])) { |
|
| 15 | - return $objects[0]->toArray(true); |
|
| 16 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Songs'); |
|
| 13 | + $objects = $handler->getTop(1); |
|
| 14 | + if (is_object($objects[0])) { |
|
| 15 | + return $objects[0]->toArray(true); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - return null; |
|
| 18 | + return null; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -8,19 +8,19 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_genres_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Genre'); |
|
| 13 | - $objects = $handler->getTop($options[0]); |
|
| 14 | - if (count($objects) > 0) { |
|
| 15 | - $ret = []; |
|
| 16 | - foreach ($objects as $id => $object) { |
|
| 17 | - $ret[$id] = $object->toArray(true); |
|
| 18 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Genre'); |
|
| 13 | + $objects = $handler->getTop($options[0]); |
|
| 14 | + if (count($objects) > 0) { |
|
| 15 | + $ret = []; |
|
| 16 | + foreach ($objects as $id => $object) { |
|
| 17 | + $ret[$id] = $object->toArray(true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - return $ret; |
|
| 21 | - } |
|
| 20 | + return $ret; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - return null; |
|
| 23 | + return null; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | function b_songlist_popular_genres_edit($options): string |
| 31 | 31 | { |
| 32 | - xoops_load('XoopsFormLoader'); |
|
| 33 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | - $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 32 | + xoops_load('XoopsFormLoader'); |
|
| 33 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | + $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 37 | 37 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | xoops_loadLanguage('blocks', 'songlist'); |
| 12 | 12 | $handler = Helper::getInstance()->getHandler('Genre'); |
| 13 | 13 | $objects = $handler->getTop($options[0]); |
| 14 | - if (count($objects) > 0) { |
|
| 14 | + if (count($objects)>0) { |
|
| 15 | 15 | $ret = []; |
| 16 | 16 | foreach ($objects as $id => $object) { |
| 17 | 17 | $ret[$id] = $object->toArray(true); |
@@ -33,5 +33,5 @@ discard block |
||
| 33 | 33 | xoops_loadLanguage('blocks', 'songlist'); |
| 34 | 34 | $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS.$num->render(); |
|
| 37 | 37 | } |
@@ -8,14 +8,14 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_album_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Albums'); |
|
| 13 | - $objects = $handler->getTop(1); |
|
| 14 | - if (is_object($objects[0])) { |
|
| 15 | - return $objects[0]->toArray(true); |
|
| 16 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Albums'); |
|
| 13 | + $objects = $handler->getTop(1); |
|
| 14 | + if (is_object($objects[0])) { |
|
| 15 | + return $objects[0]->toArray(true); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - return null; |
|
| 18 | + return null; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -8,19 +8,19 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_songs_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Songs'); |
|
| 13 | - $objects = $handler->getTop($options[0]); |
|
| 14 | - if (count($objects) > 0) { |
|
| 15 | - $ret = []; |
|
| 16 | - foreach ($objects as $id => $object) { |
|
| 17 | - $ret[$id] = $object->toArray(true); |
|
| 18 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Songs'); |
|
| 13 | + $objects = $handler->getTop($options[0]); |
|
| 14 | + if (count($objects) > 0) { |
|
| 15 | + $ret = []; |
|
| 16 | + foreach ($objects as $id => $object) { |
|
| 17 | + $ret[$id] = $object->toArray(true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - return $ret; |
|
| 21 | - } |
|
| 20 | + return $ret; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - return null; |
|
| 23 | + return null; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | function b_songlist_popular_songs_edit($options): string |
| 31 | 31 | { |
| 32 | - xoops_load('XoopsFormLoader'); |
|
| 33 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | - $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 32 | + xoops_load('XoopsFormLoader'); |
|
| 33 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | + $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 37 | 37 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | xoops_loadLanguage('blocks', 'songlist'); |
| 12 | 12 | $handler = Helper::getInstance()->getHandler('Songs'); |
| 13 | 13 | $objects = $handler->getTop($options[0]); |
| 14 | - if (count($objects) > 0) { |
|
| 14 | + if (count($objects)>0) { |
|
| 15 | 15 | $ret = []; |
| 16 | 16 | foreach ($objects as $id => $object) { |
| 17 | 17 | $ret[$id] = $object->toArray(true); |
@@ -33,5 +33,5 @@ discard block |
||
| 33 | 33 | xoops_loadLanguage('blocks', 'songlist'); |
| 34 | 34 | $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS.$num->render(); |
|
| 37 | 37 | } |
@@ -8,19 +8,19 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function b_songlist_popular_artists_show($options): ?array |
| 10 | 10 | { |
| 11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | - $handler = Helper::getInstance()->getHandler('Artists'); |
|
| 13 | - $objects = $handler->getTop($options[0]); |
|
| 14 | - if (count($objects) > 0) { |
|
| 15 | - $ret = []; |
|
| 16 | - foreach ($objects as $id => $object) { |
|
| 17 | - $ret[$id] = $object->toArray(true); //TODO mb why do we need toArray()? |
|
| 18 | - } |
|
| 11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 12 | + $handler = Helper::getInstance()->getHandler('Artists'); |
|
| 13 | + $objects = $handler->getTop($options[0]); |
|
| 14 | + if (count($objects) > 0) { |
|
| 15 | + $ret = []; |
|
| 16 | + foreach ($objects as $id => $object) { |
|
| 17 | + $ret[$id] = $object->toArray(true); //TODO mb why do we need toArray()? |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - return $ret; |
|
| 21 | - } |
|
| 20 | + return $ret; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - return null; |
|
| 23 | + return null; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | function b_songlist_popular_artists_edit($options): string |
| 31 | 31 | { |
| 32 | - xoops_load('XoopsFormLoader'); |
|
| 33 | - xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | - $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 32 | + xoops_load('XoopsFormLoader'); |
|
| 33 | + xoops_loadLanguage('blocks', 'songlist'); |
|
| 34 | + $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 37 | 37 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | xoops_loadLanguage('blocks', 'songlist'); |
| 12 | 12 | $handler = Helper::getInstance()->getHandler('Artists'); |
| 13 | 13 | $objects = $handler->getTop($options[0]); |
| 14 | - if (count($objects) > 0) { |
|
| 14 | + if (count($objects)>0) { |
|
| 15 | 15 | $ret = []; |
| 16 | 16 | foreach ($objects as $id => $object) { |
| 17 | 17 | $ret[$id] = $object->toArray(true); //TODO mb why do we need toArray()? |
@@ -33,5 +33,5 @@ discard block |
||
| 33 | 33 | xoops_loadLanguage('blocks', 'songlist'); |
| 34 | 34 | $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
| 35 | 35 | |
| 36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
| 36 | + return _BL_SONGLIST_NUMBEROFITEMS.$num->render(); |
|
| 37 | 37 | } |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | $criteria_cat = new \CriteriaCompo(); |
| 14 | 14 | $cids = $categoryHandler->GetCatAndSubCat($_SESSION['cid']); |
| 15 | 15 | if ($_SESSION['cid'] > 0) { |
| 16 | - $cids[$_SESSION['cid']] = $_SESSION['cid']; |
|
| 16 | + $cids[$_SESSION['cid']] = $_SESSION['cid']; |
|
| 17 | 17 | } |
| 18 | 18 | if (count($cids) > 0 && 0 != $_SESSION['cid']) { |
| 19 | - foreach ($cids as $cid) { |
|
| 20 | - $criteria_cat->add(new \Criteria('`cids`', '%"' . $cid . '"%', 'LIKE'), 'OR'); |
|
| 21 | - } |
|
| 19 | + foreach ($cids as $cid) { |
|
| 20 | + $criteria_cat->add(new \Criteria('`cids`', '%"' . $cid . '"%', 'LIKE'), 'OR'); |
|
| 21 | + } |
|
| 22 | 22 | } else { |
| 23 | - $criteria_cat->add(new \Criteria(''), 'OR'); |
|
| 23 | + $criteria_cat->add(new \Criteria(''), 'OR'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $criteria_cat->setSort('created'); |
@@ -35,197 +35,197 @@ discard block |
||
| 35 | 35 | $col = 1; |
| 36 | 36 | $row = 1; |
| 37 | 37 | foreach ($categories as $category) { |
| 38 | - $cat[$row][$col] = $category->toArray(true); |
|
| 39 | - $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 40 | - ++$col; |
|
| 41 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 42 | - ++$row; |
|
| 43 | - $col = 1; |
|
| 44 | - } |
|
| 38 | + $cat[$row][$col] = $category->toArray(true); |
|
| 39 | + $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 40 | + ++$col; |
|
| 41 | + if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 42 | + ++$row; |
|
| 43 | + $col = 1; |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | if (1 != $col) { |
| 47 | - $col--; |
|
| 48 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 49 | - $cat[$row][$j][$categoryHandler->keyName] = 0; |
|
| 50 | - $cat[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 51 | - } |
|
| 47 | + $col--; |
|
| 48 | + for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 49 | + $cat[$row][$j][$categoryHandler->keyName] = 0; |
|
| 50 | + $cat[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 51 | + } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** @var ArtistsHandler $artistsHandler */ |
| 55 | 55 | $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
| 56 | 56 | switch ((string)$GLOBALS['op']) { |
| 57 | - default: |
|
| 58 | - case 'item': |
|
| 59 | - switch ($fct) { |
|
| 60 | - default: |
|
| 61 | - case 'list': |
|
| 62 | - $pagenav = new \XoopsPageNav($artistsHandler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 63 | - |
|
| 64 | - $criteria_cat->setLimit($limit); |
|
| 65 | - $criteria_cat->setStart($start); |
|
| 66 | - |
|
| 67 | - $artists = $artistsHandler->getObjects($criteria_cat, false); |
|
| 68 | - |
|
| 69 | - $ret = []; |
|
| 70 | - $col = 1; |
|
| 71 | - $row = 1; |
|
| 72 | - foreach ($artists as $artist) { |
|
| 73 | - $ret[$row][$col] = $artist->toArray(true); |
|
| 74 | - $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 75 | - ++$col; |
|
| 76 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 77 | - ++$row; |
|
| 78 | - $col = 1; |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - if (1 != $col) { |
|
| 82 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 83 | - $ret[$row][$j][$artistsHandler->keyName] = 0; |
|
| 84 | - $ret[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 85 | - } |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - $url = $artistsHandler->getURL(false); |
|
| 89 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 90 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 91 | - header('Location: ' . $url); |
|
| 92 | - exit(0); |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl'; |
|
| 96 | - require $GLOBALS['xoops']->path('/header.php'); |
|
| 97 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 98 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 99 | - $GLOBALS['loaded_jquery'] = true; |
|
| 100 | - } |
|
| 101 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 102 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 103 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 104 | - $GLOBALS['xoopsTpl']->assign('results', $ret); |
|
| 105 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 106 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 107 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 108 | - if (0 != $_SESSION['cid']) { |
|
| 109 | - $category = $categoryHandler->get($_SESSION['cid']); |
|
| 110 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 111 | - } |
|
| 112 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 113 | - require $GLOBALS['xoops']->path('/footer.php'); |
|
| 114 | - break; |
|
| 115 | - case 'item': |
|
| 116 | - $artist = $artistsHandler->get($id); |
|
| 117 | - |
|
| 118 | - $url = $artist->getURL(true); |
|
| 119 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 120 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 121 | - header('Location: ' . $url); |
|
| 122 | - exit(0); |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_item.tpl'; |
|
| 126 | - require $GLOBALS['xoops']->path('/header.php'); |
|
| 127 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 128 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 129 | - $GLOBALS['loaded_jquery'] = true; |
|
| 130 | - } |
|
| 131 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 132 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 133 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 134 | - $GLOBALS['xoopsTpl']->assign('songs', false); |
|
| 135 | - $GLOBALS['xoopsTpl']->assign('artist', $artist->toArray(true)); |
|
| 136 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 137 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 138 | - require $GLOBALS['xoops']->path('/footer.php'); |
|
| 139 | - break; |
|
| 140 | - } |
|
| 141 | - break; |
|
| 142 | - case 'browseby': |
|
| 143 | - switch ($fct) { |
|
| 144 | - default: |
|
| 145 | - case 'title': |
|
| 146 | - case 'lyrics': |
|
| 147 | - case 'artist': |
|
| 148 | - case 'album': |
|
| 149 | - $browse_criteria = new \CriteriaCompo(); |
|
| 150 | - switch ($value) { |
|
| 151 | - case '0': |
|
| 152 | - for ($u = 0; $u < 10; ++$u) { |
|
| 153 | - $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR'); |
|
| 154 | - } |
|
| 155 | - break; |
|
| 156 | - default: |
|
| 157 | - $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 158 | - $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 159 | - break; |
|
| 160 | - } |
|
| 161 | - $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 162 | - $criteria->add($browse_criteria); |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - $pagenav = new \XoopsPageNav($artistsHandler->getCount($criteria), $limit, $start, 'start', "op={$GLOBALS['op']}&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 166 | - |
|
| 167 | - $criteria->setLimit($limit); |
|
| 168 | - $criteria->setStart($start); |
|
| 169 | - |
|
| 170 | - $artists = $artistsHandler->getObjects($criteria, false); |
|
| 171 | - |
|
| 172 | - $ret = []; |
|
| 173 | - $col = 1; |
|
| 174 | - $row = 1; |
|
| 175 | - foreach ($artists as $artist) { |
|
| 176 | - $ret[$row][$col] = $artist->toArray(true); |
|
| 177 | - $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 178 | - ++$col; |
|
| 179 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 180 | - ++$row; |
|
| 181 | - $col = 1; |
|
| 182 | - } |
|
| 183 | - } |
|
| 184 | - if (1 != $col) { |
|
| 185 | - $col--; |
|
| 186 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 187 | - $ret[$row][$j][$artistsHandler->keyName] = 0; |
|
| 188 | - $ret[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 189 | - } |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - $url = $artistsHandler->getURL(false); |
|
| 193 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 194 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 195 | - header('Location: ' . $url); |
|
| 196 | - exit(0); |
|
| 197 | - } |
|
| 198 | - |
|
| 199 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl'; |
|
| 200 | - require $GLOBALS['xoops']->path('/header.php'); |
|
| 201 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 202 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 203 | - $GLOBALS['loaded_jquery'] = true; |
|
| 204 | - } |
|
| 205 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 206 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 207 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 208 | - $GLOBALS['xoopsTpl']->assign('results', $ret); |
|
| 209 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 210 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 211 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 212 | - if (0 != $_SESSION['cid']) { |
|
| 213 | - $category = $categoryHandler->get($_SESSION['cid']); |
|
| 214 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 215 | - } |
|
| 216 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 217 | - require $GLOBALS['xoops']->path('/footer.php'); |
|
| 218 | - |
|
| 219 | - break; |
|
| 220 | - case 'category': |
|
| 221 | - switch ($fct) { |
|
| 222 | - default: |
|
| 223 | - case 'set': |
|
| 224 | - $_SESSION['cid'] = $id; |
|
| 225 | - break; |
|
| 226 | - case 'home': |
|
| 227 | - unset($_SESSION['cid']); |
|
| 228 | - break; |
|
| 229 | - } |
|
| 230 | - redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=0&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 57 | + default: |
|
| 58 | + case 'item': |
|
| 59 | + switch ($fct) { |
|
| 60 | + default: |
|
| 61 | + case 'list': |
|
| 62 | + $pagenav = new \XoopsPageNav($artistsHandler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 63 | + |
|
| 64 | + $criteria_cat->setLimit($limit); |
|
| 65 | + $criteria_cat->setStart($start); |
|
| 66 | + |
|
| 67 | + $artists = $artistsHandler->getObjects($criteria_cat, false); |
|
| 68 | + |
|
| 69 | + $ret = []; |
|
| 70 | + $col = 1; |
|
| 71 | + $row = 1; |
|
| 72 | + foreach ($artists as $artist) { |
|
| 73 | + $ret[$row][$col] = $artist->toArray(true); |
|
| 74 | + $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 75 | + ++$col; |
|
| 76 | + if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 77 | + ++$row; |
|
| 78 | + $col = 1; |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + if (1 != $col) { |
|
| 82 | + for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 83 | + $ret[$row][$j][$artistsHandler->keyName] = 0; |
|
| 84 | + $ret[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + $url = $artistsHandler->getURL(false); |
|
| 89 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 90 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 91 | + header('Location: ' . $url); |
|
| 92 | + exit(0); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl'; |
|
| 96 | + require $GLOBALS['xoops']->path('/header.php'); |
|
| 97 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 98 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 99 | + $GLOBALS['loaded_jquery'] = true; |
|
| 100 | + } |
|
| 101 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 102 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 103 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 104 | + $GLOBALS['xoopsTpl']->assign('results', $ret); |
|
| 105 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 106 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 107 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 108 | + if (0 != $_SESSION['cid']) { |
|
| 109 | + $category = $categoryHandler->get($_SESSION['cid']); |
|
| 110 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 111 | + } |
|
| 112 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 113 | + require $GLOBALS['xoops']->path('/footer.php'); |
|
| 114 | + break; |
|
| 115 | + case 'item': |
|
| 116 | + $artist = $artistsHandler->get($id); |
|
| 117 | + |
|
| 118 | + $url = $artist->getURL(true); |
|
| 119 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 120 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 121 | + header('Location: ' . $url); |
|
| 122 | + exit(0); |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_item.tpl'; |
|
| 126 | + require $GLOBALS['xoops']->path('/header.php'); |
|
| 127 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 128 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 129 | + $GLOBALS['loaded_jquery'] = true; |
|
| 130 | + } |
|
| 131 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 132 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 133 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 134 | + $GLOBALS['xoopsTpl']->assign('songs', false); |
|
| 135 | + $GLOBALS['xoopsTpl']->assign('artist', $artist->toArray(true)); |
|
| 136 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 137 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 138 | + require $GLOBALS['xoops']->path('/footer.php'); |
|
| 139 | + break; |
|
| 140 | + } |
|
| 141 | + break; |
|
| 142 | + case 'browseby': |
|
| 143 | + switch ($fct) { |
|
| 144 | + default: |
|
| 145 | + case 'title': |
|
| 146 | + case 'lyrics': |
|
| 147 | + case 'artist': |
|
| 148 | + case 'album': |
|
| 149 | + $browse_criteria = new \CriteriaCompo(); |
|
| 150 | + switch ($value) { |
|
| 151 | + case '0': |
|
| 152 | + for ($u = 0; $u < 10; ++$u) { |
|
| 153 | + $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR'); |
|
| 154 | + } |
|
| 155 | + break; |
|
| 156 | + default: |
|
| 157 | + $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 158 | + $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 159 | + break; |
|
| 160 | + } |
|
| 161 | + $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 162 | + $criteria->add($browse_criteria); |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + $pagenav = new \XoopsPageNav($artistsHandler->getCount($criteria), $limit, $start, 'start', "op={$GLOBALS['op']}&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 166 | + |
|
| 167 | + $criteria->setLimit($limit); |
|
| 168 | + $criteria->setStart($start); |
|
| 169 | + |
|
| 170 | + $artists = $artistsHandler->getObjects($criteria, false); |
|
| 171 | + |
|
| 172 | + $ret = []; |
|
| 173 | + $col = 1; |
|
| 174 | + $row = 1; |
|
| 175 | + foreach ($artists as $artist) { |
|
| 176 | + $ret[$row][$col] = $artist->toArray(true); |
|
| 177 | + $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 178 | + ++$col; |
|
| 179 | + if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 180 | + ++$row; |
|
| 181 | + $col = 1; |
|
| 182 | + } |
|
| 183 | + } |
|
| 184 | + if (1 != $col) { |
|
| 185 | + $col--; |
|
| 186 | + for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 187 | + $ret[$row][$j][$artistsHandler->keyName] = 0; |
|
| 188 | + $ret[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 189 | + } |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + $url = $artistsHandler->getURL(false); |
|
| 193 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 194 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 195 | + header('Location: ' . $url); |
|
| 196 | + exit(0); |
|
| 197 | + } |
|
| 198 | + |
|
| 199 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl'; |
|
| 200 | + require $GLOBALS['xoops']->path('/header.php'); |
|
| 201 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 202 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 203 | + $GLOBALS['loaded_jquery'] = true; |
|
| 204 | + } |
|
| 205 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 206 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 207 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 208 | + $GLOBALS['xoopsTpl']->assign('results', $ret); |
|
| 209 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 210 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 211 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 212 | + if (0 != $_SESSION['cid']) { |
|
| 213 | + $category = $categoryHandler->get($_SESSION['cid']); |
|
| 214 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 215 | + } |
|
| 216 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 217 | + require $GLOBALS['xoops']->path('/footer.php'); |
|
| 218 | + |
|
| 219 | + break; |
|
| 220 | + case 'category': |
|
| 221 | + switch ($fct) { |
|
| 222 | + default: |
|
| 223 | + case 'set': |
|
| 224 | + $_SESSION['cid'] = $id; |
|
| 225 | + break; |
|
| 226 | + case 'home': |
|
| 227 | + unset($_SESSION['cid']); |
|
| 228 | + break; |
|
| 229 | + } |
|
| 230 | + redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=0&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 231 | 231 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | use XoopsModules\Songlist\CategoryHandler; |
| 5 | 5 | use XoopsModules\Songlist\ArtistsHandler; |
| 6 | 6 | |
| 7 | -require_once __DIR__ . '/header.php'; |
|
| 7 | +require_once __DIR__.'/header.php'; |
|
| 8 | 8 | |
| 9 | 9 | global $file, $op, $fct, $id, $value, $gid, $cid, $start, $limit; |
| 10 | 10 | |
@@ -12,12 +12,12 @@ discard block |
||
| 12 | 12 | $categoryHandler = Helper::getInstance()->getHandler('Category'); |
| 13 | 13 | $criteria_cat = new \CriteriaCompo(); |
| 14 | 14 | $cids = $categoryHandler->GetCatAndSubCat($_SESSION['cid']); |
| 15 | -if ($_SESSION['cid'] > 0) { |
|
| 15 | +if ($_SESSION['cid']>0) { |
|
| 16 | 16 | $cids[$_SESSION['cid']] = $_SESSION['cid']; |
| 17 | 17 | } |
| 18 | -if (count($cids) > 0 && 0 != $_SESSION['cid']) { |
|
| 18 | +if (count($cids)>0 && 0!=$_SESSION['cid']) { |
|
| 19 | 19 | foreach ($cids as $cid) { |
| 20 | - $criteria_cat->add(new \Criteria('`cids`', '%"' . $cid . '"%', 'LIKE'), 'OR'); |
|
| 20 | + $criteria_cat->add(new \Criteria('`cids`', '%"'.$cid.'"%', 'LIKE'), 'OR'); |
|
| 21 | 21 | } |
| 22 | 22 | } else { |
| 23 | 23 | $criteria_cat->add(new \Criteria(''), 'OR'); |
@@ -36,24 +36,24 @@ discard block |
||
| 36 | 36 | $row = 1; |
| 37 | 37 | foreach ($categories as $category) { |
| 38 | 38 | $cat[$row][$col] = $category->toArray(true); |
| 39 | - $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 39 | + $cat[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 40 | 40 | ++$col; |
| 41 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 41 | + if ($col>$GLOBALS['songlistModuleConfig']['cols']) { |
|
| 42 | 42 | ++$row; |
| 43 | 43 | $col = 1; |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | -if (1 != $col) { |
|
| 46 | +if (1!=$col) { |
|
| 47 | 47 | $col--; |
| 48 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 48 | + for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 49 | 49 | $cat[$row][$j][$categoryHandler->keyName] = 0; |
| 50 | - $cat[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 50 | + $cat[$row][$j]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** @var ArtistsHandler $artistsHandler */ |
| 55 | 55 | $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
| 56 | -switch ((string)$GLOBALS['op']) { |
|
| 56 | +switch ((string) $GLOBALS['op']) { |
|
| 57 | 57 | default: |
| 58 | 58 | case 'item': |
| 59 | 59 | switch ($fct) { |
@@ -71,41 +71,41 @@ discard block |
||
| 71 | 71 | $row = 1; |
| 72 | 72 | foreach ($artists as $artist) { |
| 73 | 73 | $ret[$row][$col] = $artist->toArray(true); |
| 74 | - $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 74 | + $ret[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 75 | 75 | ++$col; |
| 76 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 76 | + if ($col>$GLOBALS['songlistModuleConfig']['cols']) { |
|
| 77 | 77 | ++$row; |
| 78 | 78 | $col = 1; |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | - if (1 != $col) { |
|
| 82 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 81 | + if (1!=$col) { |
|
| 82 | + for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 83 | 83 | $ret[$row][$j][$artistsHandler->keyName] = 0; |
| 84 | - $ret[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 84 | + $ret[$row][$j]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $url = $artistsHandler->getURL(false); |
| 89 | 89 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 90 | 90 | header('HTTP/1.1 301 Moved Permanently'); |
| 91 | - header('Location: ' . $url); |
|
| 91 | + header('Location: '.$url); |
|
| 92 | 92 | exit(0); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl'; |
| 96 | 96 | require $GLOBALS['xoops']->path('/header.php'); |
| 97 | 97 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 98 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 98 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 99 | 99 | $GLOBALS['loaded_jquery'] = true; |
| 100 | 100 | } |
| 101 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 101 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 102 | 102 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 103 | 103 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 104 | 104 | $GLOBALS['xoopsTpl']->assign('results', $ret); |
| 105 | 105 | $GLOBALS['xoopsTpl']->assign('categories', $cat); |
| 106 | 106 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
| 107 | 107 | $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
| 108 | - if (0 != $_SESSION['cid']) { |
|
| 108 | + if (0!=$_SESSION['cid']) { |
|
| 109 | 109 | $category = $categoryHandler->get($_SESSION['cid']); |
| 110 | 110 | $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
| 111 | 111 | } |
@@ -118,17 +118,17 @@ discard block |
||
| 118 | 118 | $url = $artist->getURL(true); |
| 119 | 119 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 120 | 120 | header('HTTP/1.1 301 Moved Permanently'); |
| 121 | - header('Location: ' . $url); |
|
| 121 | + header('Location: '.$url); |
|
| 122 | 122 | exit(0); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_item.tpl'; |
| 126 | 126 | require $GLOBALS['xoops']->path('/header.php'); |
| 127 | 127 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 128 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 128 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 129 | 129 | $GLOBALS['loaded_jquery'] = true; |
| 130 | 130 | } |
| 131 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 131 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 132 | 132 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 133 | 133 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 134 | 134 | $GLOBALS['xoopsTpl']->assign('songs', false); |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | $browse_criteria = new \CriteriaCompo(); |
| 150 | 150 | switch ($value) { |
| 151 | 151 | case '0': |
| 152 | - for ($u = 0; $u < 10; ++$u) { |
|
| 153 | - $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR'); |
|
| 152 | + for ($u = 0; $u<10; ++$u) { |
|
| 153 | + $browse_criteria->add(new \Criteria('name', $u.'%', 'LIKE'), 'OR'); |
|
| 154 | 154 | } |
| 155 | 155 | break; |
| 156 | 156 | default: |
| 157 | - $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 158 | - $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 157 | + $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value).'%', 'LIKE'), 'OR'); |
|
| 158 | + $browse_criteria->add(new \Criteria('name', \mb_strtolower($value).'%', 'LIKE'), 'OR'); |
|
| 159 | 159 | break; |
| 160 | 160 | } |
| 161 | 161 | $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
@@ -174,42 +174,42 @@ discard block |
||
| 174 | 174 | $row = 1; |
| 175 | 175 | foreach ($artists as $artist) { |
| 176 | 176 | $ret[$row][$col] = $artist->toArray(true); |
| 177 | - $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 177 | + $ret[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 178 | 178 | ++$col; |
| 179 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 179 | + if ($col>$GLOBALS['songlistModuleConfig']['cols']) { |
|
| 180 | 180 | ++$row; |
| 181 | 181 | $col = 1; |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | - if (1 != $col) { |
|
| 184 | + if (1!=$col) { |
|
| 185 | 185 | $col--; |
| 186 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 186 | + for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 187 | 187 | $ret[$row][$j][$artistsHandler->keyName] = 0; |
| 188 | - $ret[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 188 | + $ret[$row][$j]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | $url = $artistsHandler->getURL(false); |
| 193 | 193 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 194 | 194 | header('HTTP/1.1 301 Moved Permanently'); |
| 195 | - header('Location: ' . $url); |
|
| 195 | + header('Location: '.$url); |
|
| 196 | 196 | exit(0); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_artists_index.tpl'; |
| 200 | 200 | require $GLOBALS['xoops']->path('/header.php'); |
| 201 | 201 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 202 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 202 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 203 | 203 | $GLOBALS['loaded_jquery'] = true; |
| 204 | 204 | } |
| 205 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 205 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 206 | 206 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 207 | 207 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 208 | 208 | $GLOBALS['xoopsTpl']->assign('results', $ret); |
| 209 | 209 | $GLOBALS['xoopsTpl']->assign('categories', $cat); |
| 210 | 210 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
| 211 | 211 | $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
| 212 | - if (0 != $_SESSION['cid']) { |
|
| 212 | + if (0!=$_SESSION['cid']) { |
|
| 213 | 213 | $category = $categoryHandler->get($_SESSION['cid']); |
| 214 | 214 | $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
| 215 | 215 | } |
@@ -227,5 +227,5 @@ discard block |
||
| 227 | 227 | unset($_SESSION['cid']); |
| 228 | 228 | break; |
| 229 | 229 | } |
| 230 | - redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=0&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 230 | + redirect_header($_SERVER['SCRIPT_NAME']."?op=item&fct=list&id=0&value=%&start=0&limit=$limit&cid=".$_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 231 | 231 | } |