{include file="./index_top.tpl"}
<script language="JavaScript" type="text/javascript">
    // значения для системной подсказки
    var help_section = 'Settings';
    var help_sub_section = 'Additional';
</script>
<style>
select.form-control {
    width: 200px;
}
</style>
<div align=center>
    <br>{$lang.For_mobile}<span class='help_bt' h_id='mobile_settings'></span><br><br>
    <form action="edit_mobile.php" method="post">
        <table border=0 cellpadding=3>
            {if $message}
                <tr>
                    <td colspan=2 align=center>
                        <span id="edit_config__info-maessage" style="color:green">{$message}</span><br><br>
                    </td>
                </tr>
            {/if}
            <tr>
                <td align="right" width="50%">{$lang.default_page}<span class='help_bt' h_id='default_page'></span>:</td>
                <td>
                    <select class="form-control" name="default_page_mode" onchange="$('#default_page').toggle(this.value == 2)">
                        <option value="0" {if $config.mobile_default_page_mode == 0}selected{/if}>{$lang.mob_def_main_menu}</option>
                        <option value="1" {if $config.mobile_default_page_mode == 1}selected{/if}>{$lang.mob_def_user_page}</option>
                        <option value="2" {if $config.mobile_default_page_mode == 2}selected{/if}>{$lang.mob_def_cust_page}</option>
                    </select>
                    <select class="form-control" name="default_page" id="default_page" {if $config.mobile_default_page_mode != 2}style="display:none"{/if}>
                        {foreach from=$dp_list item=dp_gr key=dp_gr_key}
                            <optgroup label="{$dp_gr.name}">
                                {foreach from=$dp_gr.contents item=dp_item key=dp_item_key}
                                    <option value="{$dp_item.id}" {if $dp_item.id == $config.mobile_default_page}selected{/if}>
                                        {$dp_item.name} {if $dp_item.type=='r'}{$lang.report_page}{elseif $dp_item.type=='c'}{$lang.calendar_page}{/if}
                                    </option>
                                {/foreach}
                            </optgroup>
                        {/foreach}
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">{$lang.mob_rec_menu_mode}<span class='help_bt' h_id='mobile_record_menu_mode'></span>:</td>
                <td>
                    <select class="form-control" name="record_menu_mode">
                        <option value="0" {if $config.mobile_record_menu_mode == 0}selected{/if}>{$lang.mob_rec_menu_mode_1}</option>
                        <option value="1" {if $config.mobile_record_menu_mode == 1}selected{/if}>{$lang.mob_rec_menu_mode_2}</option>
                        <option value="2" {if $config.mobile_record_menu_mode == 2}selected{/if}>{$lang.mob_rec_menu_mode_3}</option>
                    </select>
                </td>
            </tr>

            <tr>
              <td align="right">{$lang.open_from_mobile_devices_by_default}<span class='help_bt' h_id='open_from_mobile_devices_by_default'></span>:</td>
              <td>
                <select class="form-control" name="disable_mobile_version">
                  <option value="0" {if $config.disable_mobile_version == 0}selected{/if}>{$lang.For_mobile}</option>
                  <option value="1" {if $config.disable_mobile_version == 1}selected{/if}>{$lang.For_computer}</option>
                </select>
              </td>
            </tr>

            <tr>
                <td colspan=2 align=center>
                    <br><input class="btn btn-default btn-sm" type="submit" name='save' value="{$lang.Save}">
                    <input type=hidden name="csrf" value="{$csrf}">
                </td>
            </tr>

        </table>
    </form>
    <br>
    <a href="edit_add.php">{$lang.return_to_add_settings}</a><br><br>
</div>
