当前位置: 首页>>代码示例>>PHP>>正文


PHP TemplateHandler::getInstance方法代码示例

本文整理汇总了PHP中TemplateHandler::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateHandler::getInstance方法的具体用法?PHP TemplateHandler::getInstance怎么用?PHP TemplateHandler::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TemplateHandler的用法示例。


在下文中一共展示了TemplateHandler::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: proc

 /**
  * @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);
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:31,代码来源:counter_status.class.php

示例2: proc

 /**
  * @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);
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:37,代码来源:site_info.class.php

示例3: proc

 /**
  * @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);
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:32,代码来源:login_info.class.php

示例4: triggerDispCommentAdditionSetup

 /**
  * @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();
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:29,代码来源:comment.view.php

示例5: proc

 /**
  * @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);
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:66,代码来源:newest_trackback.class.php

示例6: proc

 /**
  * @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);
 }
开发者ID:leehankyeol,项目名称:JaWeTip,代码行数:35,代码来源:eond_fileboxBanner.class.php

示例7: getPaynotyAdminDelete

	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));
	}
开发者ID:WEN2ER,项目名称:nurigo,代码行数:27,代码来源:paynoty.admin.model.php

示例8: getBoardAdminSimpleSetup

 /**
  * 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;
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:38,代码来源:board.admin.model.php

示例9: proc

 /**
  * @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);
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:33,代码来源:login_info.class.php

示例10: transHTML

 /**
  * @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);
 }
开发者ID:xefork-YJSoft,项目名称:rhymix,代码行数:31,代码来源:poll_maker.class.php

示例11: proc

 function proc($args)
 {
     //���ø� ��ü���� �� ��Ų���� ������
     $oTemplate =& TemplateHandler::getInstance();
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     return $oTemplate->compile($tpl_path, "modalpopup");
 }
开发者ID:umjinsun12,项目名称:dngshin,代码行数:7,代码来源:modalpopup.class.php

示例12: testCompileDirect

 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 } ?>');
 }
开发者ID:relip,项目名称:xe-core,代码行数:7,代码来源:TemplateHandlerTest.php

示例13: getPopupContent

 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);
 }
开发者ID:sms200207,项目名称:code_highlighter,代码行数:27,代码来源:code_highlighter.class.php

示例14: proc

 /**
  * @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;
 }
开发者ID:eondcom,项目名称:xe-planet,代码行数:66,代码来源:planet_document.class.php

示例15: getCommunicationAdminColorset

 /**
  * 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);
 }
开发者ID:umjinsun12,项目名称:dngshin,代码行数:35,代码来源:communication.admin.model.php


注:本文中的TemplateHandler::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。