#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2011 Aimluck,Inc.
 * http://www.aipo.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/>.
 *#

## ---------------------------------------------------------------------------
#set ($indicator_str = "データを送信")
#set ($action_str = "更新する")
#set ($event_submit = "eventSubmit_doTodo_insert")
#set ($subtitle = 'レイアウトの変更とアプリの追加')
#set ($indicator_id = "indicator-dlg-")
## ---------------------------------------------------------------------------
#ALdialogheader($subtitle)
#ALajaxIndicator("$indicator_id" "$!js_peid" "")
#ALerrmsg($errmsgs)
<div id="messageDiv"></div>


<form name="form$!{js_peid}" id="form$!{js_peid}" action="$!jslink.getPortletById($!{js_peid}).addQueryData('template', 'CustomizeFormJSONScreen')" method="post" onsubmit="aimluck.io.submit(this,'$indicator_id','$!js_peid',function(){ location.href='$!jslink.getAction("controls.Maximize",$!js_peid)' });return false;">
<input type="hidden" name="_name" value="customizeForm" />
<input type="hidden" name="secid" value="$secid" />
<input type="hidden" name="portlet_id" value="$!{js_peid}" />
<input type="hidden" name="mode" value="add" />
<!--
<form name="add_portlet" action="${jslink.Template}/${jslink.ActionKey}/${action}" method="post" onsubmit="return(aimluck.io.disableForm(this, true));">
-->
<input type="hidden" name="secid" value="$secid" />

<h3>レイアウトの選択</h3>
<input type="hidden" name="controller" value="$!controller" />
<table class="tableWrapper controllerTable">
<tbody>
<tr>
<td width="72" align="left" nowrap="nowrap" id="OneColumn" #if($!controller == 'OneColumn') class="selected" #end><a href="javascript:void(0);" onclick="aipo.customize.setController('$!js_peid', this)"><img src="images/layout/layout_100.gif" alt="レイアウト [ 100% ]" title="レイアウト [ 100% ]" width="72" height="72" border="0"  /></a></td>
<td width="72" align="left" nowrap="nowrap" id="TwoColumns" #if($!controller == 'TwoColumns') class="selected" #end><a href="javascript:void(0);" onclick="aipo.customize.setController('$!js_peid', this)"><img src="images/layout/layout_50-50.gif" alt="レイアウト [ 50% | 50% ]" title="レイアウト [ 50% | 50% ]" width="72" height="72" border="0" /></a></td>
<td width="72" align="left" nowrap="nowrap" id="TwoColumnsRight" #if($!controller == 'TwoColumnsRight') class="selected" #end><a href="javascript:void(0);" onclick="aipo.customize.setController('$!js_peid', this)"><img src="images/layout/layout_25-75.gif" alt="レイアウト [ 25% | 75% ]" title="レイアウト [ 25% | 75% ]" width="72" height="72" border="0" /></a></td>
<td width="72" align="left" nowrap="nowrap" id="TwoColumnsLeft" #if($!controller == 'TwoColumnsLeft') class="selected" #end><a href="javascript:void(0);" onclick="aipo.customize.setController('$!js_peid', this)"><img src="images/layout/layout_75-25.gif" alt="レイアウト [ 75% | 25% ]" title="レイアウト [ 75% | 25% ]" width="72" height="72" border="0"  /></a></td>
<td width="72" align="left" nowrap="nowrap" id="ThreeColumnsSymetric" #if($!controller == 'ThreeColumnsSymetric') class="selected" #end><a href="javascript:void(0);" onclick="aipo.customize.setController('$!js_peid', this)"><img src="images/layout/layout_33-33-33.gif" alt="レイアウト [ 33% | 33% | 33% ]" title="レイアウト [ 33% | 33% | 33% ]" width="72" height="72" border="0" /></a></td>
<td width="72" align="left" nowrap="nowrap" id="ThreeColumns" #if($!controller == 'ThreeColumns') class="selected" #end><a href="javascript:void(0);" onclick="aipo.customize.setController('$!js_peid', this)"><img src="images/layout/layout_25-50-25.gif" alt="レイアウト [ 25% | 50% | 25% ]" title="レイアウト [ 25% | 50% | 25% ]" width="72" height="72" border="0" /></a></td>
<td width="99%"></td>
</tr>
</tbody>
</table>
<br/>

<h3>追加アプリの選択</h3>
<div style="margin-bottom:10px;"><a href="http://store.aipo.com/" target="_blank"><strong>Aipoストア</strong></a>でアプリを探すことができます。</div>
<div style="height:300px;overflow:scroll;overflow-x:hidden;">
<table class="listTable" style="margin-top:0">
<tr>
#ALtdheadThin("追加")
#ALtdheadThin("現在数")
#ALtdheadW25("タイトル")
#ALtdheadW50("説明")
</tr>
###foreach ($portlet in $browser)
#foreach ($portlet in $portlets)
#set ($portletCount=0)
#foreach ($entry in $runs)
#if ($entry.parent == "GadgetsTemplate")
  #set ($pname = "GadgetsTemplate::$entry.getParameterValue('aid')")
  #if($pname == $portlet.Name)
  #set ($portletCount=$portletCount+1)
  #end
#end
#if ($entry.parent == $portlet.Name)
#set ($portletCount=$portletCount+1)
#end
#end
<tr>
#ALtdcellheaderAtt('align="center"')
###if($portletsSelected.containsKey($portlet.Name))
##<input type="checkbox" name="pname" value="$portlet.Name" checked="checked"/>
###else
<input type="checkbox" name="pname" value="$portlet.Name"/>
###end
#ALtdcellfooter()
#ALtdcellAtt("$portletCount" 'align="center"')
#ALtdcellheader()
#if ($portlet.Title) $portlet.Title #else $portlet.Name #end
#ALtdcellfooter()
#ALtdcellheader()
#if ($portlet.Description) $portlet.Description #else $l10n.CUSTOMIZER_NODESCRIPTION #end
#ALtdcellfooter()
</tr>
#end
#ALtablefooter()
</div>
<input type="hidden" name="size" value="30"/>
#ALbuttonheader()
#ALsubmit($event_submit $action_str)#ALajaxbuttonClose()
#ALbuttonfooter()
#ALformfooter()
#ALdialogfooter()
