mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 22:59:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1541 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f2e47e336d
commit
2de087f399
51 changed files with 3495 additions and 130 deletions
111
modules/poll/poll.admin.controller.php
Normal file
111
modules/poll/poll.admin.controller.php
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class pollAdminController extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
**/
|
||||
function procPollAdminInsertConfig() {
|
||||
$config->skin = Context::get('skin');
|
||||
$config->colorset = Context::get('colorset');
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('poll', $config);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 설문조사들을 삭제
|
||||
**/
|
||||
function procPollAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
|
||||
$poll_srl_list= explode('|@|', $cart);
|
||||
$poll_count = count($poll_srl_list);
|
||||
if(!$poll_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$poll_count;$i++) {
|
||||
$poll_index_srl = trim($poll_srl_list[$i]);
|
||||
if(!$poll_index_srl) continue;
|
||||
|
||||
$output = $this->deletePollTitle($poll_index_srl, true);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 삭제 (한번에 여러개의 설문 등록시 그 중 하나의 설문만 삭제)
|
||||
**/
|
||||
function deletePollTitle($poll_index_srl) {
|
||||
$args->poll_index_srl = $poll_index_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 삭제 (하나의 묶인 설문조사를 통째로 삭제)
|
||||
**/
|
||||
function deletePoll($poll_srl) {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePoll', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
28
modules/poll/poll.admin.model.php
Normal file
28
modules/poll/poll.admin.model.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class pollAdminModel extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문 목록 구해옴
|
||||
**/
|
||||
function getPollList($args) {
|
||||
$output = executeQuery('poll.getPollList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
if($output->data && !is_array($output->data)) $output->data = array($output->data);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollView
|
||||
* @class pollAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 View class
|
||||
* @brief poll모듈의 admin view class
|
||||
**/
|
||||
|
||||
class pollView extends poll {
|
||||
class pollAdminView extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -43,8 +43,8 @@
|
|||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
|
||||
// 목록 구함
|
||||
$oPollModel = &getModel('poll');
|
||||
$output = $oPollModel->getPollList($args);
|
||||
$oPollAdminModel = &getAdminModel('poll');
|
||||
$output = $oPollAdminModel->getPollList($args);
|
||||
|
||||
// 템플릿 변수 설정
|
||||
Context::set('total_count', $output->total_count);
|
||||
Loading…
Add table
Add a link
Reference in a new issue