#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2010 Aimluck,Inc.
 * http://aipostyle.com/
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *#

## $Id: row-customize.vm,v 1.3 2004/02/15 01:18:34 shinsuke Exp $
<!-- WEB-INF\templates\vm\controllers\html\row-customize.vm -->
<br>
<center>
<table width="80%" cellspacing="1" cellpadding="0" border="0">
  <tr>
    <th width="5%" #if (${skin.TitleBackgroundColor}) bgcolor="${skin.TitleBackgroundColor}" #end align="left">
      #if ($skin.TitleColor) <font color="$skin.TitleColor"> #end
      &nbsp;
      #if ($skin.TitleColor) </font> #end
    </th>
    <th #if (${skin.TitleBackgroundColor}) bgcolor="${skin.TitleBackgroundColor}" #end align="left">
      #if ($skin.TitleColor) <font color="$skin.TitleColor"> #end
      $l10n.CUSTOMIZER_NAME
      #if ($skin.TitleColor) </font> #end
    </th>
    <th width="10%" #if (${skin.TitleBackgroundColor}) bgcolor="${skin.TitleBackgroundColor}" #end align="center">
      #if ($skin.TitleColor) <font color="$skin.TitleColor"> #end
      $l10n.CUSTOMIZER_ACTION
      #if ($skin.TitleColor) </font> #end
    </th>
  </tr>
#set ($portletcount = 0)
#set ($COUNTI="0")
#foreach ($entry in $portlets)
#set ($COUNTI="1")
#set ($position = $velocityCount - 1)
  <tr>
  <td align="center" valign="top">

## Retrieve Entrytitle (-name)
#set ($title="*")
#if ($entry.Parent)
  #set ($title = $titles.get($entry.Id) )
#else
  #set ($title = $entry.MetaInfo.Title)
#end
##
#if ($title=="*")
  #if ($entry.Parent) 
    #set ($title=$entry.Parent)
  #else
    #set ($title=$entry.Name)
  #end
#end

  ## Insert a image for portlets and panes!
  #set ($FF=false)
  #foreach ($entr in $runs)
    #if ($entr.parent == $entry.Parent  && !$FF)
      #set ($FF=true)
      <img src="images/html/is_portlet.gif" width=14" height="14" border="0" alt="$l10n.CUSTOMIZER_PORTLET" hspace="2">
    #end
  #end

  ## Portlet is not used - use blank image!
  #if (!$FF)
    #set ($portletcount = $portletcount + 1)
    <a href="$jslink.getAction("controls.Customize",$entry.Id)">
      <img src="images/is_pane.gif" alt="$l10n.CUSTOMIZER_CUSTOMIZABLEPANE" width=14" height="14" border="0" hspace="2">
    </a></TD>
  #end

    <td valign="top">
  #if (!$FF)
    <a href="$jslink.getAction("controls.Customize",$entry.Id)">
      <b>$title</b>
    </a>
  #else
    <b>$title</b>  
  #end    
    </td>
    <td valign="top" align="center">
    <form action="#psmlLink($jslink.Template)" method="post">
#if ($!action) <input type="hidden" name="$jslink.ActionKey" value="$action"> #end
        <input type="hidden" name="position" value="$position">
        <input type="image" border="0" alt="Delete" src="images/close.gif" name="eventSubmit_doDelete">
#if ($velocityCount < $portlets.size())
        <input type="image" border="0" alt="Move down" src="images/down.gif" name="eventSubmit_doUp">
#else
        <img src="images/dot.gif" width=14" height="14" border="0">
#end
#if ($position > 0)
        <input type="image" border="0" src="images/up.gif" alt="Move up" name="eventSubmit_doDown">
#else
        <img src="images/dot.gif" width=14" height="14" border="0">
#end
      </form>
    </td>
  </tr>
#end
#if ($!COUNTI=="0")
    <tr>
      <td align="center" colspan="3">
        <b>$l10n.CUSTOMIZER_NOTHINGDEFINED</b>
      </td>
    </tr>
#end
  </table>
  <table cellspacing="2">
    <tr>
      <td>
        <form action="#psmlLink($jslink.Template)" method="post">
          #if ($!action) <input type="hidden" name="$jslink.ActionKey" value="$action" > #end
          <table cellspacing="2">
            <tr>
#if ($controller.Portlets.allowCustomize($data))
              <td>
                <input type="submit" name="eventSubmit_doApply" value="$saveLabel">
              </td>
#end
              <td>
                <input type="submit" name="eventSubmit_doCancel" value="$l10n.CUSTOMIZER_CANCEL">
              </td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
  </table>
</center>
