{% import "macro_functions.phtml" as mf %}

<div class="help">
    <h5>{{ 'License settings'|trans }}</h5>
</div>

<form method="post" action="{{ 'api/admin/product/update_config'|link }}" class="mainForm api-form save" data-api-msg="License settings updated">
<fieldset>
    <div class="rowElem noborder">
        <label>{{ 'Prefix'|trans }}:</label>
        <div class="formRight">
            <input type="text" name="config[prefix]" value="{{ product.config.prefix }}">
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{{ 'Length'|trans }}:</label>
        <div class="formRight">
            <input type="text" name="config[length]" value="{{ product.config.length }}">
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{{ 'Plugin'|trans }}:</label>
        <div class="formRight">
            {{ mf.selectbox('config[plugin]', admin.servicelicense_plugin_get_pairs, product.config.plugin, 1) }}
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{{ 'Validate IP'|trans }}:</label>
        <div class="formRight">
            <input type="radio" name="config[validate_ip]" value="1"{% if product.config.validate_ip %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[validate_ip]" value="0"{% if not product.config.validate_ip %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{{ 'Validate Hostname'|trans }}:</label>
        <div class="formRight">
            <input type="radio" name="config[validate_host]" value="1"{% if product.config.validate_host %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[validate_host]" value="0"{% if not product.config.validate_host %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{{ 'Validate Version'|trans }}:</label>
        <div class="formRight">
            <input type="radio" name="config[validate_version]" value="1"{% if product.config.validate_version %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[validate_version]" value="0"{% if not product.config.validate_version %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{{ 'Validate Path'|trans }}:</label>
        <div class="formRight">
            <input type="radio" name="config[validate_path]" value="1"{% if product.config.validate_path %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[validate_path]" value="0"{% if not product.config.validate_path %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    
    <input type="submit" value="{{ 'Update'|trans }}" class="greyishBtn submitForm" />
</fieldset>
    
<input type="hidden" name="id" value="{{ product.id }}" />
</form>

<div class="body">
    <h1 class="pt10">{{ 'License plugins'|trans }}</h1>
    <p>{{ 'BoxBilling gives you ability to provide your own license generation script. Follow instructions bellow to install new license plugin'|trans }}</p>

    <div class="pt20 list arrowGrey">
        <ul>
            <li>{{ 'License plugin is PHP class "License_PluginName" with one method'|trans }} <strong>generate</strong></li>
            <li>{{ 'Take a look at default plugin at'|trans }} <strong>src/bb-modules/Servicelicense/Plugin/Simple.php</strong></li>
            <li>{{ 'Create your plugin and place it to'|trans }} <strong>src/bb-modules/Servicelicense/Plugin/PluginName.php</strong></li>
            <li>{{ 'BoxBilling will automatically detect new plugin'|trans }}</li>
            <li>{{ 'Read'|trans }} <a href="http://docs.boxbilling.org/en/latest/reference/service-license.html#license-plugin" target="_blank">{{ 'BoxBilling documentation'|trans }}</a> {{ 'for more information.'|trans }}</li>
        </ul>
    </div>
</div>
