<?php

class isys_popup_custom_translation_new 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)
    {
        $rules = [
            'C__CUSTOM_TRANSLATION__NEW_KEY' =>  [
                'p_strClass' => 'input-medium',
                'p_strPlaceholder' => 'LC__'
            ],
            'C__CUSTOM_TRANSLATION__NEW_VALUE' =>  [
                'p_strClass' => 'input-medium',
                'p_strPlaceholder' => 'Optional'
            ]
        ];

        $this->template
            ->activate_editmode()
            ->smarty_tom_add_rules('tom.popup.translationImport', $rules)
            ->display(isys_module_pro::getPath() . 'templates/SettingPage/CustomTranslation/popupNewTranslation.tpl');
        die;
    }
}
