116896b584
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Universal: Auto Version Bump / Version Bump (push) Successful in 3s
Generic: Project CI / Lint & Validate (push) Successful in 11s
Update Server / Update Server (push) Successful in 11s
Generic: Project CI / Tests (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Completes the MokoJoomCross → MokoSuiteCross rebrand across all language string keys, Joomla event names, documentation, and wiki pages. - 1,151 language key references renamed (COM_, PLG_, PKG_ prefixes) - Event names renamed (onMokoJoomCross* → onMokoSuiteCross*) - CLAUDE.md, CHANGELOG.md, wiki docs updated - Zero mokojoomcross references remaining in codebase Closes #128, closes #138
62 lines
1.8 KiB
PHP
62 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @package MokoSuiteCross
|
|
* @subpackage com_mokosuitecross
|
|
* @author Moko Consulting <hello@mokoconsulting.tech>
|
|
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
|
* @license GNU General Public License version 3 or later; see LICENSE
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
use Joomla\CMS\Language\Text;
|
|
use Joomla\CMS\MVC\Controller\BaseController;
|
|
use Joomla\CMS\Router\Route;
|
|
use Joomla\Component\MokoSuiteCross\Administrator\Helper\MigrationHelper;
|
|
|
|
class DashboardController extends BaseController
|
|
{
|
|
/**
|
|
* Run Perfect Publisher Pro migration.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function migrate(): void
|
|
{
|
|
$this->checkToken();
|
|
|
|
// Check ACL
|
|
if (!$this->app->getIdentity()->authorise('mokosuitecross.migrate', 'com_mokosuitecross')) {
|
|
$this->setRedirect(
|
|
Route::_('index.php?option=com_mokosuitecross&view=dashboard', false),
|
|
Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'),
|
|
'error'
|
|
);
|
|
|
|
return;
|
|
}
|
|
|
|
$result = MigrationHelper::migrate();
|
|
|
|
if (!empty($result['errors'])) {
|
|
$this->setRedirect(
|
|
Route::_('index.php?option=com_mokosuitecross&view=dashboard', false),
|
|
Text::sprintf('COM_MOKOSUITECROSS_MIGRATION_ERROR', implode('; ', $result['errors'])),
|
|
'error'
|
|
);
|
|
|
|
return;
|
|
}
|
|
|
|
$this->setRedirect(
|
|
Route::_('index.php?option=com_mokosuitecross&view=dashboard', false),
|
|
Text::sprintf('COM_MOKOSUITECROSS_MIGRATION_SUCCESS', $result['migrated'], $result['skipped']),
|
|
'success'
|
|
);
|
|
}
|
|
}
|