git-svn-id: http://xe-core.googlecode.com/svn/trunk@1541 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-06-04 06:02:04 +00:00
parent f2e47e336d
commit 2de087f399
51 changed files with 3495 additions and 130 deletions

View file

@ -0,0 +1,52 @@
<?php
/**
* @class trackbackAdminController
* @author zero (zero@nzeo.com)
* @brief trackback모듈의 admin controller class
**/
class trackbackAdminController extends trackback {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 관리자 페이지에서 선택된 엮인글들을 삭제
**/
function procTrackbackAdminDeleteChecked() {
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null');
$trackback_srl_list= explode('|@|', $cart);
$trackback_count = count($trackback_srl_list);
if(!$trackback_count) return $this->stop('msg_cart_is_null');
$oTrackbackController = &getController('trackback');
// 글삭제
for($i=0;$i<$trackback_count;$i++) {
$trackback_srl = trim($trackback_srl_list[$i]);
if(!$trackback_srl) continue;
$oTrackbackController->deleteTrackback($trackback_srl, true);
}
$this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) );
}
/**
* @brief 모듈에 속한 모든 트랙백 삭제
**/
function deleteModuleTrackbacks($module_srl) {
// 삭제
$args->module_srl = $module_srl;
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
return $output;
}
}
?>

View file

@ -0,0 +1,66 @@
<?php
/**
* @class trackbackAdminModel
* @author zero (zero@nzeo.com)
* @brief trackback 모듈의 admin model class
**/
class trackbackAdminModel extends trackback {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 모든 엮인글를 시간 역순으로 가져옴 (관리자용)
**/
function getTotalTrackbackList($obj) {
// 검색 옵션 정리
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
if($search_target && $search_keyword) {
switch($search_target) {
case 'url' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_url = $search_keyword;
break;
case 'title' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_title= $search_keyword;
break;
case 'blog_name' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_blog_name= $search_keyword;
break;
case 'excerpt' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_excerpt = $search_keyword;
break;
case 'regdate' :
$args->s_regdate = $search_keyword;
break;
case 'ipaddress' :
$args->s_ipaddress= $search_keyword;
break;
}
}
// 변수 설정
$args->sort_index = $obj->sort_index;
$args->page = $obj->page?$obj->page:1;
$args->list_count = $obj->list_count?$obj->list_count:20;
$args->page_count = $obj->page_count?$obj->page_count:10;
// trackback.getTotalTrackbackList 쿼리 실행
$output = executeQuery('trackback.getTotalTrackbackList', $args);
// 결과가 없거나 오류 발생시 그냥 return
if(!$output->toBool()||!count($output->data)) return $output;
return $output;
}
}
?>

View file

@ -1,11 +1,11 @@
<?php
/**
* @class trackbackView
* @class trackbackAdminView
* @author zero (zero@nzeo.com)
* @brief trackback모듈의 View class
* @brief trackback모듈의 admin view class
**/
class trackbackView extends trackback {
class trackbackAdminView extends trackback {
/**
* @brief 초기화
@ -25,8 +25,8 @@
$args->sort_index = 'list_order'; ///< 소팅 값
// 목록 구함
$oTrackbackModel = &getModel('trackback');
$output = $oTrackbackModel->getTotalTrackbackList($args);
$oTrackbackAdminModel = &getAdminModel('trackback');
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
// 목록의 loop를 돌면서 mid를 구하기 위한 module_srl값을 구함
$trackback_count = count($output->data);