<$mt:setvar name="page_title" value="<__trans phrase="Manage TrackBacks">"$>
<mt:setvarblock name="system_msg">
    <mt:if name="saved">
        <mtapp:statusmsg
            id="saved"
            class="success"
            rebuild="all">
            <__trans phrase="Your changes have been saved.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="approved">
        <mtapp:statusmsg
            id="approved"
            class="success">
            <__trans phrase="The selected TrackBack(s) has been approved.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="emptied">
        <mtapp:statusmsg
            id="emptied"
            class="success">
            <__trans phrase="All TrackBacks reported as spam have been removed.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="unapproved">
        <mtapp:statusmsg
            id="unapproved"
            class="success">
            <__trans phrase="The selected TrackBack(s) has been unapproved.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="junked">
        <mtapp:statusmsg
            id="junked"
            class="success">
            <__trans phrase="The selected TrackBack(s) has been reported as spam.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="unjunked">
        <mtapp:statusmsg
            id="unjunked"
            class="success">
            <__trans phrase="The selected TrackBack(s) has been recovered from spam.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="saved_deleted_ping">
        <mtapp:statusmsg
            id="saved-deleted-ping"
            class="success">
            <__trans phrase="The selected TrackBack(s) has been deleted from the database.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="no_junk_found">
        <mtapp:statusmsg
            id="no-junk-found"
            class="info">
            <__trans phrase="No TrackBacks appeared to be spam.">
        </mtapp:statusmsg>
    </mt:if>
</mt:setvarblock>
<mt:setvarblock name="related_content">
    <mtapp:widget
        id="quickfilters"
        label="<__trans phrase="Quickfilters">">
        <$mtapp:ListFilters$>
    <mt:if name="scope_type" eq="blog">
        <ul>
            <li>
        <mt:if name="feed_url">
                <a href="<mt:var name="feed_url" escape="html">" class="icon-feed icon-left" title="<mt:var name="feed_name" escape="html">"><__trans phrase="[_1] Feed" params="<$mt:var name="object_label_plural"$>"></a>
        <mt:else><mt:unless name="tab_junk">
                <a href="<mt:var name="mt_url">?__mode=view&amp;_type=author&amp;id=<mt:var name="author_id" escape="url">" class="icon-feed-disabled icon-left" title="<__trans phrase="[_1] (Disabled)" params="<$mt:var name="feed_name" escape="html"$>">"><__trans phrase="Set Web Services Password"></a>
        </mt:unless></mt:if>
            </li>
        </ul>
    </mt:if>
    </mtapp:widget>
    <$mtapp:PageActions from="$mode"$>
</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() {
    getByID("filter-button").style.display = "inline";
}

function toggleFilter() {
    var filterActive = getByID("filter-title");
    if (filterActive.style.display == "none") {
        filterActive.style.display = "block";
        getByID("filter-select").style.display = "none";
    } else {
        filterActive.style.display = "none";
        getByID("filter-select").style.display = "block";<mt:unless name="filter">setFilterCol('status');</mt:unless>
    }
}

function setFilterCol(choice) {
    var sel = getByID('filter-select');
    if (!sel) return;
    sel.className = "filter-" + choice;
    var fld = getByID('filter-col');
    if (choice == 'status')
        fld.selectedIndex = 0;
    col_span = getByID("filter-text-col");
    if (fld.selectedIndex > -1 && col_span)
        col_span.innerHTML = '<strong>' +
            fld.options[fld.selectedIndex].text + '</strong>';
}

function doBanIP (ip) {
  window.location = ("<mt:var name="script_url">"
    + "?__mode=save&amp;_type=banlist"
    + "&amp;blog_id=<mt:var name="blog_id">" 
    + "&amp;magic_token=<mt:var name="magic_token">&amp;ip=" + ip);
}

var tableSelect;
function init() {
    // setup
    tableSelect = new TC.TableSelect( "ping-listing-table" );
    tableSelect.rowSelect = true;
    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>
}
/* ]]> */
</script>
</mt:setvarblock>
<mt:setvarblock name="list_filter_form">
<form id="filter-form" method="get" action="<mt:var name="script_url">">
    <input type="hidden" name="__mode" value="list_<$mt:var name="object_type"$>" />
        <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="script_url">">
        <div class="filter">
            <div id="filter-title">
            <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>
                <mt:if name="filter_special">  
                <strong><__trans phrase="Showing only: [_1]" params="<$mt:var name="filter_phrase" escape="html"$>"></strong>  

                <mt:else><mt:if name="filter_key">
                <strong><__trans phrase="Showing only: [_1]" params="<mt:var name="filter_label">" escape="html"></strong>
                <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 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><mt:if name="is_power_edit">&amp;is_power_edit=1</mt:if>">[ <__trans phrase="Remove filter"> ]</a>
                </mt:if></mt:if>
            </mt:unless>
            </div>
            <div id="filter-select" class="page-title" style="display: none">
                <__trans phrase="Show only [_1] where" params="<$mt:var name="object_label_plural"$>">
                <!-- begin filter form -->
                    <select id="filter-col" name="filter-col" onchange="setFilterCol(this.options[this.selectedIndex].value); enableFilterButton()">
                        <option value="status"><__trans phrase="status"></option>
                    </select>
                    <__trans phrase="is">
                    <span id="filter-status" style="display: none">
                        <select name="status-val" onchange="enableFilterButton()">
                            <option value="approved"><__trans phrase="approved"></option>
                            <option value="pending"><__trans phrase="unapproved"></option>
                        </select>
                    </span>
                <!-- end filter form -->
                <span class="buttons">
                    <a href="javascript:void(0)"
                        id="filter-button"
                        onclick="return execFilter(getByID('filter-select-form'))"
                        type="submit"
                        ><__trans phrase="Filter"></a>
                    <a href="javascript:void(0)"
                        onclick="toggleFilter(); return false;"
                        type="submit"
                        ><__trans phrase="Cancel"></a>
                </span>
            </div>
        </div>
    </form>
    </div>
</div>
</mt:setvarblock>

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