Exemple #1
0
 /**
  * @brief print account information
  */
 function dispCashpayForm()
 {
     if ($this->module_info->login_required == 'Y') {
         if (!Context::get('is_logged')) {
             return new Object(-1, 'msg_login_required');
         }
     }
     $oEpayController = getController('epay');
     // get products info using cartnos
     $reviewOutput = $oEpayController->reviewOrder();
     if (!$reviewOutput->toBool()) {
         return $reviewOutput;
     }
     Context::set('transaction_srl', $reviewOutput->transaction_srl);
     Context::set('order_srl', $reviewOutput->order_srl);
     Context::set('review_form', $reviewOutput->review_form);
     Context::set('item_name', $reviewOutput->item_name);
     Context::set('price', $reviewOutput->price);
     Context::set('purchaser_name', $reviewOutput->purchaser_name);
     Context::set('purchaser_email', $reviewOutput->purchaser_email);
     Context::set('purchaser_telnum', $reviewOutput->purchaser_telnum);
     $obj = new stdClass();
     $obj->bank_name = $this->module_info->bank_name;
     $obj->account_number = $this->module_info->account_number;
     $obj->account_holder = $this->module_info->account_holder;
     Context::set('account_info', $obj);
     $this->setTemplateFile('start');
 }
Exemple #2
0
 /**
  * Execute update
  *
  * @return Object
  */
 function moduleUpdate()
 {
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     // Add atom act
     if (!$oModuleModel->getActionForward('atom')) {
         $oModuleController->insertActionForward('rss', 'view', 'atom');
     }
     // 2007. 10. An additional set of 18 to participate in a service module, add a trigger
     if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) {
         $oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
     }
     // 2007. 10. 19 outputs the trigger before you call to set up rss url
     if (!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) {
         $oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
     }
     if ($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) {
         $oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
     }
     // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
     if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) {
         $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after');
     }
     return new Object(0, 'success_updated');
 }
 /**
  * @brief 업데이트 실행
  **/
 function moduleUpdate()
 {
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     $oDB = DB::getInstance();
     // 트리거 일괄 추가
     foreach ($this->add_triggers as $trigger) {
         if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) {
             $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
         }
     }
     if (!$oDB->isColumnExists('alliance_sites', 'title')) {
         $oDB->addColumn('alliance_sites', 'title', 'varchar', 250, '', true);
         $oDB->addIndex('alliance_sites', 'unique_title', 'title', true);
     }
     if (!$oDB->isColumnExists('alliance_logs', 'type')) {
         $oDB->addColumn('alliance_logs', 'type', 'char', 20, '', true);
     }
     if (!$oDB->isColumnExists('alliance_contents', 'site_srl')) {
         $oDB->addColumn('alliance_contents', 'site_srl', 'number', 11, 0, true);
         $oDB->addIndex('alliance_contents', 'idx_site_srl', 'site_srl');
     }
     if (!$oDB->isColumnExists('alliance_messages', 'title')) {
         $oDB->addColumn('alliance_messages', 'title', 'varchar', 250, '', true);
     }
     /* 2011.03.12 - 연합 정보 테이블의 count 칼럼 제거 */
     if ($oDB->isColumnExists('alliance_info', 'count')) {
         $oDB->dropColumn('alliance_info', 'count');
     }
     return new Object(0, 'success_updated');
 }
Exemple #4
0
 /**
  * @brief Execute update
  */
 function moduleUpdate()
 {
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     // 2007.10.17 When deleting posts/comments delete the poll as well
     if (!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
     }
     // 2008.04.22 A poll connection to add posts/comments
     if (!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
     }
     return new Object(0, 'success_updated');
 }
Exemple #5
0
 /**
  * @brief epay.getPaymentForm 에서 호출됨
  */
 function dispEposForm()
 {
     $oEpayController = getController('epay');
     $oNcartModel = getModel('ncart');
     $oModuleModel = getModel('module');
     $oEposModuleConfig = $oModuleModel->getModuleConfig('epos');
     $oEposModel = getModel('epos');
     // get products info using cartnos
     Context::set('plugin_srl', $this->module_info->module_srl);
     $review_args = Context::getRequestVars();
     $output = $oEpayController->reviewOrder();
     if (!$output->toBool()) {
         return $output;
     }
     Context::set('review_form', $output->review_form);
     //$cart_info = $output->cart_info;
     $transaction_srl = $output->transaction_srl;
     $order_srl = $output->order_srl;
     $cavalue = md5($this->module_info->storeid . $order_srl . $output->price . $this->module_info->cubkey);
     //Context::set('cart_info', $cart_info);
     Context::set('price', $output->price);
     Context::set('transaction_srl', $transaction_srl);
     Context::set('order_srl', $order_srl);
     Context::set('cavalue', $cavalue);
     $this->setTemplateFile('formdata');
 }
 /**
  * 모듈 설정을 저장하는 메소드.
  */
 public function procErrorLoggerAdminInsertConfig()
 {
     // 기존 설정을 가져온다.
     $config = $this->getConfig();
     // 새로 저장하려는 설정을 가져온다.
     $request_args = Context::getRequestVars();
     $config->error_types = 0;
     if ($request_args->error_type_fatal === 'Y') {
         $config->error_types = $config->error_types | E_ERROR;
     }
     if ($request_args->error_type_warning === 'Y') {
         $config->error_types = $config->error_types | E_WARNING;
     }
     if ($request_args->error_type_notice === 'Y') {
         $config->error_types = $config->error_types | E_NOTICE;
     }
     // 새 모듈 설정을 저장한다.
     $oModuleController = getController('module');
     $output = $oModuleController->insertModuleConfig('errorlogger', $config);
     if ($output->toBool()) {
         $this->setMessage('success_registed');
     } else {
         return $output;
     }
     if (Context::get('success_return_url')) {
         $this->setRedirectUrl(Context::get('success_return_url'));
     } else {
         $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispErrorloggerAdminConfig'));
     }
 }
 /**
  *
  */
 public function index()
 {
     $this->layout_assets->addJs("library/bootbox-4.4.0/bootbox.min.js");
     $this->layout_assets->addDataTable();
     $this->layout_assets->addJs("modulo/" . getController() . "/index.js");
     $this->layout_template->view("default", "pages/" . getController() . "/index", array());
 }
Exemple #8
0
 /**
  * @brief Display license messages
  **/
 function dispInstallIntroduce()
 {
     $install_config_file = FileHandler::getRealPath('./config/install.config.php');
     if (file_exists($install_config_file)) {
         include $install_config_file;
         if (is_array($install_config)) {
             foreach ($install_config as $k => $v) {
                 $v = $k == 'db_table_prefix' ? $v . '_' : $v;
                 Context::set($k, $v, true);
             }
             unset($GLOBALS['__DB__']);
             Context::set('install_config', true, true);
             $oInstallController =& getController('install');
             $output = $oInstallController->procInstall();
             if (!$output->toBool()) {
                 return $output;
             }
             header("location: ./");
             Context::close();
             exit;
         }
     }
     Context::set('l', Context::getLangType());
     $this->setTemplateFile('introduce');
 }
 /**
  * @brief 타임라인 게시판 목록
  * @return void
  */
 function dispTimelineAdminList()
 {
     $oTimelineModel = getModel('timeline');
     $oTimelineController = getController('timeline');
     // 모든 타임라인 게시판 정보 불러오기
     $whole_timeline_info = $oTimelineModel->getWholeTimelineInfo();
     $oModuleModel = getModel('module');
     $modules_info = array();
     // 타임라인 게시판의 모듈 정보 불러오기
     foreach ($whole_timeline_info as $key => $val) {
         $module_info = $oModuleModel->getModuleInfoByModuleSrl($key);
         if ($module_info) {
             $modules_info[$key] = new stdClass();
             $modules_info[$key]->module_info = $module_info;
             $modules_info[$key]->timeline_info = $val;
         } else {
             $output = $oTimelineController->deleteTimelineInfo($key);
             if (!$output->toBool()) {
                 return $output;
             }
         }
     }
     // 데이터 페이징 처리
     $oTimelineAdminModel = getAdminModel('timeline');
     $output = $oTimelineAdminModel->getPageHandler($modules_info, Context::get('page'));
     Context::set('page', $output->page);
     Context::set('total_page', $output->total_page);
     Context::set('total_count', $output->total_count);
     Context::set('modules_info', $output->data);
     Context::set('page_navigation', $output->page_navigation);
     $this->setTemplateFile('list');
 }
 /**
  * @brief 어드민 페이지에서 입력한 옵션 값들 세팅\n
  * option values
  * - naver_api_key
  * - yahoo_api_key
  * - sphinx info
  **/
 function procAroundmapAdminSetApiKey()
 {
     // 어드민 페이지에서 입력한 옵션값들을 가져온다.
     $config->naver_api_key = Context::get('naver_api_key');
     $config->yahoo_api_key = Context::get('yahoo_api_key');
     $config->useSphinx = Context::get('usesphinx');
     $config->serverName = Context::get('servername');
     $config->serverPort = Context::get('serverport');
     // 가져온 옵션값들을 module config에 저장한다.
     $oModuleController =& getController('module');
     $oModuleController->insertModuleConfig('aroundmap', $config);
     // 기존에 적용된 모듈을 삭제한다.
     $apply_module = Context::get('apply_module');
     $output = executeQuery('aroundmap.deleteApplyModules');
     if (!$output->toBool()) {
         return $output;
     }
     // 어드민 페이지에서 입력한 새로운 모듈을 입력한다.
     $modules = explode(',', $apply_module);
     for ($i = 0, $c = count($modules); $i < $c; $i++) {
         if ($modules[$i] != 0) {
             $args->module_srl = $modules[$i];
             $output = executeQuery('aroundmap.insertApplyModule', $args);
             if (!$output->toBool()) {
                 return $output;
             }
         }
     }
     $this->setMessage('success_applied');
 }
Exemple #11
0
 function _getWidgetContent()
 {
     // Arrange a widget ryeolro
     if ($this->module_info->mcontent) {
         $cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType());
         $interval = (int) $this->module_info->page_caching_interval;
         if ($interval > 0) {
             if (!file_exists($cache_file) || filesize($cache_file) < 1) {
                 $mtime = 0;
             } else {
                 $mtime = filemtime($cache_file);
             }
             if ($mtime + $interval * 60 > $_SERVER['REQUEST_TIME']) {
                 $page_content = FileHandler::readFile($cache_file);
                 $page_content = preg_replace('@<\\!--#Meta:@', '<!--Meta:', $page_content);
             } else {
                 $oWidgetController = getController('widget');
                 $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent);
                 FileHandler::writeFile($cache_file, $page_content);
             }
         } else {
             if (file_exists($cache_file)) {
                 FileHandler::removeFile($cache_file);
             }
             $page_content = $this->module_info->mcontent;
         }
     } else {
         $page_content = $this->module_info->content;
     }
     return $page_content;
 }
 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // action forward에 등록
     $oModuleController =& getController('module');
     $oModuleController->insertActionForward('integration_search', 'view', 'IS');
     return new Object();
 }
Exemple #13
0
 /**
  * @brief Execute update
  **/
 function moduleUpdate()
 {
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     $oDB =& DB::getInstance();
     // Save module_srl when auto-saving 15/06/2009
     if (!$oDB->isColumnExists("editor_autosave", "module_srl")) {
         $oDB->addColumn("editor_autosave", "module_srl", "number", 11);
     }
     // create an index on module_srl
     if (!$oDB->isIndexExists("editor_autosave", "idx_module_srl")) {
         $oDB->addIndex("editor_autosave", "idx_module_srl", "module_srl");
     }
     // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
     if (!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) {
         $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) {
         $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     }
     // 2007. 10. Add an editor trigger on the module addition setup
     if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) {
         $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
     }
     // 2009. 04. 14 Add a trigger from compiled codes of the editor component
     if (!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) {
         $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
     }
     // 2009. 06. 19 Remove unused trigger
     if ($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) {
         $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
     }
     return new Object(0, 'success_updated');
 }
 /**
  * @brief 업데이트(업그레이드)
  */
 function moduleUpdate()
 {
     $oDB =& DB::getInstance();
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     if (!$oDB->isColumnExists('purplebook', 'memo1')) {
         $oDB->addColumn('purplebook', 'memo1', 'varchar', '250');
     }
     if (!$oDB->isColumnExists('purplebook', 'memo2')) {
         $oDB->addColumn('purplebook', 'memo2', 'varchar', '250');
     }
     if (!$oDB->isColumnExists('purplebook', 'memo3')) {
         $oDB->addColumn('purplebook', 'memo3', 'varchar', '250');
     }
     if (!$oDB->isIndexExists("purplebook", "idx_memo1")) {
         $oDB->addIndex("purplebook", "idx_memo1", array("memo1"));
     }
     if (!$oDB->isIndexExists("purplebook", "idx_memo2")) {
         $oDB->addIndex("purplebook", "idx_memo2", array("memo2"));
     }
     if (!$oDB->isIndexExists("purplebook", "idx_memo3")) {
         $oDB->addIndex("purplebook", "idx_memo3", array("memo3"));
     }
     if (!$oDB->isIndexExists("purplebook", "idx_node_type")) {
         $oDB->addIndex("purplebook", "idx_node_type", array("node_type"));
     }
 }
 function procInstallAdminUpdateIndexModule()
 {
     if (!Context::get('index_module_srl') || !Context::get('menu_item_srl')) {
         return new Object(-1, 'msg_invalid_request');
     }
     $site_args = new stdClass();
     $site_args->site_srl = 0;
     $site_args->index_module_srl = Context::get('index_module_srl');
     $oModuleController = getController('module');
     $oModuleController->updateSite($site_args);
     // get menu item info
     $menuItemSrl = Context::get('menu_item_srl');
     $oMenuAdminModel = getAdminModel('menu');
     $output = $oMenuAdminModel->getMenuItemInfo($menuItemSrl);
     // update homeSitemap.php cache file
     $oMenuAdminController = getAdminController('menu');
     $homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
     if (file_exists($homeMenuCacheFile)) {
         include $homeMenuCacheFile;
     }
     if (!$homeMenuSrl || $homeMenuSrl != $output->menu_srl) {
         $oMenuAdminController->makeHomemenuCacheFile($output->menu_srl);
     }
     $this->setMessage('success_updated');
 }
 function moduleUpdate()
 {
     $oDB = DB::getInstance();
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     foreach (self::$columns as $column) {
         if (!$oDB->isColumnExists($column[0], $column[1])) {
             $oDB->addColumn($column[0], $column[1], $column[2], $column[3], $column[4], $column[5]);
         }
     }
     foreach (self::$deletedIndexes as $index) {
         if ($oDB->isIndexExists($index[0], $index[1])) {
             $oDB->dropIndex($index[0], $index[1], $index[2]);
         }
     }
     foreach (self::$indexes as $index) {
         if (!$oDB->isIndexExists($index[0], $index[1])) {
             $oDB->addIndex($index[0], $index[1], $index[2], $index[3]);
         }
     }
     foreach (self::$triggers as $trigger) {
         if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) {
             $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
         }
     }
     return new Object();
 }
 /**
  * @brief epay.getPaymentForm 에서 호출됨, 이니시스 모바일 결제폼 출력
  */
 function dispInipaymobileForm()
 {
     $oEpayController =& getController('epay');
     // get products info using cartnos
     $reviewOutput = $oEpayController->reviewOrder();
     if (!$reviewOutput->toBool()) {
         return $reviewOutput;
     }
     Context::set('review_form', $reviewOutput->review_form);
     Context::set('item_name', $reviewOutput->item_name);
     Context::set('price', $reviewOutput->price);
     Context::set('transaction_srl', $reviewOutput->transaction_srl);
     Context::set('order_srl', $reviewOutput->order_srl);
     Context::set('purchaser_name', $reviewOutput->purchaser_name);
     Context::set('purchaser_email', $reviewOutput->purchaser_email);
     Context::set('purchaser_telnum', $reviewOutput->purchaser_telnum);
     /**
      * next_url 및 return_url 에 url 구성은 http://domain/directory?var=val 형식으로 ?var1=val1&var2=val2 처럼 &은 허용되지 않는다. 그래서 부득이하게 n_page 에 transaction_srl을 담아오면 next_url로, r_page에 transaction_srl을 담아오면 return_url로 처리한다.
      */
     $transaction_srl = $reviewOutput->transaction_srl;
     // 가상계좌, 안심클릭시 (n_page)
     Context::set('next_url', getNotEncodedFullUrl('') . $this->module_info->mid . '?n_page=' . $transaction_srl);
     // ISP 결제시 (r_page), 결제처리는 noti_url이 호출되어 처리되므로 여기서는 그냥 결과만 보여줌
     Context::set('return_url', getNotEncodedFullUrl('') . $this->module_info->mid . '?r_page=' . $transaction_srl);
     // ISP 결제시 처리 URL 지정
     Context::set('noti_url', getNotEncodedFullUrl('') . $this->module_info->mid . '?noti_page=' . $transaction_srl);
     $this->setTemplateFile('formdata');
 }
Exemple #18
0
 /**
  * @brief 일반 요청시 출력
  **/
 function dispPageIndex()
 {
     // 템플릿에서 사용할 변수를 Context::set()
     if ($this->module_srl) {
         Context::set('module_srl', $this->module_srl);
     }
     // 캐시 파일 지정
     $cache_file = sprintf("%sfiles/cache/page/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType());
     $interval = (int) $this->module_info->page_caching_interval;
     if ($interval > 0) {
         if (!file_exists($cache_file)) {
             $mtime = 0;
         } else {
             $mtime = filemtime($cache_file);
         }
         if ($mtime + $interval * 60 > time()) {
             $page_content = FileHandler::readFile($cache_file);
         } else {
             $oWidgetController =& getController('widget');
             $page_content = $oWidgetController->transWidgetCode($this->module_info->content);
             FileHandler::writeFile($cache_file, $page_content);
         }
     } else {
         if (file_exists($cache_file)) {
             FileHandler::removeFile($cache_file);
         }
         $page_content = $this->module_info->content;
     }
     Context::set('module_info', $this->module_info);
     Context::set('page_content', $page_content);
     $this->setTemplateFile('content');
 }
Exemple #19
0
 /**
  * @brief 업데이트 실행
  **/
 function moduleUpdate()
 {
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제
     if (!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
     }
     // 2008. 04. 22 글/댓글의 추가기 설문조사의 연결
     if (!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
     }
     return new Object(0, 'success_updated');
 }
 function procWikiAdminArrangeList()
 {
     $oModuleModel =& getModel('module');
     $oDocumentController =& getController('document');
     // 대상 위키 검증
     $module_srl = Context::get('module_srl');
     $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
     if (!$module_info->module_srl || $module_info->module != 'wiki') {
         return new Object(-1, 'msg_invalid_request');
     }
     // 대상 위키의 entry값이 없는 글을 추출
     $args->module_srl = $module_srl;
     $output = executeQueryArray('wiki.getDocumentWithoutAlias', $args);
     if (!$output->toBool() || !$output->data) {
         return new Object();
     }
     foreach ($output->data as $key => $val) {
         if ($val->alias_srl) {
             continue;
         }
         $result = $oDocumentController->insertAlias($module_srl, $val->document_srl, $val->alias_title);
         if (!$result->toBool()) {
             $oDocumentController->insertAlias($module_srl, $val->document_srl, $val->alias_title . '_' . $val->document_srl);
         }
     }
 }
Exemple #21
0
 /**
  * @brief Execute update
  **/
 function moduleUpdate()
 {
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     $oDB =& DB::getInstance();
     // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for
     if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
         $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
     }
     if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
         $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
         $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
         $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
     }
     if (!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) {
         $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
     }
     // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
     if (!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) {
         $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
     }
     // tag in the index column of the table tag
     if (!$oDB->isIndexExists("tags", "idx_tag")) {
         $oDB->addIndex("tags", "idx_tag", array("document_srl", "tag"));
     }
     return new Object(0, 'success_updated');
 }
Exemple #22
0
 /**
  * @brief 외부 http로 요청되는 파일일 경우 파일을 받아와서 저장 후 return
  **/
 function getHtmlPage($path, $caching_interval, $cache_file)
 {
     // 캐시 검사
     if ($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval * 60 > time()) {
         $content = FileHandler::readFile($cache_file);
     } else {
         FileHandler::getRemoteFile($path, $cache_file);
         $content = FileHandler::readFile($cache_file);
     }
     // opage controller 생성
     $oOpageController =& getController('opage');
     // 외부 서버의 페이지 일 경우 이미지, css, javascript등의 url을 변경
     $content = $oOpageController->replaceSrc($content, $path);
     // 해당 문서를 utf-8로 변경
     $buff->content = $content;
     $buff = Context::convertEncoding($buff);
     $content = $buff->content;
     // title 추출
     $title = $oOpageController->getTitle($content);
     if ($title) {
         Context::setBrowserTitle($title);
     }
     // header script 추출
     $head_script = $oOpageController->getHeadScript($content);
     if ($head_script) {
         Context::addHtmlHeader($head_script);
     }
     // body 내용 추출
     $body_script = $oOpageController->getBodyScript($content);
     if (!$body_script) {
         $body_script = $content;
     }
     return $content;
 }
Exemple #23
0
 /**
  * @brief pay
  */
 function procCashpayDoIt()
 {
     $oEpayController = getController('epay');
     $vars = Context::getRequestVars();
     $output = $oEpayController->beforePayment($vars);
     if (!$output->toBool()) {
         return $output;
     }
     $obj = new stdClass();
     $obj->bank_name = $this->module_info->bank_name;
     $obj->account_number = $this->module_info->account_number;
     $obj->account_holder = $this->module_info->account_holder;
     $output = new Object();
     $output->add('transaction_srl', Context::get('transaction_srl'));
     $output->add('state', '1');
     // not completed
     $output->add('payment_method', 'BT');
     $output->add('payment_amount', Context::get('price'));
     $output->add('result_code', '0');
     $output->add('result_message', 'success');
     $output->add('pg_tid', $this->keygen());
     $output->add('vact_bankname', $obj->bank_name);
     $output->add('vact_num', $obj->account_number);
     $output->add('vact_name', $obj->account_holder);
     $output->add('vact_inputname', context::get('depositor_name'));
     // afterPayment will call an after trigger
     $output = $oEpayController->afterPayment($output);
     if (!$output->toBool()) {
         return $output;
     }
     $return_url = $output->get('return_url');
     if ($return_url) {
         $this->setRedirectUrl($return_url);
     }
 }
 function moduleUpdate()
 {
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     $oDB =& DB::getInstance();
     // 아이디 클릭시 나타나는 팝업메뉴에 작성글 보기 기능 추가
     if (!$oModuleModel->getTrigger('member.getMemberMenu', 'issuetracker', 'controller', 'triggerMemberMenu', 'after')) {
         $oModuleController->insertTrigger('member.getMemberMenu', 'issuetracker', 'controller', 'triggerMemberMenu', 'after');
     }
     if (!$oModuleModel->getTrigger('document.deleteDocument', 'issuetracker', 'controller', 'triggerDeleteDocument', 'after')) {
         $oModuleController->insertTrigger('document.deleteDocument', 'issuetracker', 'controller', 'triggerDeleteDocument', 'after');
     }
     // 히스토리(=댓글) 첨부파일 활성화 트리거
     if (!$oModuleModel->getTrigger('issuetracker.insertHistory', 'file', 'controller', 'triggerCommentCheckAttached', 'before')) {
         $oModuleController->insertTrigger('issuetracker.insertHistory', 'file', 'controller', 'triggerCommentCheckAttached', 'before');
     }
     if (!$oModuleModel->getTrigger('issuetracker.insertHistory', 'file', 'controller', 'triggerCommentAttachFiles', 'after')) {
         $oModuleController->insertTrigger('issuetracker.insertHistory', 'file', 'controller', 'triggerCommentAttachFiles', 'after');
     }
     if (!$oDB->isColumnExists('issues_history', 'uploaded_count')) {
         $oDB->addColumn('issues_history', 'uploaded_count', 'number', 11, 0);
     }
     if (!$oModuleModel->getTrigger('document.moveDocumentModule', 'issuetracker', 'controller', 'triggerMoveDocumentModule', 'after')) {
         $oModuleController->insertTrigger('document.moveDocumentModule', 'issuetracker', 'controller', 'triggerMoveDocumentModule', 'after');
     }
     return new Object(0, 'success_updated');
 }
 function setTrackbackModuleConfig($module_srl, $use_social_info)
 {
     $config->use_social_info = $use_social_info;
     $oModuleController =& getController('module');
     $oModuleController->insertModulePartConfig('socialxe', $module_srl, $config);
     return new Object();
 }
 /**
  * @brief 관리자 페이지에서 선택된 댓글들을 삭제
  **/
 function procCommentAdminDeleteChecked()
 {
     // 선택된 글이 없으면 오류 표시
     $cart = Context::get('cart');
     if (!$cart) {
         return $this->stop('msg_cart_is_null');
     }
     $comment_srl_list = explode('|@|', $cart);
     $comment_count = count($comment_srl_list);
     if (!$comment_count) {
         return $this->stop('msg_cart_is_null');
     }
     $oCommentController =& getController('comment');
     $deleted_count = 0;
     // 글삭제
     for ($i = 0; $i < $comment_count; $i++) {
         $comment_srl = trim($comment_srl_list[$i]);
         if (!$comment_srl) {
             continue;
         }
         $output = $oCommentController->deleteComment($comment_srl, true);
         if (!$output->toBool()) {
             continue;
         }
         $deleted_count++;
     }
     $this->setMessage(sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count));
 }
Exemple #27
0
 function _getWidgetContent()
 {
     // Arrange a widget ryeolro
     if ($this->module_info->mcontent) {
         $cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType());
         $interval = (int) $this->module_info->page_caching_interval;
         if ($interval > 0) {
             if (!file_exists($cache_file) || filesize($cache_file) < 1) {
                 $mtime = 0;
             } else {
                 $mtime = filemtime($cache_file);
             }
             if ($mtime + $interval * 60 > time()) {
                 $page_content = FileHandler::readFile($cache_file);
                 $page_content = preg_replace('@<\\!--#Meta:@', '<!--Meta:', $page_content);
             } else {
                 $oWidgetController =& getController('widget');
                 $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent);
                 FileHandler::writeFile($cache_file, $page_content);
             }
         } else {
             if (file_exists($cache_file)) {
                 FileHandler::removeFile($cache_file);
             }
             $page_content = $this->module_info->mcontent;
         }
     } else {
         preg_match_all('!(<img)([^\\>]*)(widget=)([^\\>]*?)(\\>)!is', $this->module_info->content, $matches);
         $page_content = '';
         for ($i = 0, $c = count($matches[0]); $i < $c; $i++) {
             $page_content .= preg_replace('/ style\\=\\"([^\\"]+)\\" /i', ' style="overflow:hidden;clear:both;margin:0 0 20px 0; _margin-right:10px;" ', $matches[0][$i]) . "\n\n";
         }
     }
     return $page_content;
 }
Exemple #28
0
 function installTriggers()
 {
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     /*
     			if (!$oModuleModel->getTrigger('epay.processPayment', 'nstore', 'controller', 'triggerProcessPayment', 'after')) {
     				$oModuleController->insertTrigger('epay.processPayment', 'nstore', 'controller', 'triggerProcessPayment', 'after');
     			}
     			if (!$oModuleModel->getTrigger('epay.processReview', 'nstore', 'controller', 'triggerProcessReview', 'before')) {
     				$oModuleController->insertTrigger('epay.processReview', 'nstore', 'controller', 'triggerProcessReview', 'before');
     			}
     */
     if (!$oModuleModel->getTrigger('epay.escrowDelivery', 'nstore', 'controller', 'triggerEscrowDelivery', 'after')) {
         $oModuleController->insertTrigger('epay.escrowDelivery', 'nstore', 'controller', 'triggerEscrowDelivery', 'after');
     }
     if (!$oModuleModel->getTrigger('epay.escrowConfirm', 'nstore', 'controller', 'triggerEscrowConfirm', 'after')) {
         $oModuleController->insertTrigger('epay.escrowConfirm', 'nstore', 'controller', 'triggerEscrowConfirm', 'after');
     }
     if (!$oModuleModel->getTrigger('epay.escrowDenyConfirm', 'nstore', 'controller', 'triggerEscrowDenyConfirm', 'after')) {
         $oModuleController->insertTrigger('epay.escrowDenyConfirm', 'nstore', 'controller', 'triggerEscrowDenyConfirm', 'after');
     }
     // nproduct 상품등록, 수정 할 때 처리모듈 목록 취합
     if (!$oModuleModel->getTrigger('nproduct.getProcModules', 'nstore', 'model', 'triggerGetProcModules', 'before')) {
         $oModuleController->insertTrigger('nproduct.getProcModules', 'nstore', 'model', 'triggerGetProcModules', 'before');
     }
     if (!$oModuleModel->getTrigger('member.getMemberMenu', 'nstore', 'model', 'triggerMemberMenu', 'before')) {
         $oModuleController->insertTrigger('member.getMemberMenu', 'nstore', 'model', 'triggerMemberMenu', 'before');
     }
     // 2013. 09. 25 when add new menu in sitemap, custom menu add
     if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'nstore', 'model', 'triggerModuleListInSitemap', 'after')) {
         $oModuleController->insertTrigger('menu.getModuleListInSitemap', 'nstore', 'model', 'triggerModuleListInSitemap', 'after');
     }
 }
 /**
  * @brief Execute update
  **/
 function moduleUpdate()
 {
     $oDB =& DB::getInstance();
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     return new Object(0, 'success_updated');
 }
 function procDoNotify()
 {
     $oController =& getController('module');
     $output = $oController->lock('commentnotify', 400);
     if (!$output->toBool()) {
         return;
     }
     $deadline = $output->get('deadline');
     if (file_exists($this->cachedir . $this->cachefile)) {
         FileHandler::removeFile($this->cachedir . $this->cachefile);
     }
     $oModel =& getModel('tccommentnotify');
     $output = $oModel->GetCommentsFromNotifyQueue();
     if (!$output->toBool()) {
         debugPrint("Error");
         debugPrint($output);
     }
     if ($output->data) {
         foreach ($output->data as $data) {
             $this->deleteFromQueue($data->comment_srl);
             $this->sendCommentNotify($data->comment_srl);
         }
     }
     $oController->unlock('commentnotify', $deadline);
 }