{*<!--

+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+

-->*}

{if $configLocked}
    <div class='errormessage'><img class='errormessage' src='{$assetPath|escape}/images/padlock-{$image}.gif' width='16' height='16' border='0' align='absmiddle'>
        {t str=EditConfigNotPossible}
    </div>
{/if}

{include file=plugin-group-switcher.html}

<div class="control-panel">
    <form name="packageform" id="packageform" method="post" action="plugin-index.php" enctype="multipart/form-data">
    <div class="control-set left">
        <input name="package" value="1" type="hidden">
        <input name="token"   value="{$token}" type="hidden" />
    <span class='corner bottom-left'></span>
    <span class='corner bottom-right'></span>
      <h2>Install new plugin</h2>
      Select file
      <input name="filename" tabindex="1" type="file" {if $configLocked}disabled='true'{/if}>
      <input value="Install" name="install" tabindex="2" type="submit" {if $configLocked}disabled='true'{/if}>
      <input value="Import (code only)" name="import" tabindex="3" type="submit" {if $configLocked}disabled='true'{/if}>
    </div>
    </form>
</div>


{if $formError && $formError.id > 0 && $formError.message}
<div class="error-box" style="margin-bottom: 10px">
    {$formError.message|escape}
</div>
{/if}

{if $aWarnings}
    <div class="error-box" style="margin-bottom: 10px">
        {foreach from=$aWarnings key=idx item=warning}
            {$warning|escape}
            <br />
        {/foreach}
    </div>
{/if}
{if $aErrors}
    <div class="error-box" style="margin-bottom: 10px">
        {foreach from=$aErrors key=idx item=error}
            {$error|escape}
            <br />
        {/foreach}
    </div>
{/if}
{if $aMessages}
    <div class="infomessage" style="margin-bottom: 10px">
        {foreach from=$aMessages key=idx item=message}
            {$message|escape}
            <br />
        {/foreach}
    </div>
{/if}

<table class="data" >
    <thead>
        <tr>
            <td>Name</td>
            <td>Author</td>
            <td>Status</td>
            <td colspan="3">Actions</td>
        </tr>
    </thead>

    <tbody>
      {if !$aPackages|@count}
        <tr class="even">
            <td colspan="6">
             <p>No plugins installed.</p>
            </td>
        </tr>
      {else}
      {cycle name=bgclass values="odd,even" assign=bgClass reset=1}
      {foreach from=$aPackages key=name item=aitem}
          {if !$configLocked || $aitem.enabled}
          {cycle name=bgclass assign=bgClass}
              <tr class="{$bgClass}">
                  <td width="40%">
                     <div class="item-info">
                         <p>
                            <span class="name">
                                {if $aitem.displayname != ''}
                                    {$aitem.displayname}
                                {else}
                                    {$name}
                                {/if}
                            </span>
                            <span class="version">{$aitem.version}</span>
                         </p>
                         <p>{$aitem.description}</p>
                     </div>
                  </td>
                  <td>{if {$aitem.authoremail}<a href="mailto:{$aitem.authoremail}">{/if}{$aitem.author}{if {$aitem.authoremail}</a>{/if}</td>
                  <td>{if $aitem.enabled > 0}Enabled{else}Disabled{/if}</td>
                  <td><a href='plugin-index.php?action=info&amp;package={$name}' ><span class="action icon details">Details</span></a></td>
                  <td>
                    {if $configLocked}&nbsp;{else}
                        {if $aitem.enabled > 0}
                           <a href='plugin-index.php?action=disable&amp;package={$name}&amp;{rv_add_session_token}' ><span class="action icon disable">Disable</span></a>
                        {else}
                           <a href='plugin-index.php?action=enable&amp;package={$name}&amp;{rv_add_session_token}' ><span class="action icon enable">Enable</span></a>
                        {/if}
                    {/if}
                  </td>
                  {if $configLocked}&nbsp;{else}<td><a href='plugin-index.php?action=uninstall&amp;package={$name}&amp;{rv_add_session_token}' ><span class="action icon uninstall">Uninstall</span></a></td>{/if}
              </tr>
          {/if}
        {/foreach}
       {/if}
    </tbody>
</table>



