    <style>
    .acc_menu_span {
        margin-left: {if !$rules_id}12{else}25{/if}px;
    }
    </style>
    <script>
        function saveBeforeGoForNew(name){
            $("input[name='save']").append('<input type="hidden" value="' + name +'" name="goto">');
            $("input[name='save']").next().trigger('click');
            return false;
        }

        function saveBeforeGo(name){
            let save = $("[name='save']").val();
            $("input[name='save']").append('<input type="hidden" value="' + name +'" name="goto">');
            if(save == 'templates'){
                document.getElementById('templates_form').submit();
            }
            else if(save == 'rules') {
                $("input[name='save']").next().trigger('click');
            }
            else {
                document.getElementById('comm_rights_form').submit();
            }
            return false;
        }

    </script>
    <div class="search_bar bubble speech" style="line-height:25px;background-color:#ffffff;border-top:none;width:930px;padding: 5px 0 12px 0;margin:0 0 25px 0;">
        <table>
            <tr>
                {if !$rules_id}
                <td style="white-space: nowrap">
                    <div style="margin-right:15px">
                        <div style="float:left;padding-top: 2px;">{$lang.Visibility} {$lang.tables}
                            : &nbsp;</div>
                        <img id="eye_t_{$table_vis_acc.id}"
                             style="float:left;{if !$table_acc_blocked}cursor:pointer;{/if}text-decoration:none;background-color:transparent;"
                             src='images/acc_big_{if $table_vis_acc.vis_acc && $table_vis_acc.acc}allow{elseif $table_vis_acc.acc}invisibe{else}close{/if}.png'
                             {if !$table_acc_blocked}onclick='send_cat_acc2({$group_id}, {$table_vis_acc.id}, this, "t");change_eye2(this, {$group_id});'{/if}/>
                        {if $table_acc_blocked}<img src="images/lock.svg" style="width:20px; padding-right:5px;">{/if}
                    </div>
                </td>
                {/if}
                <td style="white-space: nowrap">
                    <span>{if $menu!='common' && $menu && $menu!='rules'}<a id="goto"
                            onclick="saveBeforeGo('rules')"
                            class="href_top_menu" style="color:gray"
                            href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu={if $rules_id>0}rules&rules_id={$rules_id}{else}common{/if}">{$lang.Fields}</a>{else}
                            <b>{$lang.Fields}</b>{/if} </span>
                    {if !$rules_id}<span class="acc_menu_span">{if $menu!='filters'}<a id="goto"
                        onclick="saveBeforeGo('rules')"
                        class="href_top_menu"
                        style="color:gray{if $filter_count==0};text-decoration:none{/if}"
                        href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=filters{if $rules_id>0}&rules_id={$rules_id}{/if}">{$lang.Filters}</a>{else}
                        <b>{$lang.Filters}</b>{/if}</span>{/if}
                    <span class="acc_menu_span">{if $menu!='tips'}{if $rules_id==-1}<a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGoForNew('tips')"
                                                                style="color:gray{if $tips_count==0};text-decoration:none{/if}">
                                                                    {$lang.Tips}</a>
                                                        {else}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGo('tips')"
                                                                style="color:gray{if $tips_count==0};text-decoration:none{/if}"
                                                                href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=tips{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                    {$lang.Tips}
                                                            </a>
                                                        {/if}
                                                    {else}
                                                        <b>{$lang.Tips}</b>
                                                    {/if}
                    </span>
                    <span class="acc_menu_span">
                        <span style="color:gray; display:inline">{$lang.Templates} (
                            <span
                                style="display:inline">{if $template_type !='print'}
                                                            {if $rules_id==-1}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGoForNew('print')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}">
                                                                        {$lang.Print_ftemplates}
                                                                </a>
                                                            {else}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGo('print')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}"
                                                                    href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=templates&type=print{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                        {$lang.Print_ftemplates}
                                                                </a>
                                                            {/if}
                                                        {else}
                                                            <b style="color:black">{$lang.Print_ftemplates}</b>
                                                        {/if}</span> /
                            <span
                                style="display:inline">{if $template_type !='send'}
                                                            {if $rules_id==-1}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGoForNew('send')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}">
                                                                        {$lang.Mail_ftemplates}
                                                                </a>
                                                            {else}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGo('send')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}"
                                                                    href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=templates&type=send{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                        {$lang.Mail_ftemplates}
                                                                </a>
                                                            {/if}
                                                        {else}
                                                            <b style="color:black">{$lang.Mail_ftemplates}</b>
                                                        {/if}</span> /
                            <span
                                style="display:inline">{if $template_type !='sms'}
                                                            {if $rules_id==-1}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGoForNew('sms')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}">
                                                                        {$lang.SMS_ftemplates}
                                                                </a>
                                                            {else}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGo('sms')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}"
                                                                    href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=templates&type=sms{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                        {$lang.SMS_ftemplates}
                                                                </a>
                                                            {/if}
                                                        {else}
                                                            <b style="color:black">{$lang.SMS_ftemplates}</b>
                                                        {/if}</span> /
                            <span
                                style="display:inline">{if $template_type !='msg'}
                                                            {if $rules_id==-1}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGoForNew('msg')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}">
                                                                        {$lang.Msg_ftemplates}
                                                                </a>
                                                            {else}
                                                                <a id="goto" class="href_top_menu"
                                                                    onclick="saveBeforeGo('msg')"
                                                                    style="color:gray{if $forms_count==0};text-decoration:none{/if}"
                                                                    href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=templates&type=msg{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                        {$lang.Msg_ftemplates}
                                                                </a>
                                                            {/if}
                                                        {else}
                                                            <b style="color:black">{$lang.Msg_ftemplates}</b>
                                                        {/if}</span>)
                        </span>
                    </span>
                    <span class="acc_menu_span">{if $menu!='buttons'}
                                                        {if $rules_id==-1}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGoForNew('buttons')"
                                                                style="color:gray{if $button_count==0};text-decoration:none{/if}">
                                                                    {$lang.Adds_buttons}
                                                            </a>
                                                        {else}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGo('buttons')"
                                                                style="color:gray{if $button_count==0};text-decoration:none{/if}"
                                                                href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=buttons{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                    {$lang.Adds_buttons}
                                                            </a>
                                                        {/if}
                                                    {else}
                                                        <b style="color:black">{$lang.Adds_buttons}</b>
                                                    {/if}
                    </span>
                    <span class="acc_menu_span">{if $menu!='subtables'}
                                                        {if $rules_id==-1}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGoForNew('subtables')"
                                                                style="color:gray{if $button_count==0};text-decoration:none{/if}">
                                                                    {$lang.Subtables}
                                                            </a>
                                                        {else}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGo('subtables')"
                                                                style="color:gray{if $button_count==0};text-decoration:none{/if}"
                                                                href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=subtables{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                    {$lang.Subtables}
                                                            </a>
                                                        {/if}
                                                    {else}
                                                        <b style="color:black">{$lang.Subtables}</b>
                                                    {/if}
                    </span>
                    <span class="acc_menu_span">{if $menu!='addittables'}
                                                        {if $rules_id==-1}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGoForNew('addittables')"
                                                                style="color:gray{if $button_count==0};text-decoration:none{/if}">
                                                                    {$lang.Addittables}
                                                            </a>
                                                        {else}
                                                            <a id="goto" class="href_top_menu"
                                                                onclick="saveBeforeGo('addittables')"
                                                                style="color:gray{if $button_count==0};text-decoration:none{/if}"
                                                                href="edit_group.php?group={if $to_back}{$to_back}{else}{$group_id}{/if}&cat={$cat_id}&cat_item={$cat_item}&menu=addittables{if $rules_id>0}&rules_id={$rules_id}{/if}">
                                                                    {$lang.Addittables}
                                                            </a>
                                                        {/if}
                                                    {else}
                                                        <b style="color:black">{$lang.Addittables}</b>
                                                    {/if}
                    </span>
                </td>
            </tr>
        </table>
    </div>
