MCPcopy Create free account
hub / github.com/error311/FileRise / getAdminTitle

Function getAdminTitle

public/js/adminPanel.js:395–496  ·  view source on GitHub ↗
(
  isPro,
  proVersion,
  updatesExpired = false,
  proBundleLegacy = false,
  proBundleLegacyFiles = []
)

Source from the content-addressed store, hash-verified

393}
394
395function getAdminTitle(
396 isPro,
397 proVersion,
398 updatesExpired = false,
399 proBundleLegacy = false,
400 proBundleLegacyFiles = []
401) {
402 const corePill = `
403 <span class="badge badge-pill badge-secondary admin-core-badge">
404 Core ${version}
405 </span>
406 `;
407
408 // Normalize versions so "v1.0.1" and "1.0.1" compare cleanly
409 const norm = (v) => String(v || '').trim().replace(/^v/i, '');
410
411 const latestRaw = (typeof PRO_LATEST_BUNDLE_VERSION !== 'undefined'
412 ? PRO_LATEST_BUNDLE_VERSION
413 : ''
414 );
415
416 const currentRaw = (proVersion && proVersion !== 'not installed')
417 ? String(proVersion)
418 : '';
419
420 const hasCurrent = !!norm(currentRaw);
421 const hasLatest = !!norm(latestRaw);
422 const hasUpdate = isPro && hasCurrent && hasLatest &&
423 norm(currentRaw) !== norm(latestRaw);
424
425 if (!isPro) {
426 // Free/core only
427 return `
428 ${t("admin_panel")}
429 ${corePill}
430 `;
431 }
432
433 const pvLabel = hasCurrent ? `Pro v${norm(currentRaw)}` : 'Pro';
434
435 const proPill = `
436 <span class="badge badge-pill badge-warning admin-pro-badge">
437 ${pvLabel}
438 </span>
439 `;
440
441 const legacyFiles = Array.isArray(proBundleLegacyFiles) ? proBundleLegacyFiles : [];
442 const legacyList = legacyFiles.length ? legacyFiles.join(', ') : '';
443 const legacyTitle = legacyList
444 ? `Legacy Pro bundle detected: ${legacyList}`
445 : 'Legacy Pro bundle detected';
446 const legacyLink = updatesExpired
447 ? 'https://filerise.net/pro/renew.php'
448 : 'https://filerise.net/pro/update.php';
449 const legacyHint = (isPro && proBundleLegacy)
450 ? `
451 <a
452 href="${legacyLink}"

Callers 1

openAdminPanelFunction · 0.85

Calls 3

tFunction · 0.85
escapeHTMLFunction · 0.85
normFunction · 0.70

Tested by

no test coverage detected