Exemplo n.º 1
0
 function dispGgmailingDonotsend()
 {
     $args = Context::getRequestVars();
     $obj->ggmailing_nickname = $args->nick_name;
     $obj->ggmailing_email = $args->email;
     //member_srl 구하기
     $oModuleModel = getModel('member');
     $args->member_srl = $oModuleModel->getMemberSrlByNickName($args->nick_name);
     if (!$args->member_srl) {
         $args->member_srl = '0';
     }
     $obj->ggmailing_member_srl = $args->member_srl;
     $args->fix_regdate = date('YmdHis', strtotime($args->regdate));
     $obj->ggmailing_member_regdate = $args->fix_regdate;
     $obj->regdate = date('YmdHis');
     //executeQuery('ggmailing.insertBoardMember',$obj);
     $output = $oModuleModel->getMemberInfoByMemberSrl($args->member_srl);
     if (!$args->nick_name || !$args->fix_regdate || !$args->email) {
         $donotsend->message = '정보가 부족합니다.';
     } else {
         //현재 차단중인지 확인
         $output = executeQueryArray('ggmailing.getDonotsend', $obj);
         //차단중이 아니라면
         if ($output->data) {
             $donotsend->message = '이미 수신거부 되어 있습니다.';
         } else {
             executeQuery('ggmailing.insertDonotsend', $obj);
             $donotsend->message = '정상적으로 수신거부 되었습니다.';
         }
     }
     Context::set('args', $args);
     Context::set('donotsend', $donotsend);
     $this->setTemplateFile('donotsend');
 }
Exemplo n.º 2
0
 function isExsistDomain($domain, $client_srl = null)
 {
     $result = new Object();
     $domain = str_replace(array('http://', 'www.'), '', $domain);
     // DB에서 검색
     $args->domain = $domain;
     $args->client_srl = $client_srl;
     $output = executeQueryArray('socialxeserver.getClientByDomain', $args);
     if (!$output->toBool()) {
         return $output;
     }
     // 검색 결과가 없으면 false
     if (!$output->data) {
         $result->add('result', false);
         return $result;
     }
     // DB 검색 결과에서 도메인을 하나씩 체크
     foreach ($output->data as $client) {
         $domain_array = explode(',', $client->domain);
         foreach ($domain_array as $val) {
             // 정확히 일치하는지를 검사
             if (trim($val) == $domain) {
                 $result->add('result', true);
                 return $result;
             }
         }
     }
     // 일치하는 도메인이 없으면 false
     $result->add('result', false);
     return $result;
 }
Exemplo n.º 3
0
 /**
  * @brief 모듈 목록
  */
 function dispInipaystandardAdminModuleList()
 {
     $args = new stdClass();
     $args->sort_index = "module_srl";
     $args->page = Context::get('page');
     $args->list_count = 20;
     $args->page_count = 10;
     $args->s_module_category_srl = Context::get('module_category_srl');
     $search_target = Context::get('search_target');
     $search_keyword = Context::get('search_keyword');
     switch ($search_target) {
         case 'mid':
             $args->s_mid = $search_keyword;
             break;
         case 'browser_title':
             $args->s_browser_title = $search_keyword;
             break;
     }
     $output = executeQueryArray('inipaystandard.getModuleList', $args);
     ModuleModel::syncModuleToSite($output->data);
     Context::set('total_count', $output->total_count);
     Context::set('total_page', $output->total_page);
     Context::set('page', $output->page);
     Context::set('module_list', $output->data);
     Context::set('page_navigation', $output->page_navigation);
     $this->setTemplateFile('module_list');
 }
Exemplo n.º 4
0
 function triggerGetManagerMenu(&$manager_menu)
 {
     $oModuleModel = getModel('module');
     $logged_info = Context::get('logged_info');
     $output = executeQueryArray('cympusadmin.getModInstList');
     if (!$output->toBool()) {
         return $output;
     }
     $list = $output->data;
     $menu = new stdClass();
     $menu->title = Context::getLang('site_management');
     $menu->icon = 'dashboard';
     $menu->module = 'cympusadmin';
     $menu->submenu = array();
     foreach ($list as $key => $val) {
         $grant = $oModuleModel->getGrant($val, $logged_info);
         if ($grant->manager) {
             $submenu = new stdClass();
             $submenu->action = array('dispCympusadminAdminIndex');
             $submenu->mid = $val->mid;
             $submenu->title = Context::getLang('site_status');
             $submenu->module = 'cympusadmin';
             $menu->submenu[] = $submenu;
         }
     }
     if (count($menu->submenu)) {
         $manager_menu['cympusadmin'] = $menu;
     }
 }
Exemplo n.º 5
0
 /**
  * @brief Execute update
  **/
 function moduleUpdate()
 {
     // opage module instance update
     $output = executeQueryArray('page.pageTypeOpageCheck');
     if ($output->toBool() && count($output->data) > 0) {
         foreach ($output->data as $val) {
             $args->module_srl = $val->module_srl;
             $args->name = 'page_type';
             $args->value = 'OUTSIDE';
             $in_out = executeQuery('page.insertPageType', $args);
         }
         $output = executeQuery('page.updateAllOpage');
         if (!$output->toBool()) {
             return $output;
         }
     }
     // old page module instance update
     $output = executeQueryArray('page.pageTypeNullCheck');
     $skin_update_srls = array();
     if ($output->toBool() && $output->data) {
         foreach ($output->data as $val) {
             $args->module_srl = $val->module_srl;
             $args->name = 'page_type';
             $args->value = 'WIDGET';
             $in_out = executeQuery('page.insertPageType', $args);
             $skin_update_srls[] = $val->module_srl;
         }
     }
     if (count($skin_update_srls) > 0) {
         $skin_args->module_srls = implode(',', $skin_update_srls);
         $skin_args->is_skin_fix = "Y";
         $ouput = executeQuery('page.updateSkinFix', $skin_args);
     }
     return new Object(0, 'success_updated');
 }
Exemplo n.º 6
0
 /**
  * @brief 위젯의 실행 부분
  *
  * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     // 제목
     $title = $args->title;
     // 출력된 목록 수
     $list_count = (int) $args->list_count;
     if (!$list_count) {
         $list_count = 5;
     }
     $args->list_count = $list_count;
     // 중복 허용/ 비허용 체크
     if ($args->allow_repetition != 'Y') {
         $output = executeQueryArray('widgets.planet_document.getUniqueNewestDocuments', $args);
     } else {
         $output = executeQueryArray('widgets.planet_document.getNewestDocuments', $args);
     }
     // 플래닛 글 목록 구함
     $oPlanetModel =& getModel('planet');
     Context::set('planet', $planet = $oPlanetModel->getPlanet());
     if (count($output->data)) {
         foreach ($output->data as $key => $val) {
             $document_srl = $val->document_srl;
             $oPlanet = null;
             $oPlanet = new PlanetItem();
             $oPlanet->setAttribute($val);
             $planet_list[] = $oPlanet;
         }
     } else {
         $planet_list = array();
     }
     Context::set('planet_list', $planet_list);
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // 템플릿 파일을 지정
     $tpl_file = 'list';
     if (!$args->thumbnail_width) {
         $args->thumbnail_width = 50;
     }
     if (!$args->thumbnail_height) {
         $args->thumbnail_height = 50;
     }
     $widget_info->thumbnail_width = $args->thumbnail_width;
     $widget_info->thumbnail_height = $args->thumbnail_height;
     $widget_info->domain = Context::getDefaultUrl();
     if (!$args->show_number_of_comments) {
         $args->show_number_of_comments = "N";
     }
     if (!$args->show_author_name) {
         $args->show_author_name = "N";
     }
     $widget_info->show_number_of_comments = $args->show_number_of_comments;
     $widget_info->show_author_name = $args->show_author_name;
     $widget_info->content_cut_size = $args->content_cut_size;
     Context::set('widget_info', $widget_info);
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     $output = $oTemplate->compile($tpl_path, $tpl_file);
     return $output;
 }
 function triggerChangeNick(&$obj)
 {
     $oSejin7940_nickModel =& getmodel('sejin7940_nick');
     $module_config = $oSejin7940_nickModel->getModuleConfig();
     $logged_info = Context::get('logged_info');
     if ($logged_info->is_admin != 'Y' && $module_config->use_change_nick == 'Y' && $module_config->change_nick_term) {
         $oMemberModel =& getModel('member');
         $orgMemberInfo = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
         if ($obj->nick_name != $orgMemberInfo->nick_name) {
             $args_nick->member_srl = $logged_info->member_srl;
             $args_nick->regdate = date('YmdHis', mktime(date('H'), date('i'), date('s'), date('m'), date('d') - $module_config->change_nick_term, date('Y')));
             $args_nick->change_regdate = date('YmdHis', mktime(date('H'), date('i'), date('s'), date('m'), date('d') + $module_config->change_nick_term, date('Y')));
             $output_nick = executeQueryArray('sejin7940_nick.getNickLatestChange', $args_nick);
             $last_change_date = '';
             foreach ($output_nick->data as $key_nick => $val_nick) {
                 if (!$last_change_date) {
                     $last_change_date = $val_nick->regdate;
                     $new_change_date = date('Y년 m월 d일 H시 i분', mktime(substr($last_change_date, 8, 2), substr($last_change_date, 10, 2), substr($last_change_date, 12, 2), substr($last_change_date, 4, 2), substr($last_change_date, 6, 2) + $module_config->change_nick_term, substr($last_change_date, 0, 4)));
                 }
             }
             if (count($output_nick->data)) {
                 return new Object(-1, '닉네임 재변경은 변경 후 ' . $new_change_date . '이후에 가능합니다.');
             }
         }
     }
 }
Exemplo n.º 8
0
 function getOrderInfo($order_srl)
 {
     $config = $this->getModuleConfig();
     // order info.
     $args = new stdClass();
     $args->order_srl = $order_srl;
     $output = executeQuery('nstore_digital.getOrderInfo', $args);
     $order_info = $output->data;
     // ordered items
     $args->order_srl = $order_srl;
     $output = executeQueryArray('nstore_digital.getPurchasedItems', $args);
     $item_list = $output->data;
     if (!is_array($item_list)) {
         $item_list = array($item_list);
     }
     foreach ($item_list as $key => $val) {
         $item = new nproductItem($val, $config->currency, $config->as_sign, $config->decimals);
         if ($item->option_srl) {
             $item->price += $item->option_price;
         }
         $item_list[$key] = $item;
     }
     $order_info->item_list = $item_list;
     return $order_info;
 }
 /**
  * @brief 특정 모두의 첨부파일 모두 삭제
  **/
 function deleteModuleFiles($module_srl)
 {
     // 전체 첨부파일 목록을 구함
     $args->module_srl = $module_srl;
     $output = executeQueryArray('file.getModuleFiles', $args);
     if (!$output) {
         return $output;
     }
     $files = $output->data;
     // DB에서 삭제
     $args->module_srl = $module_srl;
     $output = executeQuery('file.deleteModuleFiles', $args);
     if (!$output->toBool()) {
         return $output;
     }
     // 실제 파일 삭제 (일단 약속에 따라서 한번에 삭제)
     FileHandler::removeDir(sprintf("./files/attach/images/%s/", $module_srl));
     FileHandler::removeDir(sprintf("./files/attach/binaries/%s/", $module_srl));
     // DB에서 구한 파일 목록을 삭제
     $path = array();
     $cnt = count($files);
     for ($i = 0; $i < $cnt; $i++) {
         $uploaded_filename = $files[$i]->uploaded_filename;
         FileHandler::removeFile($uploaded_filename);
         $path_info = pathinfo($uploaded_filename);
         if (!in_array($path_info['dirname'], $path)) {
             $path[] = $path_info['dirname'];
         }
     }
     // 해당 글의 첨부파일 디렉토리 삭제
     for ($i = 0; $i < count($path); $i++) {
         FileHandler::removeBlankDir($path[$i]);
     }
     return $output;
 }
Exemplo n.º 10
0
 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);
         }
     }
 }
 function dispTranslationAdminContent()
 {
     $args->sort_index = "module_srl";
     $args->page = Context::get('page');
     $args->list_count = 20;
     $args->page_count = 10;
     $args->s_module_category_srl = Context::get('module_category_srl');
     $s_mid = Context::get('s_mid');
     if ($s_mid) {
         $args->s_mid = $s_mid;
     }
     $s_browser_title = Context::get('s_browser_title');
     if ($s_browser_title) {
         $args->s_browser_title = $s_browser_title;
     }
     $output = executeQueryArray('translation.getTranslationList', $args);
     ModuleModel::syncModuleToSite($output->data);
     // setup module variables, context::set
     Context::set('total_count', $output->total_count);
     Context::set('total_page', $output->total_page);
     Context::set('page', $output->page);
     Context::set('translation_list', $output->data);
     Context::set('page_navigation', $output->page_navigation);
     // set template file
     $this->setTemplateFile('index');
 }
Exemplo n.º 12
0
 function dispSocialxeAdminBitly()
 {
     // 설정 정보를 받아옴
     Context::set('config', $this->config);
     // bit.ly 설정이 되어 있지 않으면 환경설정으로 보낸다.
     if (!$this->config->bitly_username || !$this->config->bitly_api_key) {
         header('Location: ' . getNotEncodedUrl('act', 'dispSocialxeAdminConfig'));
         return;
     }
     // 목록을 구하기 위한 옵션
     $args->page = Context::get('page');
     $args->title = Context::get('title');
     $output = executeQueryArray('socialxe.getBitlyPageList', $args);
     if (!$output->toBool()) {
         return $output;
     }
     // 템플릿에 쓰기 위해서 comment_model::getTotalCommentList() 의 return object에 있는 값들을 세팅
     Context::set('total_count', $output->total_count);
     Context::set('total_page', $output->total_page);
     Context::set('page', $output->page);
     Context::set('bitly_list', $output->data);
     Context::set('page_navigation', $output->page_navigation);
     // 템플릿 파일 지정
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('bitly_index');
 }
Exemplo n.º 13
0
 function getNickChangeList($obj)
 {
     $args->s_member_srl = $obj->member_srl;
     $args->page = Context::get('page');
     // /< Page
     $args->list_count = 20;
     // /< the number of posts to display on a single page
     $args->page_count = 10;
     // /< the number of pages that appear in the page navigation
     $args->sort_index = 'regdate';
     // /< sorting values
     $args->order_type = 'desc';
     // /< sorting values by order
     if ($obj->search_target == 'nick_name') {
         $args->nick_name_old = $obj->search_keyword;
         $args->nick_name_new = $obj->search_keyword;
     }
     if ($obj->search_target == 'member_srl') {
         $args->s_member_srl = $obj->search_keyword;
     }
     if ($obj->search_target == 'user_id') {
         $oMemberModel =& getModel('member');
         $member_info = $oMemberModel->getMemberInfoByUserID($obj->search_keyword);
         $args->s_member_srl = $member_info->member_srl;
     }
     $output = executeQueryArray('sejin7940_nick.getNickChangeList', $args);
     return $output;
 }
Exemplo n.º 14
0
 function nproductCategory($module_srl, $category = 0)
 {
     $args->node_id = $category;
     if ($args->node_id) {
         $output = executeQuery('nproduct.getCategoryInfo', $args);
         if (!$output->toBool()) {
             return $output;
         }
         $category_info = $output->data;
         $parent_nodes = explode('.', $category_info->node_route);
         $this->parent_nodes = $parent_nodes;
     }
     unset($args);
     // category tree
     $args->module_srl = $module_srl;
     $output = executeQueryArray('nproduct.getCategoryAllSubitems', $args);
     if (!$output->toBool()) {
         return $output;
     }
     $category_list = $output->data;
     $category_tree = array();
     $category_index = array();
     if ($category_list) {
         foreach ($category_list as $no => $cate) {
             $node_route = $cate->node_route . $cate->node_id;
             $stages = explode('.', $node_route);
             $code_str = '$category_tree["' . implode('"]["', $stages) . '"] = array();';
             eval($code_str);
             $category_index[$cate->node_id] = $cate;
         }
     }
     $this->category_tree = $category_tree;
     $this->category_index = $category_index;
 }
Exemplo n.º 15
0
 /**
  * Execute update
  *
  * @return Object
  */
 function moduleUpdate()
 {
     $oDB = DB::getInstance();
     if (!$oDB->isColumnExists("addons", "is_used_m")) {
         $oDB->addColumn("addons", "is_used_m", "char", 1, "N", TRUE);
     }
     if (!$oDB->isColumnExists("addons_site", "is_used_m")) {
         $oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", TRUE);
     }
     // 2011. 7. 29. add is_fixed column
     if (!$oDB->isColumnExists('addons', 'is_fixed')) {
         $oDB->addColumn('addons', 'is_fixed', 'char', 1, 'N', TRUE);
         // move addon info to addon_site table
         $output = executeQueryArray('addon.getAddons');
         if ($output->data) {
             foreach ($output->data as $row) {
                 $args = new stdClass();
                 $args->site_srl = 0;
                 $args->addon = $row->addon;
                 $args->is_used = $row->is_used;
                 $args->is_used_m = $row->is_used_m;
                 $args->extra_vars = $row->extra_vars;
                 executeQuery('addon.insertSiteAddon', $args);
             }
         }
     }
     return new Object(0, 'success_updated');
 }
Exemplo n.º 16
0
	function getPaynotyAdminDelete() 
	{
		// get configs.
		$args->config_srl = Context::get('config_srl');
		$output = executeQuery("paynoty.getConfig", $args);
		$id_list = $output->data->id_list;
		$group_srl_list = $output->data->group_srl_list;
		$config = $output->data;

		$args->config_srls = Context::get('config_srls');
		$output = executeQueryArray("paynoty.getModuleInfoByConfigSrl", $args);
		$mid_list = array();
		if ($output->data) 
		{
			foreach ($output->data as $no => $val) 
			{
				$mid_list[] = $val->mid;
			}
		}
		$config->mid_list = join(',', $mid_list);

		Context::set('config', $config);

		$oTemplate = &TemplateHandler::getInstance();
		$tpl = $oTemplate->compile($this->module_path.'tpl', 'delete');
		$this->add('tpl', str_replace("\n"," ",$tpl));
	}
Exemplo n.º 17
0
 public function procDosirakstoreDelete()
 {
     // 권한 체크
     if (!$this->grant->write_menu) {
         return new Object(-1, 'msg_not_permitted');
     }
     $oDB =& DB::getInstance();
     $oDB->begin();
     $no = Context::get('no');
     $args = new stdClass();
     $args->no = $no;
     $oDosirakstoreModel = getModel('dosirakstore');
     $output = $oDosirakstoreModel->getDosirakstoreOne($args);
     if (!$output->toBool()) {
         return new Object(-1, 'msg_not_founded');
     }
     $args = new stdClass();
     $args->no = $no;
     // 글 삭제
     $output = executeQueryArray('dosirakstore.deleteDosirakstoreOne', $args);
     if (!$output->toBool()) {
         $oDB->rollback();
         return $output;
     }
     // 결과 체크
     $oDB->commit();
     // alert an message
     $this->add('mid', Context::get('mid'));
     $this->setRedirectUrl(getNotEncodedUrl('', 'mid', $mid));
 }
Exemplo n.º 18
0
	/**
	 * @brief Search documents
	 **/
	function getProducts($target, $module_srls_list, $search_target, $search_keyword, $page=1, $list_count = 20)
	{
		if(is_array($module_srls_list)) $module_srls_list = implode(',',$module_srls_list);

		$args = new stdClass();
		if($target == 'exclude')
		{
			$module_srls_list .= ',0'; // exclude 'trash'
			if ($module_srls_list{0} == ',') $module_srls_list = substr($module_srls_list, 1);
			$args->exclude_module_srl = $module_srls_list;
		}
		else
		{
			$args->module_srl = $module_srls_list;
			$args->exclude_module_srl = '0'; // exclude 'trash'
		}

		$args->page = $page;
		$args->list_count = $list_count;
		$args->page_count = 10;
		$args->search_target = $search_target;
		$args->search_keyword = $search_keyword;
		$args->sort_index = 'list_order';
		$args->order_type = 'asc';
		if(!$args->module_srl)
		{
			unset($args->module_srl);
		}
		// Get a list of documents
		$oDocumentModel = getModel('document');

		$documentlist_output = $oDocumentModel->getDocumentList($args);
		if (!$documentlist_output->toBool())
		{
			return $documentlist_output;
		}
		$args = new stdClass();
		$document_srl_list = array();
		$documentlist_index = array();
		if ($documentlist_output->data)
		{
			foreach ($documentlist_output->data as $key=>$val)
			{
				$document_srl_list[] = $val->document_srl;
				$documentlist_index[$val->document_srl] = $key;
			}
		}
		$args->document_srl = implode(',',$document_srl_list);
		$output = executeQueryArray('nproduct.getItemListByDocumentSrl', $args);
		if (!$output->toBool()) return $output;
		if ($output->data)
		{
			foreach ($output->data as $key=>$val)
			{
				if ($documentlist_output->data[$documentlist_index[$val->document_srl]]) $documentlist_output->data[$documentlist_index[$val->document_srl]]->item = new nproductItem($val);
			}
		}
		return $documentlist_output;
	}
Exemplo n.º 19
0
 /**
  * @brief Get the list of polls with member info
  **/
 function getPollListWithMember($args)
 {
     $output = executeQueryArray('poll.getPollListWithMember', $args);
     if (!$output->toBool()) {
         return $output;
     }
     return $output;
 }
Exemplo n.º 20
0
 function getHomepageList($page)
 {
     if (!$page) {
         $page = 1;
     }
     $args->page = $page;
     $output = executeQueryArray('homepage.getHomepageList', $args);
     return $output;
 }
 /**
  * @brief 전화번호에 따른 회원의 인증정보를 가져온다
  */
 function getAuthenticationMemberListByClue($clue)
 {
     $args->clue = $clue;
     $output = executeQueryArray('authentication.getAuthenticationMemberListByClue', $args);
     if (!$output->toBool()) {
         return;
     }
     return $output->data;
 }
Exemplo n.º 22
0
 /**
  * Get a document list from the trash
  * @param object $obj
  * @return object
  */
 function getDocumentTrashList($obj)
 {
     // check a list and its order
     if (!in_array($obj->sort_index, array('list_order', 'delete_date', 'title'))) {
         $obj->sort_index = 'list_order';
     }
     if (!in_array($obj->order_type, array('desc', 'asc'))) {
         $obj->order_type = 'asc';
     }
     // get a module_srl if mid is returned instead of modul_srl
     if ($obj->mid) {
         $oModuleModel = getModel('module');
         $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
         unset($obj->mid);
     }
     // check if the module_srl is an array
     $args = new stdClass();
     if (is_array($obj->module_srl)) {
         $args->module_srl = implode(',', $obj->module_srl);
     } else {
         $args->module_srl = $obj->module_srl;
     }
     // Variable check
     $args->sort_index = $obj->sort_index;
     $args->order_type = $obj->order_type;
     $args->page = $obj->page ? $obj->page : 1;
     $args->list_count = $obj->list_count ? $obj->list_count : 20;
     $args->page_count = $obj->page_count ? $obj->page_count : 10;
     $args->member_srl = $obj->member_srl;
     // Specify query_id
     $query_id = 'document.getTrashList';
     // Execute a query
     $output = executeQueryArray($query_id, $args);
     // Return if no result or an error occurs
     if (!$output->toBool() || !count($output->data)) {
         return $output;
     }
     $idx = 0;
     $data = $output->data;
     unset($output->data);
     $keys = array_keys($data);
     $virtual_number = $keys[0];
     foreach ($data as $key => $attribute) {
         $oDocument = null;
         $oDocument = new documentItem();
         $oDocument->setAttribute($attribute, false);
         if ($is_admin) {
             $oDocument->setGrant();
         }
         $output->data[$virtual_number] = $oDocument;
         $virtual_number--;
     }
     return $output;
 }
Exemplo n.º 23
0
 function getModuleMidList($args)
 {
     $args->list_count = 100;
     $args->page_count = 10;
     $output = executeQueryArray('nstore.getModuleMidList', $args);
     if (!$output->toBool()) {
         return $output;
     }
     ModuleModel::syncModuleToSite($output->data);
     return $output;
 }
Exemplo n.º 24
0
 /**
  * @brief widget
  **/
 function proc($in_args)
 {
     $oModuleModel = getModel('module');
     $args = new stdClass();
     $args->node_id = Context::get('category');
     if ($args->node_id) {
         $output = executeQuery('nproduct.getCategoryInfo', $args);
         if (!$output->toBool()) {
             return $output;
         }
         $category_info = $output->data;
         $parent_nodes = explode('.', $category_info->node_route);
         Context::set('parent_nodes', $parent_nodes);
     }
     $args = new stdClass();
     $args->module_srl = $in_args->module_srls;
     $output = executeQueryArray('nproduct.getCategoryList', $args);
     if (!$output->toBool()) {
         return $output;
     }
     $category_list = $output->data;
     $category_tree = array();
     $category_index = array();
     if ($category_list) {
         foreach ($category_list as $no => $cate) {
             $node_route = $cate->node_route . $cate->node_id;
             $stages = explode('.', $node_route);
             $reference_tree =& $category_tree;
             foreach ($stages as $stage) {
                 if (!isset($reference_tree[$stage])) {
                     $reference_tree[$stage] = array();
                 }
                 $reference_tree =& $reference_tree[$stage];
             }
             unset($reference_tree);
             $module_info = $oModuleModel->getModuleInfoByModuleSrl($cate->module_srl);
             if ($module_info->mid) {
                 $cate->mid = $module_info->mid;
             }
             $category_index[$cate->node_id] = $cate;
         }
     }
     Context::set('category_tree', $category_tree);
     Context::set('category_index', $category_index);
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $in_args->skin);
     Context::set('skin', $in_args->skin);
     Context::set('widget_info', $in_args);
     // 템플릿 파일을 지정
     $tpl_file = 'categorymenu.html';
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
Exemplo n.º 25
0
 /**
  * @brief 휴지통에 존재하는 문서 목록을 가져옴
  **/
 function getDocumentTrashList($obj)
 {
     // 정렬 대상과 순서 체크
     if (!in_array($obj->sort_index, array('list_order', 'delete_date', 'title'))) {
         $obj->sort_index = 'list_order';
     }
     if (!in_array($obj->order_type, array('desc', 'asc'))) {
         $obj->order_type = 'asc';
     }
     // module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌
     if ($obj->mid) {
         $oModuleModel =& getModel('module');
         $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
         unset($obj->mid);
     }
     // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크
     if (is_array($obj->module_srl)) {
         $args->module_srl = implode(',', $obj->module_srl);
     } else {
         $args->module_srl = $obj->module_srl;
     }
     // 변수 체크
     $args->sort_index = $obj->sort_index;
     $args->order_type = $obj->order_type;
     $args->page = $obj->page ? $obj->page : 1;
     $args->list_count = $obj->list_count ? $obj->list_count : 20;
     $args->page_count = $obj->page_count ? $obj->page_count : 10;
     $args->member_srl = $obj->member_srl;
     // query_id 지정
     $query_id = 'document.getTrashList';
     // query 실행
     $output = executeQueryArray($query_id, $args);
     // 결과가 없거나 오류 발생시 그냥 return
     if (!$output->toBool() || !count($output->data)) {
         return $output;
     }
     $idx = 0;
     $data = $output->data;
     unset($output->data);
     $keys = array_keys($data);
     $virtual_number = $keys[0];
     foreach ($data as $key => $attribute) {
         $oDocument = null;
         $oDocument = new documentItem();
         $oDocument->setAttribute($attribute, false);
         if ($is_admin) {
             $oDocument->setGrant();
         }
         $output->data[$virtual_number] = $oDocument;
         $virtual_number--;
     }
     return $output;
 }
Exemplo n.º 26
0
 /**
  * Get layout instance list
  * @param int $siteSrl
  * @param string $layoutType (P : PC, M : Mobile)
  * @param string $layout name of layout
  * @param array $columnList
  * @return array layout lists in site
  **/
 function getLayoutInstanceList($siteSrl = 0, $layoutType = 'P', $layout = null, $columnList = array())
 {
     if (!$siteSrl) {
         $siteModuleInfo = Context::get('site_module_info');
         $siteSrl = (int) $siteModuleInfo->site_srl;
     }
     $args->site_srl = $siteSrl;
     $args->layout_type = $layoutType;
     $args->layout = $layout;
     $output = executeQueryArray('layout.getLayoutList', $args, $columnList);
     return $output->data;
 }
Exemplo n.º 27
0
 /**
  * @brief return pg info.
  */
 function triggerGetPgModules(&$pg_modules)
 {
     $args = new stdClass();
     $args->sort_index = "module_srl";
     $args->page = Context::get('page');
     $args->list_count = 100;
     $args->page_count = 10;
     $output = executeQueryArray('inipaystandard.getModuleList', $args);
     foreach ($output->data as $key => $val) {
         $pg_modules[$val->module_srl] = $val;
     }
 }
Exemplo n.º 28
0
 /**
  * Get TrashVO all list
  * @param object $args
  * @param array $columnList
  * @return object
  */
 function getTrashAllList($args, $columnList = array())
 {
     $output = executeQueryArray('trash.getTrashAllList', $args, $columnList);
     if (is_array($output->data)) {
         foreach ($output->data as $key => $value) {
             $oTrashVO = new TrashVO();
             $this->_setTrashObject($oTrashVO, $value);
             $output->data[$key] = $oTrashVO;
         }
     }
     return $output;
 }
Exemplo n.º 29
0
 function dispNmileageMyMileage()
 {
     $oNmileageModel =& getModel('nmileage');
     $logged_info = Context::get('logged_info');
     $args->member_srl = $logged_info->member_srl;
     $output = executeQueryArray('nmileage.getMileageHistory', $args);
     Context::set('list', $output->data);
     Context::set('colorset', 'transparent');
     $mileage = $oNmileageModel->getMileage($logged_info->member_srl);
     Context::set('mileage', $mileage);
     $this->setTemplateFile('mymileage');
 }
Exemplo n.º 30
0
 function dispNstoreOrderList()
 {
     $oFileModel = getModel('file');
     $oNstoreModel = getModel('nstore');
     $config = $oNstoreModel->getModuleConfig();
     Context::set('config', $config);
     $logged_info = Context::get('logged_info');
     // 비회원 구매가 활성화되어 있지 않고 로그인 되있지 않다면
     if (!Context::get('is_logged') && $config->guest_buy == 'N') {
         return new Object(-1, 'msg_login_required');
     }
     // 로그인되어 있지 않다면 비회원 주문상품 조회 페이지로
     if (!Context::get('is_logged')) {
         $this->dispNstoreNonLoginOrder();
         return;
     }
     $startdate = Context::get('startdate');
     $enddate = Context::get('enddate');
     if (!$startdate) {
         $startdate = date('Ymd', time() - 60 * 60 * 24 * 30);
     }
     if (!$enddate) {
         $enddate = date('Ymd');
     }
     Context::set('startdate', $startdate);
     Context::set('enddate', $enddate);
     $args = new stdClass();
     $args->member_srl = $logged_info->member_srl;
     $args->startdate = $startdate . '000000';
     $args->enddate = $enddate . '235959';
     $output = executeQueryArray('nstore.getOrderItems', $args);
     $item_list = $output->data;
     $order_list = array();
     if ($item_list) {
         foreach ($item_list as $key => $val) {
             $item = new nproductItem($val, $config->currency, $config->as_sign, $config->decimals);
             if ($item->option_srl) {
                 $item->price += $item->option_price;
             }
             $item_list[$key] = $item;
             if (!isset($order_list[$val->order_srl])) {
                 $order_list[$val->order_srl] = array();
             }
             $order_list[$val->order_srl][] = $item;
         }
     }
     Context::set('list', $item_list);
     Context::set('order_list', $order_list);
     Context::set('order_status', $this->getOrderStatus());
     Context::set('delivery_inquiry_urls', $this->delivery_inquiry_urls);
     $this->setTemplateFile('orderlist');
 }