@@ -6,14 +6,14 @@ |
||
| 6 | 6 | $moduleDirName = \basename(\dirname(__DIR__)); |
| 7 | 7 | |
| 8 | 8 | return [ |
| 9 | - 'name' => \mb_strtoupper($moduleDirName) . ' IconConfigurator', |
|
| 10 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . ' title=' . _EDIT . " align='middle'>", |
|
| 11 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt=" . _DELETE . ' title=' . _DELETE . " align='middle'>", |
|
| 12 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt=" . _CLONE . ' title=' . _CLONE . " align='middle'>", |
|
| 13 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt=" . _PREVIEW . ' title=' . _PREVIEW . " align='middle'>", |
|
| 14 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt=" . _PRINT . ' title=' . _PRINT . " align='middle'>", |
|
| 15 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt=" . _PDF . ' title=' . _PDF . " align='middle'>", |
|
| 16 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt=" . _ADD . ' title=' . _ADD . " align='middle'>", |
|
| 17 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt=" . 0 . ' title=' . _OFF . " align='middle'>", |
|
| 18 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt=" . 1 . ' title=' . _ON . " align='middle'>", |
|
| 9 | + 'name' => \mb_strtoupper($moduleDirName) . ' IconConfigurator', |
|
| 10 | + 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . ' title=' . _EDIT . " align='middle'>", |
|
| 11 | + 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt=" . _DELETE . ' title=' . _DELETE . " align='middle'>", |
|
| 12 | + 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt=" . _CLONE . ' title=' . _CLONE . " align='middle'>", |
|
| 13 | + 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt=" . _PREVIEW . ' title=' . _PREVIEW . " align='middle'>", |
|
| 14 | + 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt=" . _PRINT . ' title=' . _PRINT . " align='middle'>", |
|
| 15 | + 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt=" . _PDF . ' title=' . _PDF . " align='middle'>", |
|
| 16 | + 'add' => "<img src='" . $pathIcon16 . "/add.png' alt=" . _ADD . ' title=' . _ADD . " align='middle'>", |
|
| 17 | + '0' => "<img src='" . $pathIcon16 . "/0.png' alt=" . 0 . ' title=' . _OFF . " align='middle'>", |
|
| 18 | + '1' => "<img src='" . $pathIcon16 . "/1.png' alt=" . 1 . ' title=' . _ON . " align='middle'>", |
|
| 19 | 19 | ]; |
@@ -6,14 +6,14 @@ |
||
| 6 | 6 | $moduleDirName = \basename(\dirname(__DIR__)); |
| 7 | 7 | |
| 8 | 8 | return [ |
| 9 | - 'name' => \mb_strtoupper($moduleDirName) . ' IconConfigurator', |
|
| 10 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . ' title=' . _EDIT . " align='middle'>", |
|
| 11 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt=" . _DELETE . ' title=' . _DELETE . " align='middle'>", |
|
| 12 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt=" . _CLONE . ' title=' . _CLONE . " align='middle'>", |
|
| 13 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt=" . _PREVIEW . ' title=' . _PREVIEW . " align='middle'>", |
|
| 14 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt=" . _PRINT . ' title=' . _PRINT . " align='middle'>", |
|
| 15 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt=" . _PDF . ' title=' . _PDF . " align='middle'>", |
|
| 16 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt=" . _ADD . ' title=' . _ADD . " align='middle'>", |
|
| 17 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt=" . 0 . ' title=' . _OFF . " align='middle'>", |
|
| 18 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt=" . 1 . ' title=' . _ON . " align='middle'>", |
|
| 9 | + 'name' => \mb_strtoupper($moduleDirName).' IconConfigurator', |
|
| 10 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT.' title='._EDIT." align='middle'>", |
|
| 11 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt="._DELETE.' title='._DELETE." align='middle'>", |
|
| 12 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt="._CLONE.' title='._CLONE." align='middle'>", |
|
| 13 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt="._PREVIEW.' title='._PREVIEW." align='middle'>", |
|
| 14 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt="._PRINT.' title='._PRINT." align='middle'>", |
|
| 15 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt="._PDF.' title='._PDF." align='middle'>", |
|
| 16 | + 'add' => "<img src='".$pathIcon16."/add.png' alt="._ADD.' title='._ADD." align='middle'>", |
|
| 17 | + '0' => "<img src='".$pathIcon16."/0.png' alt=".0.' title='._OFF." align='middle'>", |
|
| 18 | + '1' => "<img src='".$pathIcon16."/1.png' alt=".1.' title='._ON." align='middle'>", |
|
| 19 | 19 | ]; |
@@ -21,69 +21,69 @@ |
||
| 21 | 21 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
| 22 | 22 | |
| 23 | 23 | return (object)[ |
| 24 | - 'name' => $moduleDirNameUpper . ' Module Configurator', |
|
| 25 | - 'paths' => [ |
|
| 26 | - 'dirname' => $moduleDirName, |
|
| 27 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 28 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 29 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 30 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 31 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 32 | - ], |
|
| 33 | - 'uploadFolders' => [ |
|
| 34 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 35 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
| 36 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
| 37 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/albums', |
|
| 38 | - ], |
|
| 39 | - 'copyBlankFiles' => [ |
|
| 40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 41 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
| 42 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
| 43 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/albums', |
|
| 44 | - ], |
|
| 24 | + 'name' => $moduleDirNameUpper . ' Module Configurator', |
|
| 25 | + 'paths' => [ |
|
| 26 | + 'dirname' => $moduleDirName, |
|
| 27 | + 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 28 | + 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 29 | + 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 30 | + 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 31 | + 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 32 | + ], |
|
| 33 | + 'uploadFolders' => [ |
|
| 34 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 35 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
| 36 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
| 37 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/albums', |
|
| 38 | + ], |
|
| 39 | + 'copyBlankFiles' => [ |
|
| 40 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 41 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
| 42 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
| 43 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/albums', |
|
| 44 | + ], |
|
| 45 | 45 | |
| 46 | - 'copyTestFolders' => [ |
|
| 47 | - [ |
|
| 48 | - XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads', |
|
| 49 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 50 | - ], |
|
| 51 | - // [ |
|
| 52 | - // XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/thumbs', |
|
| 53 | - // XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs', |
|
| 54 | - // ], |
|
| 55 | - ], |
|
| 46 | + 'copyTestFolders' => [ |
|
| 47 | + [ |
|
| 48 | + XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads', |
|
| 49 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 50 | + ], |
|
| 51 | + // [ |
|
| 52 | + // XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/thumbs', |
|
| 53 | + // XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs', |
|
| 54 | + // ], |
|
| 55 | + ], |
|
| 56 | 56 | |
| 57 | - 'templateFolders' => [ |
|
| 58 | - '/templates/', |
|
| 59 | - // '/templates/blocks/', |
|
| 60 | - // '/templates/admin/' |
|
| 61 | - ], |
|
| 62 | - 'oldFiles' => [ |
|
| 63 | - '/class/request.php', |
|
| 64 | - '/class/registry.php', |
|
| 65 | - '/class/utilities.php', |
|
| 66 | - '/class/util.php', |
|
| 67 | - // '/include/constants.php', |
|
| 68 | - // '/include/functions.php', |
|
| 69 | - '/ajaxrating.txt', |
|
| 70 | - ], |
|
| 71 | - 'oldFolders' => [ |
|
| 72 | - '/images', |
|
| 73 | - '/css', |
|
| 74 | - '/js', |
|
| 75 | - '/tcpdf', |
|
| 76 | - ], |
|
| 57 | + 'templateFolders' => [ |
|
| 58 | + '/templates/', |
|
| 59 | + // '/templates/blocks/', |
|
| 60 | + // '/templates/admin/' |
|
| 61 | + ], |
|
| 62 | + 'oldFiles' => [ |
|
| 63 | + '/class/request.php', |
|
| 64 | + '/class/registry.php', |
|
| 65 | + '/class/utilities.php', |
|
| 66 | + '/class/util.php', |
|
| 67 | + // '/include/constants.php', |
|
| 68 | + // '/include/functions.php', |
|
| 69 | + '/ajaxrating.txt', |
|
| 70 | + ], |
|
| 71 | + 'oldFolders' => [ |
|
| 72 | + '/images', |
|
| 73 | + '/css', |
|
| 74 | + '/js', |
|
| 75 | + '/tcpdf', |
|
| 76 | + ], |
|
| 77 | 77 | |
| 78 | - 'renameTables' => [// 'XX_archive' => 'ZZZZ_archive', |
|
| 79 | - ], |
|
| 80 | - 'renameColumns' => [// 'extcal_event' => ['from' => 'event_etablissement', 'to' => 'event_location'], |
|
| 81 | - ], |
|
| 82 | - 'moduleStats' => [ |
|
| 83 | - // 'totalcategories' => $helper->getHandler('Category')->getCategoriesCount(-1), |
|
| 84 | - // 'totalitems' => $helper->getHandler('Item')->getItemsCount(), |
|
| 85 | - // 'totalsubmitted' => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]), |
|
| 86 | - ], |
|
| 87 | - 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
|
| 78 | + 'renameTables' => [// 'XX_archive' => 'ZZZZ_archive', |
|
| 79 | + ], |
|
| 80 | + 'renameColumns' => [// 'extcal_event' => ['from' => 'event_etablissement', 'to' => 'event_location'], |
|
| 81 | + ], |
|
| 82 | + 'moduleStats' => [ |
|
| 83 | + // 'totalcategories' => $helper->getHandler('Category')->getCategoriesCount(-1), |
|
| 84 | + // 'totalitems' => $helper->getHandler('Item')->getItemsCount(), |
|
| 85 | + // 'totalsubmitted' => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]), |
|
| 86 | + ], |
|
| 87 | + 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
|
| 88 | 88 | <img src='" . Admin::iconUrl('xoopsmicrobutton.gif') . "' alt='XOOPS Project'></a>", |
| 89 | 89 | ]; |
@@ -20,33 +20,33 @@ discard block |
||
| 20 | 20 | $moduleDirName = \basename(\dirname(__DIR__)); |
| 21 | 21 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
| 22 | 22 | |
| 23 | -return (object)[ |
|
| 24 | - 'name' => $moduleDirNameUpper . ' Module Configurator', |
|
| 23 | +return (object) [ |
|
| 24 | + 'name' => $moduleDirNameUpper.' Module Configurator', |
|
| 25 | 25 | 'paths' => [ |
| 26 | 26 | 'dirname' => $moduleDirName, |
| 27 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 28 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 29 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 30 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 31 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 27 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
| 28 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
| 29 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
| 30 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 31 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
| 32 | 32 | ], |
| 33 | 33 | 'uploadFolders' => [ |
| 34 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 35 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
| 36 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
| 37 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/albums', |
|
| 34 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 35 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/category', |
|
| 36 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/screenshots', |
|
| 37 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/albums', |
|
| 38 | 38 | ], |
| 39 | 39 | 'copyBlankFiles' => [ |
| 40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 41 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
| 42 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
| 43 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/albums', |
|
| 40 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 41 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/category', |
|
| 42 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/screenshots', |
|
| 43 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/albums', |
|
| 44 | 44 | ], |
| 45 | 45 | |
| 46 | 46 | 'copyTestFolders' => [ |
| 47 | 47 | [ |
| 48 | - XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads', |
|
| 49 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 48 | + XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/testdata/uploads', |
|
| 49 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 50 | 50 | ], |
| 51 | 51 | // [ |
| 52 | 52 | // XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/thumbs', |
@@ -85,5 +85,5 @@ discard block |
||
| 85 | 85 | // 'totalsubmitted' => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]), |
| 86 | 86 | ], |
| 87 | 87 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
| 88 | - <img src='" . Admin::iconUrl('xoopsmicrobutton.gif') . "' alt='XOOPS Project'></a>", |
|
| 88 | + <img src='" . Admin::iconUrl('xoopsmicrobutton.gif')."' alt='XOOPS Project'></a>", |
|
| 89 | 89 | ]; |
@@ -5,37 +5,37 @@ |
||
| 5 | 5 | |
| 6 | 6 | // extra module configs |
| 7 | 7 | $modversion['config'][] = [ |
| 8 | - 'name' => 'imageConfigs', |
|
| 9 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
| 10 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
| 11 | - 'formtype' => 'line_break', |
|
| 12 | - 'valuetype' => 'textbox', |
|
| 13 | - 'default' => 'head', |
|
| 8 | + 'name' => 'imageConfigs', |
|
| 9 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
| 10 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
| 11 | + 'formtype' => 'line_break', |
|
| 12 | + 'valuetype' => 'textbox', |
|
| 13 | + 'default' => 'head', |
|
| 14 | 14 | ]; |
| 15 | 15 | |
| 16 | 16 | $modversion['config'][] = [ |
| 17 | - 'name' => 'imageWidth', |
|
| 18 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
| 19 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
| 20 | - 'formtype' => 'textbox', |
|
| 21 | - 'valuetype' => 'int', |
|
| 22 | - 'default' => 1200, |
|
| 17 | + 'name' => 'imageWidth', |
|
| 18 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
| 19 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
| 20 | + 'formtype' => 'textbox', |
|
| 21 | + 'valuetype' => 'int', |
|
| 22 | + 'default' => 1200, |
|
| 23 | 23 | ]; // =1024/16 |
| 24 | 24 | |
| 25 | 25 | $modversion['config'][] = [ |
| 26 | - 'name' => 'imageHeight', |
|
| 27 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
| 28 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
| 29 | - 'formtype' => 'textbox', |
|
| 30 | - 'valuetype' => 'int', |
|
| 31 | - 'default' => 800, |
|
| 26 | + 'name' => 'imageHeight', |
|
| 27 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
| 28 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
| 29 | + 'formtype' => 'textbox', |
|
| 30 | + 'valuetype' => 'int', |
|
| 31 | + 'default' => 800, |
|
| 32 | 32 | ]; // =768/16 |
| 33 | 33 | |
| 34 | 34 | $modversion['config'][] = [ |
| 35 | - 'name' => 'imageUploadPath', |
|
| 36 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
| 37 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
| 38 | - 'formtype' => 'textbox', |
|
| 39 | - 'valuetype' => 'text', |
|
| 40 | - 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
| 35 | + 'name' => 'imageUploadPath', |
|
| 36 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
| 37 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
| 38 | + 'formtype' => 'textbox', |
|
| 39 | + 'valuetype' => 'text', |
|
| 40 | + 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
| 41 | 41 | ]; |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | // extra module configs |
| 7 | 7 | $modversion['config'][] = [ |
| 8 | 8 | 'name' => 'imageConfigs', |
| 9 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
| 10 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
| 9 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG', |
|
| 10 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG_DSC', |
|
| 11 | 11 | 'formtype' => 'line_break', |
| 12 | 12 | 'valuetype' => 'textbox', |
| 13 | 13 | 'default' => 'head', |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | $modversion['config'][] = [ |
| 17 | 17 | 'name' => 'imageWidth', |
| 18 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
| 19 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
| 18 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH', |
|
| 19 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH_DSC', |
|
| 20 | 20 | 'formtype' => 'textbox', |
| 21 | 21 | 'valuetype' => 'int', |
| 22 | 22 | 'default' => 1200, |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $modversion['config'][] = [ |
| 26 | 26 | 'name' => 'imageHeight', |
| 27 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
| 28 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
| 27 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT', |
|
| 28 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT_DSC', |
|
| 29 | 29 | 'formtype' => 'textbox', |
| 30 | 30 | 'valuetype' => 'int', |
| 31 | 31 | 'default' => 800, |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $modversion['config'][] = [ |
| 35 | 35 | 'name' => 'imageUploadPath', |
| 36 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
| 37 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
| 36 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH', |
|
| 37 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH_DSC', |
|
| 38 | 38 | 'formtype' => 'textbox', |
| 39 | 39 | 'valuetype' => 'text', |
| 40 | - 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
| 40 | + 'default' => 'uploads/'.$modversion['dirname'].'/images', |
|
| 41 | 41 | ]; |
@@ -27,111 +27,111 @@ |
||
| 27 | 27 | $utf8mapHandler = Helper::getInstance()->getHandler('Utf8map'); |
| 28 | 28 | |
| 29 | 29 | switch ($op) { |
| 30 | - default: |
|
| 31 | - case 'search': |
|
| 32 | - $url = $songsHandler->getSearchURL(); |
|
| 33 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 34 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 35 | - header('Location: ' . $url); |
|
| 36 | - exit(0); |
|
| 37 | - } |
|
| 30 | + default: |
|
| 31 | + case 'search': |
|
| 32 | + $url = $songsHandler->getSearchURL(); |
|
| 33 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 34 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 35 | + header('Location: ' . $url); |
|
| 36 | + exit(0); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - switch ($fct) { |
|
| 40 | - default: |
|
| 41 | - case 'titleandlyrics': |
|
| 42 | - $criteria = new \CriteriaCompo(); |
|
| 43 | - foreach (explode(' ', $value) as $keyword) { |
|
| 44 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 45 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 46 | - } |
|
| 47 | - break; |
|
| 48 | - case 'albums': |
|
| 49 | - $criteria = new \CriteriaCompo(); |
|
| 50 | - foreach (explode(' ', $value) as $keyword) { |
|
| 51 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 52 | - } |
|
| 53 | - $albums = $albumsHandler->getObjects($criteria, true); |
|
| 54 | - $criteria = new \CriteriaCompo(); |
|
| 55 | - foreach ($albums as $abid => $album) { |
|
| 56 | - $criteria->add(new \Criteria('abid', $abid), 'OR'); |
|
| 57 | - } |
|
| 58 | - break; |
|
| 59 | - case 'artists': |
|
| 60 | - $criteria = new \CriteriaCompo(); |
|
| 61 | - foreach (explode(' ', $value) as $keyword) { |
|
| 62 | - $criteria->add(new \Criteria('name', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 63 | - } |
|
| 64 | - $artists = $artistsHandler->getObjects($criteria, true); |
|
| 65 | - $criteria = new \CriteriaCompo(); |
|
| 66 | - if (is_array($artists)) { |
|
| 67 | - foreach ($artists as $aid => $artist) { |
|
| 68 | - $criteria->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 69 | - } |
|
| 70 | - } |
|
| 71 | - break; |
|
| 72 | - case 'lyrics': |
|
| 73 | - $criteria = new \CriteriaCompo(); |
|
| 74 | - foreach (explode(' ', $value) as $keyword) { |
|
| 75 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 76 | - } |
|
| 77 | - break; |
|
| 78 | - case 'title': |
|
| 79 | - $criteria = new \CriteriaCompo(); |
|
| 80 | - foreach (explode(' ', $value) as $keyword) { |
|
| 81 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 82 | - } |
|
| 83 | - break; |
|
| 84 | - } |
|
| 39 | + switch ($fct) { |
|
| 40 | + default: |
|
| 41 | + case 'titleandlyrics': |
|
| 42 | + $criteria = new \CriteriaCompo(); |
|
| 43 | + foreach (explode(' ', $value) as $keyword) { |
|
| 44 | + $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 45 | + $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 46 | + } |
|
| 47 | + break; |
|
| 48 | + case 'albums': |
|
| 49 | + $criteria = new \CriteriaCompo(); |
|
| 50 | + foreach (explode(' ', $value) as $keyword) { |
|
| 51 | + $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 52 | + } |
|
| 53 | + $albums = $albumsHandler->getObjects($criteria, true); |
|
| 54 | + $criteria = new \CriteriaCompo(); |
|
| 55 | + foreach ($albums as $abid => $album) { |
|
| 56 | + $criteria->add(new \Criteria('abid', $abid), 'OR'); |
|
| 57 | + } |
|
| 58 | + break; |
|
| 59 | + case 'artists': |
|
| 60 | + $criteria = new \CriteriaCompo(); |
|
| 61 | + foreach (explode(' ', $value) as $keyword) { |
|
| 62 | + $criteria->add(new \Criteria('name', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 63 | + } |
|
| 64 | + $artists = $artistsHandler->getObjects($criteria, true); |
|
| 65 | + $criteria = new \CriteriaCompo(); |
|
| 66 | + if (is_array($artists)) { |
|
| 67 | + foreach ($artists as $aid => $artist) { |
|
| 68 | + $criteria->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | + break; |
|
| 72 | + case 'lyrics': |
|
| 73 | + $criteria = new \CriteriaCompo(); |
|
| 74 | + foreach (explode(' ', $value) as $keyword) { |
|
| 75 | + $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 76 | + } |
|
| 77 | + break; |
|
| 78 | + case 'title': |
|
| 79 | + $criteria = new \CriteriaCompo(); |
|
| 80 | + foreach (explode(' ', $value) as $keyword) { |
|
| 81 | + $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 82 | + } |
|
| 83 | + break; |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - if (0 != $gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 87 | - $criteria->add(new \Criteria('gids', '%"' . $gid . '"%', 'LIKE')); |
|
| 88 | - } |
|
| 86 | + if (0 != $gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 87 | + $criteria->add(new \Criteria('gids', '%"' . $gid . '"%', 'LIKE')); |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - if (0 != $vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 91 | - $criteria->add(new \Criteria('vcid', $vcid)); |
|
| 92 | - } |
|
| 90 | + if (0 != $vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 91 | + $criteria->add(new \Criteria('vcid', $vcid)); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - if (0 != ($_GET['cid'] ?? $cid)) { |
|
| 95 | - $criteria->add(new \Criteria('cid', ($_GET['cid'] ?? $cid))); |
|
| 96 | - } |
|
| 94 | + if (0 != ($_GET['cid'] ?? $cid)) { |
|
| 95 | + $criteria->add(new \Criteria('cid', ($_GET['cid'] ?? $cid))); |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria), $limit, $start, 'start', "?op=$op&fct=$fct&gid=$gid&vcid=$vcid&value=$value&limit=$limit"); |
|
| 98 | + $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria), $limit, $start, 'start', "?op=$op&fct=$fct&gid=$gid&vcid=$vcid&value=$value&limit=$limit"); |
|
| 99 | 99 | |
| 100 | - $criteria->setLimit($limit); |
|
| 101 | - $criteria->setStart($start); |
|
| 100 | + $criteria->setLimit($limit); |
|
| 101 | + $criteria->setStart($start); |
|
| 102 | 102 | |
| 103 | - $songs = $songsHandler->getObjects($criteria, false); |
|
| 103 | + $songs = $songsHandler->getObjects($criteria, false); |
|
| 104 | 104 | |
| 105 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_search_index.tpl'; |
|
| 106 | - require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 107 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 108 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 109 | - $GLOBALS['loaded_jquery'] = true; |
|
| 110 | - } |
|
| 111 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 112 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 113 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 114 | - foreach ($songs as $song) { |
|
| 115 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 116 | - } |
|
| 117 | - $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 118 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 119 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 120 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 121 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 122 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 123 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 124 | - require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 125 | - break; |
|
| 126 | - case 'category': |
|
| 127 | - switch ($fct) { |
|
| 128 | - default: |
|
| 129 | - case 'set': |
|
| 130 | - $_SESSION['cid'] = $id; |
|
| 131 | - break; |
|
| 132 | - case 'home': |
|
| 133 | - unset($_SESSION['cid']); |
|
| 134 | - break; |
|
| 135 | - } |
|
| 136 | - redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 105 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_search_index.tpl'; |
|
| 106 | + require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 107 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 108 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 109 | + $GLOBALS['loaded_jquery'] = true; |
|
| 110 | + } |
|
| 111 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 112 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 113 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 114 | + foreach ($songs as $song) { |
|
| 115 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 116 | + } |
|
| 117 | + $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 118 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 119 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 120 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 121 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 122 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 123 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 124 | + require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 125 | + break; |
|
| 126 | + case 'category': |
|
| 127 | + switch ($fct) { |
|
| 128 | + default: |
|
| 129 | + case 'set': |
|
| 130 | + $_SESSION['cid'] = $id; |
|
| 131 | + break; |
|
| 132 | + case 'home': |
|
| 133 | + unset($_SESSION['cid']); |
|
| 134 | + break; |
|
| 135 | + } |
|
| 136 | + redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 137 | 137 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | use XoopsModules\Songlist\SongsHandler; |
| 10 | 10 | use XoopsModules\Songlist\Utf8mapHandler; |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/header.php'; |
|
| 12 | +require_once __DIR__.'/header.php'; |
|
| 13 | 13 | |
| 14 | 14 | global $file, $op, $fct, $id, $value, $gid, $cid, $start, $limit, $singer; |
| 15 | 15 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $url = $songsHandler->getSearchURL(); |
| 33 | 33 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 34 | 34 | header('HTTP/1.1 301 Moved Permanently'); |
| 35 | - header('Location: ' . $url); |
|
| 35 | + header('Location: '.$url); |
|
| 36 | 36 | exit(0); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | case 'titleandlyrics': |
| 42 | 42 | $criteria = new \CriteriaCompo(); |
| 43 | 43 | foreach (explode(' ', $value) as $keyword) { |
| 44 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 45 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 44 | + $criteria->add(new \Criteria('title', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 45 | + $criteria->add(new \Criteria('lyrics', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 46 | 46 | } |
| 47 | 47 | break; |
| 48 | 48 | case 'albums': |
| 49 | 49 | $criteria = new \CriteriaCompo(); |
| 50 | 50 | foreach (explode(' ', $value) as $keyword) { |
| 51 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 51 | + $criteria->add(new \Criteria('title', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 52 | 52 | } |
| 53 | 53 | $albums = $albumsHandler->getObjects($criteria, true); |
| 54 | 54 | $criteria = new \CriteriaCompo(); |
@@ -59,39 +59,39 @@ discard block |
||
| 59 | 59 | case 'artists': |
| 60 | 60 | $criteria = new \CriteriaCompo(); |
| 61 | 61 | foreach (explode(' ', $value) as $keyword) { |
| 62 | - $criteria->add(new \Criteria('name', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 62 | + $criteria->add(new \Criteria('name', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 63 | 63 | } |
| 64 | 64 | $artists = $artistsHandler->getObjects($criteria, true); |
| 65 | 65 | $criteria = new \CriteriaCompo(); |
| 66 | 66 | if (is_array($artists)) { |
| 67 | 67 | foreach ($artists as $aid => $artist) { |
| 68 | - $criteria->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 68 | + $criteria->add(new \Criteria('aids', '%"'.$aid.'"%', 'LIKE'), 'OR'); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | break; |
| 72 | 72 | case 'lyrics': |
| 73 | 73 | $criteria = new \CriteriaCompo(); |
| 74 | 74 | foreach (explode(' ', $value) as $keyword) { |
| 75 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 75 | + $criteria->add(new \Criteria('lyrics', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 76 | 76 | } |
| 77 | 77 | break; |
| 78 | 78 | case 'title': |
| 79 | 79 | $criteria = new \CriteriaCompo(); |
| 80 | 80 | foreach (explode(' ', $value) as $keyword) { |
| 81 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 81 | + $criteria->add(new \Criteria('title', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 82 | 82 | } |
| 83 | 83 | break; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if (0 != $gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 87 | - $criteria->add(new \Criteria('gids', '%"' . $gid . '"%', 'LIKE')); |
|
| 86 | + if (0!=$gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 87 | + $criteria->add(new \Criteria('gids', '%"'.$gid.'"%', 'LIKE')); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if (0 != $vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 90 | + if (0!=$vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 91 | 91 | $criteria->add(new \Criteria('vcid', $vcid)); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if (0 != ($_GET['cid'] ?? $cid)) { |
|
| 94 | + if (0!=($_GET['cid'] ?? $cid)) { |
|
| 95 | 95 | $criteria->add(new \Criteria('cid', ($_GET['cid'] ?? $cid))); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_search_index.tpl'; |
| 106 | 106 | require_once $GLOBALS['xoops']->path('/header.php'); |
| 107 | 107 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 108 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 108 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 109 | 109 | $GLOBALS['loaded_jquery'] = true; |
| 110 | 110 | } |
| 111 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 111 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 112 | 112 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 113 | 113 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 114 | 114 | foreach ($songs as $song) { |
@@ -133,5 +133,5 @@ discard block |
||
| 133 | 133 | unset($_SESSION['cid']); |
| 134 | 134 | break; |
| 135 | 135 | } |
| 136 | - redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 136 | + redirect_header($_SERVER['SCRIPT_NAME']."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 137 | 137 | } |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
| 21 | 21 | |
| 22 | 22 | if (!defined('_CHARSET')) { |
| 23 | - define('_CHARSET', 'UTF-8'); |
|
| 23 | + define('_CHARSET', 'UTF-8'); |
|
| 24 | 24 | } |
| 25 | 25 | if (!defined('_CHARSET_ISO')) { |
| 26 | - define('_CHARSET_ISO', 'ISO-8859-1'); |
|
| 26 | + define('_CHARSET_ISO', 'ISO-8859-1'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $GLOBALS['myts'] = \MyTextSanitizer::getInstance(); |
@@ -64,5 +64,5 @@ discard block |
||
| 64 | 64 | $GLOBALS['limit'] = $_REQUEST['limit'] ?? $GLOBALS['songlistModuleConfig']['cols'] * $GLOBALS['songlistModuleConfig']['rows']; |
| 65 | 65 | |
| 66 | 66 | if (!isset($_SESSION['cid'])) { |
| 67 | - $_SESSION['cid'] = $GLOBALS['cid']; |
|
| 67 | + $_SESSION['cid'] = $GLOBALS['cid']; |
|
| 68 | 68 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | use Xmf\Request; |
| 19 | 19 | |
| 20 | -require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
|
| 20 | +require_once \dirname(__DIR__, 2).'/mainfile.php'; |
|
| 21 | 21 | |
| 22 | 22 | if (!defined('_CHARSET')) { |
| 23 | 23 | define('_CHARSET', 'UTF-8'); |
@@ -35,18 +35,18 @@ discard block |
||
| 35 | 35 | $GLOBALS['songlistModule'] = $moduleHandler->getByDirname('songlist'); |
| 36 | 36 | $GLOBALS['songlistModuleConfig'] = $configHandler->getConfigList($GLOBALS['songlistModule']->getVar('mid')); |
| 37 | 37 | |
| 38 | -ini_set('memory_limit', $GLOBALS['songlistModuleConfig']['memory_user'] . 'M'); |
|
| 38 | +ini_set('memory_limit', $GLOBALS['songlistModuleConfig']['memory_user'].'M'); |
|
| 39 | 39 | set_time_limit($GLOBALS['songlistModuleConfig']['time_user']); |
| 40 | 40 | |
| 41 | 41 | xoops_load('pagenav'); |
| 42 | 42 | xoops_load('xoopslists'); |
| 43 | 43 | xoops_load('xoopsformloader'); |
| 44 | -require_once $GLOBALS['xoops']->path('class' . DS . 'xoopsmailer.php'); |
|
| 44 | +require_once $GLOBALS['xoops']->path('class'.DS.'xoopsmailer.php'); |
|
| 45 | 45 | |
| 46 | 46 | xoops_loadLanguage('user'); |
| 47 | 47 | |
| 48 | 48 | //require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['songlistModule']->getVar('dirname') . '/include/functions.php'; |
| 49 | -require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['songlistModule']->getVar('dirname') . '/include/songlist.object.php'; |
|
| 49 | +require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['songlistModule']->getVar('dirname').'/include/songlist.object.php'; |
|
| 50 | 50 | //require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['songlistModule']->getVar('dirname') . '/include/songlist.form.php'; |
| 51 | 51 | |
| 52 | 52 | xoops_loadLanguage('main', 'songlist'); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $GLOBALS['vcid'] = Request::getInt('vcid', 0, 'REQUEST'); |
| 62 | 62 | $GLOBALS['cid'] = ((($_POST['cid'] ?? isset($_GET['cid'])) ? $_GET['cid'] : isset($_SESSION['cid'])) ? $_SESSION['cid'] : 0); |
| 63 | 63 | $GLOBALS['start'] = Request::getInt('start', 0, 'REQUEST'); |
| 64 | -$GLOBALS['limit'] = $_REQUEST['limit'] ?? $GLOBALS['songlistModuleConfig']['cols'] * $GLOBALS['songlistModuleConfig']['rows']; |
|
| 64 | +$GLOBALS['limit'] = $_REQUEST['limit'] ?? $GLOBALS['songlistModuleConfig']['cols']*$GLOBALS['songlistModuleConfig']['rows']; |
|
| 65 | 65 | |
| 66 | 66 | if (!isset($_SESSION['cid'])) { |
| 67 | 67 | $_SESSION['cid'] = $GLOBALS['cid']; |
@@ -37,122 +37,122 @@ discard block |
||
| 37 | 37 | $helper->loadLanguage('common'); |
| 38 | 38 | |
| 39 | 39 | switch ($op) { |
| 40 | - case 'load': |
|
| 41 | - if (Request::hasVar('ok', 'REQUEST') && 1 === Request::getInt('ok', 0)) { |
|
| 42 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 43 | - redirect_header($helper->url('admin/index.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 44 | - } |
|
| 45 | - loadSampleData(); |
|
| 46 | - } else { |
|
| 47 | - xoops_cp_header(); |
|
| 48 | - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 49 | - xoops_cp_footer(); |
|
| 50 | - } |
|
| 51 | - break; |
|
| 52 | - case 'save': |
|
| 53 | - saveSampleData(); |
|
| 54 | - break; |
|
| 55 | - case 'clear': |
|
| 56 | - if (Request::hasVar('ok', 'REQUEST') && 1 === Request::getInt('ok', 0)) { |
|
| 57 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 58 | - redirect_header($helper->url('admin/index.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 59 | - } |
|
| 60 | - clearSampleData(); |
|
| 61 | - } else { |
|
| 62 | - xoops_cp_header(); |
|
| 63 | - xoops_confirm(['ok' => 1, 'op' => 'clear'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 64 | - xoops_cp_footer(); |
|
| 65 | - } |
|
| 66 | - break; |
|
| 40 | + case 'load': |
|
| 41 | + if (Request::hasVar('ok', 'REQUEST') && 1 === Request::getInt('ok', 0)) { |
|
| 42 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 43 | + redirect_header($helper->url('admin/index.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 44 | + } |
|
| 45 | + loadSampleData(); |
|
| 46 | + } else { |
|
| 47 | + xoops_cp_header(); |
|
| 48 | + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 49 | + xoops_cp_footer(); |
|
| 50 | + } |
|
| 51 | + break; |
|
| 52 | + case 'save': |
|
| 53 | + saveSampleData(); |
|
| 54 | + break; |
|
| 55 | + case 'clear': |
|
| 56 | + if (Request::hasVar('ok', 'REQUEST') && 1 === Request::getInt('ok', 0)) { |
|
| 57 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 58 | + redirect_header($helper->url('admin/index.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 59 | + } |
|
| 60 | + clearSampleData(); |
|
| 61 | + } else { |
|
| 62 | + xoops_cp_header(); |
|
| 63 | + xoops_confirm(['ok' => 1, 'op' => 'clear'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 64 | + xoops_cp_footer(); |
|
| 65 | + } |
|
| 66 | + break; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // XMF TableLoad for SAMPLE data |
| 70 | 70 | |
| 71 | 71 | function loadSampleData(): void |
| 72 | 72 | { |
| 73 | - global $xoopsConfig; |
|
| 74 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 75 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 76 | - |
|
| 77 | - $utility = new Utility(); |
|
| 78 | - $configurator = new Configurator(); |
|
| 79 | - |
|
| 80 | - $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
|
| 81 | - |
|
| 82 | - $language = 'english/'; |
|
| 83 | - if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
| 84 | - $language = $xoopsConfig['language'] . '/'; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - // load module tables |
|
| 88 | - foreach ($tables as $table) { |
|
| 89 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 90 | - TableLoad::truncateTable($table); |
|
| 91 | - TableLoad::loadTableFromArray($table, $tabledata); |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - // load permissions |
|
| 95 | - $table = 'group_permission'; |
|
| 96 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 97 | - $mid = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); |
|
| 98 | - loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); |
|
| 99 | - |
|
| 100 | - // --- COPY test folder files --------------- |
|
| 101 | - if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders) > 0) { |
|
| 102 | - // $file = \dirname(__DIR__) . '/testdata/images/'; |
|
| 103 | - foreach (array_keys($configurator->copyTestFolders) as $i) { |
|
| 104 | - $src = $configurator->copyTestFolders[$i][0]; |
|
| 105 | - $dest = $configurator->copyTestFolders[$i][1]; |
|
| 106 | - $utility::rcopy($src, $dest); |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS')); |
|
| 73 | + global $xoopsConfig; |
|
| 74 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 75 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 76 | + |
|
| 77 | + $utility = new Utility(); |
|
| 78 | + $configurator = new Configurator(); |
|
| 79 | + |
|
| 80 | + $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
|
| 81 | + |
|
| 82 | + $language = 'english/'; |
|
| 83 | + if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
| 84 | + $language = $xoopsConfig['language'] . '/'; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + // load module tables |
|
| 88 | + foreach ($tables as $table) { |
|
| 89 | + $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 90 | + TableLoad::truncateTable($table); |
|
| 91 | + TableLoad::loadTableFromArray($table, $tabledata); |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + // load permissions |
|
| 95 | + $table = 'group_permission'; |
|
| 96 | + $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 97 | + $mid = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); |
|
| 98 | + loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); |
|
| 99 | + |
|
| 100 | + // --- COPY test folder files --------------- |
|
| 101 | + if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders) > 0) { |
|
| 102 | + // $file = \dirname(__DIR__) . '/testdata/images/'; |
|
| 103 | + foreach (array_keys($configurator->copyTestFolders) as $i) { |
|
| 104 | + $src = $configurator->copyTestFolders[$i][0]; |
|
| 105 | + $dest = $configurator->copyTestFolders[$i][1]; |
|
| 106 | + $utility::rcopy($src, $dest); |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS')); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | function saveSampleData(): void |
| 113 | 113 | { |
| 114 | - global $xoopsConfig; |
|
| 115 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 116 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 117 | - $helper = Helper::getInstance(); |
|
| 118 | - $tables = $helper->getModule()->getInfo('tables'); |
|
| 119 | - |
|
| 120 | - $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
| 121 | - if (!file_exists($languageFolder . '/')) { |
|
| 122 | - Utility::createFolder($languageFolder . '/'); |
|
| 123 | - } |
|
| 124 | - $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
| 125 | - Utility::createFolder($exportFolder); |
|
| 126 | - |
|
| 127 | - // save module tables |
|
| 128 | - foreach ($tables as $table) { |
|
| 129 | - TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - // save permissions |
|
| 133 | - $criteria = new \CriteriaCompo(); |
|
| 134 | - $criteria->add(new \Criteria('gperm_modid', $helper->getModule()->getVar('mid'))); |
|
| 135 | - $skipColumns[] = 'gperm_id'; |
|
| 136 | - TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
| 137 | - unset($criteria); |
|
| 138 | - |
|
| 139 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 114 | + global $xoopsConfig; |
|
| 115 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 116 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 117 | + $helper = Helper::getInstance(); |
|
| 118 | + $tables = $helper->getModule()->getInfo('tables'); |
|
| 119 | + |
|
| 120 | + $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
| 121 | + if (!file_exists($languageFolder . '/')) { |
|
| 122 | + Utility::createFolder($languageFolder . '/'); |
|
| 123 | + } |
|
| 124 | + $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
| 125 | + Utility::createFolder($exportFolder); |
|
| 126 | + |
|
| 127 | + // save module tables |
|
| 128 | + foreach ($tables as $table) { |
|
| 129 | + TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + // save permissions |
|
| 133 | + $criteria = new \CriteriaCompo(); |
|
| 134 | + $criteria->add(new \Criteria('gperm_modid', $helper->getModule()->getVar('mid'))); |
|
| 135 | + $skipColumns[] = 'gperm_id'; |
|
| 136 | + TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
| 137 | + unset($criteria); |
|
| 138 | + |
|
| 139 | + \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | function exportSchema(): void |
| 143 | 143 | { |
| 144 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 145 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 146 | - |
|
| 147 | - try { |
|
| 148 | - // TODO set exportSchema |
|
| 149 | - // $migrate = new Migrate($moduleDirName); |
|
| 150 | - // $migrate->saveCurrentSchema(); |
|
| 151 | - // |
|
| 152 | - // redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
|
| 153 | - } catch (\Throwable $e) { |
|
| 154 | - exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
| 155 | - } |
|
| 144 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 145 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 146 | + |
|
| 147 | + try { |
|
| 148 | + // TODO set exportSchema |
|
| 149 | + // $migrate = new Migrate($moduleDirName); |
|
| 150 | + // $migrate->saveCurrentSchema(); |
|
| 151 | + // |
|
| 152 | + // redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
|
| 153 | + } catch (\Throwable $e) { |
|
| 154 | + exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
| 155 | + } |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -169,58 +169,58 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | function loadTableFromArrayWithReplace($table, $data, $search, $replace): int |
| 171 | 171 | { |
| 172 | - /** @var \XoopsMySQLDatabase $db */ |
|
| 173 | - $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 174 | - |
|
| 175 | - $prefixedTable = $db->prefix($table); |
|
| 176 | - $count = 0; |
|
| 177 | - |
|
| 178 | - $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
| 179 | - |
|
| 180 | - $result = $db->queryF($sql); |
|
| 181 | - |
|
| 182 | - foreach ($data as $row) { |
|
| 183 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
| 184 | - $valueClause = ' VALUES ('; |
|
| 185 | - $first = true; |
|
| 186 | - foreach ($row as $column => $value) { |
|
| 187 | - if ($first) { |
|
| 188 | - $first = false; |
|
| 189 | - } else { |
|
| 190 | - $insertInto .= ', '; |
|
| 191 | - $valueClause .= ', '; |
|
| 192 | - } |
|
| 193 | - |
|
| 194 | - $insertInto .= $column; |
|
| 195 | - if ($search === $column) { |
|
| 196 | - $valueClause .= $db->quote($replace); |
|
| 197 | - } else { |
|
| 198 | - $valueClause .= $db->quote($value); |
|
| 199 | - } |
|
| 200 | - } |
|
| 201 | - |
|
| 202 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
| 203 | - |
|
| 204 | - $result = $db->queryF($sql); |
|
| 205 | - if (false !== $result) { |
|
| 206 | - ++$count; |
|
| 207 | - } |
|
| 208 | - } |
|
| 209 | - |
|
| 210 | - return $count; |
|
| 172 | + /** @var \XoopsMySQLDatabase $db */ |
|
| 173 | + $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 174 | + |
|
| 175 | + $prefixedTable = $db->prefix($table); |
|
| 176 | + $count = 0; |
|
| 177 | + |
|
| 178 | + $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
| 179 | + |
|
| 180 | + $result = $db->queryF($sql); |
|
| 181 | + |
|
| 182 | + foreach ($data as $row) { |
|
| 183 | + $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
| 184 | + $valueClause = ' VALUES ('; |
|
| 185 | + $first = true; |
|
| 186 | + foreach ($row as $column => $value) { |
|
| 187 | + if ($first) { |
|
| 188 | + $first = false; |
|
| 189 | + } else { |
|
| 190 | + $insertInto .= ', '; |
|
| 191 | + $valueClause .= ', '; |
|
| 192 | + } |
|
| 193 | + |
|
| 194 | + $insertInto .= $column; |
|
| 195 | + if ($search === $column) { |
|
| 196 | + $valueClause .= $db->quote($replace); |
|
| 197 | + } else { |
|
| 198 | + $valueClause .= $db->quote($value); |
|
| 199 | + } |
|
| 200 | + } |
|
| 201 | + |
|
| 202 | + $sql = $insertInto . ') ' . $valueClause . ')'; |
|
| 203 | + |
|
| 204 | + $result = $db->queryF($sql); |
|
| 205 | + if (false !== $result) { |
|
| 206 | + ++$count; |
|
| 207 | + } |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + return $count; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | function clearSampleData(): void |
| 214 | 214 | { |
| 215 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 216 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 217 | - $helper = Helper::getInstance(); |
|
| 218 | - // Load language files |
|
| 219 | - $helper->loadLanguage('common'); |
|
| 220 | - $tables = $helper->getModule()->getInfo('tables'); |
|
| 221 | - // truncate module tables |
|
| 222 | - foreach ($tables as $table) { |
|
| 223 | - \Xmf\Database\TableLoad::truncateTable($table); |
|
| 224 | - } |
|
| 225 | - redirect_header($helper->url('admin/index.php'), 1, constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK')); |
|
| 215 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
| 216 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 217 | + $helper = Helper::getInstance(); |
|
| 218 | + // Load language files |
|
| 219 | + $helper->loadLanguage('common'); |
|
| 220 | + $tables = $helper->getModule()->getInfo('tables'); |
|
| 221 | + // truncate module tables |
|
| 222 | + foreach ($tables as $table) { |
|
| 223 | + \Xmf\Database\TableLoad::truncateTable($table); |
|
| 224 | + } |
|
| 225 | + redirect_header($helper->url('admin/index.php'), 1, constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK')); |
|
| 226 | 226 | } |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | /** @var Helper $helper */ |
| 25 | 25 | /** @var Utility $utility */ |
| 26 | 26 | /** @var Configurator $configurator */ |
| 27 | -require \dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
| 28 | -require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 27 | +require \dirname(__DIR__, 3).'/include/cp_header.php'; |
|
| 28 | +require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 29 | 29 | |
| 30 | 30 | $op = Request::getCmd('op', ''); |
| 31 | 31 | |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | switch ($op) { |
| 40 | 40 | case 'load': |
| 41 | - if (Request::hasVar('ok', 'REQUEST') && 1 === Request::getInt('ok', 0)) { |
|
| 41 | + if (Request::hasVar('ok', 'REQUEST') && 1===Request::getInt('ok', 0)) { |
|
| 42 | 42 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 43 | 43 | redirect_header($helper->url('admin/index.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 44 | 44 | } |
| 45 | 45 | loadSampleData(); |
| 46 | 46 | } else { |
| 47 | 47 | xoops_cp_header(); |
| 48 | - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM'), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 48 | + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_CONFIRM'), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
| 49 | 49 | xoops_cp_footer(); |
| 50 | 50 | } |
| 51 | 51 | break; |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | saveSampleData(); |
| 54 | 54 | break; |
| 55 | 55 | case 'clear': |
| 56 | - if (Request::hasVar('ok', 'REQUEST') && 1 === Request::getInt('ok', 0)) { |
|
| 56 | + if (Request::hasVar('ok', 'REQUEST') && 1===Request::getInt('ok', 0)) { |
|
| 57 | 57 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 58 | 58 | redirect_header($helper->url('admin/index.php'), 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
| 59 | 59 | } |
| 60 | 60 | clearSampleData(); |
| 61 | 61 | } else { |
| 62 | 62 | xoops_cp_header(); |
| 63 | - xoops_confirm(['ok' => 1, 'op' => 'clear'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
| 63 | + xoops_confirm(['ok' => 1, 'op' => 'clear'], 'index.php', sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA')), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
| 64 | 64 | xoops_cp_footer(); |
| 65 | 65 | } |
| 66 | 66 | break; |
@@ -80,25 +80,25 @@ discard block |
||
| 80 | 80 | $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
| 81 | 81 | |
| 82 | 82 | $language = 'english/'; |
| 83 | - if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
| 84 | - $language = $xoopsConfig['language'] . '/'; |
|
| 83 | + if (is_dir(__DIR__.'/'.$xoopsConfig['language'])) { |
|
| 84 | + $language = $xoopsConfig['language'].'/'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // load module tables |
| 88 | 88 | foreach ($tables as $table) { |
| 89 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 89 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
| 90 | 90 | TableLoad::truncateTable($table); |
| 91 | 91 | TableLoad::loadTableFromArray($table, $tabledata); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // load permissions |
| 95 | 95 | $table = 'group_permission'; |
| 96 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
| 96 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
| 97 | 97 | $mid = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); |
| 98 | 98 | loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); |
| 99 | 99 | |
| 100 | 100 | // --- COPY test folder files --------------- |
| 101 | - if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders) > 0) { |
|
| 101 | + if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders)>0) { |
|
| 102 | 102 | // $file = \dirname(__DIR__) . '/testdata/images/'; |
| 103 | 103 | foreach (array_keys($configurator->copyTestFolders) as $i) { |
| 104 | 104 | $src = $configurator->copyTestFolders[$i][0]; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $utility::rcopy($src, $dest); |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS')); |
|
| 109 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_SUCCESS')); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | function saveSampleData(): void |
@@ -117,26 +117,26 @@ discard block |
||
| 117 | 117 | $helper = Helper::getInstance(); |
| 118 | 118 | $tables = $helper->getModule()->getInfo('tables'); |
| 119 | 119 | |
| 120 | - $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
| 121 | - if (!file_exists($languageFolder . '/')) { |
|
| 122 | - Utility::createFolder($languageFolder . '/'); |
|
| 120 | + $languageFolder = __DIR__.'/'.$xoopsConfig['language']; |
|
| 121 | + if (!file_exists($languageFolder.'/')) { |
|
| 122 | + Utility::createFolder($languageFolder.'/'); |
|
| 123 | 123 | } |
| 124 | - $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
| 124 | + $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/'; |
|
| 125 | 125 | Utility::createFolder($exportFolder); |
| 126 | 126 | |
| 127 | 127 | // save module tables |
| 128 | 128 | foreach ($tables as $table) { |
| 129 | - TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
| 129 | + TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // save permissions |
| 133 | 133 | $criteria = new \CriteriaCompo(); |
| 134 | 134 | $criteria->add(new \Criteria('gperm_modid', $helper->getModule()->getVar('mid'))); |
| 135 | 135 | $skipColumns[] = 'gperm_id'; |
| 136 | - TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
| 136 | + TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns); |
|
| 137 | 137 | unset($criteria); |
| 138 | 138 | |
| 139 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 139 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS')); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | function exportSchema(): void |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // |
| 152 | 152 | // redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
| 153 | 153 | } catch (\Throwable $e) { |
| 154 | - exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
| 154 | + exit(constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR')); |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
@@ -175,12 +175,12 @@ discard block |
||
| 175 | 175 | $prefixedTable = $db->prefix($table); |
| 176 | 176 | $count = 0; |
| 177 | 177 | |
| 178 | - $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
| 178 | + $sql = 'DELETE FROM '.$prefixedTable.' WHERE `'.$search.'`='.$db->quote($replace); |
|
| 179 | 179 | |
| 180 | 180 | $result = $db->queryF($sql); |
| 181 | 181 | |
| 182 | 182 | foreach ($data as $row) { |
| 183 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
| 183 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
| 184 | 184 | $valueClause = ' VALUES ('; |
| 185 | 185 | $first = true; |
| 186 | 186 | foreach ($row as $column => $value) { |
@@ -192,17 +192,17 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | $insertInto .= $column; |
| 195 | - if ($search === $column) { |
|
| 195 | + if ($search===$column) { |
|
| 196 | 196 | $valueClause .= $db->quote($replace); |
| 197 | 197 | } else { |
| 198 | 198 | $valueClause .= $db->quote($value); |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
| 202 | + $sql = $insertInto.') '.$valueClause.')'; |
|
| 203 | 203 | |
| 204 | 204 | $result = $db->queryF($sql); |
| 205 | - if (false !== $result) { |
|
| 205 | + if (false!==$result) { |
|
| 206 | 206 | ++$count; |
| 207 | 207 | } |
| 208 | 208 | } |
@@ -222,5 +222,5 @@ discard block |
||
| 222 | 222 | foreach ($tables as $table) { |
| 223 | 223 | \Xmf\Database\TableLoad::truncateTable($table); |
| 224 | 224 | } |
| 225 | - redirect_header($helper->url('admin/index.php'), 1, constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK')); |
|
| 225 | + redirect_header($helper->url('admin/index.php'), 1, constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA_OK')); |
|
| 226 | 226 | } |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | $criteria_cat = new \CriteriaCompo(); |
| 20 | 20 | $cids = $categoryHandler->GetCatAndSubCat($_SESSION['cid']); |
| 21 | 21 | if ($_SESSION['cid'] > 0) { |
| 22 | - $cids[$_SESSION['cid']] = $_SESSION['cid']; |
|
| 22 | + $cids[$_SESSION['cid']] = $_SESSION['cid']; |
|
| 23 | 23 | } |
| 24 | 24 | if (count($cids) > 0 && 0 != $_SESSION['cid']) { |
| 25 | - $criteria_cat->add(new \Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'), 'OR'); |
|
| 25 | + $criteria_cat->add(new \Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'), 'OR'); |
|
| 26 | 26 | } else { |
| 27 | - $criteria_cat->add(new \Criteria(''), 'OR'); |
|
| 27 | + $criteria_cat->add(new \Criteria(''), 'OR'); |
|
| 28 | 28 | } |
| 29 | 29 | $criteria_cat->setSort('created'); |
| 30 | 30 | $criteria_cat->setOrder('ASC'); |
@@ -38,20 +38,20 @@ discard block |
||
| 38 | 38 | $col = 1; |
| 39 | 39 | $row = 1; |
| 40 | 40 | foreach ($categories as $category) { |
| 41 | - $cat[$row][$col] = $category->toArray(true); |
|
| 42 | - $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 43 | - ++$col; |
|
| 44 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 45 | - ++$row; |
|
| 46 | - $col = 1; |
|
| 47 | - } |
|
| 41 | + $cat[$row][$col] = $category->toArray(true); |
|
| 42 | + $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 43 | + ++$col; |
|
| 44 | + if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 45 | + ++$row; |
|
| 46 | + $col = 1; |
|
| 47 | + } |
|
| 48 | 48 | } |
| 49 | 49 | if (1 != $col) { |
| 50 | - $col--; |
|
| 51 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 52 | - $cat[$row][$j][$categoryHandler->keyName] = 0; |
|
| 53 | - $cat[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 54 | - } |
|
| 50 | + $col--; |
|
| 51 | + for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 52 | + $cat[$row][$j][$categoryHandler->keyName] = 0; |
|
| 53 | + $cat[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 54 | + } |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $category_element = new SelectCategoryForm('', 'cid', ($_GET['cid'] ?? $cid)); |
@@ -61,324 +61,324 @@ discard block |
||
| 61 | 61 | /** @var SongsHandler $songsHandler */ |
| 62 | 62 | $songsHandler = Helper::getInstance()->getHandler('Songs'); |
| 63 | 63 | switch ($op) { |
| 64 | - case 'vote': |
|
| 65 | - /** @var VotesHandler $votesHandler */ |
|
| 66 | - $votesHandler = Helper::getInstance()->getHandler('Votes'); |
|
| 67 | - $votesHandler->addVote($id, $value); |
|
| 68 | - redirect_header($_POST['uri'], 10, _MD_SONGLIST_MSG_VOTED_ALREADY); |
|
| 69 | - // no break |
|
| 70 | - default: |
|
| 71 | - case 'item': |
|
| 72 | - switch ($fct) { |
|
| 73 | - default: |
|
| 74 | - case 'list': |
|
| 75 | - $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 64 | + case 'vote': |
|
| 65 | + /** @var VotesHandler $votesHandler */ |
|
| 66 | + $votesHandler = Helper::getInstance()->getHandler('Votes'); |
|
| 67 | + $votesHandler->addVote($id, $value); |
|
| 68 | + redirect_header($_POST['uri'], 10, _MD_SONGLIST_MSG_VOTED_ALREADY); |
|
| 69 | + // no break |
|
| 70 | + default: |
|
| 71 | + case 'item': |
|
| 72 | + switch ($fct) { |
|
| 73 | + default: |
|
| 74 | + case 'list': |
|
| 75 | + $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 76 | 76 | |
| 77 | - $criteria_cat->setLimit($limit); |
|
| 78 | - $criteria_cat->setStart($start); |
|
| 77 | + $criteria_cat->setLimit($limit); |
|
| 78 | + $criteria_cat->setStart($start); |
|
| 79 | 79 | |
| 80 | - $songs = $songsHandler->getObjects($criteria_cat, false); |
|
| 80 | + $songs = $songsHandler->getObjects($criteria_cat, false); |
|
| 81 | 81 | |
| 82 | - $url = $songsHandler->getURL(); |
|
| 83 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 84 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 85 | - header('Location: ' . $url); |
|
| 86 | - exit(0); |
|
| 87 | - } |
|
| 82 | + $url = $songsHandler->getURL(); |
|
| 83 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 84 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 85 | + header('Location: ' . $url); |
|
| 86 | + exit(0); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_index.tpl'; |
|
| 90 | - require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 91 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 92 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 93 | - $GLOBALS['loaded_jquery'] = true; |
|
| 94 | - } |
|
| 95 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 96 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 97 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 98 | - foreach ($songs as $song) { |
|
| 99 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 100 | - } |
|
| 101 | - $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 102 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 103 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 104 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 105 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 106 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 107 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 108 | - if (0 != $_SESSION['cid']) { |
|
| 109 | - $category = $categoryHandler->get($_SESSION['cid']); |
|
| 110 | - if (is_object($category)) { |
|
| 111 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 112 | - } |
|
| 113 | - } |
|
| 114 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 115 | - require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 116 | - break; |
|
| 117 | - case 'item': |
|
| 118 | - $song = $songsHandler->get($id); |
|
| 89 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_index.tpl'; |
|
| 90 | + require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 91 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 92 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 93 | + $GLOBALS['loaded_jquery'] = true; |
|
| 94 | + } |
|
| 95 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 96 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 97 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 98 | + foreach ($songs as $song) { |
|
| 99 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 100 | + } |
|
| 101 | + $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 102 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 103 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 104 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 105 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 106 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 107 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 108 | + if (0 != $_SESSION['cid']) { |
|
| 109 | + $category = $categoryHandler->get($_SESSION['cid']); |
|
| 110 | + if (is_object($category)) { |
|
| 111 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 112 | + } |
|
| 113 | + } |
|
| 114 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 115 | + require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 116 | + break; |
|
| 117 | + case 'item': |
|
| 118 | + $song = $songsHandler->get($id); |
|
| 119 | 119 | |
| 120 | - $url = $song->getURL(true); |
|
| 121 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 122 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 123 | - header('Location: ' . $url); |
|
| 124 | - exit(0); |
|
| 125 | - } |
|
| 120 | + $url = $song->getURL(true); |
|
| 121 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 122 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 123 | + header('Location: ' . $url); |
|
| 124 | + exit(0); |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_item.tpl'; |
|
| 128 | - require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 129 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 130 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 131 | - $GLOBALS['loaded_jquery'] = true; |
|
| 132 | - } |
|
| 133 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 134 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 135 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 136 | - $GLOBALS['xoopsTpl']->assign('songs', false); |
|
| 137 | - $GLOBALS['xoopsTpl']->assign('song', $song->toArray(true)); |
|
| 138 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 139 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 140 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 141 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 142 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 143 | - require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 144 | - break; |
|
| 145 | - } |
|
| 146 | - break; |
|
| 147 | - case 'browseby': |
|
| 148 | - switch ($fct) { |
|
| 149 | - default: |
|
| 150 | - case 'title': |
|
| 151 | - $browse_criteria = new \CriteriaCompo(); |
|
| 152 | - switch ($value) { |
|
| 153 | - case '0': |
|
| 154 | - for ($u = 0; $u < 10; ++$u) { |
|
| 155 | - $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR'); |
|
| 156 | - } |
|
| 157 | - break; |
|
| 158 | - default: |
|
| 159 | - $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 160 | - $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 161 | - break; |
|
| 162 | - } |
|
| 163 | - $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 164 | - $criteria->add($browse_criteria); |
|
| 165 | - break; |
|
| 166 | - case 'lyrics': |
|
| 167 | - $browse_criteria = new \CriteriaCompo(); |
|
| 168 | - switch ($value) { |
|
| 169 | - case '0': |
|
| 170 | - for ($u = 0; $u < 10; ++$u) { |
|
| 171 | - $browse_criteria->add(new \Criteria('lyrics', $u . '%', 'LIKE'), 'OR'); |
|
| 172 | - } |
|
| 173 | - break; |
|
| 174 | - default: |
|
| 175 | - $browse_criteria->add(new \Criteria('lyrics', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 176 | - $browse_criteria->add(new \Criteria('lyrics', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 177 | - break; |
|
| 178 | - } |
|
| 179 | - $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 180 | - $criteria->add($browse_criteria); |
|
| 181 | - break; |
|
| 182 | - case 'artist': |
|
| 183 | - $browse_criteria = new \CriteriaCompo(); |
|
| 184 | - switch ($value) { |
|
| 185 | - case '0': |
|
| 186 | - for ($u = 0; $u < 10; ++$u) { |
|
| 187 | - $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR'); |
|
| 188 | - } |
|
| 189 | - break; |
|
| 190 | - default: |
|
| 191 | - $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 192 | - $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 193 | - break; |
|
| 194 | - } |
|
| 195 | - $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
|
| 196 | - $browse_criteriab = new \CriteriaCompo(); |
|
| 197 | - foreach ($artistsHandler->getObjects($browse_criteria, true) as $aid => $obj) { |
|
| 198 | - $browse_criteriab->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 199 | - } |
|
| 200 | - $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 201 | - $criteria->add($browse_criteriab); |
|
| 202 | - break; |
|
| 203 | - case 'album': |
|
| 204 | - $browse_criteria = new \CriteriaCompo(); |
|
| 205 | - switch ($value) { |
|
| 206 | - case '0': |
|
| 207 | - for ($u = 0; $u < 10; ++$u) { |
|
| 208 | - $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR'); |
|
| 209 | - } |
|
| 210 | - break; |
|
| 211 | - default: |
|
| 212 | - $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 213 | - $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 214 | - break; |
|
| 215 | - } |
|
| 216 | - $ids = []; |
|
| 217 | - $albumsHandler = Helper::getInstance()->getHandler('Albums'); |
|
| 218 | - foreach ($albumsHandler->getObjects($browse_criteria, true) as $id => $obj) { |
|
| 219 | - $ids[$id] = $id; |
|
| 220 | - } |
|
| 221 | - $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 222 | - if (count($ids) > 0) { |
|
| 223 | - $criteria->add(new \Criteria('abid', '(' . implode(',', $ids) . ')', 'IN')); |
|
| 224 | - } |
|
| 225 | - break; |
|
| 226 | - } |
|
| 127 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_item.tpl'; |
|
| 128 | + require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 129 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 130 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 131 | + $GLOBALS['loaded_jquery'] = true; |
|
| 132 | + } |
|
| 133 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 134 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 135 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 136 | + $GLOBALS['xoopsTpl']->assign('songs', false); |
|
| 137 | + $GLOBALS['xoopsTpl']->assign('song', $song->toArray(true)); |
|
| 138 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 139 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 140 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 141 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 142 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 143 | + require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 144 | + break; |
|
| 145 | + } |
|
| 146 | + break; |
|
| 147 | + case 'browseby': |
|
| 148 | + switch ($fct) { |
|
| 149 | + default: |
|
| 150 | + case 'title': |
|
| 151 | + $browse_criteria = new \CriteriaCompo(); |
|
| 152 | + switch ($value) { |
|
| 153 | + case '0': |
|
| 154 | + for ($u = 0; $u < 10; ++$u) { |
|
| 155 | + $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR'); |
|
| 156 | + } |
|
| 157 | + break; |
|
| 158 | + default: |
|
| 159 | + $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 160 | + $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 161 | + break; |
|
| 162 | + } |
|
| 163 | + $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 164 | + $criteria->add($browse_criteria); |
|
| 165 | + break; |
|
| 166 | + case 'lyrics': |
|
| 167 | + $browse_criteria = new \CriteriaCompo(); |
|
| 168 | + switch ($value) { |
|
| 169 | + case '0': |
|
| 170 | + for ($u = 0; $u < 10; ++$u) { |
|
| 171 | + $browse_criteria->add(new \Criteria('lyrics', $u . '%', 'LIKE'), 'OR'); |
|
| 172 | + } |
|
| 173 | + break; |
|
| 174 | + default: |
|
| 175 | + $browse_criteria->add(new \Criteria('lyrics', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 176 | + $browse_criteria->add(new \Criteria('lyrics', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 177 | + break; |
|
| 178 | + } |
|
| 179 | + $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 180 | + $criteria->add($browse_criteria); |
|
| 181 | + break; |
|
| 182 | + case 'artist': |
|
| 183 | + $browse_criteria = new \CriteriaCompo(); |
|
| 184 | + switch ($value) { |
|
| 185 | + case '0': |
|
| 186 | + for ($u = 0; $u < 10; ++$u) { |
|
| 187 | + $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR'); |
|
| 188 | + } |
|
| 189 | + break; |
|
| 190 | + default: |
|
| 191 | + $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 192 | + $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 193 | + break; |
|
| 194 | + } |
|
| 195 | + $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
|
| 196 | + $browse_criteriab = new \CriteriaCompo(); |
|
| 197 | + foreach ($artistsHandler->getObjects($browse_criteria, true) as $aid => $obj) { |
|
| 198 | + $browse_criteriab->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 199 | + } |
|
| 200 | + $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 201 | + $criteria->add($browse_criteriab); |
|
| 202 | + break; |
|
| 203 | + case 'album': |
|
| 204 | + $browse_criteria = new \CriteriaCompo(); |
|
| 205 | + switch ($value) { |
|
| 206 | + case '0': |
|
| 207 | + for ($u = 0; $u < 10; ++$u) { |
|
| 208 | + $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR'); |
|
| 209 | + } |
|
| 210 | + break; |
|
| 211 | + default: |
|
| 212 | + $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 213 | + $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 214 | + break; |
|
| 215 | + } |
|
| 216 | + $ids = []; |
|
| 217 | + $albumsHandler = Helper::getInstance()->getHandler('Albums'); |
|
| 218 | + foreach ($albumsHandler->getObjects($browse_criteria, true) as $id => $obj) { |
|
| 219 | + $ids[$id] = $id; |
|
| 220 | + } |
|
| 221 | + $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
|
| 222 | + if (count($ids) > 0) { |
|
| 223 | + $criteria->add(new \Criteria('abid', '(' . implode(',', $ids) . ')', 'IN')); |
|
| 224 | + } |
|
| 225 | + break; |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | - $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 228 | + $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
| 229 | 229 | |
| 230 | - $criteria->setLimit($limit); |
|
| 231 | - $criteria->setStart($start); |
|
| 230 | + $criteria->setLimit($limit); |
|
| 231 | + $criteria->setStart($start); |
|
| 232 | 232 | |
| 233 | - $songs = $songsHandler->getObjects($criteria, false); |
|
| 233 | + $songs = $songsHandler->getObjects($criteria, false); |
|
| 234 | 234 | |
| 235 | - $url = $songsHandler->getURL(); |
|
| 236 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 237 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 238 | - header('Location: ' . $url); |
|
| 239 | - exit(0); |
|
| 240 | - } |
|
| 235 | + $url = $songsHandler->getURL(); |
|
| 236 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 237 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 238 | + header('Location: ' . $url); |
|
| 239 | + exit(0); |
|
| 240 | + } |
|
| 241 | 241 | |
| 242 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_index.tpl'; |
|
| 243 | - require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 244 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 245 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 246 | - $GLOBALS['loaded_jquery'] = true; |
|
| 247 | - } |
|
| 248 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 249 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 250 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 251 | - foreach ($songs as $song) { |
|
| 252 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 253 | - } |
|
| 254 | - $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 255 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 256 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 257 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 258 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 259 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 260 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 261 | - if (0 != $_SESSION['cid']) { |
|
| 262 | - $category = $categoryHandler->get($_SESSION['cid']); |
|
| 263 | - if (is_object($category)) { |
|
| 264 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 265 | - } |
|
| 266 | - } |
|
| 267 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 268 | - require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 269 | - break; |
|
| 270 | - break; |
|
| 271 | - case 'search': |
|
| 272 | - /** @var SongsHandler $songsHandler */ |
|
| 273 | - $songsHandler = Helper::getInstance()->getHandler('Songs'); |
|
| 274 | - $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
|
| 242 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_index.tpl'; |
|
| 243 | + require_once $GLOBALS['xoops']->path('/header.php'); |
|
| 244 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 245 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 246 | + $GLOBALS['loaded_jquery'] = true; |
|
| 247 | + } |
|
| 248 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 249 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 250 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 251 | + foreach ($songs as $song) { |
|
| 252 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 253 | + } |
|
| 254 | + $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 255 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
| 256 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 257 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 258 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 259 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 260 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 261 | + if (0 != $_SESSION['cid']) { |
|
| 262 | + $category = $categoryHandler->get($_SESSION['cid']); |
|
| 263 | + if (is_object($category)) { |
|
| 264 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
| 265 | + } |
|
| 266 | + } |
|
| 267 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 268 | + require_once $GLOBALS['xoops']->path('/footer.php'); |
|
| 269 | + break; |
|
| 270 | + break; |
|
| 271 | + case 'search': |
|
| 272 | + /** @var SongsHandler $songsHandler */ |
|
| 273 | + $songsHandler = Helper::getInstance()->getHandler('Songs'); |
|
| 274 | + $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
|
| 275 | 275 | |
| 276 | - /** @var Utf8mapHandler $utf8mapHandler */ |
|
| 277 | - $utf8mapHandler = Helper::getInstance()->getHandler('Utf8map'); |
|
| 276 | + /** @var Utf8mapHandler $utf8mapHandler */ |
|
| 277 | + $utf8mapHandler = Helper::getInstance()->getHandler('Utf8map'); |
|
| 278 | 278 | |
| 279 | - $url = $songsHandler->getSearchURL(); |
|
| 280 | - if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 281 | - header('HTTP/1.1 301 Moved Permanently'); |
|
| 282 | - header('Location: ' . $url); |
|
| 283 | - exit(0); |
|
| 284 | - } |
|
| 279 | + $url = $songsHandler->getSearchURL(); |
|
| 280 | + if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
|
| 281 | + header('HTTP/1.1 301 Moved Permanently'); |
|
| 282 | + header('Location: ' . $url); |
|
| 283 | + exit(0); |
|
| 284 | + } |
|
| 285 | 285 | |
| 286 | - switch ($fct) { |
|
| 287 | - default: |
|
| 288 | - case 'titleandlyrics': |
|
| 289 | - $criteria = new \CriteriaCompo(); |
|
| 290 | - foreach (explode(' ', $value) as $keyword) { |
|
| 291 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 292 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 293 | - } |
|
| 294 | - break; |
|
| 295 | - case 'albums': |
|
| 296 | - $criteria = new \CriteriaCompo(); |
|
| 297 | - foreach (explode(' ', $value) as $keyword) { |
|
| 298 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 299 | - } |
|
| 300 | - $albums = $albumsHandler->getObjects($criteria, true); |
|
| 301 | - $criteria = new \CriteriaCompo(); |
|
| 302 | - foreach ($albums as $abid => $album) { |
|
| 303 | - $criteria->add(new \Criteria('abid', $abid), 'OR'); |
|
| 304 | - } |
|
| 305 | - break; |
|
| 306 | - case 'artists': |
|
| 307 | - $criteria = new \CriteriaCompo(); |
|
| 308 | - foreach (explode(' ', $value) as $keyword) { |
|
| 309 | - $criteria->add(new \Criteria('name', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 310 | - } |
|
| 311 | - $artists = $artistsHandler->getObjects($criteria, true); |
|
| 312 | - $criteria = new \CriteriaCompo(); |
|
| 313 | - if (is_array($artists)) { |
|
| 314 | - foreach ($artists as $aid => $artist) { |
|
| 315 | - $criteria->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 316 | - } |
|
| 317 | - } |
|
| 318 | - break; |
|
| 319 | - case 'lyrics': |
|
| 320 | - $criteria = new \CriteriaCompo(); |
|
| 321 | - foreach (explode(' ', $value) as $keyword) { |
|
| 322 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 323 | - } |
|
| 324 | - break; |
|
| 325 | - case 'title': |
|
| 326 | - $criteria = new \CriteriaCompo(); |
|
| 327 | - foreach (explode(' ', $value) as $keyword) { |
|
| 328 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 329 | - } |
|
| 330 | - break; |
|
| 331 | - } |
|
| 286 | + switch ($fct) { |
|
| 287 | + default: |
|
| 288 | + case 'titleandlyrics': |
|
| 289 | + $criteria = new \CriteriaCompo(); |
|
| 290 | + foreach (explode(' ', $value) as $keyword) { |
|
| 291 | + $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 292 | + $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 293 | + } |
|
| 294 | + break; |
|
| 295 | + case 'albums': |
|
| 296 | + $criteria = new \CriteriaCompo(); |
|
| 297 | + foreach (explode(' ', $value) as $keyword) { |
|
| 298 | + $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 299 | + } |
|
| 300 | + $albums = $albumsHandler->getObjects($criteria, true); |
|
| 301 | + $criteria = new \CriteriaCompo(); |
|
| 302 | + foreach ($albums as $abid => $album) { |
|
| 303 | + $criteria->add(new \Criteria('abid', $abid), 'OR'); |
|
| 304 | + } |
|
| 305 | + break; |
|
| 306 | + case 'artists': |
|
| 307 | + $criteria = new \CriteriaCompo(); |
|
| 308 | + foreach (explode(' ', $value) as $keyword) { |
|
| 309 | + $criteria->add(new \Criteria('name', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 310 | + } |
|
| 311 | + $artists = $artistsHandler->getObjects($criteria, true); |
|
| 312 | + $criteria = new \CriteriaCompo(); |
|
| 313 | + if (is_array($artists)) { |
|
| 314 | + foreach ($artists as $aid => $artist) { |
|
| 315 | + $criteria->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 316 | + } |
|
| 317 | + } |
|
| 318 | + break; |
|
| 319 | + case 'lyrics': |
|
| 320 | + $criteria = new \CriteriaCompo(); |
|
| 321 | + foreach (explode(' ', $value) as $keyword) { |
|
| 322 | + $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 323 | + } |
|
| 324 | + break; |
|
| 325 | + case 'title': |
|
| 326 | + $criteria = new \CriteriaCompo(); |
|
| 327 | + foreach (explode(' ', $value) as $keyword) { |
|
| 328 | + $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 329 | + } |
|
| 330 | + break; |
|
| 331 | + } |
|
| 332 | 332 | |
| 333 | - if (0 != $gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 334 | - $criteria->add(new \Criteria('gids', '%"' . $gid . '"%', 'LIKE')); |
|
| 335 | - } |
|
| 333 | + if (0 != $gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 334 | + $criteria->add(new \Criteria('gids', '%"' . $gid . '"%', 'LIKE')); |
|
| 335 | + } |
|
| 336 | 336 | |
| 337 | - if (0 != $vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 338 | - $criteria->add(new \Criteria('vcid', $vcid)); |
|
| 339 | - } |
|
| 337 | + if (0 != $vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 338 | + $criteria->add(new \Criteria('vcid', $vcid)); |
|
| 339 | + } |
|
| 340 | 340 | |
| 341 | - if (0 != ($_GET['cid'] ?? $cid)) { |
|
| 342 | - $criteria->add(new \Criteria('cid', ($_GET['cid'] ?? $cid))); |
|
| 343 | - } |
|
| 341 | + if (0 != ($_GET['cid'] ?? $cid)) { |
|
| 342 | + $criteria->add(new \Criteria('cid', ($_GET['cid'] ?? $cid))); |
|
| 343 | + } |
|
| 344 | 344 | |
| 345 | - $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&gid=$gid&vcid=$vcid&value=$value&limit=$limit"); |
|
| 345 | + $pagenav = new \XoopsPageNav($songsHandler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&gid=$gid&vcid=$vcid&value=$value&limit=$limit"); |
|
| 346 | 346 | |
| 347 | - $criteria->setLimit($limit); |
|
| 348 | - $criteria->setStart($start); |
|
| 347 | + $criteria->setLimit($limit); |
|
| 348 | + $criteria->setStart($start); |
|
| 349 | 349 | |
| 350 | - $songs = $songsHandler->getObjects($criteria, false); |
|
| 350 | + $songs = $songsHandler->getObjects($criteria, false); |
|
| 351 | 351 | |
| 352 | - $GLOBALS['xoopsOption']['template_main'] = 'songlist_search_index.tpl'; |
|
| 353 | - require $GLOBALS['xoops']->path('/header.php'); |
|
| 354 | - if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 355 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 356 | - $GLOBALS['loaded_jquery'] = true; |
|
| 357 | - } |
|
| 358 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 359 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 360 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 361 | - foreach ($songs as $song) { |
|
| 362 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 363 | - } |
|
| 364 | - $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 365 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 366 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 367 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 368 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 369 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 370 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 371 | - require $GLOBALS['xoops']->path('/footer.php'); |
|
| 372 | - break; |
|
| 373 | - case 'category': |
|
| 374 | - switch ($fct) { |
|
| 375 | - default: |
|
| 376 | - case 'set': |
|
| 377 | - $_SESSION['cid'] = $id; |
|
| 378 | - break; |
|
| 379 | - case 'home': |
|
| 380 | - unset($_SESSION['cid']); |
|
| 381 | - break; |
|
| 382 | - } |
|
| 383 | - redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 352 | + $GLOBALS['xoopsOption']['template_main'] = 'songlist_search_index.tpl'; |
|
| 353 | + require $GLOBALS['xoops']->path('/header.php'); |
|
| 354 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
| 355 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 356 | + $GLOBALS['loaded_jquery'] = true; |
|
| 357 | + } |
|
| 358 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 359 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
| 360 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
|
| 361 | + foreach ($songs as $song) { |
|
| 362 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
| 363 | + } |
|
| 364 | + $GLOBALS['xoopsTpl']->assign('songs', true); |
|
| 365 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
| 366 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
| 367 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
| 368 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
| 369 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
| 370 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
| 371 | + require $GLOBALS['xoops']->path('/footer.php'); |
|
| 372 | + break; |
|
| 373 | + case 'category': |
|
| 374 | + switch ($fct) { |
|
| 375 | + default: |
|
| 376 | + case 'set': |
|
| 377 | + $_SESSION['cid'] = $id; |
|
| 378 | + break; |
|
| 379 | + case 'home': |
|
| 380 | + unset($_SESSION['cid']); |
|
| 381 | + break; |
|
| 382 | + } |
|
| 383 | + redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 384 | 384 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | use XoopsModules\Songlist\Utf8mapHandler; |
| 11 | 11 | |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/header.php'; |
|
| 13 | +require_once __DIR__.'/header.php'; |
|
| 14 | 14 | |
| 15 | 15 | global $file, $op, $fct, $id, $value, $gid, $cid, $vcid, $start, $limit, $singer; |
| 16 | 16 | |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | $categoryHandler = Helper::getInstance()->getHandler('Category'); |
| 19 | 19 | $criteria_cat = new \CriteriaCompo(); |
| 20 | 20 | $cids = $categoryHandler->GetCatAndSubCat($_SESSION['cid']); |
| 21 | -if ($_SESSION['cid'] > 0) { |
|
| 21 | +if ($_SESSION['cid']>0) { |
|
| 22 | 22 | $cids[$_SESSION['cid']] = $_SESSION['cid']; |
| 23 | 23 | } |
| 24 | -if (count($cids) > 0 && 0 != $_SESSION['cid']) { |
|
| 25 | - $criteria_cat->add(new \Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'), 'OR'); |
|
| 24 | +if (count($cids)>0 && 0!=$_SESSION['cid']) { |
|
| 25 | + $criteria_cat->add(new \Criteria('cid', '('.implode(',', $cids).')', 'IN'), 'OR'); |
|
| 26 | 26 | } else { |
| 27 | 27 | $criteria_cat->add(new \Criteria(''), 'OR'); |
| 28 | 28 | } |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | $row = 1; |
| 40 | 40 | foreach ($categories as $category) { |
| 41 | 41 | $cat[$row][$col] = $category->toArray(true); |
| 42 | - $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 42 | + $cat[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 43 | 43 | ++$col; |
| 44 | - if ($col > $GLOBALS['songlistModuleConfig']['cols']) { |
|
| 44 | + if ($col>$GLOBALS['songlistModuleConfig']['cols']) { |
|
| 45 | 45 | ++$row; |
| 46 | 46 | $col = 1; |
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | -if (1 != $col) { |
|
| 49 | +if (1!=$col) { |
|
| 50 | 50 | $col--; |
| 51 | - for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 51 | + for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) { |
|
| 52 | 52 | $cat[$row][$j][$categoryHandler->keyName] = 0; |
| 53 | - $cat[$row][$j]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%'; |
|
| 53 | + $cat[$row][$j]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -82,17 +82,17 @@ discard block |
||
| 82 | 82 | $url = $songsHandler->getURL(); |
| 83 | 83 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 84 | 84 | header('HTTP/1.1 301 Moved Permanently'); |
| 85 | - header('Location: ' . $url); |
|
| 85 | + header('Location: '.$url); |
|
| 86 | 86 | exit(0); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_index.tpl'; |
| 90 | 90 | require_once $GLOBALS['xoops']->path('/header.php'); |
| 91 | 91 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 92 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 92 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 93 | 93 | $GLOBALS['loaded_jquery'] = true; |
| 94 | 94 | } |
| 95 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 95 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 96 | 96 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 97 | 97 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 98 | 98 | foreach ($songs as $song) { |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
| 106 | 106 | $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
| 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 | if (is_object($category)) { |
| 111 | 111 | $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
@@ -120,17 +120,17 @@ discard block |
||
| 120 | 120 | $url = $song->getURL(true); |
| 121 | 121 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 122 | 122 | header('HTTP/1.1 301 Moved Permanently'); |
| 123 | - header('Location: ' . $url); |
|
| 123 | + header('Location: '.$url); |
|
| 124 | 124 | exit(0); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_item.tpl'; |
| 128 | 128 | require_once $GLOBALS['xoops']->path('/header.php'); |
| 129 | 129 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 130 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 130 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 131 | 131 | $GLOBALS['loaded_jquery'] = true; |
| 132 | 132 | } |
| 133 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 133 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 134 | 134 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 135 | 135 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 136 | 136 | $GLOBALS['xoopsTpl']->assign('songs', false); |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | $browse_criteria = new \CriteriaCompo(); |
| 152 | 152 | switch ($value) { |
| 153 | 153 | case '0': |
| 154 | - for ($u = 0; $u < 10; ++$u) { |
|
| 155 | - $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR'); |
|
| 154 | + for ($u = 0; $u<10; ++$u) { |
|
| 155 | + $browse_criteria->add(new \Criteria('title', $u.'%', 'LIKE'), 'OR'); |
|
| 156 | 156 | } |
| 157 | 157 | break; |
| 158 | 158 | default: |
| 159 | - $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 160 | - $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 159 | + $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value).'%', 'LIKE'), 'OR'); |
|
| 160 | + $browse_criteria->add(new \Criteria('title', \mb_strtolower($value).'%', 'LIKE'), 'OR'); |
|
| 161 | 161 | break; |
| 162 | 162 | } |
| 163 | 163 | $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
@@ -167,13 +167,13 @@ discard block |
||
| 167 | 167 | $browse_criteria = new \CriteriaCompo(); |
| 168 | 168 | switch ($value) { |
| 169 | 169 | case '0': |
| 170 | - for ($u = 0; $u < 10; ++$u) { |
|
| 171 | - $browse_criteria->add(new \Criteria('lyrics', $u . '%', 'LIKE'), 'OR'); |
|
| 170 | + for ($u = 0; $u<10; ++$u) { |
|
| 171 | + $browse_criteria->add(new \Criteria('lyrics', $u.'%', 'LIKE'), 'OR'); |
|
| 172 | 172 | } |
| 173 | 173 | break; |
| 174 | 174 | default: |
| 175 | - $browse_criteria->add(new \Criteria('lyrics', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 176 | - $browse_criteria->add(new \Criteria('lyrics', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 175 | + $browse_criteria->add(new \Criteria('lyrics', \mb_strtoupper($value).'%', 'LIKE'), 'OR'); |
|
| 176 | + $browse_criteria->add(new \Criteria('lyrics', \mb_strtolower($value).'%', 'LIKE'), 'OR'); |
|
| 177 | 177 | break; |
| 178 | 178 | } |
| 179 | 179 | $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
@@ -183,19 +183,19 @@ discard block |
||
| 183 | 183 | $browse_criteria = new \CriteriaCompo(); |
| 184 | 184 | switch ($value) { |
| 185 | 185 | case '0': |
| 186 | - for ($u = 0; $u < 10; ++$u) { |
|
| 187 | - $browse_criteria->add(new \Criteria('name', $u . '%', 'LIKE'), 'OR'); |
|
| 186 | + for ($u = 0; $u<10; ++$u) { |
|
| 187 | + $browse_criteria->add(new \Criteria('name', $u.'%', 'LIKE'), 'OR'); |
|
| 188 | 188 | } |
| 189 | 189 | break; |
| 190 | 190 | default: |
| 191 | - $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 192 | - $browse_criteria->add(new \Criteria('name', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 191 | + $browse_criteria->add(new \Criteria('name', \mb_strtoupper($value).'%', 'LIKE'), 'OR'); |
|
| 192 | + $browse_criteria->add(new \Criteria('name', \mb_strtolower($value).'%', 'LIKE'), 'OR'); |
|
| 193 | 193 | break; |
| 194 | 194 | } |
| 195 | 195 | $artistsHandler = Helper::getInstance()->getHandler('Artists'); |
| 196 | 196 | $browse_criteriab = new \CriteriaCompo(); |
| 197 | 197 | foreach ($artistsHandler->getObjects($browse_criteria, true) as $aid => $obj) { |
| 198 | - $browse_criteriab->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 198 | + $browse_criteriab->add(new \Criteria('aids', '%"'.$aid.'"%', 'LIKE'), 'OR'); |
|
| 199 | 199 | } |
| 200 | 200 | $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
| 201 | 201 | $criteria->add($browse_criteriab); |
@@ -204,13 +204,13 @@ discard block |
||
| 204 | 204 | $browse_criteria = new \CriteriaCompo(); |
| 205 | 205 | switch ($value) { |
| 206 | 206 | case '0': |
| 207 | - for ($u = 0; $u < 10; ++$u) { |
|
| 208 | - $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR'); |
|
| 207 | + for ($u = 0; $u<10; ++$u) { |
|
| 208 | + $browse_criteria->add(new \Criteria('title', $u.'%', 'LIKE'), 'OR'); |
|
| 209 | 209 | } |
| 210 | 210 | break; |
| 211 | 211 | default: |
| 212 | - $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR'); |
|
| 213 | - $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR'); |
|
| 212 | + $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value).'%', 'LIKE'), 'OR'); |
|
| 213 | + $browse_criteria->add(new \Criteria('title', \mb_strtolower($value).'%', 'LIKE'), 'OR'); |
|
| 214 | 214 | break; |
| 215 | 215 | } |
| 216 | 216 | $ids = []; |
@@ -219,8 +219,8 @@ discard block |
||
| 219 | 219 | $ids[$id] = $id; |
| 220 | 220 | } |
| 221 | 221 | $criteria = new \CriteriaCompo($criteria_cat, 'AND'); |
| 222 | - if (count($ids) > 0) { |
|
| 223 | - $criteria->add(new \Criteria('abid', '(' . implode(',', $ids) . ')', 'IN')); |
|
| 222 | + if (count($ids)>0) { |
|
| 223 | + $criteria->add(new \Criteria('abid', '('.implode(',', $ids).')', 'IN')); |
|
| 224 | 224 | } |
| 225 | 225 | break; |
| 226 | 226 | } |
@@ -235,17 +235,17 @@ discard block |
||
| 235 | 235 | $url = $songsHandler->getURL(); |
| 236 | 236 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 237 | 237 | header('HTTP/1.1 301 Moved Permanently'); |
| 238 | - header('Location: ' . $url); |
|
| 238 | + header('Location: '.$url); |
|
| 239 | 239 | exit(0); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_songs_index.tpl'; |
| 243 | 243 | require_once $GLOBALS['xoops']->path('/header.php'); |
| 244 | 244 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 245 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 245 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 246 | 246 | $GLOBALS['loaded_jquery'] = true; |
| 247 | 247 | } |
| 248 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 248 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 249 | 249 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 250 | 250 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 251 | 251 | foreach ($songs as $song) { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
| 259 | 259 | $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
| 260 | 260 | $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
| 261 | - if (0 != $_SESSION['cid']) { |
|
| 261 | + if (0!=$_SESSION['cid']) { |
|
| 262 | 262 | $category = $categoryHandler->get($_SESSION['cid']); |
| 263 | 263 | if (is_object($category)) { |
| 264 | 264 | $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $url = $songsHandler->getSearchURL(); |
| 280 | 280 | if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) { |
| 281 | 281 | header('HTTP/1.1 301 Moved Permanently'); |
| 282 | - header('Location: ' . $url); |
|
| 282 | + header('Location: '.$url); |
|
| 283 | 283 | exit(0); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -288,14 +288,14 @@ discard block |
||
| 288 | 288 | case 'titleandlyrics': |
| 289 | 289 | $criteria = new \CriteriaCompo(); |
| 290 | 290 | foreach (explode(' ', $value) as $keyword) { |
| 291 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 292 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 291 | + $criteria->add(new \Criteria('title', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 292 | + $criteria->add(new \Criteria('lyrics', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 293 | 293 | } |
| 294 | 294 | break; |
| 295 | 295 | case 'albums': |
| 296 | 296 | $criteria = new \CriteriaCompo(); |
| 297 | 297 | foreach (explode(' ', $value) as $keyword) { |
| 298 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 298 | + $criteria->add(new \Criteria('title', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 299 | 299 | } |
| 300 | 300 | $albums = $albumsHandler->getObjects($criteria, true); |
| 301 | 301 | $criteria = new \CriteriaCompo(); |
@@ -306,39 +306,39 @@ discard block |
||
| 306 | 306 | case 'artists': |
| 307 | 307 | $criteria = new \CriteriaCompo(); |
| 308 | 308 | foreach (explode(' ', $value) as $keyword) { |
| 309 | - $criteria->add(new \Criteria('name', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 309 | + $criteria->add(new \Criteria('name', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 310 | 310 | } |
| 311 | 311 | $artists = $artistsHandler->getObjects($criteria, true); |
| 312 | 312 | $criteria = new \CriteriaCompo(); |
| 313 | 313 | if (is_array($artists)) { |
| 314 | 314 | foreach ($artists as $aid => $artist) { |
| 315 | - $criteria->add(new \Criteria('aids', '%"' . $aid . '"%', 'LIKE'), 'OR'); |
|
| 315 | + $criteria->add(new \Criteria('aids', '%"'.$aid.'"%', 'LIKE'), 'OR'); |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | break; |
| 319 | 319 | case 'lyrics': |
| 320 | 320 | $criteria = new \CriteriaCompo(); |
| 321 | 321 | foreach (explode(' ', $value) as $keyword) { |
| 322 | - $criteria->add(new \Criteria('lyrics', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 322 | + $criteria->add(new \Criteria('lyrics', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 323 | 323 | } |
| 324 | 324 | break; |
| 325 | 325 | case 'title': |
| 326 | 326 | $criteria = new \CriteriaCompo(); |
| 327 | 327 | foreach (explode(' ', $value) as $keyword) { |
| 328 | - $criteria->add(new \Criteria('title', '%' . $utf8mapHandler->convert($keyword) . '%', 'LIKE')); |
|
| 328 | + $criteria->add(new \Criteria('title', '%'.$utf8mapHandler->convert($keyword).'%', 'LIKE')); |
|
| 329 | 329 | } |
| 330 | 330 | break; |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | - if (0 != $gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 334 | - $criteria->add(new \Criteria('gids', '%"' . $gid . '"%', 'LIKE')); |
|
| 333 | + if (0!=$gid && $GLOBALS['songlistModuleConfig']['genre']) { |
|
| 334 | + $criteria->add(new \Criteria('gids', '%"'.$gid.'"%', 'LIKE')); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | - if (0 != $vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 337 | + if (0!=$vcid && $GLOBALS['songlistModuleConfig']['voice']) { |
|
| 338 | 338 | $criteria->add(new \Criteria('vcid', $vcid)); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - if (0 != ($_GET['cid'] ?? $cid)) { |
|
| 341 | + if (0!=($_GET['cid'] ?? $cid)) { |
|
| 342 | 342 | $criteria->add(new \Criteria('cid', ($_GET['cid'] ?? $cid))); |
| 343 | 343 | } |
| 344 | 344 | |
@@ -352,10 +352,10 @@ discard block |
||
| 352 | 352 | $GLOBALS['xoopsOption']['template_main'] = 'songlist_search_index.tpl'; |
| 353 | 353 | require $GLOBALS['xoops']->path('/header.php'); |
| 354 | 354 | if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
| 355 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 355 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']); |
|
| 356 | 356 | $GLOBALS['loaded_jquery'] = true; |
| 357 | 357 | } |
| 358 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 358 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']); |
|
| 359 | 359 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
| 360 | 360 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']); |
| 361 | 361 | foreach ($songs as $song) { |
@@ -380,5 +380,5 @@ discard block |
||
| 380 | 380 | unset($_SESSION['cid']); |
| 381 | 381 | break; |
| 382 | 382 | } |
| 383 | - redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 383 | + redirect_header($_SERVER['SCRIPT_NAME']."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit&cid=".$_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED); |
|
| 384 | 384 | } |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | $moduleDirName = basename(dirname(__DIR__, 2)); |
| 15 | 15 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
| 16 | 16 | |
| 17 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_AVAILABLE', "<span style='color: green;'>Available</span>"); |
|
| 18 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTAVAILABLE', "<span style='color: red;'>Not available</span>"); |
|
| 19 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>"); |
|
| 20 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_CREATETHEDIR', 'Create it'); |
|
| 21 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_SETMPERM', 'Set the permission'); |
|
| 22 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRCREATED', 'The directory has been created'); |
|
| 23 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRNOTCREATED', 'The directory cannot be created'); |
|
| 24 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMSET', 'The permission has been set'); |
|
| 25 | -define('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMNOTSET', 'The permission cannot be set'); |
|
| 17 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_AVAILABLE', "<span style='color: green;'>Available</span>"); |
|
| 18 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_NOTAVAILABLE', "<span style='color: red;'>Not available</span>"); |
|
| 19 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>"); |
|
| 20 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_CREATETHEDIR', 'Create it'); |
|
| 21 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_SETMPERM', 'Set the permission'); |
|
| 22 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_DIRCREATED', 'The directory has been created'); |
|
| 23 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_DIRNOTCREATED', 'The directory cannot be created'); |
|
| 24 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_PERMSET', 'The permission has been set'); |
|
| 25 | +define('CO_'.$moduleDirNameUpper.'_'.'DC_PERMNOTSET', 'The permission cannot be set'); |
|
@@ -201,7 +201,7 @@ |
||
| 201 | 201 | define('_FRM_SONGLIST_FORM_IMPORT_UPLOAD_XML', 'XML File to import'); |
| 202 | 202 | define('_FRM_SONGLIST_FORM_IMPORT_UPLOAD_XML_DESC', 'SELECT the XML File you wish TO IMPORT FROM your SYSTEM.'); |
| 203 | 203 | define('_FRM_SONGLIST_FORM_IMPORT_EXISTING_XML', 'Use Existing File instead of Uploading'); |
| 204 | -define('_FRM_SONGLIST_FORM_IMPORT_EXISTING_XML_DESC', 'Upload Existing XML file to: ' . $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])); |
|
| 204 | +define('_FRM_SONGLIST_FORM_IMPORT_EXISTING_XML_DESC', 'Upload Existing XML file to: '.$GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])); |
|
| 205 | 205 | |
| 206 | 206 | //Import Wizard B |
| 207 | 207 | define('_FRM_SONGLIST_FORM_ISNEW_ELEMENTS', 'Set XML Elements to Import'); |