#*
 * 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_id = "indicator-dlg-")
#if  ($mode=="new_form")
#set ($action_str = "インストールする")
#set ($event_submit = "eventSubmit_doGadgets_admin_insert")
#set ($subtitle = 'アプリのインストール')
#else
#set ($action_str = "更新する")
#set ($subtitle = 'アプリ編集')
#set ($event_submit = "eventSubmit_doGadgets_admin_update")
#end
## ---------------------------------------------------------------------------
#ALdialogheader($subtitle)
##ALerrmsg($errmsgs)
<div id="messageDiv"></div>
#ALajaxIndicator("$indicator_id" "$!portlet.ID" "")
#ALajaxscreenformheader("gadgetsAdminForm" $jslink $portlet "GadgetsAdminFormJSONScreen" "aimluck.io.submit(this,'$indicator_id','$!portlet.ID', aipo.gadgets_admin.onReceiveMessage)")
#if($mode=="new_form")
<input type="hidden" name="mode" value="insert" />
#else
<input type="hidden" name="mode" value="update" />
#end
<a href="http://store.aipo.com/" target="_blank"><strong>Aipoストア</strong></a>でアプリを探すことができます。<br/><br/>
#if($mode=="new_form")
外部のアプリケーションあるいは独自のアプリケーションをインストールする場合は、OpenSocialに準拠したガジェットXMLのURLを指定してください。
#end
#ALtableheaderWide()
#ALtdcaptionAtt("#ALrequired('ガジェットURL')" "style='width:180px;'")
#ALtditemheader()
#if($mode=="new_form")
#ALtextfield('url' $!result.Url '70%' 255 'disabled')#ALcaution('（半角英数字）')
#else
$!result.UrlCR
#end
#ALtditemfooter()
#if($mode!="new_form")
#ALtdcaption("タイトル")
#ALtditemheader()
#if($!result.Detail.Icon.toString() != "")
<img src="$!result.Icon" width="16" height="16" alt="$!result.Title" align="absmiddle" />
#end
$!result.Title
#ALtditemfooter()
#ALtdcaption("アプリの説明")
#ALtditem($!result.Description)
#set($count = 0)
#foreach ($service in $!result.OAuthConsumers)
#ALtdcaption("OAuth@$!{service.Name}")
#ALtditemheader()
<h4>Request</h4>
$!service.RequestUrlCR<br/>
<br/>
<h4>Authorization</h4>
$!service.AuthorizationUrlCR<br/>
<br/>
<h4>Access</h4>
$!service.AccessUrlCR<br/>
<br/>
<h4>Type</h4>
<select name="type$!{count}">
<option value="HMAC-SHA1" #if($!service.Type.Value == "HMAC-SHA1") selected="selected" #end>HMAC-SHA1</option>
<!-- option value="RSA-SHA1"  #if($!service.Type.Value == "RSA-SHA1") selected="selected" #end>RSA-SHA1</option -->
</select>
<h4>consumer key</h4>
#ALtextfield("consumerKey$!{count}" $!service.ConsumerKey '70%' 255 'disabled')#ALcaution('（半角英数字）')
<h4>consumer secret</h4>
#ALtextfield("consumerSecret$!{count}" $!service.ConsumerSecret '70%' 255 'disabled')#ALcaution('（半角英数字）')
#ALtditemfooter()
#set($count = $count + 1)
#end
#end
#ALtablefooter()
#if($mode=="new_form")
<p class="center"><label for="sendActivity"><input type="checkbox" id="sendActivity" name="sendActivity" value="true" checked="true"/>全員の更新情報へ通知する</label></p>
<br/>
#end
#if($mode!="new_form")
「更新する」をクリックすると、タイトル、アプリの説明、アイコン画像を最新のガジェットURLより取得して更新を行います。
#end
#ALbuttonheader()
#ALsubmit($event_submit $action_str)#ALajaxbuttonClose()
#ALbuttonfooter()
#ALformfooter()
#ALdialogfooter()
