/**
  * @brief 관리자 페이지의 신고 목록 보기
  **/
 function dispCommentAdminDeclared()
 {
     // 목록을 구하기 위한 옵션
     $args->page = Context::get('page');
     ///< 페이지
     $args->list_count = 30;
     ///< 한페이지에 보여줄 글 수
     $args->page_count = 10;
     ///< 페이지 네비게이션에 나타날 페이지의 수
     $args->sort_index = 'comment_declared.declared_count';
     ///< 소팅 값
     $args->order_type = 'desc';
     ///< 소팅 정렬 값
     // 목록을 구함
     $declared_output = executeQuery('comment.getDeclaredList', $args);
     if ($declared_output->data && count($declared_output->data)) {
         $comment_list = array();
         $oCommentModel =& getModel('comment');
         foreach ($declared_output->data as $key => $comment) {
             $comment_list[$key] = new commentItem();
             $comment_list[$key]->setAttribute($comment);
         }
         $declared_output->data = $comment_list;
     }
     // 템플릿에 쓰기 위해서 comment_model::getCommentList() 의 return object에 있는 값들을 세팅
     Context::set('total_count', $declared_output->total_count);
     Context::set('total_page', $declared_output->total_page);
     Context::set('page', $declared_output->page);
     Context::set('comment_list', $declared_output->data);
     Context::set('page_navigation', $declared_output->page_navigation);
     // 템플릿 지정
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('declared_list');
 }
 /**
  * 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);
 }
	/**
	 * Skin Settings
	 *
	 * @return Object
	 */
	function dispStore_searchAdminSkinInfo()
	{
		$oModuleModel = getModel('module');
		$module_srl = Context::get('module_srl');
		// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
		if($module_srl) 
		{
			$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
			if(!$module_info) 
			{
				Context::set('module_srl','');
				$this->act = 'list';
			}
			else
			{
				$oModuleModel->syncModuleToSite($module_info);
				$this->module_info = $module_info;
				Context::set('module_info',$module_info);
			}
		}

		// 공통 모듈 권한 설정 페이지 호출
		$oModuleAdminModel = getAdminModel('module');
		$skin_content = $oModuleAdminModel->getModuleSkinHTML($this->module_info->module_srl);
		Context::set('skin_content', $skin_content);
		$this->setTemplateFile('skininfo');
	}
Example #4
0
 /**
  * Report an improper comment
  * @return void
  */
 function dispCommentDeclare()
 {
     $this->setLayoutFile('popup_layout');
     $comment_srl = Context::get('target_srl');
     $oMemberModel = getModel('member');
     // A message appears if the user is not logged-in
     if (!$oMemberModel->isLogged()) {
         return $this->stop('msg_not_logged');
     }
     // Create the comment object.
     $oCommentModel = getModel('comment');
     // Creates an object for displaying the selected comment
     $oComment = $oCommentModel->getComment($comment_srl);
     if (!$oComment->isExists()) {
         return new Object(-1, 'msg_invalid_request');
     }
     // Check permissions
     if (!$oComment->isAccessible()) {
         return new Object(-1, 'msg_not_permitted');
     }
     // Browser title settings
     Context::set('target_comment', $oComment);
     Context::set('target_srl', $comment_srl);
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('declare_comment');
 }
Example #5
0
function __makeMenu(&$list, $parent_srl)
{
    $oMenuAdminController = getAdminController('menu');
    foreach ($list as $idx => &$item) {
        Context::set('parent_srl', $parent_srl, TRUE);
        Context::set('menu_name', $item['menu_name'], TRUE);
        Context::set('module_type', $item['module_type'], TRUE);
        Context::set('module_id', $item['module_id'], TRUE);
        if ($item['is_shortcut'] === 'Y') {
            Context::set('is_shortcut', $item['is_shortcut'], TRUE);
            Context::set('shortcut_target', $item['shortcut_target'], TRUE);
        } else {
            Context::set('is_shortcut', 'N', TRUE);
            Context::set('shortcut_target', null, TRUE);
        }
        $output = $oMenuAdminController->procMenuAdminInsertItem();
        if ($output instanceof Object && !$output->toBool()) {
            return $output;
        }
        $menu_srl = $oMenuAdminController->get('menu_item_srl');
        $item['menu_srl'] = $menu_srl;
        if ($item['list']) {
            __makeMenu($item['list'], $menu_srl);
        }
    }
}
Example #6
0
 function getNewsFromAgency()
 {
     //Retrieve recent news and set them into context
     $newest_news_url = sprintf("http://store.nurigo.net/?module=newsagency&act=getNewsagencyArticle&inst=notice&top=6&loc=%s", _XE_LOCATION_);
     $cache_file = sprintf("%sfiles/cache/license_news.%s.cache.php", _XE_PATH_, _XE_LOCATION_);
     if (!file_exists($cache_file) || filemtime($cache_file) + 60 * 60 < time()) {
         // Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing textmessageistration page
         // Ensure to access the textmessageistration page even though news cannot be displayed
         FileHandler::writeFile($cache_file, '');
         FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL' => getFullUrl('')));
     }
     if (file_exists($cache_file)) {
         $oXml = new XmlParser();
         $buff = $oXml->parse(FileHandler::readFile($cache_file));
         $item = $buff->zbxe_news->item;
         if ($item) {
             if (!is_array($item)) {
                 $item = array($item);
             }
             foreach ($item as $key => $val) {
                 $obj = null;
                 $obj->title = $val->body;
                 $obj->date = $val->attrs->date;
                 $obj->url = $val->attrs->url;
                 $news[] = $obj;
             }
             Context::set('news', $news);
         }
         Context::set('released_version', $buff->zbxe_news->attrs->released_version);
         Context::set('download_link', $buff->zbxe_news->attrs->download_link);
     }
 }
Example #7
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();
 }
Example #8
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));
	}
 /**
  * @brief XML 파일을 업로드하는 form 출력
  **/
 function dispImporterAdminContent()
 {
     $this->setTemplatePath($this->module_path . 'tpl');
     $source_type = Context::get('source_type');
     switch ($source_type) {
         case 'member':
             $template_filename = "member";
             break;
         case 'ttxml':
             $oModuleModel =& getModel('module');
             $mid_list = $oModuleModel->getMidList();
             Context::set('mid_list', $mid_list);
             $template_filename = "ttxml";
             break;
         case 'module':
             $oModuleModel =& getModel('module');
             $mid_list = $oModuleModel->getMidList();
             Context::set('mid_list', $mid_list);
             $template_filename = "module";
             break;
         case 'message':
             $template_filename = "message";
             break;
         case 'sync':
             $template_filename = "sync";
             break;
         default:
             $template_filename = "index";
             break;
     }
     $this->setTemplateFile($template_filename);
 }
 /**
  * @brief epay.getPaymentForm 에서 호출됨, 이니시스 모바일 결제폼 출력
  */
 function dispInipaymobileForm()
 {
     $oEpayController =& getController('epay');
     // get products info using cartnos
     $reviewOutput = $oEpayController->reviewOrder();
     if (!$reviewOutput->toBool()) {
         return $reviewOutput;
     }
     Context::set('review_form', $reviewOutput->review_form);
     Context::set('item_name', $reviewOutput->item_name);
     Context::set('price', $reviewOutput->price);
     Context::set('transaction_srl', $reviewOutput->transaction_srl);
     Context::set('order_srl', $reviewOutput->order_srl);
     Context::set('purchaser_name', $reviewOutput->purchaser_name);
     Context::set('purchaser_email', $reviewOutput->purchaser_email);
     Context::set('purchaser_telnum', $reviewOutput->purchaser_telnum);
     /**
      * next_url 및 return_url 에 url 구성은 http://domain/directory?var=val 형식으로 ?var1=val1&var2=val2 처럼 &은 허용되지 않는다. 그래서 부득이하게 n_page 에 transaction_srl을 담아오면 next_url로, r_page에 transaction_srl을 담아오면 return_url로 처리한다.
      */
     $transaction_srl = $reviewOutput->transaction_srl;
     // 가상계좌, 안심클릭시 (n_page)
     Context::set('next_url', getNotEncodedFullUrl('') . $this->module_info->mid . '?n_page=' . $transaction_srl);
     // ISP 결제시 (r_page), 결제처리는 noti_url이 호출되어 처리되므로 여기서는 그냥 결과만 보여줌
     Context::set('return_url', getNotEncodedFullUrl('') . $this->module_info->mid . '?r_page=' . $transaction_srl);
     // ISP 결제시 처리 URL 지정
     Context::set('noti_url', getNotEncodedFullUrl('') . $this->module_info->mid . '?noti_page=' . $transaction_srl);
     $this->setTemplateFile('formdata');
 }
Example #11
0
 /**
  * Admin page 
  *
  * @return Object
  */
 function dispCounterAdminIndex()
 {
     // set today's if no date is given
     $selected_date = (int) Context::get('selected_date');
     if (!$selected_date) {
         $selected_date = date("Ymd");
     }
     Context::set('selected_date', $selected_date);
     // create the counter model object
     $oCounterModel = getModel('counter');
     // get a total count and daily count
     $site_module_info = Context::get('site_module_info');
     $status = $oCounterModel->getStatus(array(0, $selected_date), $site_module_info->site_srl);
     Context::set('total_counter', $status[0]);
     Context::set('selected_day_counter', $status[$selected_date]);
     // get data by time, day, month, and year
     $type = Context::get('type');
     if (!$type) {
         $type = 'day';
         Context::set('type', $type);
     }
     $detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl);
     Context::set('detail_status', $detail_status);
     // display
     $this->setTemplateFile('index');
 }
Example #12
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();
 }
 /**
  * configuration to manage messages and friends
  * @return void
  */
 function dispCommunicationAdminConfig()
 {
     // Creating an object
     $oEditorModel = getModel('editor');
     $oModuleModel = getModel('module');
     $oLayoutModel = getModel('layout');
     $oCommunicationModel = getModel('communication');
     // get the configurations of communication module
     Context::set('config', $oCommunicationModel->getConfig());
     // get a list of layout
     Context::set('layout_list', $oLayoutModel->getLayoutList());
     // get a list of editor skins
     Context::set('editor_skin_list', $oEditorModel->getEditorSkinList());
     // get a list of communication skins
     Context::set('skin_list', $oModuleModel->getSkins($this->module_path));
     // get a list of communication skins
     Context::set('mobile_skin_list', $oModuleModel->getSkins($this->module_path, 'm.skins'));
     // Get a layout list
     $layout_list = $oLayoutModel->getLayoutList();
     Context::set('layout_list', $layout_list);
     $mlayout_list = $oLayoutModel->getLayoutList(0, 'M');
     Context::set('mlayout_list', $mlayout_list);
     $security = new Security();
     $security->encodeHTML('config..');
     $security->encodeHTML('layout_list..');
     $security->encodeHTML('editor_skin_list..');
     $security->encodeHTML('skin_list..title');
     $security->encodeHTML('mobile_skin_list..title');
     $oMemberModel = getModel('member');
     $group_list = $oMemberModel->getGroups($this->site_srl);
     Context::set('group_list', $group_list);
     // specify a template
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('index');
 }
 /**
  * @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;
 }
Example #15
0
 /**
  * @brief Display messages
  **/
 function dispMessage()
 {
     // Get configurations (using module model object)
     $oModuleModel =& getModel('module');
     $this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
     if (!$config->skin) {
         $config->skin = 'default';
         $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
     } else {
         //check theme
         $config_parse = explode('|@|', $config->skin);
         if (count($config_parse) > 1) {
             $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
         } else {
             $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
         }
     }
     // Template path
     $this->setTemplatePath($template_path);
     // Get the member configuration
     $member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $member_config);
     // Set a flag to check if the https connection is made when using SSL and create https url
     $ssl_mode = false;
     if ($member_config->enable_ssl == 'Y') {
         if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     Context::set('system_message', nl2br($this->getMessage()));
     $this->setTemplateFile('system_message');
 }
Example #16
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 관리자 페이지 초기화면
  **/
 function dispCounterAdminIndex()
 {
     // 정해진 일자가 없으면 오늘자로 설정
     $selected_date = Context::get('selected_date');
     if (!$selected_date) {
         $selected_date = date("Ymd");
     }
     Context::set('selected_date', $selected_date);
     // counter model 객체 생성
     $oCounterModel =& getModel('counter');
     // 전체 카운터 및 지정된 일자의 현황 가져오기
     $site_module_info = Context::get('site_module_info');
     $status = $oCounterModel->getStatus(array(0, $selected_date), $site_module_info->site_srl);
     Context::set('total_counter', $status[0]);
     Context::set('selected_day_counter', $status[$selected_date]);
     // 시간, 일, 월, 년도별로 데이터 가져오기
     $type = Context::get('type');
     if (!$type) {
         $type = 'day';
         Context::set('type', $type);
     }
     $detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl);
     Context::set('detail_status', $detail_status);
     // 표시
     $this->setTemplateFile('index');
 }
Example #18
0
 /**
  * Trash list
  * @return void
  */
 function dispTrashAdminList()
 {
     $args->page = Context::get('page');
     // /< Page
     $args->list_count = 30;
     // /< the number of posts to display on a single page
     $args->page_count = 5;
     // /< the number of pages that appear in the page navigation
     $args->search_target = Context::get('search_target');
     // /< search (title, contents ...)
     $args->search_keyword = Context::get('search_keyword');
     // /< keyword to search
     $oTrashModel = getModel('trash');
     $output = $oTrashModel->getTrashList($args);
     // for no text comment language and for document manange language
     $oCommentModel =& getModel('comment');
     $oDocumentModel =& getModel('document');
     Context::set('trash_list', $output->data);
     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);
     // 템플릿 파일 지정
     $this->setTemplateFile('trash_list');
 }
 /**
  * 기록한 에러 목록을 표시하는 메소드.
  */
 public function dispErrorLoggerAdminList()
 {
     // 현재 설정을 불러온다.
     Context::set('elconfig', $this->getConfig());
     // 에러 목록을 불러온다.
     $obj = new stdClass();
     $elcount = executeQuery('errorlogger.countErrorLog', $obj);
     $elcount = $elcount->toBool() ? $elcount->data->count : 0;
     $obj->page = $page = Context::get('page') ? Context::get('page') : 1;
     $ellog = executeQuery('errorlogger.getErrorLog', $obj);
     $ellog = $ellog->toBool() ? $ellog->data : array();
     Context::set('elcount', $elcount);
     Context::set('ellog', $ellog);
     // 페이징을 처리한다.
     $paging = new Object();
     $paging->total_count = $elcount;
     $paging->total_page = max(1, ceil($elcount / 20));
     $paging->page = $page;
     $paging->page_navigation = new PageHandler($paging->total_count, $paging->total_page, $page, 10);
     Context::set('paging', $paging);
     Context::set('page', $page);
     // 템플릿을 지정한다.
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('list');
 }
Example #20
0
 /**
  * @brief 스팸필터의 설정 화면
  **/
 function dispLdapAdminConfig()
 {
     $oModel =& getModel('ldap');
     Context::set('config', $oModel->getConfig());
     // 템플릿 파일 지정
     $this->setTemplateFile('index');
 }
Example #21
0
 protected function setUp()
 {
     /**
      * Setup mock data
      **/
     // string
     Context::set('content1', '<strong>Hello, world</strong>');
     Context::set('content2', 'Wow, >_< !');
     // object
     $args = new stdClass();
     $args->prop1 = 'Normal string';
     $args->prop2 = 'He said, "Very nice!"';
     $args->prop3 = '<strong>Strong</strong> Baby';
     Context::set('object1', $args);
     // array
     $arr = array();
     $arr[] = '<span class="first">F</span>irst';
     $arr[] = '<u>S</u>econd';
     $arr[] = '<b>T</b>hird';
     Context::set('array1', $arr);
     // associative array
     $aarr = array();
     $aarr['elem1'] = 'One <ins>1</ins>';
     $aarr['elem2'] = 'Two <del>2</del>';
     $aarr['elem3'] = 'Three <addr>3</addr>';
     Context::set('array2', $aarr);
 }
Example #22
0
 /**
  * @brief Message output
  **/
 function dispMessage()
 {
     // Get configurations (using module model object)
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('message');
     if (!$config->mskin) {
         $config->mskin = 'default';
     }
     // Set the template path
     $template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin);
     // Get the member configuration
     $oModuleModel = getModel('module');
     $member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $member_config);
     // Set a flag to check if the https connection is made when using SSL and create https url
     $ssl_mode = false;
     if ($member_config->enable_ssl == 'Y') {
         if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     Context::set('system_message', nl2br($this->getMessage()));
     Context::set('act', 'procMemberLogin');
     Context::set('mid', '');
     $this->setTemplatePath($template_path);
     $this->setTemplateFile('system_message');
 }
 /**
  * @brief 초기화
  **/
 function init()
 {
     // 서비스 모듈 정보를 얻는다.
     $oSocialxeserverModel =& getModel('socialxeserver');
     $this->service_module_info = $oSocialxeserverModel->getServiceModuleInfo();
     Context::set('service_module_info', $this->service_module_info);
 }
Example #24
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;
 }
 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');
 }
Example #26
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);
 }
 /**
  * @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);
 }
Example #28
0
 /**
  * @brief 메세지 출력 
  **/
 function dispMessage()
 {
     // 설정 정보를 받아옴 (module model 객체를 이용)
     $oModuleModel =& getModel('module');
     $config = $oModuleModel->getModuleConfig('message');
     if (!$config->skin) {
         $config->skin = 'default';
     }
     // 템플릿 경로를 지정
     $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
     // 회원 관리 정보를 받음
     $oModuleModel =& getModel('module');
     $member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $member_config);
     // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
     $ssl_mode = false;
     if ($member_config->enable_ssl == 'Y') {
         if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     Context::set('system_message', nl2br($this->getMessage()));
     $this->setTemplatePath($template_path);
     $this->setTemplateFile('system_message');
 }
Example #29
0
 /**
  * Check whether to use RSS rss url by adding
  *
  * @return Object
  */
 function triggerRssUrlInsert()
 {
     $oModuleModel = getModel('module');
     $total_config = $oModuleModel->getModuleConfig('rss');
     $current_module_srl = Context::get('module_srl');
     $site_module_info = Context::get('site_module_info');
     if (is_array($current_module_srl)) {
         unset($current_module_srl);
     }
     if (!$current_module_srl) {
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
     }
     if (!$current_module_srl) {
         return new Object();
     }
     // Imported rss settings of the selected module
     $oRssModel = getModel('rss');
     $rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
     if ($rss_config->open_rss != 'N') {
         Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
         Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
     }
     if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') {
         if (Context::isAllowRewrite() && !Context::get('vid')) {
             $request_uri = Context::getRequestUri();
             Context::set('general_rss_url', $request_uri . 'rss');
             Context::set('general_atom_url', $request_uri . 'atom');
         } else {
             Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
             Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
         }
     }
     return new Object();
 }
 function dispCommentNotifyAdminList()
 {
     // 목록을 구하기 위한 옵션
     $args->page = Context::get('page');
     ///< 페이지
     $args->sort_index = 'list_order';
     ///< 소팅 값
     $oCommentNotifyModel =& getModel('tccommentnotify');
     $output = $oCommentNotifyModel->GetNotifiedList($args);
     Context::set('total_count', $output->total_count);
     Context::set('total_page', $output->total_page);
     Context::set('page', $output->page);
     $notify_list = array();
     if (!$output->data) {
         $output->data = array();
     }
     foreach ($output->data as $notifyparent) {
         $item = null;
         $item->parent = $notifyparent;
         $item->children = $oCommentNotifyModel->GetChildren($notifyparent->notified_srl);
         $notify_list[] = $item;
     }
     Context::set('notify_list', $notify_list);
     Context::set('page_navigation', $output->page_navigation);
     // 템플릿 지정
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('commentnotify_list');
 }