<?php

namespace ThurData\Servers\KerioEmail\App\Http\Actions;


use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
use ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\AddonController;
use function ThurData\Servers\KerioEmail\Core\Helper\di;

/**
 *
 * Created by PhpStorm.
 * User: ThurData
 * Date: 13.11.19
 * Time: 13:45
 * Class AdminServicesTabFields
 */
class AdminServicesTabFields extends AddonController
{

    public function execute($params = null)
    {
        $productManager = new ProductManager();
        $productManager->loadByHostingId($params['serviceid']);

        $webmail = $productManager->getClientUrl();
        return [
            'Login' => '<a class="btn" href="' . $webmail . '" target="_blank" style="color:#000000; text-decoration: none;">' .
                       di('lang')->absoluteT('logInToWebmail') . '</a>'
        ];
    }
}