<!--<?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 type="text/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 type="text/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 type="text/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 type="text/javascript" src="js/core/core.js"></script>
<script type="text/javascript">
setCurrent('a_$a','a_self','current');
</script>

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