Passed
Pull Request — master (#2)
by Michael
07:10 queued 03:28
created
testdata/index.php 2 patches
Indentation   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -37,122 +37,122 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
index.php 2 patches
Indentation   +314 added lines, -314 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
language/english/directorychecker.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
language/english/forms.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
language/english/filechecker.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 $moduleDirName      = basename(dirname(__DIR__, 2));
15 15
 $moduleDirNameUpper = mb_strtoupper($moduleDirName);
16 16
 
17
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_AVAILABLE', "<span style='color: green;'>Available</span>");
18
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTAVAILABLE', "<span style='color: red;'>Not available</span>");
19
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>");
20
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_COPYTHEFILE', 'Copy it');
21
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_CREATETHEFILE', 'Create it');
22
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_SETMPERM', 'Set the permission');
23
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_FILECOPIED', 'The file has been copied');
24
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_FILENOTCOPIED', 'The file cannot be copied');
25
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_PERMSET', 'The permission has been set');
26
-define('CO_' . $moduleDirNameUpper . '_' . 'FC_PERMNOTSET', 'The permission cannot be set');
17
+define('CO_'.$moduleDirNameUpper.'_'.'FC_AVAILABLE', "<span style='color: green;'>Available</span>");
18
+define('CO_'.$moduleDirNameUpper.'_'.'FC_NOTAVAILABLE', "<span style='color: red;'>Not available</span>");
19
+define('CO_'.$moduleDirNameUpper.'_'.'FC_NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>");
20
+define('CO_'.$moduleDirNameUpper.'_'.'FC_COPYTHEFILE', 'Copy it');
21
+define('CO_'.$moduleDirNameUpper.'_'.'FC_CREATETHEFILE', 'Create it');
22
+define('CO_'.$moduleDirNameUpper.'_'.'FC_SETMPERM', 'Set the permission');
23
+define('CO_'.$moduleDirNameUpper.'_'.'FC_FILECOPIED', 'The file has been copied');
24
+define('CO_'.$moduleDirNameUpper.'_'.'FC_FILENOTCOPIED', 'The file cannot be copied');
25
+define('CO_'.$moduleDirNameUpper.'_'.'FC_PERMSET', 'The permission has been set');
26
+define('CO_'.$moduleDirNameUpper.'_'.'FC_PERMNOTSET', 'The permission cannot be set');
Please login to merge, or discard this patch.
language/english/feedback.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,21 +21,21 @@
 block discarded – undo
21 21
 $moduleDirName      = \basename(\dirname(__DIR__, 2));
22 22
 $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
23 23
 
24
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE', 'Send a feedback');
25
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT', 'Recipient');
26
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME', 'Name');
27
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER', 'Please enter your name');
28
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE', 'Website');
29
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER', 'Please enter your website');
30
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL', 'Email');
31
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER', 'Please enter your email');
32
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE', 'Type of feedback');
33
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION', 'Suggestions');
34
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS', 'Bugs');
35
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL', 'Testimonials');
36
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES', 'Features');
37
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS', 'Misc');
38
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT', 'Feedback content');
39
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR', 'Feedback for module ');
40
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_SUCCESS', 'Feedback successfully sent');
41
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_ERROR', 'An errror occured when feedback was sent!');
24
+define('CO_'.$moduleDirNameUpper.'_'.'FB_FORM_TITLE', 'Send a feedback');
25
+define('CO_'.$moduleDirNameUpper.'_'.'FB_RECIPIENT', 'Recipient');
26
+define('CO_'.$moduleDirNameUpper.'_'.'FB_NAME', 'Name');
27
+define('CO_'.$moduleDirNameUpper.'_'.'FB_NAME_PLACEHOLER', 'Please enter your name');
28
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SITE', 'Website');
29
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SITE_PLACEHOLER', 'Please enter your website');
30
+define('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL', 'Email');
31
+define('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL_PLACEHOLER', 'Please enter your email');
32
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE', 'Type of feedback');
33
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_SUGGESTION', 'Suggestions');
34
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_BUGS', 'Bugs');
35
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_TESTIMONIAL', 'Testimonials');
36
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_FEATURES', 'Features');
37
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_OTHERS', 'Misc');
38
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_CONTENT', 'Feedback content');
39
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_FOR', 'Feedback for module ');
40
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_SUCCESS', 'Feedback successfully sent');
41
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_ERROR', 'An errror occured when feedback was sent!');
Please login to merge, or discard this patch.
language/english/modinfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
 //1.14
110 110
 //Help
111 111
 define('_MI_SONGLIST_DIRNAME', basename(dirname(__DIR__, 2)));
112
-define('_MI_SONGLIST_HELP_HEADER', __DIR__ . '/help/helpheader.tpl');
112
+define('_MI_SONGLIST_HELP_HEADER', __DIR__.'/help/helpheader.tpl');
113 113
 define('_MI_SONGLIST_BACK_2_ADMIN', 'Back to Administration of ');
114 114
 define('_MI_SONGLIST_OVERVIEW', 'Overview');
115 115
 
Please login to merge, or discard this patch.
language/english/common.php 1 patch
Spacing   +155 added lines, -155 removed lines patch added patch discarded remove patch
@@ -16,138 +16,138 @@  discard block
 block discarded – undo
16 16
 $moduleDirName = basename(dirname(__DIR__, 2));
17 17
 $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
18 18
 
19
-\define('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS', 'GD library support: ');
20
-\define('CO_' . $moduleDirNameUpper . '_GDLIBVERSION', 'GD Library version: ');
21
-\define('CO_' . $moduleDirNameUpper . '_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)");
22
-\define('CO_' . $moduleDirNameUpper . '_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)");
23
-\define('CO_' . $moduleDirNameUpper . '_IMAGEINFO', 'Server status');
24
-\define('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): ');
25
-\define('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): ');
26
-\define('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): ');
27
-\define('CO_' . $moduleDirNameUpper . '_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> ");
28
-\define('CO_' . $moduleDirNameUpper . '_OFF', "<span style='font-weight: bold;'>OFF</span>");
29
-\define('CO_' . $moduleDirNameUpper . '_ON', "<span style='font-weight: bold;'>ON</span>");
30
-\define('CO_' . $moduleDirNameUpper . '_SERVERPATH', 'Server path to XOOPS root: ');
31
-\define('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS', 'Server uploads status: ');
32
-\define('CO_' . $moduleDirNameUpper . '_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>");
33
-\define('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.');
34
-
35
-\define('CO_' . $moduleDirNameUpper . '_PRINT', "<span style='font-weight: bold;'>Print</span>");
36
-\define('CO_' . $moduleDirNameUpper . '_PDF', "<span style='font-weight: bold;'>Create PDF</span>");
37
-
38
-\define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'");
39
-\define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED1', "Update failed - couldn't add new fields");
40
-\define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'");
41
-\define('CO_' . $moduleDirNameUpper . '_ERROR_COLUMN', 'Could not create column in database : %s');
42
-\define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)');
43
-\define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)');
44
-\define('CO_' . $moduleDirNameUpper . '_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module');
45
-
46
-\define('CO_' . $moduleDirNameUpper . '_FOLDERS_DELETED_OK', 'Upload Folders have been deleted');
19
+\define('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS', 'GD library support: ');
20
+\define('CO_'.$moduleDirNameUpper.'_GDLIBVERSION', 'GD Library version: ');
21
+\define('CO_'.$moduleDirNameUpper.'_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)");
22
+\define('CO_'.$moduleDirNameUpper.'_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)");
23
+\define('CO_'.$moduleDirNameUpper.'_IMAGEINFO', 'Server status');
24
+\define('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): ');
25
+\define('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): ');
26
+\define('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): ');
27
+\define('CO_'.$moduleDirNameUpper.'_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> ");
28
+\define('CO_'.$moduleDirNameUpper.'_OFF', "<span style='font-weight: bold;'>OFF</span>");
29
+\define('CO_'.$moduleDirNameUpper.'_ON', "<span style='font-weight: bold;'>ON</span>");
30
+\define('CO_'.$moduleDirNameUpper.'_SERVERPATH', 'Server path to XOOPS root: ');
31
+\define('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS', 'Server uploads status: ');
32
+\define('CO_'.$moduleDirNameUpper.'_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>");
33
+\define('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.');
34
+
35
+\define('CO_'.$moduleDirNameUpper.'_PRINT', "<span style='font-weight: bold;'>Print</span>");
36
+\define('CO_'.$moduleDirNameUpper.'_PDF', "<span style='font-weight: bold;'>Create PDF</span>");
37
+
38
+\define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'");
39
+\define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED1', "Update failed - couldn't add new fields");
40
+\define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'");
41
+\define('CO_'.$moduleDirNameUpper.'_ERROR_COLUMN', 'Could not create column in database : %s');
42
+\define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)');
43
+\define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)');
44
+\define('CO_'.$moduleDirNameUpper.'_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module');
45
+
46
+\define('CO_'.$moduleDirNameUpper.'_FOLDERS_DELETED_OK', 'Upload Folders have been deleted');
47 47
 
48 48
 // Error Msgs
49
-\define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH', 'Could not delete %s directory');
50
-\define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_REMOVE', 'Could not delete %s');
51
-\define('CO_' . $moduleDirNameUpper . '_ERROR_NO_PLUGIN', 'Could not load plugin');
49
+\define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH', 'Could not delete %s directory');
50
+\define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_REMOVE', 'Could not delete %s');
51
+\define('CO_'.$moduleDirNameUpper.'_ERROR_NO_PLUGIN', 'Could not load plugin');
52 52
 
53 53
 //Help
54
-\define('CO_' . $moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__, 2)));
55
-\define('CO_' . $moduleDirNameUpper . '_HELP_HEADER', __DIR__ . '/help/helpheader.tpl');
56
-\define('CO_' . $moduleDirNameUpper . '_BACK_2_ADMIN', 'Back to Administration of ');
57
-\define('CO_' . $moduleDirNameUpper . '_OVERVIEW', 'Overview');
54
+\define('CO_'.$moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__, 2)));
55
+\define('CO_'.$moduleDirNameUpper.'_HELP_HEADER', __DIR__.'/help/helpheader.tpl');
56
+\define('CO_'.$moduleDirNameUpper.'_BACK_2_ADMIN', 'Back to Administration of ');
57
+\define('CO_'.$moduleDirNameUpper.'_OVERVIEW', 'Overview');
58 58
 
59 59
 //\define('CO_' . $moduleDirNameUpper . '_HELP_DIR', __DIR__);
60 60
 
61 61
 //help multi-page
62
-\define('CO_' . $moduleDirNameUpper . '_DISCLAIMER', 'Disclaimer');
63
-\define('CO_' . $moduleDirNameUpper . '_LICENSE', 'License');
64
-\define('CO_' . $moduleDirNameUpper . '_SUPPORT', 'Support');
62
+\define('CO_'.$moduleDirNameUpper.'_DISCLAIMER', 'Disclaimer');
63
+\define('CO_'.$moduleDirNameUpper.'_LICENSE', 'License');
64
+\define('CO_'.$moduleDirNameUpper.'_SUPPORT', 'Support');
65 65
 
66 66
 //Sample Data
67
-\define('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA', 'Import Sample Data (will delete ALL current data)');
68
-\define('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_CONFIRM', 'Are you sure to Import Sample Data? (It will delete ALL current data)');
69
-\define('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA_SUCCESS', 'Sample Date imported  successfully');
70
-\define('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA', 'Export Tables to YAML');
71
-\define('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS', 'Export Tables to YAML successfully');
72
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA', 'Clear the Sample Data');
73
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_OK', 'The Sample Data has been cleared');
74
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA_CONFIRM', 'Are you sure to Clear Sample Data? (It will delete ALL current data)');
75
-\define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA', 'Export DB Schema to YAML');
76
-\define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS', 'Export DB Schema to YAML was a success');
77
-\define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR', 'ERROR: Export of DB Schema to YAML failed');
78
-\define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
79
-\define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
80
-\define('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS', 'Hide the Import buttons)');
81
-\define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS', 'Show the Import buttons)');
82
-
83
-\define('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM', 'Confirm');
67
+\define('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA', 'Import Sample Data (will delete ALL current data)');
68
+\define('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_CONFIRM', 'Are you sure to Import Sample Data? (It will delete ALL current data)');
69
+\define('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA_SUCCESS', 'Sample Date imported  successfully');
70
+\define('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA', 'Export Tables to YAML');
71
+\define('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS', 'Export Tables to YAML successfully');
72
+\define('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA', 'Clear the Sample Data');
73
+\define('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA_OK', 'The Sample Data has been cleared');
74
+\define('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA_CONFIRM', 'Are you sure to Clear Sample Data? (It will delete ALL current data)');
75
+\define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA', 'Export DB Schema to YAML');
76
+\define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_SUCCESS', 'Export DB Schema to YAML was a success');
77
+\define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR', 'ERROR: Export of DB Schema to YAML failed');
78
+\define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
79
+\define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
80
+\define('CO_'.$moduleDirNameUpper.'_'.'HIDE_SAMPLEDATA_BUTTONS', 'Hide the Import buttons)');
81
+\define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLEDATA_BUTTONS', 'Show the Import buttons)');
82
+
83
+\define('CO_'.$moduleDirNameUpper.'_'.'CONFIRM', 'Confirm');
84 84
 
85 85
 //letter choice
86
-\define('CO_' . $moduleDirNameUpper . '_' . 'BROWSETOTOPIC', "<span style='font-weight: bold;'>Browse items alphabetically</span>");
87
-\define('CO_' . $moduleDirNameUpper . '_' . 'OTHER', 'Other');
88
-\define('CO_' . $moduleDirNameUpper . '_' . 'ALL', 'All');
86
+\define('CO_'.$moduleDirNameUpper.'_'.'BROWSETOTOPIC', "<span style='font-weight: bold;'>Browse items alphabetically</span>");
87
+\define('CO_'.$moduleDirNameUpper.'_'.'OTHER', 'Other');
88
+\define('CO_'.$moduleDirNameUpper.'_'.'ALL', 'All');
89 89
 
90 90
 // block defines
91
-\define('CO_' . $moduleDirNameUpper . '_' . 'ACCESSRIGHTS', 'Access Rights');
92
-\define('CO_' . $moduleDirNameUpper . '_' . 'ACTION', 'Action');
93
-\define('CO_' . $moduleDirNameUpper . '_' . 'ACTIVERIGHTS', 'Active Rights');
94
-\define('CO_' . $moduleDirNameUpper . '_' . 'BADMIN', 'Block Administration');
95
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLKDESC', 'Description');
96
-\define('CO_' . $moduleDirNameUpper . '_' . 'CBCENTER', 'Center Middle');
97
-\define('CO_' . $moduleDirNameUpper . '_' . 'CBLEFT', 'Center Left');
98
-\define('CO_' . $moduleDirNameUpper . '_' . 'CBRIGHT', 'Center Right');
99
-\define('CO_' . $moduleDirNameUpper . '_' . 'SBLEFT', 'Left');
100
-\define('CO_' . $moduleDirNameUpper . '_' . 'SBRIGHT', 'Right');
101
-\define('CO_' . $moduleDirNameUpper . '_' . 'SIDE', 'Alignment');
102
-\define('CO_' . $moduleDirNameUpper . '_' . 'TITLE', 'Title');
103
-\define('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE', 'Visible');
104
-\define('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN', 'Visible In');
105
-\define('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT', 'Weight');
106
-
107
-\define('CO_' . $moduleDirNameUpper . '_' . 'PERMISSIONS', 'Permissions');
108
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS', 'Blocks Admin');
109
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_DESC', 'Blocks/Group Admin');
110
-
111
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_MANAGMENT', 'Manage');
112
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_ADDBLOCK', 'Add a new block');
113
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_EDITBLOCK', 'Edit a block');
114
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK', 'Clone a block');
91
+\define('CO_'.$moduleDirNameUpper.'_'.'ACCESSRIGHTS', 'Access Rights');
92
+\define('CO_'.$moduleDirNameUpper.'_'.'ACTION', 'Action');
93
+\define('CO_'.$moduleDirNameUpper.'_'.'ACTIVERIGHTS', 'Active Rights');
94
+\define('CO_'.$moduleDirNameUpper.'_'.'BADMIN', 'Block Administration');
95
+\define('CO_'.$moduleDirNameUpper.'_'.'BLKDESC', 'Description');
96
+\define('CO_'.$moduleDirNameUpper.'_'.'CBCENTER', 'Center Middle');
97
+\define('CO_'.$moduleDirNameUpper.'_'.'CBLEFT', 'Center Left');
98
+\define('CO_'.$moduleDirNameUpper.'_'.'CBRIGHT', 'Center Right');
99
+\define('CO_'.$moduleDirNameUpper.'_'.'SBLEFT', 'Left');
100
+\define('CO_'.$moduleDirNameUpper.'_'.'SBRIGHT', 'Right');
101
+\define('CO_'.$moduleDirNameUpper.'_'.'SIDE', 'Alignment');
102
+\define('CO_'.$moduleDirNameUpper.'_'.'TITLE', 'Title');
103
+\define('CO_'.$moduleDirNameUpper.'_'.'VISIBLE', 'Visible');
104
+\define('CO_'.$moduleDirNameUpper.'_'.'VISIBLEIN', 'Visible In');
105
+\define('CO_'.$moduleDirNameUpper.'_'.'WEIGHT', 'Weight');
106
+
107
+\define('CO_'.$moduleDirNameUpper.'_'.'PERMISSIONS', 'Permissions');
108
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS', 'Blocks Admin');
109
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_DESC', 'Blocks/Group Admin');
110
+
111
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_MANAGMENT', 'Manage');
112
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_ADDBLOCK', 'Add a new block');
113
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_EDITBLOCK', 'Edit a block');
114
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_CLONEBLOCK', 'Clone a block');
115 115
 
116 116
 //myblocksadmin
117
-\define('CO_' . $moduleDirNameUpper . '_' . 'AGDS', 'Admin Groups');
118
-\define('CO_' . $moduleDirNameUpper . '_' . 'BCACHETIME', 'Cache Time');
119
-\define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_ADMIN', 'Blocks Admin');
120
-\define('CO_' . $moduleDirNameUpper . '_' . 'UPDATE_SUCCESS', 'Update successful');
117
+\define('CO_'.$moduleDirNameUpper.'_'.'AGDS', 'Admin Groups');
118
+\define('CO_'.$moduleDirNameUpper.'_'.'BCACHETIME', 'Cache Time');
119
+\define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_ADMIN', 'Blocks Admin');
120
+\define('CO_'.$moduleDirNameUpper.'_'.'UPDATE_SUCCESS', 'Update successful');
121 121
 
122 122
 //Template Admin
123
-\define('CO_' . $moduleDirNameUpper . '_' . 'TPLSETS', 'Template Management');
124
-\define('CO_' . $moduleDirNameUpper . '_' . 'GENERATE', 'Generate');
125
-\define('CO_' . $moduleDirNameUpper . '_' . 'FILENAME', 'File Name');
123
+\define('CO_'.$moduleDirNameUpper.'_'.'TPLSETS', 'Template Management');
124
+\define('CO_'.$moduleDirNameUpper.'_'.'GENERATE', 'Generate');
125
+\define('CO_'.$moduleDirNameUpper.'_'.'FILENAME', 'File Name');
126 126
 
127 127
 //Menu
128
-\define('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE', 'Migrate');
129
-\define('CO_' . $moduleDirNameUpper . '_' . 'FOLDER_YES', 'Folder "%s" exist');
130
-\define('CO_' . $moduleDirNameUpper . '_' . 'FOLDER_NO', 'Folder "%s" does not exist. Create the specified folder with CHMOD 777.');
131
-\define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS', 'Show Development Tools Button?');
132
-\define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS_DESC', 'If yes, the "Migrate" Tab and other Development tools will be visible to the Admin.');
133
-\define('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_FEEDBACK', 'Feedback');
134
-\define('CO_' . $moduleDirNameUpper . '_' . 'MIGRATE_OK', 'Database migrated to current schema.');
135
-\define('CO_' . $moduleDirNameUpper . '_' . 'MIGRATE_WARNING', 'Warning! This is intended for developers only. Confirm write schema file from current database.');
136
-\define('CO_' . $moduleDirNameUpper . '_' . 'MIGRATE_SCHEMA_OK', 'Current schema file written');
128
+\define('CO_'.$moduleDirNameUpper.'_'.'ADMENU_MIGRATE', 'Migrate');
129
+\define('CO_'.$moduleDirNameUpper.'_'.'FOLDER_YES', 'Folder "%s" exist');
130
+\define('CO_'.$moduleDirNameUpper.'_'.'FOLDER_NO', 'Folder "%s" does not exist. Create the specified folder with CHMOD 777.');
131
+\define('CO_'.$moduleDirNameUpper.'_'.'SHOW_DEV_TOOLS', 'Show Development Tools Button?');
132
+\define('CO_'.$moduleDirNameUpper.'_'.'SHOW_DEV_TOOLS_DESC', 'If yes, the "Migrate" Tab and other Development tools will be visible to the Admin.');
133
+\define('CO_'.$moduleDirNameUpper.'_'.'ADMENU_FEEDBACK', 'Feedback');
134
+\define('CO_'.$moduleDirNameUpper.'_'.'MIGRATE_OK', 'Database migrated to current schema.');
135
+\define('CO_'.$moduleDirNameUpper.'_'.'MIGRATE_WARNING', 'Warning! This is intended for developers only. Confirm write schema file from current database.');
136
+\define('CO_'.$moduleDirNameUpper.'_'.'MIGRATE_SCHEMA_OK', 'Current schema file written');
137 137
 
138 138
 //Latest Version Check
139
-\define('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION', 'New Version: ');
139
+\define('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION', 'New Version: ');
140 140
 
141 141
 //DirectoryChecker
142
-\define('CO_' . $moduleDirNameUpper . '_' . 'AVAILABLE', "<span style='color: green;'>Available</span>");
143
-\define('CO_' . $moduleDirNameUpper . '_' . 'NOTAVAILABLE', "<span style='color: red;'>Not available</span>");
144
-\define('CO_' . $moduleDirNameUpper . '_' . 'NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>");
145
-\define('CO_' . $moduleDirNameUpper . '_' . 'CREATETHEDIR', 'Create it');
146
-\define('CO_' . $moduleDirNameUpper . '_' . 'SETMPERM', 'Set the permission');
147
-\define('CO_' . $moduleDirNameUpper . '_' . 'DIRCREATED', 'The directory has been created');
148
-\define('CO_' . $moduleDirNameUpper . '_' . 'DIRNOTCREATED', 'The directory cannot be created');
149
-\define('CO_' . $moduleDirNameUpper . '_' . 'PERMSET', 'The permission has been set');
150
-\define('CO_' . $moduleDirNameUpper . '_' . 'PERMNOTSET', 'The permission cannot be set');
142
+\define('CO_'.$moduleDirNameUpper.'_'.'AVAILABLE', "<span style='color: green;'>Available</span>");
143
+\define('CO_'.$moduleDirNameUpper.'_'.'NOTAVAILABLE', "<span style='color: red;'>Not available</span>");
144
+\define('CO_'.$moduleDirNameUpper.'_'.'NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>");
145
+\define('CO_'.$moduleDirNameUpper.'_'.'CREATETHEDIR', 'Create it');
146
+\define('CO_'.$moduleDirNameUpper.'_'.'SETMPERM', 'Set the permission');
147
+\define('CO_'.$moduleDirNameUpper.'_'.'DIRCREATED', 'The directory has been created');
148
+\define('CO_'.$moduleDirNameUpper.'_'.'DIRNOTCREATED', 'The directory cannot be created');
149
+\define('CO_'.$moduleDirNameUpper.'_'.'PERMSET', 'The permission has been set');
150
+\define('CO_'.$moduleDirNameUpper.'_'.'PERMNOTSET', 'The permission cannot be set');
151 151
 
152 152
 //FileChecker
153 153
 //\define('CO_' . $moduleDirNameUpper . '_' . 'AVAILABLE', "<span style='color: green;'>Available</span>");
@@ -157,70 +157,70 @@  discard block
 block discarded – undo
157 157
 //\define('CO_' . $moduleDirNameUpper . '_' . 'CREATETHEFILE', 'Create it');
158 158
 //\define('CO_' . $moduleDirNameUpper . '_' . 'SETMPERM', 'Set the permission');
159 159
 
160
-\define('CO_' . $moduleDirNameUpper . '_' . 'FILECOPIED', 'The file has been copied');
161
-\define('CO_' . $moduleDirNameUpper . '_' . 'FILENOTCOPIED', 'The file cannot be copied');
160
+\define('CO_'.$moduleDirNameUpper.'_'.'FILECOPIED', 'The file has been copied');
161
+\define('CO_'.$moduleDirNameUpper.'_'.'FILENOTCOPIED', 'The file cannot be copied');
162 162
 
163 163
 //\define('CO_' . $moduleDirNameUpper . '_' . 'PERMSET', 'The permission has been set');
164 164
 //\define('CO_' . $moduleDirNameUpper . '_' . 'PERMNOTSET', 'The permission cannot be set');
165 165
 
166 166
 //image config
167
-\define('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_EXT_IMAGE', 'EXTERNAL Image configuration');
168
-
169
-\define('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_STYLING_START', '<span style="color: #FF0000; font-size: Small;  font-weight: bold;">:: ');
170
-\define('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_STYLING_END', ' ::</span> ');
171
-\define('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_STYLING_DESC_START', '<span style="color: #FF0000; font-size: Small;">');
172
-\define('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_STYLING_DESC_END', '</span> ');
173
-
174
-\define('CO_' . $moduleDirNameUpper . '_' . 'PREFERENCE_BREAK_CONFIG_IMAGE', constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_STYLING_START') . constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_EXT_IMAGE') . constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIG_STYLING_END'));
175
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', 'Image Display Width');
176
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', 'Display width for image');
177
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', 'Image Display Height');
178
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', 'Display height for image');
179
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', '<span style="color: #FF0000; font-size: Small;  font-weight: bold;">--- EXTERNAL Image configuration ---</span> ');
180
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', '');
181
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', 'Image Upload path');
182
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', 'Path for uploading images');
183
-
184
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_FILE_SIZE', 'Image File Size (in Bytes)');
185
-\define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_FILE_SIZE_DSC','The maximum file size of the image file (in Bytes)');
167
+\define('CO_'.$moduleDirNameUpper.'_'.'CONFIG_EXT_IMAGE', 'EXTERNAL Image configuration');
168
+
169
+\define('CO_'.$moduleDirNameUpper.'_'.'CONFIG_STYLING_START', '<span style="color: #FF0000; font-size: Small;  font-weight: bold;">:: ');
170
+\define('CO_'.$moduleDirNameUpper.'_'.'CONFIG_STYLING_END', ' ::</span> ');
171
+\define('CO_'.$moduleDirNameUpper.'_'.'CONFIG_STYLING_DESC_START', '<span style="color: #FF0000; font-size: Small;">');
172
+\define('CO_'.$moduleDirNameUpper.'_'.'CONFIG_STYLING_DESC_END', '</span> ');
173
+
174
+\define('CO_'.$moduleDirNameUpper.'_'.'PREFERENCE_BREAK_CONFIG_IMAGE', constant('CO_'.$moduleDirNameUpper.'_'.'CONFIG_STYLING_START').constant('CO_'.$moduleDirNameUpper.'_'.'CONFIG_EXT_IMAGE').constant('CO_'.$moduleDirNameUpper.'_'.'CONFIG_STYLING_END'));
175
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH', 'Image Display Width');
176
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH_DSC', 'Display width for image');
177
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT', 'Image Display Height');
178
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT_DSC', 'Display height for image');
179
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG', '<span style="color: #FF0000; font-size: Small;  font-weight: bold;">--- EXTERNAL Image configuration ---</span> ');
180
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG_DSC', '');
181
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH', 'Image Upload path');
182
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH_DSC', 'Path for uploading images');
183
+
184
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_FILE_SIZE', 'Image File Size (in Bytes)');
185
+\define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_FILE_SIZE_DSC', 'The maximum file size of the image file (in Bytes)');
186 186
 
187 187
 //Module Stats
188
-\define('CO_' . $moduleDirNameUpper . '_' . 'STATS_SUMMARY', 'Module Statistics');
189
-\define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_CATEGORIES', 'Categories:');
190
-\define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_ITEMS', 'Items');
191
-\define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_OFFLINE', 'Offline');
192
-\define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_PUBLISHED', 'Published');
193
-\define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_REJECTED', 'Rejected');
194
-\define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_SUBMITTED', 'Submitted');
188
+\define('CO_'.$moduleDirNameUpper.'_'.'STATS_SUMMARY', 'Module Statistics');
189
+\define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_CATEGORIES', 'Categories:');
190
+\define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_ITEMS', 'Items');
191
+\define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_OFFLINE', 'Offline');
192
+\define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_PUBLISHED', 'Published');
193
+\define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_REJECTED', 'Rejected');
194
+\define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_SUBMITTED', 'Submitted');
195 195
 
196
-\define('CO_' . $moduleDirNameUpper . '_' . 'ERROR403', 'You are not allowed to view this page!');
196
+\define('CO_'.$moduleDirNameUpper.'_'.'ERROR403', 'You are not allowed to view this page!');
197 197
 
198 198
 //Preferences
199
-\define('CO_' . $moduleDirNameUpper . '_' . 'TRUNCATE_LENGTH', 'Number of Characters to truncate to the long text field');
200
-\define('CO_' . $moduleDirNameUpper . '_' . 'TRUNCATE_LENGTH_DESC', 'Set the maximum number of characters to truncate the long text fields');
199
+\define('CO_'.$moduleDirNameUpper.'_'.'TRUNCATE_LENGTH', 'Number of Characters to truncate to the long text field');
200
+\define('CO_'.$moduleDirNameUpper.'_'.'TRUNCATE_LENGTH_DESC', 'Set the maximum number of characters to truncate the long text fields');
201 201
 
202
-\define('CO_' . $moduleDirNameUpper . '_' . 'DELETE_BLOCK_CONFIRM', 'Are you sure to delete this Block?');
202
+\define('CO_'.$moduleDirNameUpper.'_'.'DELETE_BLOCK_CONFIRM', 'Are you sure to delete this Block?');
203 203
 
204 204
 //Cloning
205
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE', 'Clone');
206
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_DSC', 'Cloning a module has never been this easy! Just type in the name you want for it and hit submit button!');
207
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_TITLE', 'Clone %s');
208
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME', 'Choose a name for the new module');
209
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_NAME_DSC', 'Do not use special characters! <br>Do not choose an existing module dirname or database table name!');
210
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_INVALIDNAME', 'ERROR: Invalid module name, please try another one!');
211
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_EXISTS', 'ERROR: Module name already taken, please try another one!');
212
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_CONGRAT', 'Congratulations! %s was sucessfully created!<br>You may want to make changes in language files.');
213
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_IMAGEFAIL', 'Attention, we failed creating the new module logo. Please consider modifying assets/images/logo_module.png manually!');
214
-\define('CO_' . $moduleDirNameUpper . '_' . 'CLONE_FAIL', "Sorry, we failed in creating the new clone. Maybe you need to temporally set write permissions (CHMOD 777) to 'modules' folder and try again.");
205
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE', 'Clone');
206
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_DSC', 'Cloning a module has never been this easy! Just type in the name you want for it and hit submit button!');
207
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_TITLE', 'Clone %s');
208
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_NAME', 'Choose a name for the new module');
209
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_NAME_DSC', 'Do not use special characters! <br>Do not choose an existing module dirname or database table name!');
210
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_INVALIDNAME', 'ERROR: Invalid module name, please try another one!');
211
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_EXISTS', 'ERROR: Module name already taken, please try another one!');
212
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_CONGRAT', 'Congratulations! %s was sucessfully created!<br>You may want to make changes in language files.');
213
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_IMAGEFAIL', 'Attention, we failed creating the new module logo. Please consider modifying assets/images/logo_module.png manually!');
214
+\define('CO_'.$moduleDirNameUpper.'_'.'CLONE_FAIL', "Sorry, we failed in creating the new clone. Maybe you need to temporally set write permissions (CHMOD 777) to 'modules' folder and try again.");
215 215
 
216 216
 
217 217
 //JSON-LD generation of www.schema.org
218
-\define('CO_' . $moduleDirNameUpper . '_' . 'GENERATE_JSONLD', 'Generate Schema Markup through JSON LD');
219
-\define('CO_' . $moduleDirNameUpper . '_' . 'GENERATE_JSONLD_DESC', 'Mark up your module with structured data to help search engines better understand the content of your web page');
218
+\define('CO_'.$moduleDirNameUpper.'_'.'GENERATE_JSONLD', 'Generate Schema Markup through JSON LD');
219
+\define('CO_'.$moduleDirNameUpper.'_'.'GENERATE_JSONLD_DESC', 'Mark up your module with structured data to help search engines better understand the content of your web page');
220 220
 
221 221
 //Repository not found
222
-\define('CO_' . $moduleDirNameUpper . '_' . 'REPO_NOT_FOUND', 'Repository Not Found: ');
222
+\define('CO_'.$moduleDirNameUpper.'_'.'REPO_NOT_FOUND', 'Repository Not Found: ');
223 223
 //Release not found
224
-\define('CO_' . $moduleDirNameUpper . '_' . 'NO_REL_FOUND', 'Released Version Not Found: ');
224
+\define('CO_'.$moduleDirNameUpper.'_'.'NO_REL_FOUND', 'Released Version Not Found: ');
225 225
 //rename upload folder on uninstall
226
-\define('CO_' . $moduleDirNameUpper . '_' . 'ERROR_FOLDER_RENAME_FAILED', 'Could not rename upload folder, please rename manually');
226
+\define('CO_'.$moduleDirNameUpper.'_'.'ERROR_FOLDER_RENAME_FAILED', 'Could not rename upload folder, please rename manually');
Please login to merge, or discard this patch.
albums.php 2 patches
Indentation   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 $criteria_cat    = new \CriteriaCompo();
14 14
 $cids            = $categoryHandler->GetCatAndSubCat($_SESSION['cid']);
15 15
 if ($_SESSION['cid'] > 0) {
16
-    $cids[$_SESSION['cid']] = $_SESSION['cid'];
16
+	$cids[$_SESSION['cid']] = $_SESSION['cid'];
17 17
 }
18 18
 if (count($cids) > 0 && 0 != $_SESSION['cid']) {
19
-    $criteria_cat->add(new \Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'), 'OR');
19
+	$criteria_cat->add(new \Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'), 'OR');
20 20
 } else {
21
-    $criteria_cat->add(new \Criteria(''), 'OR');
21
+	$criteria_cat->add(new \Criteria(''), 'OR');
22 22
 }
23 23
 $criteria_cat->setSort('created');
24 24
 $criteria_cat->setOrder('ASC');
@@ -32,198 +32,198 @@  discard block
 block discarded – undo
32 32
 $col = 1;
33 33
 $row = 1;
34 34
 foreach ($categories as $category) {
35
-    $cat[$row][$col]          = $category->toArray(true);
36
-    $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
37
-    ++$col;
38
-    if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
39
-        ++$row;
40
-        $col = 1;
41
-    }
35
+	$cat[$row][$col]          = $category->toArray(true);
36
+	$cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
37
+	++$col;
38
+	if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
39
+		++$row;
40
+		$col = 1;
41
+	}
42 42
 }
43 43
 if (1 != $col) {
44
-    $col--;
45
-    for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
46
-        $cat[$row][$j][$categoryHandler->keyName] = 0;
47
-        $cat[$row][$j]['width']                   = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
48
-    }
44
+	$col--;
45
+	for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
46
+		$cat[$row][$j][$categoryHandler->keyName] = 0;
47
+		$cat[$row][$j]['width']                   = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
48
+	}
49 49
 }
50 50
 
51 51
 /** @var AlbumsHandler $albumsHandler */
52 52
 $albumsHandler = Helper::getInstance()->getHandler('Albums');
53 53
 switch ($op) {
54
-    default:
55
-    case 'item':
56
-        switch ($fct) {
57
-            default:
58
-            case 'list':
59
-                $pagenav = new \XoopsPageNav($albumsHandler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit");
60
-
61
-                $criteria_cat->setLimit($limit);
62
-                $criteria_cat->setStart($start);
63
-
64
-                $albums = $albumsHandler->getObjects($criteria_cat, false);
65
-
66
-                $ret = [];
67
-                $col = 1;
68
-                $row = 1;
69
-                foreach ($albums as $album) {
70
-                    $ret[$row][$col]          = $album->toArray(true);
71
-                    $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
72
-                    ++$col;
73
-                    if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
74
-                        ++$row;
75
-                        $col = 1;
76
-                    }
77
-                }
78
-                if (1 != $col) {
79
-                    for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
80
-                        $ret[$row][$j][$albumsHandler->keyName] = 0;
81
-                        $ret[$row][$j]['width']                 = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
82
-                    }
83
-                }
84
-
85
-                $url = $albumsHandler->getURL();
86
-                if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
87
-                    header('HTTP/1.1 301 Moved Permanently');
88
-                    header('Location: ' . $url);
89
-                    exit(0);
90
-                }
91
-
92
-                $GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_index.tpl';
93
-                require_once $GLOBALS['xoops']->path('/header.php');
94
-                if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
95
-                    $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
96
-                    $GLOBALS['loaded_jquery'] = true;
97
-                }
98
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
99
-                $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
100
-                $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
101
-                $GLOBALS['xoopsTpl']->assign('results', $ret);
102
-                $GLOBALS['xoopsTpl']->assign('categories', $cat);
103
-                $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
104
-                $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
105
-                if (0 != $_SESSION['cid']) {
106
-                    $category = $categoryHandler->get($_SESSION['cid']);
107
-                    $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
108
-                }
109
-                require_once $GLOBALS['xoops']->path('/footer.php');
110
-                break;
111
-            case 'item':
112
-                $album = $albumsHandler->get($id);
113
-
114
-                $url = $album->getURL(true);
115
-                if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
116
-                    header('HTTP/1.1 301 Moved Permanently');
117
-                    header('Location: ' . $url);
118
-                    exit(0);
119
-                }
120
-
121
-                $GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_item.tpl';
122
-                require_once $GLOBALS['xoops']->path('/header.php');
123
-                if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
124
-                    $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
125
-                    $GLOBALS['loaded_jquery'] = true;
126
-                }
127
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
128
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
129
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
130
-                $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
131
-                $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
132
-                $GLOBALS['xoopsTpl']->assign('songs', false);
133
-                $GLOBALS['xoopsTpl']->assign('album', $album->toArray(true));
134
-                $GLOBALS['xoopsTpl']->assign('categories', $cat);
135
-                $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
136
-                require_once $GLOBALS['xoops']->path('/footer.php');
137
-                break;
138
-        }
139
-        break;
140
-    case 'browseby':
141
-        switch ($fct) {
142
-            default:
143
-            case 'title':
144
-            case 'lyrics':
145
-            case 'artist':
146
-            case 'album':
147
-                $browse_criteria = new \CriteriaCompo();
148
-                switch ($value) {
149
-                    case '0':
150
-                        for ($u = 0; $u < 10; ++$u) {
151
-                            $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR');
152
-                        }
153
-                        break;
154
-                    default:
155
-                        $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR');
156
-                        $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR');
157
-                        break;
158
-                }
159
-                $criteria = new \CriteriaCompo($criteria_cat, 'AND');
160
-                $criteria->add($browse_criteria);
161
-        }
162
-
163
-        $pagenav = new \XoopsPageNav($albumsHandler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit");
164
-
165
-        $criteria->setLimit($limit);
166
-        $criteria->setStart($start);
167
-
168
-        $albums = $albumsHandler->getObjects($criteria, false);
169
-
170
-        $ret = [];
171
-        $col = 1;
172
-        $row = 1;
173
-        foreach ($albums as $album) {
174
-            $ret[$row][$col]          = $album->toArray(true);
175
-            $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
176
-            ++$col;
177
-            if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
178
-                ++$row;
179
-                $col = 1;
180
-            }
181
-        }
182
-        if (1 != $col) {
183
-            $col--;
184
-            for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
185
-                $ret[$row][$j][$albumsHandler->keyName] = 0;
186
-                $ret[$row][$j]['width']                 = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
187
-            }
188
-        }
189
-
190
-        $url = $albumsHandler->getURL();
191
-        if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
192
-            header('HTTP/1.1 301 Moved Permanently');
193
-            header('Location: ' . $url);
194
-            exit(0);
195
-        }
196
-
197
-        $GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_index.tpl';
198
-        require_once $GLOBALS['xoops']->path('/header.php');
199
-        if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
200
-            $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
201
-            $GLOBALS['loaded_jquery'] = true;
202
-        }
203
-        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
204
-        $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
205
-        $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
206
-        $GLOBALS['xoopsTpl']->assign('results', $ret);
207
-        $GLOBALS['xoopsTpl']->assign('songs', false);
208
-        $GLOBALS['xoopsTpl']->assign('categories', $cat);
209
-        $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
210
-        if (0 != $_SESSION['cid']) {
211
-            $category = $categoryHandler->get($_SESSION['cid']);
212
-            $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
213
-        }
214
-        $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
215
-        require_once $GLOBALS['xoops']->path('/footer.php');
216
-        break;
217
-        break;
218
-    case 'category':
219
-        switch ($fct) {
220
-            default:
221
-            case 'set':
222
-                $_SESSION['cid'] = $id;
223
-                break;
224
-            case 'home':
225
-                unset($_SESSION['cid']);
226
-                break;
227
-        }
228
-        redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=$start&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED);
54
+	default:
55
+	case 'item':
56
+		switch ($fct) {
57
+			default:
58
+			case 'list':
59
+				$pagenav = new \XoopsPageNav($albumsHandler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit");
60
+
61
+				$criteria_cat->setLimit($limit);
62
+				$criteria_cat->setStart($start);
63
+
64
+				$albums = $albumsHandler->getObjects($criteria_cat, false);
65
+
66
+				$ret = [];
67
+				$col = 1;
68
+				$row = 1;
69
+				foreach ($albums as $album) {
70
+					$ret[$row][$col]          = $album->toArray(true);
71
+					$ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
72
+					++$col;
73
+					if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
74
+						++$row;
75
+						$col = 1;
76
+					}
77
+				}
78
+				if (1 != $col) {
79
+					for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
80
+						$ret[$row][$j][$albumsHandler->keyName] = 0;
81
+						$ret[$row][$j]['width']                 = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
82
+					}
83
+				}
84
+
85
+				$url = $albumsHandler->getURL();
86
+				if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
87
+					header('HTTP/1.1 301 Moved Permanently');
88
+					header('Location: ' . $url);
89
+					exit(0);
90
+				}
91
+
92
+				$GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_index.tpl';
93
+				require_once $GLOBALS['xoops']->path('/header.php');
94
+				if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
95
+					$GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
96
+					$GLOBALS['loaded_jquery'] = true;
97
+				}
98
+				$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
99
+				$GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
100
+				$GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
101
+				$GLOBALS['xoopsTpl']->assign('results', $ret);
102
+				$GLOBALS['xoopsTpl']->assign('categories', $cat);
103
+				$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
104
+				$GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
105
+				if (0 != $_SESSION['cid']) {
106
+					$category = $categoryHandler->get($_SESSION['cid']);
107
+					$GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
108
+				}
109
+				require_once $GLOBALS['xoops']->path('/footer.php');
110
+				break;
111
+			case 'item':
112
+				$album = $albumsHandler->get($id);
113
+
114
+				$url = $album->getURL(true);
115
+				if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
116
+					header('HTTP/1.1 301 Moved Permanently');
117
+					header('Location: ' . $url);
118
+					exit(0);
119
+				}
120
+
121
+				$GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_item.tpl';
122
+				require_once $GLOBALS['xoops']->path('/header.php');
123
+				if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
124
+					$GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
125
+					$GLOBALS['loaded_jquery'] = true;
126
+				}
127
+				$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
128
+				$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
129
+				$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
130
+				$GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
131
+				$GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
132
+				$GLOBALS['xoopsTpl']->assign('songs', false);
133
+				$GLOBALS['xoopsTpl']->assign('album', $album->toArray(true));
134
+				$GLOBALS['xoopsTpl']->assign('categories', $cat);
135
+				$GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
136
+				require_once $GLOBALS['xoops']->path('/footer.php');
137
+				break;
138
+		}
139
+		break;
140
+	case 'browseby':
141
+		switch ($fct) {
142
+			default:
143
+			case 'title':
144
+			case 'lyrics':
145
+			case 'artist':
146
+			case 'album':
147
+				$browse_criteria = new \CriteriaCompo();
148
+				switch ($value) {
149
+					case '0':
150
+						for ($u = 0; $u < 10; ++$u) {
151
+							$browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR');
152
+						}
153
+						break;
154
+					default:
155
+						$browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR');
156
+						$browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR');
157
+						break;
158
+				}
159
+				$criteria = new \CriteriaCompo($criteria_cat, 'AND');
160
+				$criteria->add($browse_criteria);
161
+		}
162
+
163
+		$pagenav = new \XoopsPageNav($albumsHandler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit");
164
+
165
+		$criteria->setLimit($limit);
166
+		$criteria->setStart($start);
167
+
168
+		$albums = $albumsHandler->getObjects($criteria, false);
169
+
170
+		$ret = [];
171
+		$col = 1;
172
+		$row = 1;
173
+		foreach ($albums as $album) {
174
+			$ret[$row][$col]          = $album->toArray(true);
175
+			$ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
176
+			++$col;
177
+			if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
178
+				++$row;
179
+				$col = 1;
180
+			}
181
+		}
182
+		if (1 != $col) {
183
+			$col--;
184
+			for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
185
+				$ret[$row][$j][$albumsHandler->keyName] = 0;
186
+				$ret[$row][$j]['width']                 = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
187
+			}
188
+		}
189
+
190
+		$url = $albumsHandler->getURL();
191
+		if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
192
+			header('HTTP/1.1 301 Moved Permanently');
193
+			header('Location: ' . $url);
194
+			exit(0);
195
+		}
196
+
197
+		$GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_index.tpl';
198
+		require_once $GLOBALS['xoops']->path('/header.php');
199
+		if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
200
+			$GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
201
+			$GLOBALS['loaded_jquery'] = true;
202
+		}
203
+		$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
204
+		$GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
205
+		$GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
206
+		$GLOBALS['xoopsTpl']->assign('results', $ret);
207
+		$GLOBALS['xoopsTpl']->assign('songs', false);
208
+		$GLOBALS['xoopsTpl']->assign('categories', $cat);
209
+		$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
210
+		if (0 != $_SESSION['cid']) {
211
+			$category = $categoryHandler->get($_SESSION['cid']);
212
+			$GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
213
+		}
214
+		$GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
215
+		require_once $GLOBALS['xoops']->path('/footer.php');
216
+		break;
217
+		break;
218
+	case 'category':
219
+		switch ($fct) {
220
+			default:
221
+			case 'set':
222
+				$_SESSION['cid'] = $id;
223
+				break;
224
+			case 'home':
225
+				unset($_SESSION['cid']);
226
+				break;
227
+		}
228
+		redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=$start&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED);
229 229
 }
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use XoopsModules\Songlist\CategoryHandler;
5 5
 use XoopsModules\Songlist\AlbumsHandler;
6 6
 
7
-require_once __DIR__ . '/header.php';
7
+require_once __DIR__.'/header.php';
8 8
 
9 9
 global $file, $op, $fct, $id, $value, $gid, $cid, $start, $limit;
10 10
 
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
 $categoryHandler = Helper::getInstance()->getHandler('Category');
13 13
 $criteria_cat    = new \CriteriaCompo();
14 14
 $cids            = $categoryHandler->GetCatAndSubCat($_SESSION['cid']);
15
-if ($_SESSION['cid'] > 0) {
15
+if ($_SESSION['cid']>0) {
16 16
     $cids[$_SESSION['cid']] = $_SESSION['cid'];
17 17
 }
18
-if (count($cids) > 0 && 0 != $_SESSION['cid']) {
19
-    $criteria_cat->add(new \Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'), 'OR');
18
+if (count($cids)>0 && 0!=$_SESSION['cid']) {
19
+    $criteria_cat->add(new \Criteria('cid', '('.implode(',', $cids).')', 'IN'), 'OR');
20 20
 } else {
21 21
     $criteria_cat->add(new \Criteria(''), 'OR');
22 22
 }
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
 $row = 1;
34 34
 foreach ($categories as $category) {
35 35
     $cat[$row][$col]          = $category->toArray(true);
36
-    $cat[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
36
+    $cat[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
37 37
     ++$col;
38
-    if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
38
+    if ($col>$GLOBALS['songlistModuleConfig']['cols']) {
39 39
         ++$row;
40 40
         $col = 1;
41 41
     }
42 42
 }
43
-if (1 != $col) {
43
+if (1!=$col) {
44 44
     $col--;
45
-    for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
45
+    for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) {
46 46
         $cat[$row][$j][$categoryHandler->keyName] = 0;
47
-        $cat[$row][$j]['width']                   = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
47
+        $cat[$row][$j]['width']                   = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
48 48
     }
49 49
 }
50 50
 
@@ -68,41 +68,41 @@  discard block
 block discarded – undo
68 68
                 $row = 1;
69 69
                 foreach ($albums as $album) {
70 70
                     $ret[$row][$col]          = $album->toArray(true);
71
-                    $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
71
+                    $ret[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
72 72
                     ++$col;
73
-                    if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
73
+                    if ($col>$GLOBALS['songlistModuleConfig']['cols']) {
74 74
                         ++$row;
75 75
                         $col = 1;
76 76
                     }
77 77
                 }
78
-                if (1 != $col) {
79
-                    for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
78
+                if (1!=$col) {
79
+                    for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) {
80 80
                         $ret[$row][$j][$albumsHandler->keyName] = 0;
81
-                        $ret[$row][$j]['width']                 = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
81
+                        $ret[$row][$j]['width']                 = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
82 82
                     }
83 83
                 }
84 84
 
85 85
                 $url = $albumsHandler->getURL();
86 86
                 if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
87 87
                     header('HTTP/1.1 301 Moved Permanently');
88
-                    header('Location: ' . $url);
88
+                    header('Location: '.$url);
89 89
                     exit(0);
90 90
                 }
91 91
 
92 92
                 $GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_index.tpl';
93 93
                 require_once $GLOBALS['xoops']->path('/header.php');
94 94
                 if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
95
-                    $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
95
+                    $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
96 96
                     $GLOBALS['loaded_jquery'] = true;
97 97
                 }
98
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
98
+                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
99 99
                 $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
100 100
                 $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
101 101
                 $GLOBALS['xoopsTpl']->assign('results', $ret);
102 102
                 $GLOBALS['xoopsTpl']->assign('categories', $cat);
103 103
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
104 104
                 $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']);
105
-                if (0 != $_SESSION['cid']) {
105
+                if (0!=$_SESSION['cid']) {
106 106
                     $category = $categoryHandler->get($_SESSION['cid']);
107 107
                     $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
108 108
                 }
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
                 $url = $album->getURL(true);
115 115
                 if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
116 116
                     header('HTTP/1.1 301 Moved Permanently');
117
-                    header('Location: ' . $url);
117
+                    header('Location: '.$url);
118 118
                     exit(0);
119 119
                 }
120 120
 
121 121
                 $GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_item.tpl';
122 122
                 require_once $GLOBALS['xoops']->path('/header.php');
123 123
                 if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
124
-                    $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
124
+                    $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
125 125
                     $GLOBALS['loaded_jquery'] = true;
126 126
                 }
127
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
128
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
129
-                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
127
+                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
128
+                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
129
+                $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
130 130
                 $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
131 131
                 $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
132 132
                 $GLOBALS['xoopsTpl']->assign('songs', false);
@@ -147,13 +147,13 @@  discard block
 block discarded – undo
147 147
                 $browse_criteria = new \CriteriaCompo();
148 148
                 switch ($value) {
149 149
                     case '0':
150
-                        for ($u = 0; $u < 10; ++$u) {
151
-                            $browse_criteria->add(new \Criteria('title', $u . '%', 'LIKE'), 'OR');
150
+                        for ($u = 0; $u<10; ++$u) {
151
+                            $browse_criteria->add(new \Criteria('title', $u.'%', 'LIKE'), 'OR');
152 152
                         }
153 153
                         break;
154 154
                     default:
155
-                        $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value) . '%', 'LIKE'), 'OR');
156
-                        $browse_criteria->add(new \Criteria('title', \mb_strtolower($value) . '%', 'LIKE'), 'OR');
155
+                        $browse_criteria->add(new \Criteria('title', \mb_strtoupper($value).'%', 'LIKE'), 'OR');
156
+                        $browse_criteria->add(new \Criteria('title', \mb_strtolower($value).'%', 'LIKE'), 'OR');
157 157
                         break;
158 158
                 }
159 159
                 $criteria = new \CriteriaCompo($criteria_cat, 'AND');
@@ -172,42 +172,42 @@  discard block
 block discarded – undo
172 172
         $row = 1;
173 173
         foreach ($albums as $album) {
174 174
             $ret[$row][$col]          = $album->toArray(true);
175
-            $ret[$row][$col]['width'] = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
175
+            $ret[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
176 176
             ++$col;
177
-            if ($col > $GLOBALS['songlistModuleConfig']['cols']) {
177
+            if ($col>$GLOBALS['songlistModuleConfig']['cols']) {
178 178
                 ++$row;
179 179
                 $col = 1;
180 180
             }
181 181
         }
182
-        if (1 != $col) {
182
+        if (1!=$col) {
183 183
             $col--;
184
-            for ($j = $col; $j <= $GLOBALS['songlistModuleConfig']['cols']; ++$j) {
184
+            for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; ++$j) {
185 185
                 $ret[$row][$j][$albumsHandler->keyName] = 0;
186
-                $ret[$row][$j]['width']                 = floor(100 / $GLOBALS['songlistModuleConfig']['cols']) . '%';
186
+                $ret[$row][$j]['width']                 = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%';
187 187
             }
188 188
         }
189 189
 
190 190
         $url = $albumsHandler->getURL();
191 191
         if (!mb_strpos($url, $_SERVER['REQUEST_URI'])) {
192 192
             header('HTTP/1.1 301 Moved Permanently');
193
-            header('Location: ' . $url);
193
+            header('Location: '.$url);
194 194
             exit(0);
195 195
         }
196 196
 
197 197
         $GLOBALS['xoopsOption']['template_main'] = 'songlist_albums_index.tpl';
198 198
         require_once $GLOBALS['xoops']->path('/header.php');
199 199
         if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) {
200
-            $GLOBALS['xoTheme']->addScript(XOOPS_URL . _MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
200
+            $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, ['type' => 'text/javascript']);
201 201
             $GLOBALS['loaded_jquery'] = true;
202 202
         }
203
-        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . _MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
203
+        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, ['type' => 'text/css']);
204 204
         $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']);
205 205
         $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['SCRIPT_NAME']);
206 206
         $GLOBALS['xoopsTpl']->assign('results', $ret);
207 207
         $GLOBALS['xoopsTpl']->assign('songs', false);
208 208
         $GLOBALS['xoopsTpl']->assign('categories', $cat);
209 209
         $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
210
-        if (0 != $_SESSION['cid']) {
210
+        if (0!=$_SESSION['cid']) {
211 211
             $category = $categoryHandler->get($_SESSION['cid']);
212 212
             $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true));
213 213
         }
@@ -225,5 +225,5 @@  discard block
 block discarded – undo
225 225
                 unset($_SESSION['cid']);
226 226
                 break;
227 227
         }
228
-        redirect_header($_SERVER['SCRIPT_NAME'] . "?op=item&fct=list&id=0&value=%&start=$start&limit=$limit&cid=" . $_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED);
228
+        redirect_header($_SERVER['SCRIPT_NAME']."?op=item&fct=list&id=0&value=%&start=$start&limit=$limit&cid=".$_SESSION['cid'], 10, _MD_SONGLIST_MSG_CATEGORYCHANGED);
229 229
 }
Please login to merge, or discard this patch.