예제 #1
0
 /**
  * @brief Widget execution
  * Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
  * After generating the result, do not print but return it.
  */
 function proc($args)
 {
     // Get status of the accumulated, yesterday's, today's counts
     $oCounterModel = getModel('counter');
     $site_module_info = Context::get('site_module_info');
     $output = $oCounterModel->getStatus(array('00000000', date('Ymd', $_SERVER['REQUEST_TIME'] - 60 * 60 * 24), date('Ymd')), $site_module_info->site_srl);
     if (count($output)) {
         foreach ($output as $key => $val) {
             if (!$key) {
                 Context::set('total_counter', $val);
             } elseif ($key == date("Ymd")) {
                 Context::set('today_counter', $val);
             } else {
                 Context::set('yesterday_counter', $val);
             }
         }
     }
     // Set a path of the template skin (values of skin, colorset settings)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // Specify a template file
     $tpl_file = 'counter_status';
     // Compile a template
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #2
0
 /**
  * @brief 위젯의 실행 부분
  *
  * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     $oDocument =& getClass('document');
     $site_module_info = Context::get('site_module_info');
     Context::set('widget_info', $widget_info);
     $args->site_srl = (int) $site_module_info->site_srl;
     // 회원수 추출
     $output = executeQuery('widgets.site_info.getMemberCount', $args);
     $widget_info->member_count = $output->data->cnt;
     // 새글 추출
     $args->regdate = date("YmdHis", time() - 24 * 60 * 60);
     $output = executeQuery('widgets.site_info.getNewDocument', $args);
     $widget_info->new_documents = $output->data->cnt;
     // 개설일
     $output = executeQuery('widgets.site_info.getCreatedDate', $args);
     $widget_info->created = $output->data->regdate;
     // 가입 여부
     $logged_info = Context::get('logged_info');
     if (count($logged_info->group_list)) {
         $widget_info->joined = true;
     } else {
         $widget_info->joined = false;
     }
     Context::set('widget_info', $widget_info);
     Context::set('colorset', $args->colorset);
     // 템플릿 컴파일
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     $tpl_file = 'site_info';
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #3
0
 /**
  * @brief 위젯의 실행 부분
  * ./widgets/위젯/conf/info.xml에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // 템플릿 파일을 지정
     if (Context::get('is_logged')) {
         $tpl_file = 'login_info';
     } else {
         $tpl_file = 'login_form';
     }
     // 회원 관리 정보를 받음
     $oModuleModel =& getModel('module');
     $this->member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $this->member_config);
     // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
     $ssl_mode = false;
     if ($this->member_config->enable_ssl == 'Y') {
         if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #4
0
 /**
  * @brief 모듈의 추가 설정에서 댓글 설정을 하는 form 추가
  **/
 function triggerDispCommentAdditionSetup(&$obj)
 {
     $current_module_srl = Context::get('module_srl');
     $current_module_srls = Context::get('module_srls');
     if (!$current_module_srl && !$current_module_srls) {
         // 선택된 모듈의 정보를 가져옴
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
         if (!$current_module_srl) {
             return new Object();
         }
     }
     // 댓글 설정을 구함
     $oCommentModel =& getModel('comment');
     $comment_config = $oCommentModel->getCommentConfig($current_module_srl);
     Context::set('comment_config', $comment_config);
     // 그룹 목록을 구함
     $oMemberModel =& getModel('member');
     $group_list = $oMemberModel->getGroups();
     Context::set('group_list', $group_list);
     // 템플릿 파일 지정
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'comment_module_config');
     $obj .= $tpl;
     return new Object();
 }
 /**
  * @brief 위젯의 실행 부분
  *
  * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     // 대상 모듈 (mid_list는 기존 위젯의 호환을 위해서 처리하는 루틴을 유지. module_srls로 위젯에서 변경)
     $oModuleModel =& getModel('module');
     if ($args->mid_list) {
         $mid_list = explode(",", $args->mid_list);
         if (count($mid_list)) {
             $module_srls = $oModuleModel->getModuleSrlByMid($mid_list);
             if (count($module_srls)) {
                 $args->module_srls = implode(',', $module_srls);
             } else {
                 $args->module_srls = null;
             }
         }
     }
     // 제목
     $title = $args->title;
     // 정렬 대상
     $order_target = $args->order_target;
     if (!in_array($order_target, array('list_order', 'update_order'))) {
         $order_target = 'list_order';
     }
     // 정렬 순서
     $order_type = $args->order_type;
     if (!in_array($order_type, array('asc', 'desc'))) {
         $order_type = 'asc';
     }
     // 출력된 목록 수
     $list_count = (int) $args->list_count;
     if (!$list_count) {
         $list_count = 5;
     }
     // 대상 모듈이 선택되어 있지 않으면 해당 사이트의 전체 모듈을 대상으로 함
     $site_module_info = Context::get('site_module_info');
     if ($args->module_srls) {
         $obj->module_srl = $args->module_srls;
     } else {
         if ($site_module_info) {
             $obj->site_srl = (int) $site_module_info->site_srl;
         }
     }
     $obj->sort_index = $order_target;
     $obj->list_count = $list_count;
     // trackback 모듈의 model 객체를 받아서 getTrackbackList() method를 실행
     $oTrackbackModel =& getModel('trackback');
     $output = $oTrackbackModel->getNewestTrackbackList($obj);
     $widget_info->title = $title;
     $widget_info->trackback_list = $output->data;
     preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i', $args->style, $matches);
     $widget_info->width = trim($matches[3][0]);
     Context::set('widget_info', $widget_info);
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // 템플릿 파일을 지정
     $tpl_file = 'list';
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
 /**
  * @brief 위젯의 실행 부분
  *
  * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     $banners = array();
     for ($i = 1; $i <= 10; $i++) {
         $array = array();
         foreach (array('url', 'img', 'target') as $type) {
             $key = $type . "_" . $i;
             $array[$type] = $args->{$key};
         }
         if ($array['img']) {
             array_push($banners, $array);
         }
     }
     shuffle($banners);
     $rand_keys = array_rand($banners, 2);
     $widget_info->url_1 = $banners[$rand_keys[0]]['url'];
     $widget_info->img_1 = $banners[$rand_keys[0]]['img'];
     $widget_info->target_1 = $banners[$rand_keys[0]]['target'];
     $widget_info->url_2 = $banners[$rand_keys[1]]['url'];
     $widget_info->img_2 = $banners[$rand_keys[1]]['img'];
     $widget_info->target_2 = $banners[$rand_keys[1]]['target'];
     Context::set('widget_info', $widget_info);
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     $tpl_file = 'skin';
     // 위젯 스킨의 템플릿 파일명을 지칭함. 해당 위젯의 스킨 파일은 이 이름을 써야 동작함.
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #7
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));
	}
예제 #8
0
 /**
  * Get the board module admin simple setting page
  * @return void
  */
 public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl)
 {
     if (!$moduleSrl) {
         return;
     }
     Context::set('module_srl', $moduleSrl);
     // default module info setting
     $oModuleModel = getModel('module');
     $moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
     $moduleInfo->use_status = explode('|@|', $moduleInfo->use_status);
     if ($moduleInfo) {
         Context::set('module_info', $moduleInfo);
     }
     // get document status list
     $oDocumentModel = getModel('document');
     $documentStatusList = $oDocumentModel->getStatusNameList();
     Context::set('document_status_list', $documentStatusList);
     // set order target list
     foreach ($this->order_target as $key) {
         $order_target[$key] = Context::getLang($key);
     }
     $order_target['list_order'] = Context::getLang('document_srl');
     $order_target['update_order'] = Context::getLang('last_update');
     Context::set('order_target', $order_target);
     // for advanced language & url
     $oAdmin = getClass('admin');
     Context::set('setupUrl', $setupUrl);
     // Extract admin ID set in the current module
     $admin_member = $oModuleModel->getAdminId($moduleSrl);
     Context::set('admin_member', $admin_member);
     $oTemplate =& TemplateHandler::getInstance();
     $html = $oTemplate->compile($this->module_path . 'tpl/', 'board_setup_basic');
     return $html;
 }
예제 #9
0
 /**
  * @brief Widget execution
  * Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
  * After generating the result, do not print but return it.
  */
 function proc($args)
 {
     // Set a path of the template skin (values of skin, colorset settings)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // Specify a template file
     if (Context::get('is_logged')) {
         $tpl_file = 'login_info';
     } else {
         $tpl_file = 'login_form';
     }
     // Get the member configuration
     $oModuleModel = getModel('module');
     $this->member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $this->member_config);
     // Set a flag to check if the https connection is made when using SSL and create https url
     $ssl_mode = false;
     $useSsl = Context::getSslStatus();
     if ($useSsl != 'none') {
         if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     // Compile a template
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #10
0
 /**
  * @brief Editor of the components separately if you use a unique code to the html code for a method to change
  *
  * Images and multimedia, seolmundeung unique code is required for the editor component added to its own code, and then
  * DocumentModule:: transContent() of its components transHtml() method call to change the html code for your own
  */
 function transHTML($xml_obj)
 {
     $args = new stdClass();
     $args->poll_srl = $xml_obj->attrs->poll_srl;
     $skin = $xml_obj->attrs->skin;
     if (!$skin) {
         $skin = 'default';
     }
     $args->skin = $skin;
     preg_match('/width([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches);
     $width = $matches[2];
     if (!$width) {
         $width = 400;
     }
     $args->style = sprintf('width:%dpx', $width);
     // Set a path of the template skin (values of skin, colorset settings)
     $tpl_path = sprintf('%sskins/%s', _XE_PATH_ . 'widgets/pollWidget/', $args->skin);
     $tpl_file = 'pollview';
     Context::set('colorset', $args->colorset);
     Context::set('poll_srl', $args->poll_srl);
     Context::set('style', $args->style);
     // Compile a template
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #11
0
 function proc($args)
 {
     //���ø� ��ü���� �� ��Ų���� ������
     $oTemplate =& TemplateHandler::getInstance();
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     return $oTemplate->compile($tpl_path, "modalpopup");
 }
예제 #12
0
 public function testCompileDirect()
 {
     $tmpl = TemplateHandler::getInstance();
     $result = $tmpl->compileDirect(dirname(__FILE__), 'sample.html');
     $result = trim($result);
     $this->assertEquals($result, $this->prefix . '<?php if($__Context->has_blog){ ?><a href="http://mygony.com">Taggon\'s blog</a><?php } ?>');
 }
 function getPopupContent()
 {
     // 템플릿을 미리 컴파일해서 컴파일된 소스를 return
     $tpl_path = $this->component_path . 'tpl';
     $tpl_file = 'popup.html';
     $script_path = $this->component_path . 'syntaxhighlighter/scripts/';
     $brushes = array();
     foreach ($this->brushes as $item) {
         $brush_autoload[] = '"' . $item[2] . ' ' . $script_path . 'shBrush' . $item[1] . '.js"';
     }
     if (!$this->theme) {
         $this->theme = 'Default';
     }
     $theme_file = $this->component_path . 'syntaxhighlighter/styles/shCore' . $this->theme . '.css';
     if (!file_exists($theme_file)) {
         $theme_file = $this->component_path . 'syntaxhighlighter/styles/shCoreDjango.css';
     }
     Context::set('tpl_path', $tpl_path);
     Context::set('script_path', $script_path);
     Context::set('brushes', $this->brushes);
     Context::set('brush_autoload', implode(',', $brush_autoload));
     Context::addCSSFile($theme_file);
     Context::addJsFile($script_path . 'shCore.js');
     Context::addJsFile($script_path . 'shAutoloader.js');
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #14
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;
 }
 /**
  * the html to select colorset of the skin
  * @return void
  */
 function getCommunicationAdminColorset()
 {
     $skin = Context::get('skin');
     $type = Context::get('type') == 'P' ? 'P' : 'M';
     Context::set('type', $type);
     if ($type == 'P') {
         $dir = 'skins';
     } else {
         $dir = 'm.skins';
     }
     if (!$skin) {
         $tpl = "";
     } else {
         $oModuleModel = getModel('module');
         $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
         Context::set('skin_info', $skin_info);
         $oModuleModel = getModel('module');
         $communication_config = $oModuleModel->getModuleConfig('communication');
         if (!$communication_config->colorset) {
             $communication_config->colorset = "white";
         }
         Context::set('communication_config', $communication_config);
         $security = new Security();
         $security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
         $security->encodeHTML('skin_info.colorset..name');
         $oTemplate = TemplateHandler::getInstance();
         $tpl = $oTemplate->compile($this->module_path . 'tpl', 'colorset_list');
     }
     $this->add('tpl', $tpl);
     $this->add('type', $type);
 }
예제 #16
0
 /**
  * @brief 위젯의 실행 부분
  *
  * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     $list_count = (int) $args->list_count;
     if (!$list_count) {
         $list_count = 5;
     }
     $use_mid = $args->use_mid;
     if ($use_mid == 'mid') {
         $mid = Context::get('mid');
     } else {
         $mid = null;
     }
     $obj->list_count = $list_count;
     $obj->mid = $mid;
     // session model 객체 생성
     $oSessionModel =& getModel('session');
     $output = $oSessionModel->getLoggedMembers($obj);
     $widget_info->member_list = $output->data;
     $widget_info->logged_member_count = $output->total_count;
     Context::set('widget_info', $widget_info);
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // 템플릿 파일을 지정
     $tpl_file = 'list';
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     $output = $oTemplate->compile($tpl_path, $tpl_file);
     return $output;
 }
예제 #17
0
 /**
  * Add a form fot comment setting on the additional setting of module
  * @param string $obj
  * @return string
  */
 function triggerDispCommentAdditionSetup(&$obj)
 {
     $current_module_srl = Context::get('module_srl');
     $current_module_srls = Context::get('module_srls');
     if (!$current_module_srl && !$current_module_srls) {
         // get information of the selected module
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
         if (!$current_module_srl) {
             return new Object();
         }
     }
     // get the comment configuration
     $oCommentModel = getModel('comment');
     $comment_config = $oCommentModel->getCommentConfig($current_module_srl);
     Context::set('comment_config', $comment_config);
     // get a group list
     $oMemberModel = getModel('member');
     $group_list = $oMemberModel->getGroups();
     Context::set('group_list', $group_list);
     // Set a template file
     $oTemplate = TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'comment_module_config');
     $obj .= $tpl;
     return new Object();
 }
예제 #18
0
 /**
  * This is for additional configuration for service module
  * It only receives file configurations
  *
  * @param string $obj The html string of page of addition setup of module
  * @return Object
  */
 function triggerDispFileAdditionSetup(&$obj)
 {
     $current_module_srl = Context::get('module_srl');
     $current_module_srls = Context::get('module_srls');
     if (!$current_module_srl && !$current_module_srls) {
         // Get information of the current module
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
         if (!$current_module_srl) {
             return new Object();
         }
     }
     // Get file configurations of the module
     $oFileModel = getModel('file');
     $file_config = $oFileModel->getFileModuleConfig($current_module_srl);
     Context::set('file_config', $file_config);
     // Get a permission for group setting
     $oMemberModel = getModel('member');
     $site_module_info = Context::get('site_module_info');
     $group_list = $oMemberModel->getGroups($site_module_info->site_srl);
     Context::set('group_list', $group_list);
     // Set a template file
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'file_module_config');
     $obj .= $tpl;
     return new Object();
 }
예제 #19
0
 /**
  * @brief 서비스형 모듈의 추가 설정을 위한 부분
  * file의 사용 형태에 대한 설정만 받음
  **/
 function triggerDispFileAdditionSetup(&$obj)
 {
     $current_module_srl = Context::get('module_srl');
     $current_module_srls = Context::get('module_srls');
     if (!$current_module_srl && !$current_module_srls) {
         // 선택된 모듈의 정보를 가져옴
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
         if (!$current_module_srl) {
             return new Object();
         }
     }
     // 선택된 모듈의 file설정을 가져옴
     $oFileModel =& getModel('file');
     $file_config = $oFileModel->getFileModuleConfig($current_module_srl);
     Context::set('file_config', $file_config);
     // 그룹의 설정을 위한 권한 가져오기
     $oMemberModel =& getModel('member');
     $site_module_info = Context::get('site_module_info');
     $group_list = $oMemberModel->getGroups($site_module_info->site_srl);
     Context::set('group_list', $group_list);
     // 템플릿 파일 지정
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'file_module_config');
     $obj .= $tpl;
     return new Object();
 }
예제 #20
0
 /**
  * @brief Additional configurations for a service module
  * Receive the form for the form used by point
  */
 function triggerDispPointAdditionSetup(&$obj)
 {
     $current_module_srl = Context::get('module_srl');
     $current_module_srls = Context::get('module_srls');
     if (!$current_module_srl && !$current_module_srls) {
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
         if (!$current_module_srl) {
             return new Object();
         }
     }
     // Get the configuration information
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('point');
     if ($current_module_srl) {
         $module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl);
         if (!$module_config) {
             $module_config['insert_document'] = $config->insert_document;
             $module_config['insert_comment'] = $config->insert_comment;
             $module_config['upload_file'] = $config->upload_file;
             $module_config['download_file'] = $config->download_file;
             $module_config['read_document'] = $config->read_document;
             $module_config['voted'] = $config->voted;
             $module_config['blamed'] = $config->blamed;
         }
     }
     $module_config['module_srl'] = $current_module_srl;
     $module_config['point_name'] = $config->point_name;
     Context::set('module_config', $module_config);
     // Set the template file
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'point_module_config');
     $obj .= $tpl;
     return new Object();
 }
 /**
  * @brief Widget execution
  * Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
  * After generating the result, do not print but return it.
  */
 public function proc($args)
 {
     $skin = $args->skin ? $args->skin : 'default';
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $skin);
     Context::set('member_total', $this->getTotalMemberCount());
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, 'index');
 }
예제 #22
0
 function _compileInfo($skin)
 {
     $oSocialxeModel =& getModel('socialxe');
     // 언어 로드
     Context::loadLang($this->widget_path . 'lang');
     // 서비스 목록
     $provider_list = $oSocialxeModel->getProviderList();
     Context::set('provider_list', $provider_list);
     // 서비스 로그인 상태
     $logged_provider = $oSocialxeModel->loggedProviderList();
     $logged_count = count($logged_provider);
     foreach ($provider_list as $provider) {
         $provider_is_logged[$provider] = $oSocialxeModel->isLogged($provider);
     }
     if (!isset($provider_is_logged)) {
         $provider_is_logged = array();
     }
     Context::set('provider_is_logged', $provider_is_logged);
     Context::set('logged_provider', $logged_provider);
     Context::set('logged_count', $logged_count);
     // 로그인한 서비스의 닉네임들
     foreach ($logged_provider as $provider) {
         $nick_names[$provider] = $oSocialxeModel->getProviderNickName($provider);
     }
     Context::set('nick_names', $nick_names);
     // 대표 계정
     $master_provider = $oSocialxeModel->getMasterProvider();
     Context::set('master_provider', $master_provider);
     // 대표 계정의 프로필 이미지
     $profile_image = $oSocialxeModel->getProfileImage();
     Context::set('profile_image', $profile_image);
     // 대표 계정의 닉네임
     $nick_name = $oSocialxeModel->getNickName();
     Context::set('nick_name', $nick_name);
     // 부계정
     $slave_provider = $oSocialxeModel->getSlaveProvider();
     Context::set('slave_provider', $slave_provider);
     // 부계정의 프로필 이미지
     $slave_profile_image = $oSocialxeModel->getSlaveProfileImage();
     Context::set('slave_profile_image', $slave_profile_image);
     // 부계정의 닉네임
     $slave_nick_name = $oSocialxeModel->getSlaveNickName();
     Context::set('slave_nick_name', $slave_nick_name);
     // 자동 로그인 키
     $auto_login_key = $oSocialxeModel->getAutoLoginKey();
     Context::set('auto_login_key', $auto_login_key);
     // 자동 로그인 키 요청 주소
     $auto_login_key_url = $oSocialxeModel->getAutoLoginKeyUrl();
     Context::set('auto_login_key_url', $auto_login_key_url);
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $skin);
     Context::set('skin', $skin);
     // 템플릿 파일을 지정
     $tpl_file = 'info';
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
 function getNstore_digitalAdminDeletePeriods()
 {
     $oNstore_digitalModel =& getModel('nstore_digital');
     $period_info_arr = $oNstore_digitalModel->getPeriodsInfo(Context::get('period_srl'));
     Context::set('period_info_arr', $period_info_arr);
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'form_delete_periods');
     $this->add('tpl', str_replace("\n", " ", $tpl));
 }
예제 #24
0
 function getNstoreAdminDeleteOrders()
 {
     $oNstoreModel =& getModel('nstore');
     $order_info_arr = $oNstoreModel->getOrdersInfo(Context::get('order_srl'));
     Context::set('order_info_arr', $order_info_arr);
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'form_delete_orders');
     $this->add('tpl', str_replace("\n", " ", $tpl));
 }
예제 #25
0
 /**
  * @brief 위젯의 실행 부분
  *
  * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
  * 결과를 만든후 print가 아니라 return 해주어야 한다
  **/
 function proc($args)
 {
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     $tpl_file = 'language_select';
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #26
0
 /**
  * @brief popup window to display in popup window request is to add content
  */
 function getPopupContent()
 {
     // Pre-compiled source code to compile template return to
     $tpl_path = $this->component_path . 'tpl';
     $tpl_file = 'popup.html';
     Context::set("tpl_path", $tpl_path);
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #27
0
 /**
  * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
  **/
 function getPopupContent()
 {
     // 템플릿을 미리 컴파일해서 컴파일된 소스를 return
     $tpl_path = $this->component_path . 'tpl';
     $tpl_file = 'popup.html';
     Context::set("tpl_path", $tpl_path);
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #28
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;
     }
     $mid_list = explode(",", $args->mid_list);
     $subject_cut_size = $args->subject_cut_size;
     if (!$subject_cut_size) {
         $subject_cut_size = 0;
     }
     $oMemberModel =& getModel('member');
     $this->oPointModel =& getModel('point');
     $obj->list_count = $list_count;
     $obj->is_admin = $args->without_admin == "true" ? "N" : "";
     $output = new Object();
     if ($args->with_group || $args->without->group) {
         if ($args->with_group) {
             $obj->selected_group_srl = $args->with_group;
         } else {
             $obj->selected_group_without_srl = $args->without_group;
         }
         $output = executeQuery('widgets.rank_point.getMemberListWithinGroup', $obj);
     } else {
         //전체 포인트 목록을 구해옴
         $output = executeQuery("widgets.rank_point.getMemberList", $obj);
     }
     // 오류가 생기면 그냥 무시
     if (!$output->toBool()) {
         return;
     }
     // 결과가 있으면 각 문서 객체화를 시킴
     if (count($output->data)) {
         foreach ($output->data as $key => $val) {
             $point_list[$key] = $val;
         }
     } else {
         $point_list = array();
     }
     $widget_info->title = $title;
     $widget_info->list_count = $list_count;
     $widget_info->point_list = $point_list;
     $widget_info->subject_cut_size = $subject_cut_size;
     $widget_info->debug = $debug;
     Context::set('widget_info', $widget_info);
     // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // 템플릿 파일을 지정
     $tpl_file = 'list';
     // 템플릿 컴파일
     $oTemplate =& TemplateHandler::getInstance();
     $output = $oTemplate->compile($tpl_path, $tpl_file);
     return $output;
 }
예제 #29
0
 function getNmileageAdminMinusMileage()
 {
     $oModuleModel = getModel('module');
     $module_srl = Context::get('module_srl');
     $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
     Context::set('module_info', $module_info);
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'form_minus_mileage');
     $this->add('tpl', str_replace("\n", " ", $tpl));
 }
 /**
  * module delete form 가져오기
  */
 function getPurplebookAdminDeleteModInst()
 {
     $oModuleModel =& getModel('module');
     $module_srl = Context::get('module_srl');
     $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
     Context::set('module_info', $module_info);
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'form_delete_modinst');
     $this->add('tpl', str_replace("\n", " ", $tpl));
 }