<?php
/**
 * #8037 Standalone "Filter" dropdown for contexts WITHOUT a stream-type dropdown (profiles,
 * groups, or a main stream with a single stream type). It carries only the "Hide my posts"
 * checkbox, but uses the same filter icon + "Filter" header as the stream-type dropdown so every
 * context looks uniform. Renders nothing when my-posts isn't available (e.g. guests).
 */

$show_my_posts_list = apply_filters('peepso_show_my_posts_list', array());
if (!$show_my_posts_list || !is_array($show_my_posts_list) || !count($show_my_posts_list)) {
    return;
}
?>
<div class="pso-posts__filter pso-posts__filter--myposts pso-posts__filter--filter ps-js-dropdown ps-js-activitystream-filter" data-id="peepso_stream_filter_show_my_posts">
    <a href="javascript:" class="pso-posts-filter__toggle ps-js-dropdown-toggle" aria-haspopup="true">
        <i class="pso-i-settings-sliders ps-js-icon"></i>
        <span><?php echo esc_attr__('Filter', 'peepso-core'); ?></span>
    </a>
    <div class="pso-posts-filter__box ps-js-dropdown-menu" role="menu">
        <div class="pso-posts-filter__title">
            <span><?php echo esc_attr__('Filter', 'peepso-core'); ?></span>
            <a href="javascript:" class="pso-posts-filter__close ps-js-cancel" role="button" aria-label="<?php echo esc_attr__('Close', 'peepso-core'); ?>"><i class="pso-i-cross-small"></i></a>
        </div>
        <?php PeepSoTemplate::exec_template('activity', 'stream-filter-myposts', array('separator' => false)); ?>
    </div>
</div>
