<?php

namespace ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\Http;

use \ThurData\Servers\KerioEmail\Core\App\Controllers\Interfaces\ClientArea;
use \ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\HttpController;

class ClientPageController extends HttpController implements ClientArea
{
    public function execute($params = null)
    {
        if (class_exists('\ThurData\Servers\KerioEmail\App\Hooks\InternalHooks\PreClientAreaPageLoad'))
        {
            $preClietAreaHook = new \ThurData\Servers\KerioEmail\App\Hooks\InternalHooks\PreClientAreaPageLoad($params);
            $newParams = $preClietAreaHook->execute();
            if ($newParams && is_array($newParams))
            {
                $params = $newParams;
            }
        }
        
        return parent::execute($params);
    }
}
