( isPro, proVersion, updatesExpired = false, proBundleLegacy = false, proBundleLegacyFiles = [] )
| 393 | } |
| 394 | |
| 395 | function 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}" |
no test coverage detected