<?php

namespace ModulesGarden\Servers\ZimbraEmail\App\Http\Actions;


use ModulesGarden\Servers\ZimbraEmail\App\Libs\Product\ProductManager;
use ModulesGarden\Servers\ZimbraEmail\Core\App\Controllers\Instances\AddonController;
use function ModulesGarden\Servers\ZimbraEmail\Core\Helper\di;

/**
 *
 * Created by PhpStorm.
 * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
 * 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>'
        ];
    }
}