<div class="af2_menu_sheet">
    <div class="af2_menu_sheet_content">
        <div class="af2_card">
            <div class="af2_card_block">
                <?php include AF2_MENU_HOOKS_SNIPPET ?>
                <div class="af2_post_table">
                    <div class="af2_post_table_head">
                        <div class="af2_post_table_row">
                            <div class="af2_post_table_content af2_post_table_checkbox" style="width: 60px;"><input type="checkbox" class="af2_choose_all_table_objects"></div>
                            <?php foreach( $table_columns as $table_column ) { ?>
                            <?php $hide_column = !(isset($table_column['hidden']) && $table_column['hidden'] == true) ? '' : 'af2_hide' ?>
                            <div class="af2_post_table_content <?=$hide_column?>" style="width: <?=$table_column['width']?>; flex: <?=$table_column['flex']?>; min-width: <?=$table_column['min-width']?>; max-width: <?=$table_column['max-width']?>">
                                <h5><?=__($table_column['lable'], 'af2_multilanguage')?></h5>
                            </div>
                            <?php } ?>
                        </div>
                    </div>
                    <div class="af2_post_table_body">
                        <?php foreach( $posts as $post ) { ?>
                        <?php 
                            $uid_label = null;
                            foreach($table_columns as $table_column) {
                                if($table_column['uid'] == true) $uid_label = $table_column['lable'];
                            } 
                        ?>
                        <div id="<?=$post[$uid_label]?>" class="af2_post_table_row <?= isset($post['error']) && $post['error'] == 'true' ? 'af2_error_row' : ''?>">
                            <div class="af2_post_table_content af2_post_table_checkbox" style="width: 60px;"><input type="checkbox" id="<?=$post[$uid_label]?>" class="af2_choose_table_object"></div>
                            <?php foreach( $table_columns as $table_column ) { ?>
                            <?php $hide_column = !(isset($table_column['hidden']) && $table_column['hidden'] == true) ? '' : 'af2_hide' ?>
                            <div class="af2_post_table_content <?=$hide_column?>" style="width: <?=$table_column['width']?>; flex: <?=$table_column['flex']?>" data-searchfilter="<?=$table_column['lable']?>"
                            data-searchvalue="<?=$table_column['translate'] ? __($post[$table_column['lable']], 'af2_multilanguage') : $post[$table_column['lable']]?>">
                                <?php if(isset($table_column['select'])) { ?>
                                    <select style="padding: 0px 25px 0 10px !important;" class="<?=$table_column['select']['select_class']?>" data-elementid="<?=$post[$uid_label]?>">
                                        <option value="empty"><?=__($table_column['select']['empty_value'], 'af2_multilanguage')?></option>
                                        <?php foreach($table_column['select']['selection_values'] as $option) { ?>
                                            <option value="<?=$option['value']?>" <?= $post[$table_column['lable']] === $option['value'] ? 'selected' : '' ?>><?=$option['label']?></option>
                                        <?php } ?>
                                    </select>
                                <?php } else { ?>
                                <?php if(!$table_column['button']) { ?>
                                <p class="table_content <?=$table_column['highlight'] ? 'af2_highlight' : ''?>">
                                    <?php if(isset($table_column['url']) && $table_column['url'] && isset($table_builder_load_url) && isset($table_builder_load_url_id)) { ?>
                                        <?php 
                                            $actual_href = $table_builder_load_url.$post[$table_builder_load_url_id];
                                            if(isset($table_column['urlnum']) && $table_column['urlnum'] > -1) {
                                                $val = $table_builder_load_url_ids_array[$table_column['urlnum']];
                                                $actual_href = $val['page'].$post[$val['id']];
                                            }
                                        ?>
                                        <a class="af2_btn_link" href="<?=$actual_href?>">
                                            <?=$table_column['translate'] ? __($post[$table_column['lable']], 'af2_multilanguage') : $post[$table_column['lable']]?>
                                        </a>
                                        <?php } else { ?>
                                        <?=$table_column['translate'] ? __($post[$table_column['lable']], 'af2_multilanguage') : $post[$table_column['lable']]?>
                                        <?php } ?>
                                </p>
                                <?php } else { ?>
                                <div class="table_content">
                                    <?php if(isset($table_column['url']) && $table_column['url'] && isset($table_builder_load_url) && isset($table_builder_load_url_id)) { ?>
                                        <?php 
                                            $actual_href = $table_builder_load_url.$post[$table_builder_load_url_id];
                                            if(isset($table_column['urlnum']) && $table_column['urlnum'] > -1) {
                                                $val = $table_builder_load_url_ids_array[$table_column['urlnum']];
                                                $actual_href = $val['page'].$post[$val['id']];
                                            }
                                        ?>
                                        <a class="af2_btn_link" href="<?=$actual_href?>">
                                            <div class="af2_btn af2_btn_<?=$table_column['buttonclass']?>">
                                                <?=$table_column['translate'] ? __($post[$table_column['lable']], 'af2_multilanguage') : $post[$table_column['lable']]?>
                                            </div>
                                        </a>
                                        <?php } else { ?>
                                            <div class="af2_btn af2_btn_<?=$table_column['buttonclass']?>" <?=isset($table_column['buttonid']) && $table_column['buttonid'] ? 'data-objectid="'.$post[$uid_label].'"' : ''?>>
                                            <?=$table_column['translate'] ? __($post[$table_column['lable']], 'af2_multilanguage') : $post[$table_column['lable']]?>
                                        </div>
                                        <?php } ?>
                                </div>
                                <?php } ?>
                                <?php } ?>
                            </div>
                            <?php } ?>
                        </div>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php include AF2_MENU_SIDEBAR ?>

    <?php if( $custom_template != null ) include $custom_template; ?>
</div>