<?php

use isys_component_popup;
use isys_component_template;
use isys_helper_link;
use isys_module_pro;
use isys_module_request;

class isys_popup_download_center_info extends isys_component_popup
{
    /**
     * Handles SMARTY request for dialog plus lists and builds the list base on the specified table.
     *
     * @param isys_component_template & $p_tplclass
     * @param array                     $p_params
     *
     * @return  string
     */
    public function handle_smarty_include(isys_component_template $p_tplclass, $p_params)
    {
        return '';
    }

    /**
     * Method for handling the module request.
     *
     * @param isys_module_request $p_modreq
     *
     * @return void
     * @throws \idoit\Exception\JsonException
     */
    public function &handle_module_request(isys_module_request $p_modreq)
    {
        \isys_application::instance()->container->get('settingsUser')->set('pro.news.download-center', 1);

        $this->template->activate_editmode()
            ->assign('cssPath', isys_module_pro::getPath() . 'assets/css/popup-download-center-info.css')
            ->assign('downloadCenterUrl', isys_helper_link::create_url([
                C__GET__MODULE_ID     => C__MODULE__SYSTEM,
                C__GET__MODULE_SUB_ID => C__MODULE__PRO,
                C__GET__SETTINGS_PAGE => 'download-center'
            ], true))
            ->display(isys_module_pro::getPath() . 'templates/SettingPage/Center/Download/popupDownloadCenterInfo.tpl');
        die;
    }
}
