mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
8326004cb2
2773 changed files with 91485 additions and 0 deletions
57
modules/tag/tag.controller.php
Normal file
57
modules/tag/tag.controller.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
/**
|
||||
* @class tagController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief tag 모듈의 controller class
|
||||
**/
|
||||
|
||||
class tagController extends tag {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 태그 입력
|
||||
* 태그 입력은 해당 글의 모든 태그를 삭제 후 재 입력하는 방식을 이용
|
||||
**/
|
||||
function insertTag($module_srl, $document_srl, $tags) {
|
||||
|
||||
// 해당 글의 tags를 모두 삭제
|
||||
$this->deleteTag($document_srl);
|
||||
if(!$tags) return;
|
||||
|
||||
// tags변수 정리
|
||||
$tmp_tag_list = explode(',', $tags);
|
||||
$tag_count = count($tmp_tag_list);
|
||||
for($i=0;$i<$tag_count;$i++) {
|
||||
$tag = trim($tmp_tag_list[$i]);
|
||||
if(!$tag) continue;
|
||||
$tag_list[] = $tag;
|
||||
}
|
||||
if(!count($tag_list)) return;
|
||||
|
||||
// 다시 태그를 입력
|
||||
$args->module_srl = $module_srl;
|
||||
$args->document_srl = $document_srl;
|
||||
$tag_count = count($tag_list);
|
||||
for($i=0;$i<$tag_count;$i++) {
|
||||
$args->tag = $tag_list[$i];
|
||||
executeQuery('tag.insertTag', $args);
|
||||
}
|
||||
|
||||
return implode(',',$tag_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 문서의 태그 삭제
|
||||
**/
|
||||
function deleteTag($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
return executeQuery('tag.deleteTag', $args);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue