<style type="text/css">
  a:visited { color: navy; text-decoration: underline }
  a:hover { color: red; text-decoration: underline }
  a:active { color: white; text-decoration: none }
  table.plugins {
    border: 2px solid #999;
    width: 800px;
    border-collapse: collapse;
  }
  table.plugins td, p {
    font-family: Tahoma,Arial,Helvetica,sans-serif;
    font-size: 13px;
    padding: 0px;
  }
  table.plugins td {
    padding: 2px;
    margin: 0px;
  }
  table.plugins .header td {
    color: white;
    font-weight: bold;
    background: navy;
  }
  table.plugins .header .name {
    justify: left;
  }
  table.plugins td {
    color: #000066;
    border-left: solid 1px #d8d8d8;
    border-bottom: solid 1px #d8d8d8;
    text-align: center;
  }
  table.plugins .even td {
    background: white;
  }
  table.plugins .odd td {
    background: #e9e9e9
  }
  table.plugins .plugin td.sort-field {
    background: #e9e9e9;
  }
  table.plugin .plugin td {
    text-align: center;
    vertical-align: top;
  }
  table.plugins .name {
    width: 452px;
    text-align: left;
  }
  table.plugins .author {
    width: 150px;
  }
  table.plugins .plugin .name div, table.plugins .plugin .author div {
    overflow: hidden;
  }
  table.plugins .price {
    width: 65px;
  }
  table.plugins .details {
    width: 130px;
  }
</style>

<%if num_plugins%>
  <p>
    <b>Install Plugins from Gossamer Threads</b><br>
    From here you can download plugins directly from Gossamer Threads to your server.
  </p>
  <p>There are <b><%num_plugins%></b> plugins available for download.</p>
  <%if results%><p><font color="green"><%results%></font></p><%endif%>
  <%if error%><p><font color="red"><%error%></font></p><%endif%>
  <%if speedbar%><p><b>Page</b>: <%speedbar%></p><%endif%>
  <table class="plugins">
    <tr class="header">
      <td class="name"><a href="<%base_url%>;plugin_man_do=download_gossamer;sb=plugin_name;so=<%if so eq 'desc'%>asc<%else%>desc<%endif%>"><font color="#FFFFFF">Name</font></a></td>
      <td class="author"><a href="<%base_url%>;plugin_man_do=download_gossamer;sb=client_name;so=<%if so eq 'desc'%>asc<%else%>desc<%endif%>"><font color="#FFFFFF">Author</font></a></td>
      <td class="price"><a href="<%base_url%>;plugin_man_do=download_gossamer;sb=plugin_price;so=<%if so eq 'desc'%>asc<%else%>desc<%endif%>"><font color="#FFFFFF">Price</font></a></td>
      <td class="details">&nbsp;</td>
    </tr>
    <%loop plugins%>
    <tr class="plugin <%if even%>even<%else%>odd<%endif%>">
      <td class="name <%if sb eq 'plugin_name'%> sort-field<%endif%>">
        <div>
          <b><%plg_name%></b>
          <%if plg_language%><br>Language: <%plg_language%><%endif%>
          <br>Description: <%plg_description%>
          <%if plg_support%><br>Support: <%plg_support%><%endif%>
          <%if plg_support_url%><br>Support URL: <a href="<%plg_support_url%>" target="_blank"><%plg_support_url%></a><%endif%>
          <%if plg_updated%><br><b><small>Last updated: <i><%plg_updated%></small></i></b><%endif%>
        </div>
      </td>
      <td class="author <%if sb eq 'client_name'%>sort-field<%endif%>">
        <div>
          <%~if author_name%><a href="<%if plg_author == 1%>http://www.gossamer-threads.com<%else%><%plg_url%><%endif%>" target="_blank"><%author_name%></a>
          <%~else%>&nbsp;
          <%~endif~%>
        </div>
      </td>
      <td class="price <%if sb eq 'plugin_price'%>sort-field<%endif%>">
        <%~if plg_license == 2%>
          <%~if plg_price%><%plg_price%><%else%>&nbsp;<%endif%>
        <%~else%>Free
        <%~endif~%>
      </td>
      <td class="details">
        Version: <%plg_version%><br />
        Installed: <%if installed%><%installed%><%else%>No<%endif%><br />
        <a href="<%base_url%>;plugin_man_do=download_url;url=<%download_url%>">Download</a>
      </td>
    </tr>
    <%endloop%>
  </table>
  <%if speedbar%><p><b>Page</b>: <%speedbar%></p><%endif%>
<%else%>
  <table border="1" cellpadding="3" cellspacing="0" width="504">
    <tr>
      <td>
        <p>
          <b>Add New Plugins</b><br />
          You can add new plugins either by uploading a file, downloading from
          a URL, or downloading directly from Gossamer Threads.
        </p>
        <%if results%><p><font color="green"><%results%></font></p><%endif%>
        <%if error_code or error%>
          <p><font color="red">Unable to list plugins:
          <%~if error_code eq 'invalid_product_id'%>
            Invalid product ID.  Please contact <a href="mailto:support@gossamer-threads.com">support@gossamer-threads.com</a>
            referencing this error.
          <%~elsif error_code starts 'admin_path_mismatch'%>
            Unable to list plugins: Your admin path does not match the admin path stored on the plugin server.
            <%~if error_code ends '_reset'%>
              <br /><br />You can reset the admin path stored on the Gossamer Threads plugin server a limited number of
              times from the <a href="http://www.gossamer-threads.com/scripts/licensed/" target="_blank">licensed download area</a>.
            <%~endif%>
          <%~elsif error_code%>
            You are not authorized to connect to the plugin server.  Please contact
            <a href="mailto:support@gossamer-threads.com">support@gossamer-threads.com</a>  for more information
            and reference status: '<%error_code%>'
          <%~else%>
            <%error%>
          <%~endif~%>
          </font></p>
        <%endif%>
        <form action="admin.cgi" method="POST">
          <input type="hidden" name="do" value="page" />
          <input type="hidden" name="page" value="plugin_manager.html" />
          <input type="hidden" name="plugin_man_do" value="download_gossamer" />
          <p>List Plugins on Gossamer Threads <input type="submit" value="Show" /></p>
        </form>
        <form action="admin.cgi" method="POST">
          <input type="hidden" name="do" value="page" />
          <input type="hidden" name="page" value="plugin_manager.html" />
          <input type="hidden" name="plugin_man_do" value="download_url" />
          <p>Install from URL: <input type="text" name="url" /> <input type="submit" value="Install" /></p>
        </form>
        <form action="admin.cgi" method="POST" enctype="multipart/form-data">
          <input type="hidden" name="do" value="page" />
          <input type="hidden" name="page" value="plugin_manager.html" />
          <input type="hidden" name="plugin_man_do" value="download_file" />
          <p>Install from File: <input type="file" name="file" /> <input type="submit" value="Install" /></p>
        </form>
      </td>
    </tr>
  </table>
<%endif%>
