本文整理汇总了PHP中ModuleHandler::triggerCall方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleHandler::triggerCall方法的具体用法?PHP ModuleHandler::triggerCall怎么用?PHP ModuleHandler::triggerCall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleHandler
的用法示例。
在下文中一共展示了ModuleHandler::triggerCall方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispMemberSignUpForm
function dispMemberSignUpForm()
{
$oMemberModel =& getModel('member');
if ($oMemberModel->isLogged()) {
return $this->stop('msg_already_logged');
}
$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $this->member_config);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
if ($this->member_config->enable_join != 'Y') {
return $this->stop('msg_signup_disabled');
}
$oMemberAdminView =& getAdminView('member');
$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
Context::set('formTags', $formTags);
$member_config = $oMemberModel->getMemberConfig();
Context::set('member_config', $member_config);
global $lang;
$identifierForm->title = $lang->{$member_config->identifier};
$identifierForm->name = $member_config->identifier;
$identifierForm->value = $member_info->{$member_config->identifier};
Context::set('identifierForm', $identifierForm);
// Set a template file
$this->setTemplateFile('signup_form');
}
示例2: init
function init()
{
// forbit access if the user is not an administrator
if (!$this->grant->manager && !$this->grant->is_admin) {
return $this->stop("msg_is_not_administrator");
}
// change into administration layout
//$this->setTemplatePath('./modules/cympusadmin/tpl');
$this->setLayoutPath('./modules/cympusadmin/tpl');
$this->setLayoutFile(_CYMPUSADMIN_LAYOUT_);
Context::loadLang(_XE_PATH_ . 'modules/cympusadmin/lang/');
if ($this->grant->is_admin) {
// parse admin menu
$oXmlParser = new XmlParser();
$xml_obj = $oXmlParser->loadXmlFile('./modules/cympusadmin/conf/' . _CYMPUSADMIN_MENU_);
$admin_menu = cympusadmin::getMenu($xml_obj->menu->item);
Context::set('cympusadmin_menu', $admin_menu);
} else {
$output = ModuleHandler::triggerCall('cympusadmin.getManagerMenu', 'before', $manager_menu);
if (!$output->toBool()) {
return $output;
}
Context::set('cympusadmin_menu', $manager_menu);
}
$news = getNewsFromAgency();
Context::set('news', $news);
Context::set('admin_bar', 'false');
$oModuleModel =& getModel('module');
$module_info = $oModuleModel->getModuleInfoXml('cympusadmin');
Context::set('cympus_modinfo', $module_info);
return new Object();
}
示例3: getCommentMenu
/**
* display the pop-up menu of the post
* Print, scrap, vote-up(recommen), vote-down(non-recommend), report features added
* @return void
*/
function getCommentMenu()
{
// get the post's id number and the current login information
$comment_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
$logged_info = Context::get('logged_info');
$act = Context::get('cur_act');
// array values for menu_list, "comment post, target, url"
$menu_list = array();
// call a trigger
ModuleHandler::triggerCall('comment.getCommentMenu', 'before', $menu_list);
$oCommentController =& getController('comment');
// feature that only member can do
if ($logged_info->member_srl) {
$oCommentModel =& getModel('comment');
$columnList = array('comment_srl', 'module_srl', 'member_srl', 'ipaddress');
$oComment = $oCommentModel->getComment($comment_srl, false, $columnList);
$module_srl = $oComment->get('module_srl');
$member_srl = $oComment->get('member_srl');
$oModuleModel =& getModel('module');
$comment_config = $oModuleModel->getModulePartConfig('document', $module_srl);
if ($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl) {
// Add a vote-up button for positive feedback
$url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url, 'cmd_vote', '', 'javascript');
}
if ($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl) {
// Add a vote-down button for negative feedback
$url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url, 'cmd_vote_down', '', 'javascript');
}
// Add the report feature against abused posts
$url = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url, 'cmd_declare', '', 'javascript');
}
// call a trigger (after)
ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list);
// find a comment by IP matching if an administrator.
if ($logged_info->is_admin == 'Y') {
$oCommentModel =& getModel('comment');
$oComment = $oCommentModel->getComment($comment_srl);
if ($oComment->isExists()) {
// Find a post of the corresponding ip address
$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'ipaddress', 'search_keyword', $oComment->getIpAddress());
$oCommentController->addCommentPopupMenu($url, 'cmd_search_by_ipaddress', $icon_path, 'TraceByIpaddress');
$url = sprintf("var params = new Array(); params['ipaddress_list']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment->getIpAddress());
$oCommentController->addCommentPopupMenu($url, 'cmd_add_ip_to_spamfilter', '', 'javascript');
}
}
// Changing a language of pop-up menu
$menus = Context::get('comment_popup_menu_list');
$menus_count = count($menus);
for ($i = 0; $i < $menus_count; $i++) {
$menus[$i]->str = Context::getLang($menus[$i]->str);
}
// get a list of final organized pop-up menus
$this->add('menus', $menus);
}
示例4: getCommentMenu
/**
* @brief 선택된 게시물의 팝업메뉴 표시
*
* 인쇄, 스크랩, 추천, 비추천, 신고 기능 추가
**/
function getCommentMenu()
{
// 요청된 게시물 번호와 현재 로그인 정보 구함
$comment_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
$logged_info = Context::get('logged_info');
$act = Context::get('cur_act');
// menu_list 에 "표시할글,target,url" 을 배열로 넣는다
$menu_list = array();
// trigger 호출
ModuleHandler::triggerCall('comment.getCommentMenu', 'before', $menu_list);
$oCommentController =& getController('comment');
// 회원이어야만 가능한 기능
if ($logged_info->member_srl) {
// 추천 버튼 추가
$url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url, 'cmd_vote', './modules/document/tpl/icons/vote_up.gif', 'javascript');
// 비추천 버튼 추가
$url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url, 'cmd_vote_down', './modules/document/tpl/icons/vote_down.gif', 'javascript');
// 신고 기능 추가
$url = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url, 'cmd_declare', './modules/document/tpl/icons/declare.gif', 'javascript');
}
// trigger 호출 (after)
ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list);
// 관리자일 경우 ip로 글 찾기
if ($logged_info->is_admin == 'Y') {
$oCommentModel =& getModel('comment');
$oComment = $oCommentModel->getComment($comment_srl);
if ($oComment->isExists()) {
// ip주소에 해당하는 글 찾기
$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'ipaddress', 'search_keyword', $oComment->get('ipaddress'));
$icon_path = './modules/member/tpl/images/icon_management.gif';
$oCommentController->addCommentPopupMenu($url, 'cmd_search_by_ipaddress', $icon_path, 'TraceByIpaddress');
$url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment->getIpAddress());
$oCommentController->addCommentPopupMenu($url, 'cmd_add_ip_to_spamfilter', './modules/document/tpl/icons/declare.gif', 'javascript');
}
}
// 팝업메뉴의 언어 변경
$menus = Context::get('comment_popup_menu_list');
$menus_count = count($menus);
for ($i = 0; $i < $menus_count; $i++) {
$menus[$i]->str = Context::getLang($menus[$i]->str);
}
// 최종적으로 정리된 팝업메뉴 목록을 구함
$this->add('menus', $menus);
}
示例5: init
function init($module = null)
{
// change into administration layout
$config = getModel('cympusadmin')->getConfig();
$args = new stdClass();
$args->module = 'cympusadmin';
$module_list = getModel('module')->getModuleSrlList($args);
if (!empty($module_list)) {
foreach ($module_list as $module_info) {
$cympus_module_info = $module_info;
}
}
$module_path = './modules/cympusadmin/';
$template_path = sprintf("%sskins/%s/", $module_path, $cympus_module_info->skin);
if (!is_dir($template_path) || !$cympus_module_info->skin) {
$config->admin_skins = 'default';
$template_path = sprintf("%sskins/%s/", $module_path, $cympus_module_info->skin);
}
if ($module) {
$module->setLayoutPath($template_path);
$module->setLayoutFile(_CYMPUSADMIN_LAYOUT_);
} else {
$this->setLayoutPath($template_path);
$this->setLayoutFile(_CYMPUSADMIN_LAYOUT_);
}
Context::loadLang(_XE_PATH_ . 'modules/cympusadmin/lang/');
$logged_info = Context::get('logged_info');
if ($logged_info->is_admin == 'Y') {
// parse admin menu
$oXmlParser = new XmlParser();
$xml_obj = $oXmlParser->loadXmlFile('./modules/cympusadmin/conf/' . _CYMPUSADMIN_MENU_);
$admin_menu = cympusadmin::getMenu($xml_obj->menu->item);
Context::set('cympusadmin_menu', $admin_menu);
} else {
$output = ModuleHandler::triggerCall('cympusadmin.getManagerMenu', 'before', $manager_menu);
if (!$output->toBool()) {
return $output;
}
Context::set('cympusadmin_menu', $manager_menu);
}
$news = getNewsFromAgency();
Context::set('news', $news);
Context::set('admin_bar', 'false');
$oModuleModel = getModel('module');
$module_info = $oModuleModel->getModuleInfoXml('cympusadmin');
Context::set('cympus_modinfo', $module_info);
return new Object();
}
示例6: getTextyleCustomMenu
/**
* @brief get textyle custom menu
**/
function getTextyleCustomMenu()
{
static $custom_menu = null;
if (is_null($custom_menu)) {
$oModuleModel =& getModel('module');
$config = $oModuleModel->getModuleConfig('textyle');
$custom_menu->hidden_menu = $config->hidden_menu;
if (!$custom_menu->hidden_menu) {
$custom_menu->hidden_menu = array();
}
$custom_menu->attached_menu = $config->attached_menu;
if (!$custom_menu->attached_menu) {
$custom_menu->attached_menu = array();
}
}
$output = ModuleHandler::triggerCall('textyle.getTextyleCustomMenu', 'after', $custom_menu);
if (!$output->toBool()) {
return $output;
}
return $custom_menu;
}
示例7: dispEpayAdminTransactions
/**
* @brief list transactions
*/
function dispEpayAdminTransactions()
{
// transactions
$args->page = Context::get('page');
$output = executeQueryArray('epay.getTransactionList', $args);
if (!$output->toBool()) {
return $output;
}
$list = $output->data;
ModuleHandler::triggerCall('epay.getTransactionList', 'after', $list);
Context::set('list', $list);
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('page_navigation', $output->page_navigation);
// module instances
$output = executeQueryArray('epay.getAllModInstList');
$modinst_list = array();
$list = $output->data;
if (!is_array($list)) {
$list = array();
}
foreach ($list as $key => $modinfo) {
$modinst_list[$modinfo->module_srl] = $modinfo;
}
Context::set('modinst_list', $modinst_list);
$this->setTemplateFile('transactions');
}
示例8: dispIssuetrackerAdminAdditionSetup
function dispIssuetrackerAdminAdditionSetup()
{
$content = '';
// 추가 설정을 위한 트리거 호출
// 이슈트래커 모듈이지만 차후 다른 모듈에서의 사용도 고려하여 trigger 이름을 공용으로 사용할 수 있도록 하였음
$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'before', $content);
$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content);
Context::set('setup_content', $content);
// 템플릿 파일 지정
$this->setTemplateFile('addition_setup');
}
示例9: displayContent
/**
* @ 실행된 모듈의 컨텐츠를 출력
**/
function displayContent($oModule = NULL)
{
// 설정된 모듈이 정상이지 않을 경우 message 모듈 객체 생성
if (!$oModule || !is_object($oModule)) {
$this->error = 'msg_module_is_not_exists';
}
// install 모듈이 아닐 때 DB 접속에 문제가 있으면 오류
if ($this->module != 'install' && $GLOBALS['__DB__'][Context::getDBType()]->is_connected == false) {
$this->error = 'msg_dbconnect_failed';
}
// 모듈 동작을 마친 후 trigger call
$output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule);
if (!$output->toBool()) {
$this->error = $output->getMessage();
}
// HTML call 이면 message view 객체 이용하도록
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
// 에러가 발생하였을시 처리
if ($this->error) {
// message 모듈 객체를 생성해서 컨텐츠 생성
$oMessageView =& getView('message');
$oMessageView->setError(-1);
$oMessageView->setMessage($this->error);
$oMessageView->dispMessage();
// 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경
if ($oModule) {
$oModule->setTemplatePath($oMessageView->getTemplatePath());
$oModule->setTemplateFile($oMessageView->getTemplateFile());
// 그렇지 않으면 message 객체를 호출된 객체로 지정
} else {
$oModule = $oMessageView;
}
}
// 해당 모듈에 layout_srl이 있는지 확인
if ($oModule->module_info->layout_srl && !$oModule->getLayoutFile()) {
// layout_srl이 있으면 해당 레이아웃 정보를 가져와 layout_path/ layout_file 위치 변경
$oLayoutModel =& getModel('layout');
$layout_info = $oLayoutModel->getLayout($oModule->module_info->layout_srl);
if ($layout_info) {
// 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력
if ($layout_info->extra_var_count) {
foreach ($layout_info->extra_var as $var_id => $val) {
if ($val->type == 'image') {
if (preg_match('/^\\.\\/files\\/attach\\/images\\/(.+)/i', $val->value)) {
$val->value = Context::getRequestUri() . substr($val->value, 2);
}
}
$layout_info->{$var_id} = $val->value;
}
}
// 레이아웃 정보중 menu를 Context::set
if ($layout_info->menu_count) {
foreach ($layout_info->menu as $menu_id => $menu) {
if (file_exists($menu->php_file)) {
@(include $menu->php_file);
}
Context::set($menu_id, $menu);
}
}
// 레이아웃 정보를 Context::set
Context::set('layout_info', $layout_info);
$oModule->setLayoutPath($layout_info->path);
$oModule->setLayoutFile('layout');
// 레이아웃이 수정되었을 경우 수정본을 지정
$edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
if (file_exists($edited_layout)) {
$oModule->setEditedLayoutFile($edited_layout);
}
}
}
}
// 컨텐츠 출력
$oDisplayHandler = new DisplayHandler();
$oDisplayHandler->printContent($oModule);
}
示例10: deleteMember
/**
* Delete User
*/
function deleteMember($member_srl)
{
// Call a trigger (before)
$trigger_obj = new stdClass();
$trigger_obj->member_srl = $member_srl;
$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
if (!$output->toBool()) {
return $output;
}
// Create a model object
$oMemberModel = getModel('member');
// Bringing the user's information
if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) {
$columnList = array('member_srl', 'is_admin');
$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
}
if (!$this->memberInfo) {
return new Object(-1, 'msg_not_exists_member');
}
// If managers can not be deleted
if ($this->memberInfo->is_admin == 'Y') {
return new Object(-1, 'msg_cannot_delete_admin');
}
$oDB =& DB::getInstance();
$oDB->begin();
$args = new stdClass();
$args->member_srl = $member_srl;
// Delete the entries in member_auth_mail
$output = executeQuery('member.deleteAuthMail', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
executeQuery('member.deleteMemberModifyNickNameLog', $args);
// TODO: If the table is not an upgrade may fail.
/*
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
*/
// Delete the entries in member_group_member
$output = executeQuery('member.deleteMemberGroupMember', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
// member removed from the table
$output = executeQuery('member.deleteMember', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Call a trigger (after)
ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
$oDB->commit();
// Name, image, image, mark, sign, delete
$this->procMemberDeleteImageName($member_srl);
$this->procMemberDeleteImageMark($member_srl);
$this->procMemberDeleteProfileImage($member_srl);
$this->delSignature($member_srl);
$this->_clearMemberCache($member_srl);
return $output;
}
示例11: declaredDocument
/**
* Report posts
* @param int $document_srl
* @param string $declare_message
* @return void|Object
*/
function declaredDocument($document_srl, $declare_message = '')
{
// Fail if session information already has a reported document
if ($_SESSION['declared_document'][$document_srl]) {
return new Object(-1, 'failed_declared');
}
// Check if previously reported
$args = new stdClass();
$args->document_srl = $document_srl;
$output = executeQuery('document.getDeclaredDocument', $args);
if (!$output->toBool()) {
return $output;
}
$declared_count = $output->data->declared_count ? $output->data->declared_count : 0;
$trigger_obj = new stdClass();
$trigger_obj->document_srl = $document_srl;
$trigger_obj->declared_count = $declared_count;
// Call a trigger (before)
$trigger_output = ModuleHandler::triggerCall('document.declaredDocument', 'before', $trigger_obj);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
// Get the original document
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
// Pass if the author's IP address is as same as visitor's.
if ($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) {
$_SESSION['declared_document'][$document_srl] = true;
return new Object(-1, 'failed_declared');
}
// Check if document's author is a member.
if ($oDocument->get('member_srl')) {
// Create a member model object
$oMemberModel = getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
// Pass after registering a session if author's information is same as the currently logged-in user's.
if ($member_srl && $member_srl == abs($oDocument->get('member_srl'))) {
$_SESSION['declared_document'][$document_srl] = true;
return new Object(-1, 'failed_declared');
}
}
// Use member_srl for logged-in members and IP address for non-members.
$args = new stdClass();
if ($member_srl) {
$args->member_srl = $member_srl;
} else {
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
}
$args->document_srl = $document_srl;
$args->declare_message = trim(htmlspecialchars($declare_message));
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
// Pass after registering a sesson if reported/declared documents are in the logs.
if ($output->data->count) {
$_SESSION['declared_document'][$document_srl] = true;
return new Object(-1, 'failed_declared');
}
// begin transaction
$oDB =& DB::getInstance();
$oDB->begin();
// Add the declared document
if ($declared_count > 0) {
$output = executeQuery('document.updateDeclaredDocument', $args);
} else {
$output = executeQuery('document.insertDeclaredDocument', $args);
}
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Leave logs
$output = executeQuery('document.insertDocumentDeclaredLog', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
$this->add('declared_count', $declared_count + 1);
// Call a trigger (after)
$trigger_obj->declared_count = $declared_count + 1;
ModuleHandler::triggerCall('document.declaredDocument', 'after', $trigger_obj);
// commit
$oDB->commit();
// Leave in the session information
$_SESSION['declared_document'][$document_srl] = true;
$this->setMessage('success_declared');
}
示例12: declaredComment
/**
* Report a blamed comment
* @param $comment_srl
* @return void
*/
function declaredComment($comment_srl)
{
// Fail if session information already has a reported document
if ($_SESSION['declared_comment'][$comment_srl]) {
return new Object(-1, 'failed_declared');
}
// check if already reported
$args = new stdClass();
$args->comment_srl = $comment_srl;
$output = executeQuery('comment.getDeclaredComment', $args);
if (!$output->toBool()) {
return $output;
}
$declared_count = $output->data->declared_count ? $output->data->declared_count : 0;
$trigger_obj = new stdClass();
$trigger_obj->comment_srl = $comment_srl;
$trigger_obj->declared_count = $declared_count;
// Call a trigger (before)
$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
// get the original comment
$oCommentModel = getModel('comment');
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
// failed if both ip addresses between author's and the current user are same.
if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) {
$_SESSION['declared_comment'][$comment_srl] = TRUE;
return new Object(-1, 'failed_declared');
}
// if the comment author is a member
if ($oComment->get('member_srl')) {
// create the member model object
$oMemberModel = getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
// session registered if the author information matches to the current logged-in user's.
if ($member_srl && $member_srl == $oComment->get('member_srl')) {
$_SESSION['declared_comment'][$comment_srl] = TRUE;
return new Object(-1, 'failed_declared');
}
}
// If logged-in, use the member_srl. otherwise use the ipaddress.
if ($member_srl) {
$args->member_srl = $member_srl;
} else {
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
}
$args->comment_srl = $comment_srl;
$log_output = executeQuery('comment.getCommentDeclaredLogInfo', $args);
// session registered if log info contains report log.
if ($log_output->data->count) {
$_SESSION['declared_comment'][$comment_srl] = TRUE;
return new Object(-1, 'failed_declared');
}
// begin transaction
$oDB =& DB::getInstance();
$oDB->begin();
// execute insert
if ($output->data->declared_count > 0) {
$output = executeQuery('comment.updateDeclaredComment', $args);
} else {
$output = executeQuery('comment.insertDeclaredComment', $args);
}
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
// leave the log
$output = executeQuery('comment.insertCommentDeclaredLog', $args);
// Call a trigger (after)
$trigger_obj->declared_count = $declared_count + 1;
$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'after', $trigger_obj);
if (!$trigger_output->toBool()) {
$oDB->rollback();
return $trigger_output;
}
$oDB->commit();
// leave into the session information
$_SESSION['declared_comment'][$comment_srl] = TRUE;
$this->setMessage('success_declared');
}
示例13: displayContent
/**
* display contents from executed module
* @param ModuleObject $oModule module instance
* @return void
**/
function displayContent($oModule = NULL)
{
// If the module is not set or not an object, set error
if (!$oModule || !is_object($oModule)) {
$this->error = 'msg_module_is_not_exists';
$this->httpStatusCode = '404';
}
// If connection to DB has a problem even though it's not install module, set error
if ($this->module != 'install' && $GLOBALS['__DB__'][Context::getDBType()]->isConnected() == false) {
$this->error = 'msg_dbconnect_failed';
}
// Call trigger after moduleHandler proc
$output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule);
if (!$output->toBool()) {
$this->error = $output->getMessage();
}
// Use message view object, if HTML call
$methodList = array('XMLRPC' => 1, 'JSON' => 1);
if (!isset($methodList[Context::getRequestMethod()])) {
if ($_SESSION['XE_VALIDATOR_RETURN_URL']) {
$display_handler = new DisplayHandler();
$display_handler->_debugOutput();
header('location:' . $_SESSION['XE_VALIDATOR_RETURN_URL']);
return;
}
// If error occurred, handle it
if ($this->error) {
// display content with message module instance
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
$oMessageObject =& ModuleHandler::getModuleInstance('message', $type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if ($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() != '200') {
$this->_setHttpStatusMessage($oMessageObject->getHttpStatusCode());
$oMessageObject->setTemplateFile('http_status_code');
}
// If module was called normally, change the templates of the module into ones of the message view module
if ($oModule) {
$oModule->setTemplatePath($oMessageObject->getTemplatePath());
$oModule->setTemplateFile($oMessageObject->getTemplateFile());
// Otherwise, set message instance as the target module
} else {
$oModule = $oMessageObject;
}
$this->_clearErrorSession();
}
// Check if layout_srl exists for the module
if (Mobile::isFromMobilePhone()) {
$layout_srl = $oModule->module_info->mlayout_srl;
} else {
$layout_srl = $oModule->module_info->layout_srl;
}
if ($layout_srl && !$oModule->getLayoutFile()) {
// If layout_srl exists, get information of the layout, and set the location of layout_path/ layout_file
$oLayoutModel =& getModel('layout');
$layout_info = $oLayoutModel->getLayout($layout_srl);
if ($layout_info) {
// Input extra_vars into $layout_info
if ($layout_info->extra_var_count) {
foreach ($layout_info->extra_var as $var_id => $val) {
if ($val->type == 'image') {
if (preg_match('/^\\.\\/files\\/attach\\/images\\/(.+)/i', $val->value)) {
$val->value = Context::getRequestUri() . substr($val->value, 2);
}
}
$layout_info->{$var_id} = $val->value;
}
}
// Set menus into context
if ($layout_info->menu_count) {
foreach ($layout_info->menu as $menu_id => $menu) {
if (file_exists($menu->php_file)) {
@(include $menu->php_file);
}
Context::set($menu_id, $menu);
}
}
// Set layout information into context
Context::set('layout_info', $layout_info);
$oModule->setLayoutPath($layout_info->path);
$oModule->setLayoutFile('layout');
// If layout was modified, use the modified version
$edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
if (file_exists($edited_layout)) {
$oModule->setEditedLayoutFile($edited_layout);
}
}
}
}
// Display contents
$oDisplayHandler = new DisplayHandler();
$oDisplayHandler->printContent($oModule);
}
示例14: dispMemberSignUpForm
/**
* @brief Display member join form
*/
function dispMemberSignUpForm()
{
//setcookie for redirect url in case of going to member sign up
setcookie("XE_REDIRECT_URL", $_SERVER['HTTP_REFERER']);
$member_config = $this->member_config;
$oMemberModel = getModel('member');
// Get the member information if logged-in
if ($oMemberModel->isLogged()) {
return $this->stop('msg_already_logged');
}
// call a trigger (before)
$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
// Error appears if the member is not allowed to join
if ($member_config->enable_join != 'Y') {
return $this->stop('msg_signup_disabled');
}
$oMemberAdminView = getAdminView('member');
$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
Context::set('formTags', $formTags);
// Editor of the module set for signing by calling getEditor
foreach ($formTags as $formTag) {
if ($formTag->name == 'signature') {
$oEditorModel = getModel('editor');
$option = new stdClass();
$option->primary_key_name = 'member_srl';
$option->content_key_name = 'signature';
$option->allow_fileupload = false;
$option->enable_autosave = false;
$option->enable_default_component = true;
$option->enable_component = false;
$option->resizable = false;
$option->disable_html = true;
$option->height = 100;
$option->skin = $member_config->signature_editor_skin;
$option->colorset = $member_config->sel_editor_colorset;
$editor = $oEditorModel->getEditor($member_info->member_srl, $option);
Context::set('editor', $editor);
}
}
global $lang;
$identifierForm = new stdClass();
$identifierForm->title = $lang->{$member_config->identifier};
$identifierForm->name = $member_config->identifier;
$identifierForm->value = $member_info->{$member_config->identifier};
Context::set('identifierForm', $identifierForm);
$this->addExtraFormValidatorMessage();
// Set a template file
$this->setTemplateFile('signup_form');
}
示例15: procAuthenticationVerifyAuthCode
function procAuthenticationVerifyAuthCode()
{
$reqvars = Context::getRequestVars();
$authentication_srl = Context::get('authentication_srl');
$args->authentication_srl = $authentication_srl;
$output = executeQuery('authentication.getAuthentication', $args);
if (!$output->toBool()) {
return $output;
}
$authentication_1 = Context::get('authcode');
$authentication_2 = $output->data->authcode;
if ($authentication_1 == $authentication_2) {
$_SESSION['authentication_pass'] = 'Y';
$args->passed = 'Y';
$args->authentication_srl = $_SESSION['authentication_srl'];
$output = executeQuery('authentication.updateAuthentication', $args);
if (!$output->toBool()) {
return $output;
}
$this->setMessage('인증이 완료되었습니다. 다음페이지로 이동합니다.');
$reqvars->passed = 'Y';
$reqvars->authentication_srl = $args->authentication_srl;
$trigger_output = ModuleHandler::triggerCall('authentication.procAuthenticationVerifyAuthCode', 'after', $reqvars);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
} else {
$reqvars->passed = 'N';
$reqvars->authentication_srl = $args->authentication_srl;
$trigger_output = ModuleHandler::triggerCall('authentication.procAuthenticationVerifyAuthCode', 'after', $reqvars);
if (!$trigger_output->toBool()) {
return $trigger_output;
}
return new Object(-1, '인증코드가 올바르지 않습니다.');
}
}