<%template _header%>
<!--header end-->

<!--TheCurrent start-->
<div id="foruminfo">
	<div class="userinfo">
		<h2><a href="{config.forumurl}" class="home">{config.forumtitle}</a><span><a href="usercp.aspx">用户中心</a></span><span><a href="usercpspacemanagealbum.aspx">管理{config.albumname}</a></span><strong>管理图片</strong></h2>	</div>
	<div class="forumstats">
		<div id="search">
				<%template _quicksearch%>
		</div>
	</div>
</div>
<!--TheCurrent end-->

<!--主体-->
<script type="text/javascript">
	function checkAll(bCheck,theform)
	{
		for (var i = 0;i < theform.elements.length;i++)
		{
			var e = theform.elements[i];
			if (e.name == "photoid")
				e.checked = bCheck;
		}
	}
	
	function delePhoto(theform)
	{
		var checkPhoto = isCheckPhoto(theform);	
		if(!checkPhoto)
		{
			alert("您没有选中所要删除的图片！");
			return false;
		}
		else
		{
			if(confirm("您真要删除下面所选图片吗？删除后将无法恢复！"))
			{
				$("active").value = "delete";
				theform.submit();
			}
			else
			{
				return false;
			}
		}
	}
	
	function changeAlbum(theform)
	{
		var checkPhoto = isCheckPhoto(theform);	
		if(!checkPhoto)
		{
			alert("您没有选中所要转移的图片！");
			return false;
		}
		else
		{
			o = $("alibumList");
			if(confirm("您确认要将 {currentalbumname} 相册中所选图片转移到 " + o.options[o.selectedIndex].text + " 相册中吗？"))
			{
				$("active").value = "change";
				return true;
			}
			else
			{
				return false;
			}
		}
	}
	
	function setLogo(theform)
	{
		o = $("logoList");
		if(confirm("您确认要将 " + o.options[o.selectedIndex].text + " 图片设置为 {currentalbumname} 相册的封面吗？"))
		{
			$("active").value = "setlogo";
			theform.submit();
		}
		else
		{
			return false;
		}
	}
	
	function isCheckPhoto(theform)
	{
		var checkPhoto = false;
		for (var i=0;i<theform.elements.length;i++)
		{
			var e = theform.elements[i];
			if (e.name == "photoid" && e.checked)
			{
				return true;
			}
		}
		return false;
	}
	
</script>
<div class="controlpannel">
   <%template _menu%>
	<div class="pannelcontent">
		<div class="pcontent">
			<div class="panneldetail">
				<%template _albummenu%>	
				<div class="pannelbody">
					<div class="pannellist">
					<%if page_err==0%>
						<%if ispost%>
							<%template _msgbox%>
						<%else%>
						<form action="" method="post">
						<h3>{currentalbumname}({photocount})</h3>
						<div style="line-height:36px;">
							<input type="checkbox" onclick="checkAll(this.checked,this.form)" />全选&nbsp;&nbsp;
							<a href="#" onclick="return delePhoto(document.forms[1])"  class="OtherButton">删除图片</a>&nbsp;&nbsp;&nbsp;
							<a href="#" onclick="if(changeAlbum(document.forms[1])) document.forms[1].submit();">转移图片</a>到
							<select name="alibumList" id="alibumList">
							<%loop alibum albumList%>
								<option value="{alibum[albumid]}">{alibum[title]}</option>
							<%/loop%>
							</select>
							&nbsp;&nbsp;&nbsp;
							将
							<select name="logoList" id="logoList">
							<%loop logo logoList%>
								<option value="{logo[photoid]}">{logo[PhotoOrder]}</option>
							<%/loop%>
							</select>
							<a href="###" onclick="return setLogo(document.forms[1])">设置为封面</a>&nbsp;&nbsp;&nbsp;
							<a href="usercpspacephotoadd.aspx?albumid={albumid}"  class="ImpButton">增加图片</a>
							<input type="hidden" name="active" id="active" value="" />
						</div>
						<div class="compartline">&nbsp;</div>
						<ul id="photo">
							 <%loop singlePhotoInfo photoList%>
							<li>
							    <div class="Ntphotoimg">
								<a href='showphoto.aspx?photoid={singlePhotoInfo[photoid]}' target='_blank'>
								<img src='{singlePhotoInfo[TFileName]}' border='0' title='{singlePhotoInfo[Description]}' style='border: 1px solid rgb(0, 0, 0);padding:4px' style="max-width: 150px; max-height: 150px;"></a>
								<%if singlePhotoInfo["isattachment"].ToString()=="1"%>
								<span style='position:relative;left:-15px;top:0px;z-index:1'><img src='templates/{templatepath}/images/attphoto.gif' width='30' height='37' border='0' title="来自附件"></span>
								<%/if%>
								</div>
								<div class="NtPhotoDetail">
								<input type='checkbox' name='photoid' value='{singlePhotoInfo[PhotoId]}' /> {singlePhotoInfo[PhotoOrder]}&nbsp;&nbsp; <a href="usercpeditphoto.aspx?photoid={singlePhotoInfo[photoid]}">编辑</a>
								<br />{singlePhotoInfo[title]}
								<br />
								上传时间：{singlePhotoInfo[PostDate]}
								</div>
							</li>
							<%/loop%>
						</ul>
						</form>
						</div>
						<div class="forumpages">
  							<div class="forumpagesnumbers">
							<table border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td class="forumallpages"><strong>{pageid}</strong>/&nbsp;&nbsp;{pagecount}&nbsp;&nbsp;页</td>
									<td style="width:10px;">&nbsp;</td>
									<td class="forumallpages">{pagenumbers}</td>
									<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) window.location='usercpspacemanagephoto.aspx?albumid={albumid}&page=' + this.value"  size="4" maxlength="9"  class="colorblue2"/>页</td>
								</tr>
							</table>
							</div>
						</div>
						<%/if%>
						</div>
					<%else%>
					<%template _usercperrmsgbox%>
					<%/if%>
			  </div>
			</div>
		</div>
</div>
</div>
<%template _copyright%>
<%template _footer%>
