<?php

namespace ThurData\Servers\KerioEmail\Core\App\Controllers\AppControllers;

use ThurData\Servers\KerioEmail\Core\App\Controllers\Interfaces\AppController;
use ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\Http\AdminPageController;
use ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\Http\ClientPageController;

class Http extends \ThurData\Servers\KerioEmail\Core\App\Controllers\AppController implements AppController
{
    public function getControllerInstanceClass ($callerName, $params)
    {
        //todo
        $functionName = str_replace($this->getModuleName() . '_', '', $callerName);
        switch ($functionName)
        {
            //HTTP controllers
            case 'output':
                return AdminPageController::class;
            case 'clientarea':
                return ClientPageController::class;
        }

        return null;
    }

    public function getModuleName ()
    {
        return 'KerioEmail';
    }
}
