<mt:setvarblock name="page_title"><__trans phrase="Manage Users"></mt:setvarblock>
<mt:setvarblock name="related_content">
    <mtapp:widget
        id="quickfilters"
        label="<__trans phrase="Quickfilters">">
        <$mtapp:listfilters$>
    </mtapp:widget>
    <$mtapp:pageactions$>
</mt:setvarblock>
<mt:setvarblock name="html_body_footer">
    <$mt:include name="include/display_options.tmpl"$>
</mt:setvarblock>
<mt:setvarblock name="html_head" append="1">
<script type="text/javascript">
/* <![CDATA[ */
function enableFilterButton() {
    jQuery('#filter-button').css('display', 'inline');
}

function toggleFilter() {
    if (jQuery('#filter-title').toggle().css('display') == 'none') {
        <mt:unless name="filter">setFilterCol('status');</mt:unless>
    }
    jQuery('#filter-select').toggle();
}

function setFilterCol(choice) {
    if (!jQuery('#filter-select').length) return;
    if (choice != 'none') {
        jQuery('#filter-select span').not('.buttons').hide();
        jQuery('#filter-'+choice).show().addClass('filter-'+choice);
        jQuery('#filter-col').val(choice);
        jQuery('#filter-text-col').html('<strong>'+jQuery('#filter-col option:selected').text()+'</strong>');
    }
}

function init()
{
    setFilterCol(<mt:if name="filter">'<mt:var name="filter" escape="js">'<mt:else>'none'</mt:if>);<mt:if name="filter">
    setFilterVal('<mt:var name="filter_val" escape="js">');</mt:if>
}

function removeMemberRole(author_id, role_id) {
    if (confirm("<__trans phrase="Are you sure you want to remove the user from this role?" escape="js">")) {
        jQuery('#user-listing-form input[name=__mode]').val('revoke_role');
        jQuery('#user-listing-form input[name=author_id]').val(author_id);
        jQuery('#user-listing-form input[name=role_id]').val(role_id);
        jQuery('#user-listing-form').submit();
    }
    return false;
}
/* ]]> */
</script>
</mt:setvarblock>
<mt:setvarblock name="system_msg">
    <div id="msg-block">
        <mt:if name="saved">
            <mtapp:statusmsg id="saved-msg" class="success" can_close="1">
            <__trans phrase="Your changes have been saved.">
            </mtapp:statusmsg>
        </mt:if>
    </div>
</mt:setvarblock>
<mt:setvarblock name="content_header">
    <mt:if name="can_manage">
<ul>
    <li><a href="<mt:var name="script_url">?__mode=dialog_grant_role&amp;type=<mt:if name="is_blog">blog<mt:else>website</mt:if>&amp;_type=user<mt:if name="blog_id">&amp;blog_id=<mt:var name="blog_id"></mt:if>&amp;return_args=<mt:var name="return_args" escape="url">" class="icon-left icon-create mt-open-dialog"><mt:if name="is_blog"><__trans phrase="Add a user to this blog"><mt:else><__trans phrase="Add a user to this website"></mt:if></a></li>
</ul>
    </mt:if>
</mt:setvarblock>
<mt:setvarblock name="list_filter_form">
<form id="filter-form" method="get" action="<mt:var name="mt_url">">
<input type="hidden" name="__mode" value="list_member" />
<mt:if name="blog_id">
<input type="hidden" name="blog_id" value="<mt:var name="blog_id">" />
</mt:if>
<input id="filter" type="hidden" name="filter" value="" />
<input id="filter_val" type="hidden" name="filter_val" value="" />
</form>
    <div class="listing-filter">
        <div class="listing-filter-inner inner pkg">
<form id="filter-select-form" method="get" action="<mt:var name="mt_url">" onsubmit="return execFilter(this)">
    <div class="filter">
        <div id="filter-title">
        <mt:if name="filter_key">
            <strong><__trans phrase="Showing only: [_1]" params="<mt:var name="filter_label">"></strong>
            <a class="filter-link" href="<mt:var name="script_url">?__mode=<mt:var name="mode" escape="url"><mt:if name="blog_id">&amp;blog_id=<mt:var name="blog_id" escape="url"></mt:if>">[ <__trans phrase="Remove filter"> ]</a>
        <mt:else>
            <mt:unless name="filter">
            <strong><__trans phrase="All [_1]" params="<$mt:var name="object_label_plural"$>"></strong>
            <a href="javascript:void(0)" onclick="toggleFilter()" class="filter-link">[ <__trans phrase="change"> ]</a>
            <mt:else>
            <strong><a href="javascript:void(0)" onclick="toggleFilter()"><__trans phrase="[_1] where [_2] is [_3]" params='<$mt:var name="object_label_plural"$>%%<span id="filter-text-col">&nbsp;</span>%%<span id="filter-text-val"></span>'></a></strong>
            <a href="<mt:var name="script_url">?__mode=<mt:var name="mode" escape="url"><mt:if name="blog_id">&amp;blog_id=<mt:var name="blog_id" escape="url"></mt:if>">[ <__trans phrase="Remove filter"> ]</a>
            </mt:unless>
        </mt:if>
        </div>
        <div id="filter-select" class="page-title" style="display: none">
            <__trans phrase="Show only users where">
            <!-- start filter form -->
                <select id="filter-col" name="filter" onchange="setFilterCol(this.options[this.selectedIndex].value);enableFilterButton(this)">
                    <option value="role"><__trans phrase="role"></option>
                    <option value="status"><__trans phrase="status"></option>
                </select>
                <__trans phrase="is">
                <span id="filter-role" style="display: none">
                    <select id="role-val" name="filter_val" onchange="enableFilterButton()">
            <mt:loop name="role_loop">
                        <option value="<$mt:var name="role_id" escape="html"$>"<mt:if name="selected"> selected="selected"</mt:if>><$mt:var name="role_name" escape="html"$></option>
            </mt:loop>
                    </select>
                </span>
                <span id="filter-status" style="display: none">
                    <select id="status-val" name="filter_val" onchange="enableFilterButton()">
                        <option value="enabled"><__trans phrase="enabled"></option>
                        <option value="disabled"><__trans phrase="disabled"></option>
                        <option value="pending"><__trans phrase="pending"></option>
                    </select>
                </span>
            <!-- end of filter form -->
            <span class="buttons">
                <button
                    id="filter-button"
                    onclick="return execFilter(getByID('filter-select-form'))"
                    type="submit"
                    ><__trans phrase="Filter"></button>
                <button
                    onclick="toggleFilter(); return false;"
                    type="submit"
                    ><__trans phrase="Cancel"></button>
            </span>
        </div>
    </div>
</form>
    </div>
</div>
</mt:setvarblock>

<$mt:include name="include/header.tmpl"$>
<$mt:var name="list_filter_form"$>
<$mt:include name="include/member_table.tmpl"$>
<mt:setvarblock name="jq_js_include" append="1">
    init();
    jQuery.mtCheckbox();
</mt:setvarblock>
<$mt:include name="include/footer.tmpl"$>
