<?php

namespace ModulesGarden\Servers\OpenXchange\App\Http\Admin;

use ModulesGarden\Servers\OpenXchange\Core\Helper;
use ModulesGarden\Servers\OpenXchange\Core\Http\AbstractClientController;
use ModulesGarden\Servers\OpenXchange\App\UI\Client\Home\Pages\ServiceInformation;
use ModulesGarden\Servers\OpenXchange\App\UI\Admin\ProductConfiguration\Pages\ConfigForm;
use ModulesGarden\Servers\OpenXchange\App\UI\Admin\ProductConfiguration\Pages\ConfigurablesOptions;


/**
 *
 * Created by PhpStorm.
 * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
 * Date: 28.08.19
 * Time: 09:10
 * Class ProductConfiguration
 */
class ProductConfiguration extends AbstractClientController
{

    public function index()
    {
        $view = Helper\viewIntegrationAddon()
            ->addElement(ConfigForm::class)
            ->addElement(ConfigurablesOptions::class);

        return $view;
    }

    public function adminServicesTabFields() {
        try {
            return Helper\view()
                ->addElement(ServiceInformation::class);
        }
        catch (\Exception $e) {
            logActivity($e->getMessage());
        }
    }

}