- appinfo/Application.php: Namespace OCA\AnalyticsHub\AppInfo, Class Application - appinfo/info.xml: Namespace AnalyticsHub, Navigation analyticshub.page.index - lib/Controller/PageController.php: Namespace OCA\AnalyticsHub\Controller\Page, Class PageController - This follows standard Nextcloud autoloader conventions - Application extends OCP\AppFramework\App - PageController extends OCP\AppFramework\Controller Should fix autoloader issues: - AppInfo class in AppInfo namespace (correct) - PageController class in Controller namespace (correct) - Navigation points to page.index (correct) - Application.php has correct extends App This should resolve all Application class loading errors and allow admin page to load properly.
40 lines
845 B
PHP
40 lines
845 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\AnalyticsHub\Controller\Page;
|
|
|
|
use OCP\IRequest;
|
|
use OCP\AppFramework\Controller;
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
|
|
/**
|
|
* Admin Page Controller
|
|
*
|
|
* @NoAdminRequired
|
|
* @NoCSRFRequired
|
|
*/
|
|
class PageController extends Controller {
|
|
|
|
protected $appName;
|
|
|
|
public function __construct(string $appName, IRequest $request) {
|
|
parent::__construct($appName, $request);
|
|
$this->appName = $appName;
|
|
}
|
|
|
|
/**
|
|
* Index page - render admin UI
|
|
*
|
|
* @NoAdminRequired
|
|
* @NoCSRFRequired
|
|
*/
|
|
public function index(): TemplateResponse {
|
|
return new TemplateResponse($this->appName, 'admin', [
|
|
'app_name' => $this->appName,
|
|
'version' => '1.0.0',
|
|
'status' => 'Testing - admin accessible',
|
|
]);
|
|
}
|
|
}
|