<?php

namespace ModulesGarden\OpenXchangeAddon\Core\App\Controllers\Instances\Http;

use \ModulesGarden\OpenXchangeAddon\Core\App\Controllers\Interfaces\ClientArea;
use \ModulesGarden\OpenXchangeAddon\Core\App\Controllers\Instances\HttpController;

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