mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
planet Bookmark 애드온 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4789 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b98189a262
commit
f1b41d0932
6 changed files with 162 additions and 2 deletions
13
addons/planet_bookmark/conf/info.xml
Normal file
13
addons/planet_bookmark/conf/info.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<addon version="0.2">
|
||||
<title xml:lang="ko">플래닛 Bookmark 애드온</title>
|
||||
<description xml:lang="ko">
|
||||
플래닛 Bookmark 애드온
|
||||
</description>
|
||||
<version>0.1</version>
|
||||
<date>2008-10-31</date>
|
||||
|
||||
<author email_address="zero@zeroboard.com" link="http://blog.nzeo.com">
|
||||
<name xml:lang="ko">zero</name>
|
||||
</author>
|
||||
</addon>
|
||||
23
addons/planet_bookmark/planet_bookmark.addon.php
Normal file
23
addons/planet_bookmark/planet_bookmark.addon.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
if(!defined("__ZBXE__")) exit();
|
||||
|
||||
/**
|
||||
* @file planet_bookmark.addon.php
|
||||
* @author zero (zero@zeroboard.com)
|
||||
* @brief
|
||||
**/
|
||||
|
||||
if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC" && Context::getResponseMethod()!="JSON") {
|
||||
$config = Context::get('config');
|
||||
if($config->mid == 'planet'){
|
||||
$oPlanet = Context::get('planet');
|
||||
if($oPlanet->isMyPlanet()){
|
||||
$oPlanetModel = &getModel('planet');
|
||||
$countBookmark = $oPlanetModel->getTagSearchResultCount($oPlanet->getModuleSrl(),'bookmark');
|
||||
|
||||
Context::addHtmlHeader("<script type=\"text/javascript\">//<![CDATA[\nvar planet_bookmark_count=".( (int)$countBookmark).";\n//]]></script>");
|
||||
Context::addJsFile('./addons/planet_bookmark/planet_bookmark.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
96
addons/planet_bookmark/planet_bookmark.js
Normal file
96
addons/planet_bookmark/planet_bookmark.js
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
function planetBookmarkTab(){
|
||||
if($('planet_tab')) $('planet_tab').innerHTML += '<ul id="planetBookmarkTab" class="exTab"><li><a href="#planet_tab" onclick="planetShowBookmarkList(this);">Bookmark<sup><span id="planet_bookmark_count">'+ planet_bookmark_count + '</span></a></li></ul>';
|
||||
}
|
||||
xAddEventListener(window,'load',planetBookmarkTab);
|
||||
|
||||
function planetShowBookmarkList(o){
|
||||
$ElementList('#planetBookmarkTab li').removeClass('active');
|
||||
$Element(o).parent().addClass('active');
|
||||
$ElementList('#planet_myTab li').removeClass('active');
|
||||
planetBookmarkReload();
|
||||
}
|
||||
|
||||
function planetBookmarkReload(){
|
||||
$('commentList').innerHTML = '<div class="commentHeader"><h3 class="exTitle">Bookmark</h3><span class="button strong black todoWrite"><button type="button" onclick="showWritePostBookmark()">Bookmark</button></span></div>\n<div id="bookmarkList" class="commentBody todoManager"></div>\n<div id="todoList_page" class="pagination a1"></div>\n\n<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>\n';
|
||||
planetGetBookmark(0);
|
||||
}
|
||||
|
||||
function planetGetBookmark(page){
|
||||
$('bookmarkList').innerHTML ='';
|
||||
var response_tags = new Array('error','message','contentList','pageNavigation');
|
||||
exec_xml('planet','dispPlanetContentTagSearch',{keyword:'bookmark',page:page,mid:current_mid},completeGetBookmark,response_tags);
|
||||
}
|
||||
|
||||
function completeGetBookmark(ret_obj,response_tags, params, fo_obj) {
|
||||
if(ret_obj['error'] == 0 && ret_obj.contentList){
|
||||
var o = new Array();
|
||||
var it = new Array();
|
||||
var items = ret_obj['contentList']['item'];
|
||||
|
||||
if(typeof(items[0]) == 'undefined') {
|
||||
it[0] = items;
|
||||
} else {
|
||||
it = items;
|
||||
}
|
||||
|
||||
o.push('<ul>');
|
||||
for(var i=0,c=it.length;i<c;i++){
|
||||
var tag = $A();
|
||||
if(typeof(it[i]['tag_list']['item'])=='string'){
|
||||
tag.push(it[i]['tag_list']['item']);
|
||||
}else{
|
||||
tag = $A(it[i]['tag_list']['item']);
|
||||
}
|
||||
|
||||
tag = tag.filter(function(v){return !/bookmark/i.test(v);});
|
||||
tag = tag.$value().join(',');
|
||||
|
||||
o.push('<li>');
|
||||
o.push(it[i]['content']);
|
||||
if(tag) {
|
||||
o.push('<div class="tag">');
|
||||
o.push('<img src="'+request_uri+'addons/planet_bookmark/tag.gif" title="tag" />');
|
||||
o.push(tag);
|
||||
o.push('</div>');
|
||||
}
|
||||
o.push("</li>\n");
|
||||
}
|
||||
|
||||
o.push('</ul>');
|
||||
o.push('<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>');
|
||||
|
||||
$('bookmarkList').innerHTML = o.join('');
|
||||
|
||||
var pageNavigation = ret_obj['pageNavigation'];
|
||||
$('planet_bookmark_count').innerHTML = pageNavigation.total_count ? pageNavigation.total_count : 0;
|
||||
|
||||
if(pageNavigation.total_page > 1){
|
||||
|
||||
var str = "";
|
||||
if(pageNavigation.first_page>1) str += '<a class="prev" href="#planet_tab" onclick="planetGetBookmark('+(pageNavigation.first_page-1)+');">Prev</a>';
|
||||
|
||||
for(var i=pageNavigation.first_page;i<=pageNavigation.page_count;i++){
|
||||
if(i== pageNavigation.cur_page){
|
||||
str += "<strong>"+i+"</strong>";
|
||||
}else{
|
||||
str += '<a href="#planet_tab" onclick="planetGetBookmark('+i+');">'+ i +'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if(pageNavigation.total_page != pageNavigation.last_page) str += '<a class="next" href="#planet_tab" onclick="planetGetBookmark('+(pageNavigation.last_page+1)+');">next</a>';
|
||||
$('bookmarkList_page').innerHTML = str;
|
||||
}
|
||||
window.location.href="#planet_tab";
|
||||
}else{
|
||||
$('planet_bookmark_count').innerHTML = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function showWritePostBookmark(tag){
|
||||
tag = tag||'bookmark';
|
||||
$Element($('writePostForm').about_tag).hide();
|
||||
$Element($('writePostForm').content_tag).show();
|
||||
$('writePostForm').content_tag.value = tag;
|
||||
window.document.location.href="#writePost";
|
||||
showWritePost();
|
||||
}
|
||||
28
addons/planet_bookmark/planet_todo.addon.php
Normal file
28
addons/planet_bookmark/planet_todo.addon.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
if(!defined("__ZBXE__")) exit();
|
||||
|
||||
/**
|
||||
* @file planet_todo.addon.php
|
||||
* @author SOL군 (sol@ngleader.com)
|
||||
* @brief
|
||||
**/
|
||||
|
||||
|
||||
|
||||
if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC" && Context::getResponseMethod()!="JSON") {
|
||||
$config = Context::get('config');
|
||||
|
||||
//getTagSearchResultCount
|
||||
if($config->mid == 'planet'){
|
||||
$oPlanet = Context::get('planet');
|
||||
if($oPlanet->isMyPlanet()){
|
||||
$oPlanetModel = &getModel('planet');
|
||||
$countTodo = $oPlanetModel->getTagSearchResultCount($oPlanet->getModuleSrl(),'todo');
|
||||
$countDone = $oPlanetModel->getTagSearchResultCount($oPlanet->getModuleSrl(),'done');
|
||||
|
||||
Context::addHtmlHeader("<script type=\"text/javascript\">//<![CDATA[\nvar planet_todo_count={todo:".$countTodo.",done:".$countDone."};\n//]]></script>");
|
||||
Context::addJsFile('./addons/planet_todo/planet_todo.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
BIN
addons/planet_bookmark/tag.gif
Normal file
BIN
addons/planet_bookmark/tag.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 205 B |
|
|
@ -1,7 +1,7 @@
|
|||
function planetTab(){
|
||||
planet_todo_count.todo = planet_todo_count.todo ? planet_todo_count.todo:0;
|
||||
planet_todo_count.done = planet_todo_count.done ? planet_todo_count.done:0;
|
||||
if($('planet_tab')) $('planet_tab').innerHTML += '<ul id="planetex_Tab" class="exTab"><li><a href="#planet_tab" onclick="planet_showTodoList(this);">ToDo<sup><span id="planet_todo_count">'+ planet_todo_count.todo + '</span>/<span id="planet_done_count">' + planet_todo_count.done + '</span></sup></a></li>';
|
||||
if($('planet_tab')) $('planet_tab').innerHTML += '<ul id="planetex_Tab" class="exTab"><li><a href="#planet_tab" onclick="planet_showTodoList(this);">ToDo<sup><span id="planet_todo_count">'+ planet_todo_count.todo + '</span>/<span id="planet_done_count">' + planet_todo_count.done + '</span></sup></a></li></ul>';
|
||||
}
|
||||
xAddEventListener(window,'load',planetTab);
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ function planet_showTodoList(o){
|
|||
}
|
||||
|
||||
function planet_reload_todo(){
|
||||
$('commentList').innerHTML = '<div class="commentHeader"><h3 class="exTitle">TODO</h3><span class="button strong black todoWrite"><button type="button" onclick="showWritePostTodo()">TODO 쓰기</button></span></div>\n<div id="todoList" class="commentBody todoManager"></div>\n<div id="todoList_page" class="pagination a1"></div>\n<div class="commentHeader"><h3 class="exTitle">DONE</h3></div>\n<div id="doneList" class="commentBody todoManager"></div>\n<div id="doneList_page" class="pagination a1"></div>\n<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>\n';
|
||||
$('commentList').innerHTML = '<div class="commentHeader"><h3 class="exTitle">TODO</h3><span class="button strong black todoWrite"><button type="button" onclick="showWritePostTodo()">TODO Post</button></span></div>\n<div id="todoList" class="commentBody todoManager"></div>\n<div id="todoList_page" class="pagination a1"></div>\n<div class="commentHeader"><h3 class="exTitle">DONE</h3></div>\n<div id="doneList" class="commentBody todoManager"></div>\n<div id="doneList_page" class="pagination a1"></div>\n<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>\n';
|
||||
planet_getTodo();
|
||||
planet_getDone();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue