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


PHP DevblocksPlatform::getExtensions方法代码示例

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


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

示例1: run

 function run()
 {
     $logger = DevblocksPlatform::getConsoleLog();
     $logger->info("[Sensors] Starting...");
     // Only pull enabled sensors with an extension_id
     $sensors = DAO_Sensor::getWhere(sprintf("%s=%d", DAO_Sensor::IS_DISABLED, 0));
     $sensor_types = DevblocksPlatform::getExtensions('portsensor.sensor', true);
     if (is_array($sensors)) {
         foreach ($sensors as $sensor) {
             if (!empty($sensor->extension_id) && isset($sensor_types[$sensor->extension_id])) {
                 // Skip external sensors
                 if ('sensor.external' == $sensor->extension_id) {
                     continue;
                 }
                 $runner = $sensor_types[$sensor->extension_id];
                 $output = sprintf("%s (%s)", $sensor->name, $sensor->extension_id);
                 if (method_exists($runner, 'run')) {
                     $fields = array();
                     $success = $runner->run($sensor, $fields);
                     $fields[DAO_Sensor::UPDATED_DATE] = time();
                     $fields[DAO_Sensor::FAIL_COUNT] = $success ? 0 : intval($sensor->fail_count) + 1;
                     DAO_Sensor::update($sensor->id, $fields);
                 }
                 $logger->info("[Sensors] Running {$output}... {$result}");
             }
         }
     }
     // Sensor Runner Event
     $eventMgr = DevblocksPlatform::getEventService();
     $eventMgr->trigger(new Model_DevblocksEvent('cron.sensors.post', array()));
     $logger->info("[Sensors] Finished!");
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:32,代码来源:cron.classes.php

示例2: newTicketComment

 private function newTicketComment($event)
 {
     DevblocksPlatform::getExtensions('cerberusweb.ticket.tab', true);
     // ticket_comment.id
     @($comment_id = $event->params['comment_id']);
     // ticket.id
     @($ticket_id = $event->params['ticket_id']);
     // address.id
     @($address_id = $event->params['address_id']);
     // text of actual comment.
     @($comment_text = $event->params['comment']);
     if (empty($ticket_id) || empty($address_id) || empty($comment_text)) {
         return;
     }
     $setting_manifest = DevblocksPlatform::getExtension(AnswernetLastActionAndAuditLogConfigTab::ID);
     $setting = $setting_manifest->createInstance();
     /* @var $job CerberusCronPageExtension */
     $al_comment_enabled = intval($setting->getParam(AnswernetLastActionAndAuditLogConfigTab::AL_COMMENT_ENABLED, 0));
     $uf_comment_enabled = intval($setting->getParam(AnswernetLastActionAndAuditLogConfigTab::UF_COMMENT_ENABLED, 0));
     if (class_exists('DAO_TicketAuditLog', true)) {
         if ($al_comment_enabled) {
             @($address = DAO_Address::get($address_id));
             @($worker_id = DAO_Worker::lookupAgentEmail($address->email));
             $fields = array(DAO_TicketAuditLog::TICKET_ID => $ticket_id, DAO_TicketAuditLog::WORKER_ID => $worker_id, DAO_TicketAuditLog::CHANGE_DATE => time(), DAO_TicketAuditLog::CHANGE_FIELD => "answernet.last_action_and_audit_log.type.comment", DAO_TicketAuditLog::CHANGE_VALUE => substr($comment_text, 0, 128));
             $log_id = DAO_TicketAuditLog::create($fields);
             unset($fields);
         }
     }
     if ($uf_comment_enabled) {
         $change_fields[DAO_Ticket::UPDATED_DATE] = time();
         DAO_Ticket::updateTicket($ticket_id, $change_fields);
         unset($change_fields);
     }
 }
开发者ID:rmiddle,项目名称:cerb4_plugins,代码行数:34,代码来源:App.php

示例3: render

 function render()
 {
     $active_worker = UsermeetApplication::getActiveWorker();
     $visit = UsermeetApplication::getVisit();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $response = DevblocksPlatform::getHttpResponse();
     $tpl->assign('request_path', implode('/', $response->path));
     // Remember the last tab/URL
     if (null == ($selected_tab = @$response->path[1])) {
         $selected_tab = $visit->get(UsermeetVisit::KEY_HOME_SELECTED_TAB, 'notifications');
     }
     $tpl->assign('selected_tab', $selected_tab);
     $tab_manifests = DevblocksPlatform::getExtensions('usermeet.home.tab', false);
     $tpl->assign('tab_manifests', $tab_manifests);
     // Custom workspaces
     //		$workspaces = DAO_WorkerWorkspaceList::getWorkspaces($active_worker->id);
     //		$tpl->assign('workspaces', $workspaces);
     // ====== Who's Online
     $whos_online = DAO_Worker::getAllOnline();
     if (!empty($whos_online)) {
         $tpl->assign('whos_online', $whos_online);
         $tpl->assign('whos_online_count', count($whos_online));
     }
     $tpl->display('file:' . $this->_TPL_PATH . 'home/index.tpl');
 }
开发者ID:rmiddle,项目名称:usermeet,代码行数:26,代码来源:home.php

示例4: _getModules

 private function _getModules()
 {
     if (empty($this->_modules)) {
         // [TODO] Load sub-controller plugins
         $module_manifests = DevblocksPlatform::getExtensions('usermeet.sc.controller', false, true);
         foreach ($module_manifests as $module_manifest) {
             /* @var $module_manifest DevblocksExtensionManifest */
             if (null != ($mods = $module_manifest->params['modules'])) {
                 foreach ($mods as $mod) {
                     $mod['extension_id'] = $module_manifest->id;
                     $this->_modules[$mod['uri']] = $mod;
                 }
             }
         }
     }
     return $this->_modules;
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:17,代码来源:UmScApp.php

示例5: render

 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl->assign('path', $this->_TPL_PATH);
     $response = DevblocksPlatform::getHttpResponse();
     $stack = $response->path;
     array_shift($stack);
     // activity
     $tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.activity.tab', false);
     uasort($tab_manifests, create_function('$a, $b', "return strcasecmp(\$a->name,\$b->name);\n"));
     $tpl->assign('tab_manifests', $tab_manifests);
     @($tab_selected = array_shift($stack));
     if (empty($tab_selected)) {
         $tab_selected = 'tasks';
     }
     $tpl->assign('tab_selected', $tab_selected);
     $tpl->display('file:' . $this->_TPL_PATH . 'activity/index.tpl');
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:19,代码来源:activity.php

示例6: render

 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $visit = CerberusApplication::getVisit();
     $translate = DevblocksPlatform::getTranslationService();
     $response = DevblocksPlatform::getHttpResponse();
     $tpl->assign('request_path', implode('/', $response->path));
     $stack = $response->path;
     array_shift($stack);
     // research
     $tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.research.tab', false);
     uasort($tab_manifests, create_function('$a, $b', "return strcasecmp(\$a->name,\$b->name);\n"));
     $tpl->assign('tab_manifests', $tab_manifests);
     @($tab_selected = array_shift($stack));
     if (empty($tab_selected)) {
         $tab_selected = '';
     }
     $tpl->assign('tab_selected', $tab_selected);
     $tpl->display('file:' . $this->_TPL_PATH . 'research/index.tpl');
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:21,代码来源:research.php

示例7: render

 function render()
 {
     $translate = DevblocksPlatform::getTranslationService();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = $this->_TPL_PATH;
     $tpl->assign('path', $tpl_path);
     $response = DevblocksPlatform::getHttpResponse();
     $path = $response->path;
     array_shift($path);
     // preferences
     $tab_manifests = DevblocksPlatform::getExtensions('feg.preferences.tab', false);
     $tpl->assign('tab_manifests', $tab_manifests);
     @($section = array_shift($path));
     // section
     switch ($section) {
         default:
             $tpl->assign('tab', $section);
             $tpl->display('file:' . $tpl_path . 'preferences/index.tpl');
             break;
     }
 }
开发者ID:rmiddle,项目名称:feg,代码行数:21,代码来源:preferences.php

示例8: render

 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $active_worker = FegApplication::getActiveWorker();
     $visit = FegApplication::getVisit();
     $response = DevblocksPlatform::getHttpResponse();
     $translate = DevblocksPlatform::getTranslationService();
     $url = DevblocksPlatform::getUrlService();
     $stack = $response->path;
     @array_shift($stack);
     // customer
     @($customer_id = array_shift($stack));
     @($customer = DAO_CustomerAccount::get($customer_id));
     if (empty($customer)) {
         echo "<H1>" . $translate->_('customer.display.invalid_customer') . "</H1>";
         return;
     }
     $tpl->assign('customer_id', $customer_id);
     // Tabs
     $tab_manifests = DevblocksPlatform::getExtensions('feg.customer.tab', false);
     $tpl->assign('tab_manifests', $tab_manifests);
     @($tab_selected = array_shift($stack));
     if (empty($tab_selected)) {
         $tab_selected = 'property';
     }
     $tpl->assign('tab_selected', $tab_selected);
     switch ($tab_selected) {
         case 'property':
             @($tab_parm = array_shift($stack));
             break;
     }
     // ====== Who's Online
     $whos_online = DAO_Worker::getAllOnline();
     if (!empty($whos_online)) {
         $tpl->assign('whos_online', $whos_online);
         $tpl->assign('whos_online_count', count($whos_online));
     }
     $tpl->display('file:' . $this->_TPL_PATH . 'customer/index.tpl');
 }
开发者ID:rmiddle,项目名称:feg,代码行数:40,代码来源:customer.php

示例9: handleRequest

 function handleRequest(DevblocksHttpRequest $request)
 {
     $translate = DevblocksPlatform::getTranslationService();
     // [TODO] Do we want any concept of authentication here?
     $stack = $request->path;
     array_shift($stack);
     // rss
     $hash = array_shift($stack);
     $feed = DAO_ViewRss::getByHash($hash);
     if (empty($feed)) {
         die($translate->_('rss.bad_feed'));
     }
     // Sources
     $rss_sources = DevblocksPlatform::getExtensions('cerberusweb.rss.source', true);
     if (isset($rss_sources[$feed->source_extension])) {
         $rss_source =& $rss_sources[$feed->source_extension];
         /* @var $rss_source Extension_RssSource */
         header("Content-Type: text/xml");
         echo $rss_source->getFeedAsRss($feed);
     }
     exit;
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:22,代码来源:rss.php

示例10: render

 function render()
 {
     $translate = DevblocksPlatform::getTranslationService();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = $this->_TPL_PATH;
     $tpl->assign('path', $tpl_path);
     $tpl->cache_lifetime = "0";
     $response = DevblocksPlatform::getHttpResponse();
     $path = $response->path;
     array_shift($path);
     // preferences
     $tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.preferences.tab', false);
     $tpl->assign('tab_manifests', $tab_manifests);
     @($section = array_shift($path));
     // section
     switch ($section) {
         case 'confirm_email':
             @($code = array_shift($path));
             $active_worker = CerberusApplication::getActiveWorker();
             $worker_addresses = DAO_AddressToWorker::getWhere(sprintf("%s = '%s' AND %s = %d", DAO_AddressToWorker::CODE, addslashes(str_replace(' ', '', $code)), DAO_AddressToWorker::WORKER_ID, $active_worker->id));
             @($worker_address = array_shift($worker_addresses));
             if (!empty($code) && null != $worker_address && $worker_address->code == $code && $worker_address->code_expire > time()) {
                 DAO_AddressToWorker::update($worker_address->address, array(DAO_AddressToWorker::CODE => '', DAO_AddressToWorker::IS_CONFIRMED => 1, DAO_AddressToWorker::CODE_EXPIRE => 0));
                 $output = array(vsprintf($translate->_('prefs.address.confirm.tip'), $worker_address->address));
                 $tpl->assign('pref_success', $output);
             } else {
                 $errors = array($translate->_('prefs.address.confirm.invalid_code'));
                 $tpl->assign('pref_errors', $errors);
             }
             $tpl->display('file:' . $tpl_path . 'preferences/index.tpl');
             break;
         default:
             $tpl->assign('tab', $section);
             $tpl->display('file:' . $tpl_path . 'preferences/index.tpl');
             break;
     }
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:37,代码来源:preferences.php

示例11: newTicketComment

 private function newTicketComment($event)
 {
     DevblocksPlatform::getExtensions('cerberusweb.ticket.tab', true);
     // ticket_comment.id
     @($comment_id = $event->params['comment_id']);
     // Event context
     @($context = $event->params['context']);
     // ticket.id if context == ticket.
     @(${$ticket_id} = $event->params['context_id']);
     @($address_id = $event->params['address_id']);
     // text of actual comment.
     @($comment_text = $event->params['comment']);
     if (CerberusContexts::CONTEXT_TICKET != $context) {
         return;
     }
     if (empty($ticket_id) || empty($address_id) || empty($comment_text)) {
         return;
     }
     $settings = DevblocksPlatform::getPluginSettingsService();
     $al_merge_enabled = intval($settings->get('cerb5blog.last_action_and_audit_log', 'al_merge_enabled', 0));
     if (class_exists('DAO_TicketAuditLog', true)) {
         $al_comment_enabled = intval($settings->get('cerb5blog.last_action_and_audit_log', 'al_comment_enabled', 0));
         if ($al_comment_enabled) {
             @($address = DAO_Address::get($address_id));
             @($worker_id = DAO_Worker::lookupAgentEmail($address->email));
             $fields = array(DAO_TicketAuditLog::TICKET_ID => $ticket_id, DAO_TicketAuditLog::WORKER_ID => $worker_id, DAO_TicketAuditLog::CHANGE_DATE => time(), DAO_TicketAuditLog::CHANGE_FIELD => "cerb5blog.last_action_and_audit_log.type.comment", DAO_TicketAuditLog::CHANGE_VALUE => substr($comment_text, 0, 128));
             $log_id = DAO_TicketAuditLog::create($fields);
             unset($fields);
         }
     }
     $uf_comment_enabled = intval($settings->get('cerb5blog.last_action_and_audit_log', 'uf_comment_enabled', 0));
     if ($uf_comment_enabled) {
         $change_fields[DAO_Ticket::UPDATED_DATE] = time();
         DAO_Ticket::update($ticket_id, $change_fields);
         unset($change_fields);
     }
 }
开发者ID:rmiddle,项目名称:cerb5_plugins,代码行数:37,代码来源:App.php

示例12: parseMessage

 /**
  * Enter description here...
  *
  * @param CerberusParserMessage $message
  * @return integer
  */
 public static function parseMessage(CerberusParserMessage $message, $options = array())
 {
     /*
      * options:
      * 'no_autoreply'
      */
     $logger = DevblocksPlatform::getConsoleLog();
     $settings = DevblocksPlatform::getPluginSettingsService();
     $helpdesk_senders = CerberusApplication::getHelpdeskSenders();
     // Pre-parse mail filters
     $pre_filters = Model_PreParseRule::getMatches($message);
     if (is_array($pre_filters) && !empty($pre_filters)) {
         // Load filter action manifests for reuse
         $ext_action_mfts = DevblocksPlatform::getExtensions('cerberusweb.mail_filter.action', false);
         // Loop through all matching filters
         foreach ($pre_filters as $pre_filter) {
             // Do something with matching filter's actions
             foreach ($pre_filter->actions as $action_key => $action) {
                 switch ($action_key) {
                     case 'blackhole':
                         return NULL;
                         break;
                     case 'redirect':
                         @($to = $action['to']);
                         CerberusMail::reflect($message, $to);
                         return NULL;
                         break;
                     case 'bounce':
                         @($msg = $action['message']);
                         @($subject = 'Delivery failed: ' . self::fixQuotePrintableString($message->headers['subject']));
                         // [TODO] Follow the RFC spec on a true bounce
                         if (null != ($fromAddressInst = CerberusParser::getAddressFromHeaders($message->headers))) {
                             CerberusMail::quickSend($fromAddressInst->email, $subject, $msg);
                         }
                         return NULL;
                         break;
                     default:
                         // Plugin pre-parser filter actions
                         if (isset($ext_action_mfts[$action_key])) {
                             if (null != @($ext_action = $ext_action_mfts[$action_key]->createInstance())) {
                                 try {
                                     /* @var $ext_action Extension_MailFilterAction */
                                     $ext_action->run($pre_filter, $message);
                                 } catch (Exception $e) {
                                 }
                             }
                         }
                         break;
                 }
             }
         }
     }
     $headers =& $message->headers;
     // From
     if (null == ($fromAddressInst = CerberusParser::getAddressFromHeaders($headers))) {
         $logger->err("[Parser] 'From' address could not be created.");
         return NULL;
     }
     // To/Cc/Bcc
     $to = array();
     $sTo = @$headers['to'];
     $bIsNew = true;
     if (!empty($sTo)) {
         // [TODO] Do we still need this RFC address parser?
         $to = CerberusParser::parseRfcAddress($sTo);
     }
     // Subject
     // Fix quote printable subject (quoted blocks can appear anywhere in subject)
     $sSubject = "";
     if (isset($headers['subject']) && !empty($headers['subject'])) {
         $sSubject = $headers['subject'];
         if (is_array($sSubject)) {
             $sSubject = array_shift($sSubject);
         }
     }
     // The subject can still end up empty after QP decode
     if (empty($sSubject)) {
         $sSubject = "(no subject)";
     }
     // Date
     $iDate = @strtotime($headers['date']);
     // If blank, or in the future, set to the current date
     if (empty($iDate) || $iDate > time()) {
         $iDate = time();
     }
     // Is banned?
     if (1 == $fromAddressInst->is_banned) {
         $logger->info("[Parser] Ignoring ticket from banned address: " . $fromAddressInst->email);
         return NULL;
     }
     // Overloadable
     $enumSpamTraining = '';
     // Message Id / References / In-Reply-To
     @($sMessageId = $headers['message-id']);
//.........这里部分代码省略.........
开发者ID:Hildy,项目名称:cerb5,代码行数:101,代码来源:Parser.php

示例13: getCommunityAction

 function getCommunityAction()
 {
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl_path = dirname(__FILE__) . '/templates/';
     $tpl->assign('path', $tpl_path);
     if (!empty($id)) {
         $community = DAO_Community::get($id);
         $tpl->assign('community', $community);
     }
     // Tool Manifests
     $tools = DevblocksPlatform::getExtensions('usermeet.tool', false, true);
     $tpl->assign('tool_manifests', $tools);
     $tpl->display('file:' . $tpl_path . 'community/config/tab/community_config.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:16,代码来源:classes.php

示例14: writeResponse

 public function writeResponse(DevblocksHttpResponse $response)
 {
     $path = $response->path;
     // [JAS]: Ajax? // [TODO] Explore outputting whitespace here for Safari
     //	    if(empty($path))
     //			return;
     $tpl = DevblocksPlatform::getTemplateService();
     $session = DevblocksPlatform::getSessionService();
     $settings = DevblocksPlatform::getPluginSettingsService();
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = FegApplication::getActiveWorker();
     $visit = $session->getVisit();
     $page_manifests = $this->_getAllowedPages();
     $controller = array_shift($path);
     // Default page [TODO] This is supposed to come from framework.config.php
     if (empty($controller)) {
         $controller = 'preferences';
     }
     // [JAS]: Require us to always be logged in for Feg pages
     if (empty($visit) && 0 != strcasecmp($controller, 'login')) {
         $query = array();
         if (!empty($response->path)) {
             $query = array('url' => urlencode(implode('/', $response->path)));
         }
         DevblocksPlatform::redirect(new DevblocksHttpRequest(array('login'), $query));
     }
     $page_id = $this->_getPageIdByUri($controller);
     @($page = DevblocksPlatform::getExtension($page_id, true));
     /* @var $page FegPageExtension */
     if (empty($page)) {
         header("Status: 404");
         return;
         // [TODO] 404
     }
     // [JAS]: Listeners (Step-by-step guided tour, etc.)
     $listenerManifests = DevblocksPlatform::getExtensions('devblocks.listener.http');
     foreach ($listenerManifests as $listenerManifest) {
         /* @var $listenerManifest DevblocksExtensionManifest */
         $inst = $listenerManifest->createInstance();
         /* @var $inst DevblocksHttpRequestListenerExtension */
         $inst->run($response, $tpl);
     }
     $tpl->assign('active_worker', $active_worker);
     $tour_enabled = false;
     if (!empty($visit) && !is_null($active_worker)) {
         $tour_enabled = intval(DAO_WorkerPref::get($active_worker->id, 'assist_mode', 1));
         $keyboard_shortcuts = intval(DAO_WorkerPref::get($active_worker->id, 'keyboard_shortcuts', 1));
         $tpl->assign('pref_keyboard_shortcuts', $keyboard_shortcuts);
         //	    	$active_worker_memberships = $active_worker->getMemberships();
         //	    	$tpl->assign('active_worker_memberships', $active_worker_memberships);
         $unread_notifications = DAO_WorkerEvent::getUnreadCountByWorker($active_worker->id);
         $tpl->assign('active_worker_notify_count', $unread_notifications);
         DAO_Worker::logActivity($active_worker->id, $page->getActivity());
     }
     $tpl->assign('tour_enabled', $tour_enabled);
     // [JAS]: Variables provided to all page templates
     $tpl->assign('settings', $settings);
     $tpl->assign('session', $_SESSION);
     $tpl->assign('translate', $translate);
     $tpl->assign('visit', $visit);
     $tpl->assign('license', FegLicense::getInstance());
     $tpl->assign('page_manifests', $page_manifests);
     $tpl->assign('page', $page);
     $tpl->assign('response_uri', implode('/', $response->path));
     $core_tpl = APP_PATH . '/features/feg.core/templates/';
     $tpl->assign('core_tpl', $core_tpl);
     // Prebody Renderers
     $preBodyRenderers = DevblocksPlatform::getExtensions('feg.renderer.prebody', true);
     if (!empty($preBodyRenderers)) {
         $tpl->assign('prebody_renderers', $preBodyRenderers);
     }
     // Postbody Renderers
     $postBodyRenderers = DevblocksPlatform::getExtensions('feg.renderer.postbody', true);
     if (!empty($postBodyRenderers)) {
         $tpl->assign('postbody_renderers', $postBodyRenderers);
     }
     // Timings
     $tpl->assign('render_time', microtime(true) - DevblocksPlatform::getStartTime());
     if (function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
         $tpl->assign('render_memory', memory_get_usage() - DevblocksPlatform::getStartMemory());
         $tpl->assign('render_peak_memory', memory_get_peak_usage() - DevblocksPlatform::getStartPeakMemory());
     }
     $tpl->display($core_tpl . 'border.tpl');
     //		$cache = DevblocksPlatform::getCacheService();
     //		$cache->printStatistics();
 }
开发者ID:rmiddle,项目名称:feg,代码行数:86,代码来源:plugin.classes.php

示例15: showConversationAction

 function showConversationAction()
 {
     @($id = DevblocksPlatform::importGPC($_REQUEST['ticket_id'], 'integer'));
     @($expand_all = DevblocksPlatform::importGPC($_REQUEST['expand_all'], 'integer', '0'));
     @($active_worker = CerberusApplication::getActiveWorker());
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $tpl->assign('expand_all', $expand_all);
     $ticket = DAO_Ticket::getTicket($id);
     $tpl->assign('ticket', $ticket);
     $tpl->assign('requesters', $ticket->getRequesters());
     $messages = $ticket->getMessages();
     arsort($messages);
     $tpl->assign('latest_message_id', key($messages));
     $tpl->assign('messages', $messages);
     // Thread comments and messages on the same level
     $convo_timeline = array();
     // Track senders and their orgs
     $message_senders = array();
     $message_sender_orgs = array();
     // Loop messages
     foreach ($messages as $message_id => $message) {
         /* @var $message CerberusMessage */
         $key = $message->created_date . '_m' . $message_id;
         // build a chrono index of messages
         $convo_timeline[$key] = array('m', $message_id);
         // If we haven't cached this sender address yet
         if (!isset($message_senders[$message->address_id])) {
             if (null != ($sender_addy = DAO_Address::get($message->address_id))) {
                 $message_senders[$sender_addy->id] = $sender_addy;
                 // If we haven't cached this sender org yet
                 if (!isset($message_sender_orgs[$sender_addy->contact_org_id])) {
                     if (null != ($sender_org = DAO_ContactOrg::get($sender_addy->contact_org_id))) {
                         $message_sender_orgs[$sender_org->id] = $sender_org;
                     }
                 }
             }
         }
     }
     $tpl->assign('message_senders', $message_senders);
     $tpl->assign('message_sender_orgs', $message_sender_orgs);
     @($mail_inline_comments = DAO_WorkerPref::get($active_worker->id, 'mail_inline_comments', 1));
     if ($mail_inline_comments) {
         // if inline comments are enabled
         $comments = DAO_TicketComment::getByTicketId($id);
         arsort($comments);
         $tpl->assign('comments', $comments);
         // build a chrono index of comments
         foreach ($comments as $comment_id => $comment) {
             /* @var $comment Model_TicketComment */
             $key = $comment->created . '_c' . $comment_id;
             $convo_timeline[$key] = array('c', $comment_id);
         }
     }
     // sort the timeline
     if (!$expand_all) {
         krsort($convo_timeline);
     } else {
         ksort($convo_timeline);
     }
     $tpl->assign('convo_timeline', $convo_timeline);
     // Message Notes
     $notes = DAO_MessageNote::getByTicketId($id);
     $message_notes = array();
     // Index notes by message id
     if (is_array($notes)) {
         foreach ($notes as $note) {
             if (!isset($message_notes[$note->message_id])) {
                 $message_notes[$note->message_id] = array();
             }
             $message_notes[$note->message_id][$note->id] = $note;
         }
     }
     $tpl->assign('message_notes', $message_notes);
     // Message toolbar items
     $messageToolbarItems = DevblocksPlatform::getExtensions('cerberusweb.message.toolbaritem', true);
     if (!empty($messageToolbarItems)) {
         $tpl->assign('message_toolbaritems', $messageToolbarItems);
     }
     // Workers
     $workers = DAO_Worker::getAll();
     $tpl->assign('workers', $workers);
     $tpl->register_modifier('makehrefs', array('CerberusUtils', 'smarty_modifier_makehrefs'));
     $tpl->display('file:' . $this->_TPL_PATH . 'display/modules/conversation/index.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:85,代码来源:display.php


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