<!--<?php
require_once(uTemplate::printEot('header'));
require_once(uTemplate::printEot('user_appleft'));
print <<<EOT
-->
<script type="text/javascript" src="js/pw_weibo.js"></script>
<div class="contUser">
<table width="100%"><tr><td valign="top" height="500">
	<div class="p15 cc">
		<h4 class="site"><img src="u/images/module/collection.png" align="absmiddle" class="mr10" /><span>收藏</span></h4>
		<div class="c"></div>
		<div class="navC mb10">
			<ul>
				<li id="type_all"><a href="{$basename}a=$a">全部</a></li>
				<li id="type_postfavor"><a href="{$basename}a=$a&type=postfavor">帖子</a></li>
				<li id="type_tucool"><a href="{$basename}a=$a&type=tucool">图酷</a></li>
				<li id="type_weibo"><a href="{$basename}a=$a&type=weibo">新鲜事</a></li>
				<li id="type_cms"><a href="{$basename}a=$a&type=cms">文章</a></li>
<!--
EOT;
if($db_dopen){print <<<EOT
-->
				<li id="type_diary"><a href="{$basename}a=$a&type=diary">日志</a></li>
<!--
EOT;
}if($db_phopen){print <<<EOT
-->
				<li id="type_photo"><a href="{$basename}a=$a&type=photo">照片</a></li>
<!--
EOT;
}if($db_groups_open){print <<<EOT
-->
				<li id="type_group"><a href="{$basename}a=$a&type=group">群组</a></li>
<!--
EOT;
}print <<<EOT
-->
				<li id="type_active"><a href="{$basename}a=$a&type=active">活动</a></li>
				<li id="type_web"><a href="{$basename}a=$a&type=web">网页</a></li>
				<li id="type_multimedia"><a href="{$basename}a=$a&type=multimedia">多媒体</a></li>
			</ul>		
<script language="JavaScript">
setCurrent('type_$type','type_all','current');
</script>
		</div>
	<div id="sidebar" class="sidebar fr">
		<div class="boxC">
		<h3>收藏分类</h3>
		<ul class="ulE" id="dt_ul">
			<li id="dt_all"><a href="{$basename}a=list&type=$type&ftype=0" id="ftype_all">所有分类</a>[$ftypeNumTotal]</li>
<!--
EOT;
foreach ($ftypeid as $key => $value) {
$k = $key;
print <<<EOT
-->
			<li id="dt_$k" onmousemove="isMouseUp($k,0)" onmouseout="isMouseUp($k,1)" >
		<!--
EOT;
if ($winduid || $groupid == 3) {print <<<EOT
-->						
                    
                <a id="del_{$k}" style="visibility:hidden"title="删除" class="adel cp mr10" onclick="pwConfirm('是否确认删除？',this,function(){delChangeNum($ftypeNum[$k]);delType('$k','$winduid');})">删除</a>
                   <a  id="edit_{$k}" style="visibility:hidden" title="编辑"   class="aedit mr5 cp" onclick="showEidt('$k','$winduid');" >编辑</a> 
<!--
EOT;
}print <<<EOT
--> 
			<a href="{$basename}a=list&type=$type&ftype=$k" id="ftype_$k">$value</a> <cite id="dnum_{$k}">[$ftypeNum[$k]]</cite>
			</li>
<!--
EOT;
}print <<<EOT
-->
			<li id="dt_-1"><a href="{$basename}a=list&type=$type&ftype=-1" id="ftype_def">默认分类</a> [<span id="ftype_def_num">$defaultNum</span>]</li>
		</ul>
		
<!--
EOT;
if ($winduid || $groupid == 3) {print <<<EOT
-->
	
	<div class="pd5"  ><span class="cp addImg" onclick="addType('dt_ul','$winduid','collection');">添加分类</span></div>

<!--
EOT;
}print <<<EOT
-->
		</div>
	</div>
<script language="javascript">
setCurrent('dt_$ftype','dt_all','current');
function Checkinfo() {
	if (confirm('确定要删除该分类吗?')) {
		return true;
	} else {
		return false;
	}
}
function delChangeNum(num) {
	var defNum = getObj("ftype_def_num").innerHTML;
	var num = parseInt(num);
	if (num == null) num = 0;
	var defNumChange = parseInt(defNum) + num;
	getObj("ftype_def_num").innerHTML = defNumChange;
}
</script>
		<div class="contentB">
			<div class="p15 bgA">
				<p class="mb5">收藏网页、视频、音乐、Flash</p>
					<form action="{$baseUrl}q=collection" method="post" name="shareform" onsubmit="return false;">
					<input type="hidden" name="verify" value="$verifyhash" />
					<input type="hidden" name="a" value="post" />
							<div class="mb10">
								<input id="shareLinkInput" type="text" class="input input_wb mr5" name="link" value="http://" />
								<span class="mr5"><span class="btn2"><span><button type="submit" onclick="collection.post(this.form)">收藏为私有</button></span></span></span>
								<a href="javascript:;" class="help_a">如何收藏<i><p class="b">如何收藏视频?</p>
								<p class="mb10">填写视频网址。(目前支持优酷、YouTube、新浪、搜狐)</p>
								<p class="b">如何收藏音乐？</p>
								<p class="mb10">填写音乐文件的网址。(后缀需要是mp3或者wma)</p>
								<p class="b">如何收藏Flash？</p>
								<p>填写 Flash 文件的网址。(后缀需要是swf)</p></i></a>
							</div>
					</form>
			</div>
			<div class="cc">
<!--
EOT;
if($collectionDb){
require_once(printEot('m_collection_model'));
$collectionModelTemplate->photoPop();
print <<<EOT
-->
		<form method="post" name="docollection" id="docollection" action="apps.php?q=collection&type=$type" onsubmit="return checkdel()">
        	<input type="hidden" name="verify" value="$verifyhash" />
            <input type="hidden" name="a" value="dels" />
            <table width="100%" class="mb10">
<!--
EOT;
print <<<EOT
-->

<!--
EOT;
foreach($collectionDb as $value){
	$method = $value['type'];
    if (!in_array($method, array('weibo', 'postfavor', 'tucool', 'diary', 'photo', 'group', 'active', 'web', 'multimedia','cms')))
	    continue;
	$collectionModelTemplate->$method($value);
}
print <<<EOT
-->            	
            </table>
<script language="javascript">
function  checkdel() {
	var obj = document.docollection["idarray[]"];
	var ar = obj.length ? obj:[obj];
		for(var i=0;i<ar.length;i++){
			if(ar[i].checked === true){
				if (confirm('确定删除吗？')) {
					return true;
			    }
				return false;
			}
		}
showDialog('error','请选择操作对象!', 2);
return false;
}
function removes(){ 
	if(removesIsNotSelect()){
		ajax.send('apps.php?q=collection&a=remove',document.docollection,function(){
			var rText = ajax.request.responseText.split('\t');
			if (rText[0] == 'success') {
				window.location.reload();
			} else {
				showDialog('error','请选择操作对象!', 2);
			}
		});
	}
}
//移动的时候 没有选择移动对象，弹出提示
function removesIsNotSelect() {
	var obj = document.docollection["idarray[]"];
	var ar = obj.length ? obj:[obj];
		for(var i=0;i<ar.length;i++){
			if(ar[i].checked === true){
				return true;
			}
		}
	getObj("ftype").value = 0;
	showDialog('error','请选择操作对象!', 2);
	return false;
}
</script>
<div class="bgA p5 mb10"><span class="fr">共<span id="collectionNumButtom">{$count}</span>条收藏</span><label class="mr20 cp"><input type="checkbox" onclick="CheckAll(this.form)" />&nbsp;全选</label><span class="bt2"><span><button type="submit">删除</button> </span></span>
或移至 
	<select name="ftype" id="ftype" onChange="javascript:removes();">
    <option value="0" selected="selected">所有分类</option>
    <option value="-1">默认分类</option>
<!--
EOT;
foreach($ftypeData as $value){
print <<<EOT
-->  
    <option value="$value[ctid]">$value[name]</option>
<!--
EOT;
	}print <<<EOT
-->
    </select>
</div>
		</form>
<div class="mb10 cc">$pages</div>

<!--
EOT;
}else{print <<<EOT
-->
				<div class="p15 f14 tac">暂无收藏</div>
<!--
EOT;
}print <<<EOT
-->
		</div>
			</div>

	</div>
</td></tr></table>
</div>
<!--
EOT;
print <<<EOT
-->
<script language="JavaScript" src="js/core/core.js"></script>
<script language="JavaScript">
setCurrent('a_$a','a_self','current');
</script>

<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
</script>
<script language="javascript" src="apps/$appdir/js/collection.js"></script>
<script language="JavaScript" src="js/app_comment.js"></script>
<script language="JavaScript" src="js/app_type.js"></script>
<!--
EOT;
require_once(uTemplate::printEot('footer'));
?>-->