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


PHP DevblocksPlatform::getTemplateService方法代码示例

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


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

示例1: render

 function render()
 {
     $response = DevblocksPlatform::getHttpResponse();
     $stack = $response->path;
     array_shift($stack);
     // login
     $section = array_shift($stack);
     switch ($section) {
         case "forgot":
             $step = array_shift($stack);
             $tpl = DevblocksPlatform::getTemplateService();
             switch ($step) {
                 default:
                 case "step1":
                     if (@($failed = array_shift($stack)) == "failed") {
                         $tpl->assign('failed', true);
                     }
                     $tpl->display('file:' . $this->_TPL_PATH . 'login/forgot1.tpl');
                     break;
                 case "step2":
                     $tpl->display('file:' . $this->_TPL_PATH . 'login/forgot2.tpl');
                     break;
                 case "step3":
                     $tpl->display('file:' . $this->_TPL_PATH . 'login/forgot3.tpl');
                     break;
             }
             break;
         default:
             $tpl = DevblocksPlatform::getTemplateService();
             @($redir_path = explode('/', urldecode(DevblocksPlatform::importGPC($_REQUEST["url"], "string", ""))));
             $tpl->assign('original_path', count($redir_path) == 0 ? 'login' : implode(',', $redir_path));
             $tpl->display('file:' . $this->_TPL_PATH . 'login/login.tpl');
             break;
     }
 }
开发者ID:rmiddle,项目名称:usermeet,代码行数:35,代码来源:login.php

示例2: configure

 function configure($instance)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(__FILE__)) . '/templates/';
     $tpl->assign('path', $tpl_path);
     $tpl->display($tpl_path . 'cron/heartbeat/config.tpl');
 }
开发者ID:rmiddle,项目名称:usermeet,代码行数:7,代码来源:cron.classes.php

示例3: getTemplateHandler

 public static function getTemplateHandler()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(__FILE__) . '/templates/';
     $tpl->assign('path', $tpl_path);
     $tpl->cache_lifetime = "0";
     $total_new_count = 0;
     foreach (DAO_WorkflowView::getGroupTotals() as $data) {
         $total_new_count += $data["total"];
     }
     $tpl->assign('total_new_count', $total_new_count);
     $newest = isset($_SESSION["fluid_latest_seen"]) ? $_SESSION["fluid_latest_seen"] : time() - 3600;
     $worker = CerberusApplication::getActiveWorker();
     $memberships = $worker->getMemberships();
     $params = array(SearchFields_Ticket::TICKET_TEAM_ID => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_TEAM_ID, 'in', array_keys($memberships)), SearchFields_Ticket::TICKET_DELETED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_DELETED, 'eq', 0), SearchFields_Ticket::TICKET_WAITING => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_WAITING, 'eq', 0), SearchFields_Ticket::TICKET_CLOSED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_CLOSED, 'eq', 0), SearchFields_Ticket::TICKET_UPDATED_DATE => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_UPDATED_DATE, '>', $newest));
     list($results, $total) = DAO_Ticket::search(array(SearchFields_Ticket::TICKET_ID, SearchFields_Ticket::TICKET_MASK, SearchFields_Ticket::TICKET_SUBJECT, SearchFields_Ticket::TICKET_LAST_WROTE), $params, 5, 0, SearchFields_Ticket::TICKET_UPDATED_DATE, false, true);
     $tickets = array();
     foreach ($results as $ticket) {
         if ($ticket[SearchFields_Ticket::TICKET_UPDATED_DATE] > $newest) {
             $newest = $ticket[SearchFields_Ticket::TICKET_UPDATED_DATE];
         }
         $tickets[] = $ticket;
     }
     $_SESSION["fluid_latest_seen"] = $newest;
     $tpl->assign("recent_tickets_json", json_encode($tickets));
     $tpl->assign("recent_ticket_count", json_encode($total));
     return $tpl;
 }
开发者ID:jsjohnst,项目名称:cerb4_fluidapp,代码行数:28,代码来源:plugin.php

示例4: render

 function render()
 {
     $response = DevblocksPlatform::getHttpResponse();
     $stack = $response->path;
     array_shift($stack);
     // login
     $section = array_shift($stack);
     switch ($section) {
         case "forgot":
             $step = array_shift($stack);
             $tpl = DevblocksPlatform::getTemplateService();
             switch ($step) {
                 default:
                 case "step1":
                     if (@($failed = array_shift($stack)) == "failed") {
                         $tpl->assign('failed', true);
                     }
                     $tpl->display('file:' . $this->_TPL_PATH . 'login/forgot1.tpl');
                     break;
                 case "step2":
                     $tpl->display('file:' . $this->_TPL_PATH . 'login/forgot2.tpl');
                     break;
                 case "step3":
                     $tpl->display('file:' . $this->_TPL_PATH . 'login/forgot3.tpl');
                     break;
             }
             break;
         default:
             $manifest = DevblocksPlatform::getExtension('login.default');
             $inst = $manifest->createInstance(1);
             /* @var $inst Extension_LoginAuthenticator */
             $inst->renderLoginForm();
             break;
     }
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:35,代码来源:login.php

示例5: showSensorPeekAction

 function showSensorPeekAction()
 {
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id'], 'string', ''));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $tpl->assign('view_id', $view_id);
     if (null == ($sensor = DAO_Sensor::get($id))) {
         $sensor = new Model_Sensor();
         $sensor->extension_id = 'sensor.external';
     }
     $tpl->assign('sensor', $sensor);
     $sensor_types = DevblocksPlatform::getExtensions('portsensor.sensor', false);
     $tpl->assign('sensor_types', $sensor_types);
     // Sensor extension instance
     if (!empty($sensor->extension_id) && isset($sensor_types[$sensor->extension_id])) {
         $tpl->assign('sensor_extension', DevblocksPlatform::getExtension($sensor->extension_id, true));
     }
     // Custom Fields
     $custom_fields = DAO_CustomField::getBySource(PsCustomFieldSource_Sensor::ID);
     $tpl->assign('custom_fields', $custom_fields);
     $custom_field_values = DAO_CustomFieldValue::getValuesBySourceIds(PsCustomFieldSource_Sensor::ID, $id);
     if (isset($custom_field_values[$id])) {
         $tpl->assign('custom_field_values', $custom_field_values[$id]);
     }
     $tpl->display('file:' . $this->_TPL_PATH . 'sensors/peek.tpl');
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:27,代码来源:sensors.php

示例6: render

 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $response = DevblocksPlatform::getHttpResponse();
     $stack = $response->path;
     $tpl->display('file:' . $this->_TPL_PATH . 'welcome/index.tpl');
 }
开发者ID:rmiddle,项目名称:usermeet,代码行数:8,代码来源:welcome.php

示例7: configure

 function configure()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/';
     $sHomeHtml = DAO_CommunityToolProperty::get(UmPortalHelper::getCode(), self::PARAM_HOME_HTML, '');
     $tpl->assign('home_html', $sHomeHtml);
     $tpl->display("file:{$tpl_path}portal/sc/config/module/home.tpl");
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:8,代码来源:home.php

示例8: configure

 function configure()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/';
     $sNewsRss = DAO_CommunityToolProperty::get(UmPortalHelper::getCode(), self::PARAM_NEWS_RSS, '');
     $news_rss = !empty($sNewsRss) ? unserialize($sNewsRss) : array();
     $tpl->assign('news_rss', $news_rss);
     $tpl->display("file:{$tpl_path}portal/sc/config/module/announcements.tpl");
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:9,代码来源:announcements.php

示例9: generateTicketsAction

 function generateTicketsAction()
 {
     require_once dirname(__FILE__) . '/api/API.class.php';
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(__FILE__) . '/templates/';
     $tpl->assign('path', $tpl_path);
     $tpl->cache_lifetime = "0";
     @($address = DevblocksPlatform::importGPC($_POST['address'], 'string'));
     @($dataset = DevblocksPlatform::importGPC($_POST['dataset'], 'string'));
     @($how_many = DevblocksPlatform::importGPC($_POST['how_many'], 'integer', 0));
     if (empty($address)) {
         $tpl->assign('error', sprintf("Oops! '%s' is not a valid e-mail address.", htmlspecialchars($address)));
         $tpl->display('file:' . $tpl_path . 'config_tab/output.tpl');
         return;
     }
     // [JAS]: [TODO] This should probably move to an extension point later
     switch ($dataset) {
         default:
         case "retail":
             $dataset = new RetailDataset();
             break;
         case "hosting":
             $dataset = new HostingDataset();
             break;
         case "edu":
             $dataset = new EduDataset();
             break;
         case "gov":
             $dataset = new GovDataset();
             break;
         case "npo":
             $dataset = new NPODataset();
             break;
         case "spam":
             $dataset = new SpamDataset();
             break;
     }
     $simulator = CerberusSimulator::getInstance();
     $emails = $simulator->generateEmails($dataset, $how_many);
     foreach ($emails as $template) {
         if (preg_match("/\"(.*?)\" \\<(.*?)\\>/", $template['sender'], $matches)) {
             $personal = $matches[1];
             $from = $matches[1];
         }
         // [TODO] error checking
         $message = new CerberusParserMessage();
         $message->headers['from'] = $template['sender'];
         $message->headers['to'] = $address;
         $message->headers['subject'] = $template['subject'];
         $message->headers['message-id'] = CerberusApplication::generateMessageId();
         $message->body = sprintf("%s\r\n" . "\r\n" . "--\r\n%s\r\n", $template['body'], $personal);
         CerberusParser::parseMessage($message, array('no_autoreply' => true));
     }
     $tpl->assign('output', sprintf("Success!  %d simulated tickets were generated for %s", $how_many, htmlspecialchars($address)));
     $tpl->display('file:' . $tpl_path . 'config_tab/output.tpl');
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:56,代码来源:classes.php

示例10: showTab

 function showTab()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(__FILE__)) . '/templates/';
     $tpl->assign('path', $tpl_path);
     $kb_topics = DAO_KbCategory::getWhere('parent_id = 0');
     $tpl->assign('kb_topics', $kb_topics);
     $access_keys = DAO_WebapiKey::getWhere();
     $tpl->assign('access_keys', $access_keys);
     $tpl->display('file:' . $tpl_path . 'config/index.tpl');
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:11,代码来源:App.php

示例11: renderLoginForm

 function renderLoginForm()
 {
     // draws HTML form of controls needed for login information
     $tpl = DevblocksPlatform::getTemplateService();
     // add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)
     $translate = DevblocksPlatform::getTranslationService();
     $tpl->assign('translate', $translate);
     @($redir_path = explode('/', urldecode(DevblocksPlatform::importGPC($_REQUEST["url"], "string", ""))));
     $tpl->assign('original_path', count($redir_path) == 0 ? 'login' : implode(',', $redir_path));
     $tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_default.tpl');
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:11,代码来源:login.classes.php

示例12: configure

 function configure(Model_CommunityTool $instance)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(__FILE__))) . '/templates/';
     // F&R
     $fnr_topics = DAO_FnrTopic::getWhere();
     $tpl->assign('fnr_topics', $fnr_topics);
     $sFnrTopics = DAO_CommunityToolProperty::get($instance->code, self::PARAM_FNR_TOPICS, '');
     $fnr_topics = !empty($sFnrTopics) ? unserialize($sFnrTopics) : array();
     $tpl->assign('enabled_topics', $fnr_topics);
     $tpl->display("file:{$tpl_path}portal/sc/config/resources.tpl");
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:12,代码来源:resources.php

示例13: renderConfig

 function renderConfig(Model_PreParseRule $filter = null)
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $path = dirname(__FILE__) . '/templates/';
     $groups = DAO_Group::getAll();
     $tpl->assign('groups', $groups);
     $ticket_fields = DAO_CustomField::getBySource('cerberusweb.fields.source.ticket');
     $tpl->assign('ticket_fields', $ticket_fields);
     $params = $filter->actions[self::EXTENSION_ID];
     $tpl->assign('headers', $params['headers']);
     $tpl->assign('custom_fields', $params['custom_fields']);
     $tpl->display($path . 'header_filter_action.tpl');
 }
开发者ID:rmiddle,项目名称:cerb4_plugins,代码行数:13,代码来源:plugin.php

示例14: configure

 function configure()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(__FILE__))) . '/templates/';
     //		$require_login = DAO_CommunityToolProperty::get(UmPortalHelper::getCode(),self::PARAM_REQUIRE_LOGIN, 0);
     //		$tpl->assign('kb_require_login', $require_login);
     // F&R
     $fnr_topics = DAO_FnrTopic::getWhere();
     $tpl->assign('fnr_topics', $fnr_topics);
     $sFnrTopics = DAO_CommunityToolProperty::get(UmPortalHelper::getCode(), self::PARAM_FNR_TOPICS, '');
     $fnr_topics = !empty($sFnrTopics) ? unserialize($sFnrTopics) : array();
     $tpl->assign('enabled_topics', $fnr_topics);
     $tpl->display("file:{$tpl_path}portal/sc/config/resources.tpl");
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:14,代码来源:resources.php

示例15: saveAnswernetAction

 function saveAnswernetAction()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(__FILE__)) . '/templates/';
     $tpl->cache_lifetime = "0";
     @($al_comment_enabled = DevblocksPlatform::importGPC($_REQUEST['al_comment_enabled'], 'integer', 0));
     @($uf_comment_enabled = DevblocksPlatform::importGPC($_POST['uf_comment_enabled'], 'integer', 0));
     @($al_merge_enabled = DevblocksPlatform::importGPC($_REQUEST['al_merge_enabled'], 'integer', 0));
     @($uf_merge_enabled = DevblocksPlatform::importGPC($_POST['uf_merge_enabled'], 'integer', 0));
     $this->setParam('al_comment_enabled', $al_comment_enabled);
     $this->setParam('uf_comment_enabled', $uf_comment_enabled);
     $this->setParam('al_merge_enabled', $al_merge_enabled);
     $this->setParam('uf_merge_enabled', $uf_merge_enabled);
     $tpl->display('file:' . $tpl_path . 'config_success.tpl');
 }
开发者ID:rmiddle,项目名称:cerb4_plugins,代码行数:15,代码来源:App.php


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