/**
  * Show details for specified transaction
  */
 private function showTransactionDetails()
 {
     $manager = ShopTransactionsManager::getInstance();
     $buyer_manager = ShopBuyersManager::getInstance();
     $address_manager = ShopDeliveryAddressManager::getInstance();
     $id = fix_id($_REQUEST['id']);
     $transaction = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id));
     $buyer = $buyer_manager->getSingleItem($buyer_manager->getFieldNames(), array('id' => $transaction->buyer));
     $address = $address_manager->getSingleItem($address_manager->getFieldNames(), array('id' => $transaction->address));
     $full_address = "{$address->name}\n\n{$address->street}\n";
     $full_address .= "{$address->zip} {$address->city}\n";
     if (empty($address->state)) {
         $full_address .= $address->country;
     } else {
         $full_address .= "{$address->state}, {$address->country}";
     }
     $params = array('id' => $transaction->id, 'uid' => $transaction->uid, 'type' => $transaction->type, 'type_string' => '', 'status' => $transaction->status, 'currency' => $transaction->currency, 'handling' => $transaction->handling, 'shipping' => $transaction->shipping, 'timestamp' => $transaction->timestamp, 'delivery_method' => $transaction->delivery_method, 'remark' => $transaction->remark, 'total' => $transaction->total, 'first_name' => $buyer->first_name, 'last_name' => $buyer->last_name, 'email' => $buyer->email, 'address_name' => $address->name, 'address_street' => $address->street, 'address_city' => $address->city, 'address_zip' => $address->zip, 'address_state' => $address->state, 'address_country' => $address->country, 'full_address' => $full_address);
     $template = new TemplateHandler('transaction_details.xml', $this->path . 'templates/');
     // register tag handler
     $template->registerTagHandler('_item_list', $this, 'tag_TransactionItemList');
     $template->registerTagHandler('_transaction_status', $this, 'tag_TransactionStatus');
     $template->restoreXML();
     $template->setLocalParams($params);
     $template->parse();
 }
Exemple #2
0
 function display()
 {
     require_once "include/Expressions/Dependency.php";
     require_once "include/TemplateHandler/TemplateHandler.php";
     $th = new TemplateHandler();
     $depScript = $th->createDependencyJavascript(array('phone_office' => array('calculated' => true, "formula" => 'add(strlen($name), $employees)', "enforced" => true)), array(), "EditView");
     $smarty = new Sugar_Smarty();
     $smarty->assign("dependencies", $depScript);
     $smarty->display('modules/ExpressionEngine/tpls/cfTest.tpl');
 }
Exemple #3
0
 /**
  * Embed flash player with specified parameters
  *
  * @param string $url
  * @param string $target_id
  * @param integer $width
  * @param integer $height
  * @param array $flash_vars
  * @param array $params
  */
 public function embedSWF($url, $target_id, $width, $height, $flash_vars = array(), $params = array())
 {
     $template = new TemplateHandler('embed.xml', $this->path . 'templates/');
     $template->setMappedModule($this->name);
     $p_flashvars = json_encode($flash_vars);
     $p_params = json_encode($params);
     $script = "swfobject.embedSWF('{$url}', '{$target_id}', '{$width}', '{$height}', '{$this->flash_version}', null, {$p_flashvars}, {$p_params});";
     $params = array('params' => $p_params, 'flash_vars' => $p_flashvars, 'url' => $url, 'id' => $target_id, 'width' => $width, 'height' => $height, 'version' => $this->flash_version, 'script' => $script);
     $template->restoreXML();
     $template->setLocalParams($params);
     $template->parse();
 }
Exemple #4
0
 public function display()
 {
     global $current_user;
     $this->bean->custom_fields->retrieve();
     unset($this->dv->defs['templateMeta']['form']['buttons'][1]);
     unset($this->dv->defs['templateMeta']['form']['buttons'][2]);
     unset($this->dv->defs['templateMeta']['form']['buttons'][3]);
     unset($this->dv->defs['templateMeta']['form']['buttons'][4]);
     $th = new TemplateHandler();
     $th->clearCache($this->module);
     parent::display();
 }
 function procSmartPhone(&$oSmartPhone)
 {
     $prev_date = Context::get('prev_date');
     if ($prev_date) {
         $oSmartPhone->setPrevUrl(getUrl('date', $prev_date, 'document_srl', ''));
     }
     $next_date = Context::get('next_date');
     if ($next_date) {
         $oSmartPhone->setNextUrl(getUrl('date', $next_date, 'document_srl', ''));
     }
     $oTemplate = new TemplateHandler();
     $content = $oTemplate->compile($this->module_path . 'tpl', 'smartphone');
     $oSmartPhone->setContent($content);
 }
 /**
  * @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;
 }
 /**
  * @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;
 }
Exemple #8
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();
 }
 /**
  * @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);
 }
Exemple #10
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 위젯의 실행 부분
  *
  * ./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 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);
 }
 /**
  * @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);
 }
 /**
  * @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);
 }
Exemple #15
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();
 }
Exemple #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));
	}
 function procSmartPhone(&$oSmartPhone)
 {
     if (!$this->grant->access) {
         return $oSmartPhone->setContent(Context::getLang('msg_not_permitted'));
     }
     // 위젯을 1렬로 정렬
     preg_match_all('!(<img)([^\\>]*)(widget=)([^\\>]*?)(\\>)!is', $this->module_info->content, $matches);
     $content = '';
     for ($i = 0, $c = count($matches[0]); $i < $c; $i++) {
         $content .= preg_replace('/ style\\=\\"([^\\"]+)\\" /i', ' style="overflow:hidden;clear:both;margin:0 0 20px 0; _margin-right:10px;" ', $matches[0][$i]) . "\n\n";
     }
     Context::set('content', $content);
     $oTemplate = new TemplateHandler();
     $content = $oTemplate->compile($this->module_path . 'tpl', 'smartphone');
     $oSmartPhone->setContent($content);
 }
 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);
 }
 /**
  * @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);
 }
 function proc($args)
 {
     //���ø� ��ü���� �� ��Ų���� ������
     $oTemplate =& TemplateHandler::getInstance();
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     return $oTemplate->compile($tpl_path, "modalpopup");
 }
Exemple #21
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();
 }
 /**
  * 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);
 }
 /**
  * clearAll
  * Helper function to remove all .tpl files in the cache directory
  *
  */
 function clearAll()
 {
     global $beanList;
     foreach ($beanList as $module_dir => $object_name) {
         TemplateHandler::clearCache($module_dir);
     }
 }
Exemple #24
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 } ?>');
 }
Exemple #25
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();
 }
 /**
  * @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);
 }
 /**
  * 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;
 }
 /**
  * @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');
 }
 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);
 }
 /**
  * @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);
 }