|
@@ -294,68 +294,6 @@ class Users {
|
294
|
294
|
return true;
|
295
|
295
|
}
|
296
|
296
|
|
297
|
|
- /**
|
298
|
|
- * Generates a check list of release types, ordered by the user or default
|
299
|
|
- * @param array $SiteOptions
|
300
|
|
- * @param boolean $Default Returns the default list if true
|
301
|
|
- */
|
302
|
|
- public static function release_order(&$SiteOptions, $Default = false) {
|
303
|
|
- global $ReleaseTypes;
|
304
|
|
-
|
305
|
|
- $RT = $ReleaseTypes + array(
|
306
|
|
- 1024 => 'Guest Appearance',
|
307
|
|
- 1023 => 'Remixed By',
|
308
|
|
- 1022 => 'Composition',
|
309
|
|
- 1021 => 'Produced By');
|
310
|
|
-
|
311
|
|
- if ($Default || empty($SiteOptions['SortHide'])) {
|
312
|
|
- $Sort =& $RT;
|
313
|
|
- $Defaults = !empty($SiteOptions['HideTypes']);
|
314
|
|
- } else {
|
315
|
|
- $Sort =& $SiteOptions['SortHide'];
|
316
|
|
- $MissingTypes = array_diff_key($RT, $Sort);
|
317
|
|
- if (!empty($MissingTypes)) {
|
318
|
|
- foreach (array_keys($MissingTypes) as $Missing) {
|
319
|
|
- $Sort[$Missing] = 0;
|
320
|
|
- }
|
321
|
|
- }
|
322
|
|
- }
|
323
|
|
-
|
324
|
|
- foreach ($Sort as $Key => $Val) {
|
325
|
|
- if (isset($Defaults)) {
|
326
|
|
- $Checked = $Defaults && isset($SiteOptions['HideTypes'][$Key]) ? ' checked="checked"' : '';
|
327
|
|
- } else {
|
328
|
|
- if (!isset($RT[$Key])) {
|
329
|
|
- continue;
|
330
|
|
- }
|
331
|
|
- $Checked = $Val ? ' checked="checked"' : '';
|
332
|
|
- $Val = $RT[$Key];
|
333
|
|
- }
|
334
|
|
-
|
335
|
|
- $ID = $Key. '_' . (int)(!!$Checked);
|
336
|
|
-
|
337
|
|
- // The HTML is indented this far for proper indentation in the generated HTML
|
338
|
|
- // on user.php?action=edit
|
339
|
|
-?>
|
340
|
|
- <li class="sortable_item">
|
341
|
|
- <label><input type="checkbox"<?=$Checked?> id="<?=$ID?>" /> <?=$Val?></label>
|
342
|
|
- </li>
|
343
|
|
-<?
|
344
|
|
- }
|
345
|
|
- }
|
346
|
|
-
|
347
|
|
- /**
|
348
|
|
- * Returns the default order for the sort list in a JS-friendly string
|
349
|
|
- * @return string
|
350
|
|
- */
|
351
|
|
- public static function release_order_default_js(&$SiteOptions) {
|
352
|
|
- ob_start();
|
353
|
|
- self::release_order($SiteOptions, true);
|
354
|
|
- $HTML = ob_get_contents();
|
355
|
|
- ob_end_clean();
|
356
|
|
- return json_encode($HTML);
|
357
|
|
- }
|
358
|
|
-
|
359
|
297
|
/**
|
360
|
298
|
* Generate a random string
|
361
|
299
|
*
|