#*
 * Aipo is a groupware program developed by TOWN, Inc.
 * Copyright (C) 2004-2015 TOWN, 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 ($newUrl = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","WikiFormScreen").addQueryData("entityid","new").addQueryData("wikipage","parent")))##.addQueryData("page","parent")
#set ($indicator_id = "indicator-list-")
## ---------------------------------------------------------------------------
#set ($categoryEtc = false)
## ---------------------------------------------------------------------------
#AUIcontentsAreaHeader()
<h2>$l10n.WIKI_MANAGEMENT</h2>
#if($result.TopWikiList.size() <=0)
#AUISummaryDiv()
	#AUIbuttonAction($l10n.WIKI_CREATE "javascript:aipo.common.showDialog('$newUrl','$!portlet.ID',aipo.wiki.onLoadWikiDialog);")
#AUISummaryDivfooter()
#AUIEmptyMessage("icon-edit-sign" "$l10n.WIKI_EMPTY_MESSAGE")
#else
#AUISummaryFilterDivHeader()
<form class="auiSearch" style="margin-right:1em;" id="searchForm_$!{portlet.ID}" action="$!jslink.getPortletById($!portlet.ID)" onsubmit='aimluck.io.postViewPage(this, "$!{portlet.ID}", "search-${indicator_id}"); return false;'>
<div class="filterInputField">
<input type="hidden" name="baseuri_$!{portlet.ID}" id="baseuri_$!{portlet.ID}" value='$!jslink.getPortletById($!portlet.ID).addQueryData("template","WikiListScreen")' />
<input type="hidden" name="template" value="WikiListScreen"/>
<div class="filters" id="filters_$!portlet.ID">
#if("$!result.CategoryName"!="")
#ALfilterTip($!result.CategoryName "aipo.wiki.filterSetDefault('$!portlet.ID','category');")
#end
</div>

<a href="javascript:void(0);" id="filter_drawer_$!portlet.ID" class="filterDropDrawer menubarOpenButton" onclick='aipo.wiki.toggleMenu(dojo.byId("menubar_auiFilter_$!portlet.ID"),dojo.byId("filters_$!portlet.ID"),true);' title="フィルタ"><i class="auiIcon auiIconArwBottom"></i></a>
<input class="text" style="width:320px;" type="text" name="keyword" id="q$!{portlet.ID}" value="$!result.targetKeyword" onfocus='aipo.wiki.initFilterSearch("$!portlet.ID");' onblur='aipo.wiki.finFilterSearch("$!portlet.ID");' />
</div>
#AUIButtonSearch("$l10n.COMMON_SEARCH")
<div class="indicatorWrap floatLeft ml10" style="padding-top: 0.4em;">#ALajaxIndicator("search-${indicator_id}" "$!{portlet.ID}" "&nbsp;")</div>
#AUISearchFooter()
#AUISummaryFilterDivFooter()
#ALajaxlistformheaderAction('Wiki')
#if($result.List.size() <= 0)
#AUIEmptyMessage("icon-edit-sign" "$l10n.WIKI_EMPTY_MESSAGE")
#else
#ALajaxIndicator("${indicator_id}" "$!{portlet.ID}" "")
<div id="listmessageDiv"></div>
#AUISummaryDiv()
#AUIajaxbuttonCheckboxDelete("$l10n.COMMON_DELETE" "$!jslink.getPortletById($!portlet.ID).addQueryData('template','WikiFormJSONScreen').addQueryData('mode','multi_delete')" "$indicator_id" "$!portlet.ID" "aipo.wiki.onListReceiveMessage")
#AUIajaxpageview('WikiListScreen' $result)
#AUISummaryDivfooter()
<table class="auiRowTable auiMbTable wide">
	<colgroup span="3"></colgroup>
	<colgroup style="width: 9em;"></colgroup>
	<tbody>
		<tr>
			#ALtdheadAtt("#ALswitchCheckbox()" "class='center auiMTCheck'")
			#ALtdheadAtt("#ALajaxsort('wiki_name' $l10n.WIKI_TITLE $result 'WikiListScreen')" "")
			#ALtdheadAtt("#ALajaxsort('parent_name' $l10n.WIKI_PARENT $result 'WikiListScreen')" "")
			#ALtdheadAtt("#ALajaxsort('update_user' $l10n.COMMON_UPDATE_USER $result 'WikiListScreen')" "class='wName'")
			#ALtdheadAtt("#ALajaxsort('update_date' $l10n.COMMON_UPDATE_DATE $result 'WikiListScreen')" "")
		</tr>
		#foreach ($record in $result.List)
		<tr>
			#ALtdcellheaderAtt('align="center" class="auiMTCheck"')
			<input name="check$!record.Id" type="checkbox" value="$!record.Id" />
		    #ALtdcellfooter()
		    #ALtdcellheaderAtt('class="auiMTCaption"')
				<div>
					<a href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","WikiViewScreen").addQueryData("entityid",$record.Id))', '$!portlet.ID');" >$!record.NameHtml</a>
				</div>
			#ALtdcellfooter()
			#if($!record.getParentId().getValueWithInt() == 0)
				<td></td>
			#else
				<td><div>$!record.ParentName</div></td>
			#end
			<td><div><a href="javascript: void(0)" onclick="aipo.message.popupProfile($!{record.UpdateUserId},arguments[0])">$!record.UpdateUser</div></td>
			<td>$!record.UpdateDate</td>
		</tr>
		#end
	</tbody>
</table>
#AUISummaryDiv()
#AUIajaxbuttonCheckboxDelete("$l10n.COMMON_DELETE" "$!jslink.getPortletById($!portlet.ID).addQueryData('template','WikiFormJSONScreen').addQueryData('mode','multi_delete')" "$indicator_id" "$!portlet.ID" "aipo.wiki.onListReceiveMessage")
#AUIajaxpageview('WikiListScreen' $result)
#AUISummaryDivfooter()
#ALformfooter()
#end
#end
#AUIcontentsAreaFooter()
<img src="images/common/dot.gif" width="1" height="1" alt="" onload='if(dojo.byId("filters_$!{portlet.ID}").offsetWidth != 0) {dojo.byId("q$!{portlet.ID}").style.paddingLeft=dojo.byId("filters_$!{portlet.ID}").offsetWidth+"px";} if(dojo.isIE){ dojo.byId("q$!{portlet.ID}").style.width=480-dojo.byId("filters_$!{portlet.ID}").offsetWidth+"px"; }' />
<div class="menubar multi" id="menubar_auiFilter_$!portlet.ID" style="display:none;">
  <div>
    <ul class="filtertype filtertype_$!portlet.ID" data-type="category" data-defaultparam="">
      <li data-param="" #if("$!result.CategoryId"==""||"$!result.CategoryId"=="0") class="selected" #end><a href="javascript:void(0);" #if("$!result.CategoryId"==""||"$!result.CategoryId"=="0") class="selected" #end onclick='aipo.wiki.filterClick("$!portlet.ID",this,event)'>$l10n.WIKI_ALL_CATEGORY</a></li>
    #foreach($record in $result.TopWikiList)
      <li data-param="$!record.Id" #if("$!result.CategoryId"=="$!record.Id") class="selected" #end><a href="javascript:void(0);" #if("$!result.CategoryId"=="$!record.Id") class="selected" #end onclick='aipo.wiki.filterClick("$!portlet.ID",this,event)'>$!{record.Name}</a></li>
    #end
    </ul>
  </div>
</div>

#parse("/portlets/html/wiki-widgets.vm")
