| @@ -15,8 +15,9 @@ | ||
| 15 | 15 | |
| 16 | 16 | use Buttonizer\Api\Settings\MigrateToStandalone; |
| 17 | 17 | use Buttonizer\Core\Admin\BaseAdmin; |
| 18 | 18 | use Buttonizer\Core\Utils\PermissionCheck; |
| 19 | +use Buttonizer\Migration\LegacyFallback; | |
| 19 | 20 | |
| 20 | 21 | # No script kiddies |
| 21 | 22 | defined('ABSPATH') or die('No script kiddies please!'); |
| 22 | 23 | |
| @@ -83,8 +84,29 @@ | ||
| 83 | 84 | return "migration"; |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | 87 | return parent::getActionLock(); |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * Dashboard configuration. | |
| 92 | + * | |
| 93 | + * Adds whether this site can go back to an absorbed plugin's old system, | |
| 94 | + * so the signup screen can offer it the way that plugin used to. | |
| 95 | + * | |
| 96 | + * @return array | |
| 97 | + */ | |
| 98 | + protected function getLocalizeData(): array | |
| 99 | + { | |
| 100 | + $data = parent::getLocalizeData(); | |
| 101 | + | |
| 102 | + $source = LegacyFallback::available(); | |
| 103 | + | |
| 104 | + // Only ever offered to a site whose old system Buttonizer took over, | |
| 105 | + // so the name that means something here is the old one. | |
| 106 | + $data['legacyModule'] = $source ? ['label' => $source->legacyLabel()] : null; | |
| 107 | + | |
| 108 | + return $data; | |
| 87 | 109 | } |
| 88 | 110 | |
| 89 | 111 | /** |
| 90 | 112 | * Migration status (legacy-specific). |