mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 06:13:32 +09:00
위젯 검출 정규 표현식을 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2892 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f9896fe51a
commit
90aa62a6ac
993 changed files with 9190 additions and 10457 deletions
|
|
@ -14,44 +14,77 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 태그 입력
|
||||
* 태그 입력은 해당 글의 모든 태그를 삭제 후 재 입력하는 방식을 이용
|
||||
* @brief ,(콤마)로 연결된 태그를 정리하는 trigger
|
||||
**/
|
||||
function insertTag($module_srl, $document_srl, $tags) {
|
||||
|
||||
// 해당 글의 tags를 모두 삭제
|
||||
$this->deleteTag($document_srl);
|
||||
if(!$tags) return;
|
||||
function triggerArrangeTag(&$obj) {
|
||||
if(!$obj->tags) return new Object();
|
||||
|
||||
// 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;
|
||||
$tag_list = explode(',', $obj->tags);
|
||||
$tag_count = count($tag_list);
|
||||
$tag_list = array_unique($tag_list);
|
||||
if(!count($tag_list)) return new Object();
|
||||
|
||||
foreach($tag_list as $tag) {
|
||||
if(!trim($tag)) continue;
|
||||
$arranged_tag_list[] = trim($tag);
|
||||
}
|
||||
if(!count($tag_list)) return;
|
||||
if(!count($arranged_tag_list)) $obj->tags = null;
|
||||
else $obj->tags = implode(',',$arranged_tag_list);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 태그 입력 trigger
|
||||
* 태그 입력은 해당 글의 모든 태그를 삭제 후 재 입력하는 방식을 이용
|
||||
**/
|
||||
function triggerInsertTag(&$obj) {
|
||||
$module_srl = $obj->module_srl;
|
||||
$document_srl = $obj->document_srl;
|
||||
$tags = $obj->tags;
|
||||
if(!$document_srl || !$tags) return new Object();
|
||||
|
||||
// 해당 글의 tags를 모두 삭제
|
||||
$output = $this->triggerDeleteTag($obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 다시 태그를 입력
|
||||
$args->module_srl = $module_srl;
|
||||
$args->document_srl = $document_srl;
|
||||
|
||||
$tag_list = explode(',',$tags);
|
||||
$tag_count = count($tag_list);
|
||||
for($i=0;$i<$tag_count;$i++) {
|
||||
$args->tag = $tag_list[$i];
|
||||
executeQuery('tag.insertTag', $args);
|
||||
$output = executeQuery('tag.insertTag', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
return implode(',',$tag_list);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 문서의 태그 삭제
|
||||
* @brief 특정 문서의 태그 삭제 trigger
|
||||
* document_srl에 속한 tag 모두 삭제
|
||||
**/
|
||||
function deleteTag($document_srl) {
|
||||
function triggerDeleteTag(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
return executeQuery('tag.deleteTag', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief module 삭제시 해당 태그 모두 삭제하는 trigger
|
||||
**/
|
||||
function triggerDeleteModuleTags(&$obj) {
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new Object();
|
||||
|
||||
$oTagController = &getAdminController('tag');
|
||||
return $oTagController->deleteModuleTags($module_srl);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue