<mt:setvarblock name="save_button_title"><__trans phrase="Save these [_1] (s)" params="<mt:var name="object_label_plural" lower_case="1">"></mt:setvarblock>
<mt:setvarblock name="republish_button_title"><__trans phrase="Republish selected [_1] (r)" params="<mt:var name="object_label_plural" lower_case="1">"></mt:setvarblock>
<mt:setvarblock name="delete_button_title"><__trans phrase="Delete selected [_1] (x)" params="<mt:var name="object_label_plural" lower_case="1">"></mt:setvarblock>

<mt:setvarblock name="action_buttons">
  <mt:if name="can_republish">
<button
   accesskey="r"
   title="<$mt:var name="republish_button_title"$>"
   class="button mt-publish-items">
  <__trans phrase="Publish">
</button>
  </mt:if>
<button
   accesskey="x"
   title="<$mt:var name="delete_button_title"$>"
   class="button mt-delete-items">
  <__trans phrase="Delete">
</button>
</mt:setvarblock>

<mt:setvarblock name="original_blog_id"><mt:var name="blog_id"></mt:setvarblock>

<mtapp:listing  hide_pager="1">
  <mt:if name="__first__">
    <mt:setvarblock name="table_header">
    <tr>
      <th class="col head cb"><input type="checkbox" name="id-head" value="all" class="select" /></th>
      <th class="col head status si">
        <img src="<$mt:var name="static_uri"$>images/status_icons/invert-flag.gif" alt="<__trans phrase="Status">" title="<__trans phrase="Status">" width="9" height="9" />
      </th>
      <th class="col head title primary"><span class="col-label"><__trans phrase="Title"></span></th>
      <mt:unless name="blog_view">
        <mt:unless name="scope_type" eq="blog">
          <mt:if name="object_type" eq="entry">
      <th class="col head blog"><span class="col-label"><__trans phrase="Blog"></span></th>
          <mt:else>
      <th class="col head blog"><span class="col-label"><__trans phrase="Website/Blog"></span></th>
          </mt:if>
        </mt:unless>
      </mt:unless>
      <th class="col head category"><span class="col-label"><mt:if name="object_type" eq="page"><__trans phrase="Folder"><mt:else><__trans phrase="Category"></mt:if></span></th>
      <th class="col head author"><span class="col-label"><__trans phrase="Author"></span></th>
      <th class="col head datetime"><span class="col-label"><mt:if name="object_type" eq="page"><__trans phrase="Last Modified"><mt:else><__trans phrase="Created"></mt:if></span></th>
      <th class="col head view"><span class="col-label"><__trans phrase="View"></span></th>
    </tr>
    </mt:setvarblock>
  <thead>
    <mt:var name="table_header">
  </thead>
  <tfoot>
    <mt:var name="table_header">
  </tfoot>
  <tbody>
  </mt:if>
    <tr class="<mt:if name="__odd__">odd<mt:else>even</mt:if>">
      <td class="col cb">
  <mt:if name="has_edit_access">
      <input type="checkbox" name="id" value="<$mt:var name="id"$>" class="select" />
  <mt:else>
        &#160;
  </mt:if>
      </td>
  <mt:if name="has_publish_access">
      <td class="status">
        <select name="status_<$mt:var name="id"$>">
          <option value="1"<mt:if name="status_draft"> selected="selected"</mt:if>><__trans phrase="Unpublished (Draft)"></option>
          <option value="2"<mt:if name="status_publish"> selected="selected"</mt:if>><__trans phrase="Published"></option>
          <option value="3"<mt:if name="status_review"> selected="selected"</mt:if>><__trans phrase="Unpublished (Review)"></option>
          <option value="4"<mt:if name="status_future"> selected="selected"</mt:if>><__trans phrase="Scheduled"></option>
        </select>
      </td>
  <mt:else>
      <td class="col status si<mt:if name="status_draft"> status-draft</mt:if><mt:if name="status_publish"> status-publish</mt:if><mt:if name="status_review"> status-review</mt:if><mt:if name="status_future"> status-future</mt:if><mt:if name="status_spam"> status-spam</mt:if>">
        <img src="<$mt:var name="static_uri"$>images/spacer.gif" alt="" class="status-icon" width="9" height="9" />
      </td>
  </mt:if>
      <td class="col title" colspan="<mt:if name="is_blog">5<mt:else>6</mt:if>">
        <strong><a href="<$mt:var name="script_url"$>?__mode=view&amp;_type=<mt:var name="object_type">&amp;id=<$mt:var name="id"$>&amp;blog_id=<$mt:var name="blog_id"$>"><$mt:var name="title_long"$></a></strong>
  <mt:if name="excerpt">
        &#8212; <$mt:var name="excerpt" escape="html"$>
  </mt:if>
      </td>
    </tr>
    <tr class="<mt:if name="__odd__">odd<mt:else>even</mt:if> slave">
      <td class="col">&#160;</td>
      <td class="col">&#160;</td>
      <td class="col"><mt:if name="has_edit_access"><a href="<$mt:var name="script_url"$>?__mode=view&amp;_type=<mt:var name="object_type">&amp;id=<$mt:var name="id"$>&amp;blog_id=<$mt:var name="blog_id"$>"><mt:if name="object_type" ne="page"><__trans phrase="Edit Entry"><mt:else><__trans phrase="Edit Page"></mt:if></a><mt:else>&#160;</mt:if></td>
  <mt:unless name="blog_view">
    <mt:unless name="scope_type" eq="blog">
      <td class="col blog"><a href="<$mt:var name="script_url"$>?__mode=list&_type=<mt:var name="object_type">&amp;blog_id=<$mt:var name="weblog_id"$>"><$mt:var name="weblog_name" escape="html"$></a></td>
    </mt:unless>
  </mt:unless>
      <td class="col category">
  <mt:if name="is_editable">
    <mt:if name="entry_blog_id" eq="$original_blog_id">
        <select name="category_id_<$mt:var name="id"$>">
          <option value=""><__trans phrase="None"></option>
      <mt:loop name="row_category_loop">
          <option value="<$mt:var name="category_id"$>" title="<$mt:var name="category_label" encode_html="1"$>"<mt:if name="category_is_selected"> selected="selected"</mt:if>><$mt:var name="category_label_spacer"$><$mt:var name="category_label" encode_html="1"$></option>
      </mt:loop>
        </select>
    <mt:else>
      <mt:if name="object_type" eq="entry">
        <mt:var name="category_label" escape="html" default="-">
      <mt:else>
        <mt:var name="category_label" escape="html" default="(root)">
      </mt:if>
    </mt:if>
  <mt:else>
    <mt:if name="object_type" eq="entry">
      <mt:var name="category_label" escape="html" default="-">
    <mt:else>
      <mt:var name="category_label" escape="html" default="(root)">
    </mt:if>
  </mt:if>
      </td>
      <td class="col author">
  <mt:if name="is_editable">
        <input type="hidden" name="author_id_<$mt:var name="id"$>" value="<$mt:var name="row_author_id"$>" id="entry_author_id_<$mt:var name="id"$>">
        <a href="<$mt:var name="script_url"$>?__mode=dialog_select_author&amp;blog_id=<$mt:var name="blog_id"$>&amp;multi=0&amp;entry_type=<mt:var name="object_type">&amp;idfield=entry_author_id_<$mt:var name="id"$>&amp;namefield=entry_author_name_<$mt:var name="id"$>" class="mt-open-dialog"><span id="entry_author_name_<$mt:var name="id"$>"><$mt:var name="row_author_name" escape="html"$></span></a>
  <mt:else>
    <mt:var name="author_name" escape="html">
  </mt:if>
      </td>
      <td class="col datetime">
  <mt:if name="has_publish_access">
        <input type="text" name="created_on_<$mt:var name="id"$>" value="<$mt:var name="created_on_time_formatted"$>" />
  <mt:else>
        <span title="<$mt:var name="created_on_time_formatted"$>">
    <mt:if name="created_on_relative">
      <mt:if name="dates_relative">
        <mt:var name="created_on_relative">
      <mt:else>
        <mt:var name="created_on_formatted">
      </mt:if>
    <mt:else>
      <mt:var name="created_on_formatted">
    </mt:if>
        </span>
  </mt:if>
      </td>
      <td class="col view status-view">
  <mt:if name="entry_permalink">
        <a href="<$mt:var name="entry_permalink"$>" target="<__trans phrase="_external_link_target">" title="<mt:if name="object_type" eq="entry"><__trans phrase="View entry"><mt:else><__trans phrase="View page"></mt:if>"><img src="<$mt:var name="static_uri"$>images/spacer.gif" alt="<mt:if name="object_type" eq="entry"><__trans phrase="View entry"><mt:else><__trans phrase="View page"></mt:if>" width="13" height="9" /></a>
  <mt:else>
        &#160;
  </mt:if>
      </td>
    </tr>
  <mt:if name="__last__">
  </tbody>
</mt:if>

<mt:else>
  <mt:if name="object_type" eq="entry">
    <mtapp:statusmsg
       id="zero-state"
       class="info zero-state"
       can_close="0">
      <__trans phrase="No entries could be found."><mt:if name="is_blog"> <__trans phrase="<a href="[_1]">Create an entry</a> now." params="<$mt:var name="mt_url"$>?__mode=view&amp;_type=entry&amp;blog_id=<$mt:var name="blog_id"$>"></mt:if>
    </mtapp:statusmsg>
  <mt:else>
    <mtapp:statusmsg
       id="zero-state"
       class="info zero-state"
       can_close="0">
      <__trans phrase="No pages could be found. <a href="[_1]">Create a page</a> now." params="<$mt:var name="mt_url"$>?__mode=view&amp;_type=page&amp;blog_id=<$mt:var name="blog_id"$>">
    </mtapp:statusmsg>
  </mt:if>

</mtapp:listing>

<mt:setvarblock name="jq_js_include" append="1">
    jQuery('button.mt-publish-items').mtPublishItems({
        id: '<$mt:var name="object_type"$>-listing-form',
        singular: '<mt:var name="object_label" lower_case="1" escape="js">',
        plural: '<mt:var name="object_label_plural" lower_case="1" escape="js">',
        mode: 'rebuild_new_phase',
        args: {<mt:if name="blog_id">'blog_id': '<mt:var name="blog_id">'</mt:if><mt:if name="search"><mt:if name="blog_id">, </mt:if>'search': '<mt:var name="search" escape="js">'</mt:if>},
        phrase: '<__trans phrase="to republish" escape="js">'
    });
    jQuery('button.mt-delete-items').mtDeleteItems({
        id: '<$mt:var name="object_type"$>-listing-form',
        singular: '<mt:var name="object_label" lower_case="1" escape="js">',
        plural: '<mt:var name="object_label_plural" lower_case="1" escape="js">',
        args: {<mt:if name="search">'search': '<mt:var name="search" escape="js">'</mt:if>}
    });
    jQuery('button.mt-<mt:var name="form_id">-action').mtDoPluginAction({
        id: '<mt:var name="form_id">',
        plural: '<mt:if name="object_label_plural"><mt:var name="object_label_plural" escape="js"></mt:if>',
        args: {<mt:if name="search">'search': '<mt:var name="search" escape="js">'</mt:if>},
        phrase: '<__trans phrase="to act upon" escape="js">'
    });
    jQuery('button.mt-submit-items').mtSubmitItems({
        id: '<$mt:var name="object_type"$>-listing-form'
    });
</mt:setvarblock>
