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


PHP DevblocksPlatform类代码示例

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


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

示例1: saveConfiguration

 function saveConfiguration(Model_CommunityTool $instance)
 {
     // KB
     @($aFnrTopics = DevblocksPlatform::importGPC($_POST['topic_ids'], 'array', array()));
     $aFnrTopics = array_flip($aFnrTopics);
     DAO_CommunityToolProperty::set($instance->code, self::PARAM_FNR_TOPICS, serialize($aFnrTopics));
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:7,代码来源:resources.php

示例2: _handleCronSensorsPost

 private function _handleCronSensorsPost($event)
 {
     $logger = DevblocksPlatform::getConsoleLog();
     $translate = DevblocksPlatform::getTranslationService();
     $sensors = DAO_Sensor::getAll();
     // Check that all external sensors aren't over their M.I.A. time
     if (is_array($sensors)) {
         foreach ($sensors as $sensor) {
             /* @var $sensor Model_Sensor */
             // Only external sensors
             if ('sensor.external' != $sensor->extension_id) {
                 continue;
             }
             // Skip if the sensor hasn't run once yet
             if (0 == $sensor->updated_date) {
                 continue;
             }
             $mia_secs = intval($sensor->params->mia_secs);
             $elapsed = time() - $sensor->updated_date;
             if ($mia_secs && $elapsed > $mia_secs) {
                 $fields = array(DAO_Sensor::STATUS => 2, DAO_Sensor::FAIL_COUNT => intval($sensor->fail_count) + 1, DAO_Sensor::METRIC => $translate->_('sensor.status.mia'), DAO_Sensor::OUTPUT => $translate->_('sensor.status.mia'));
                 DAO_Sensor::update($sensor->id, $fields);
                 $logger->info($sensor->name . " is M.I.A. for {$elapsed} seconds.");
             }
         }
     }
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:27,代码来源:listeners.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: saveConfiguration

 function saveConfiguration()
 {
     // KB
     @($aFnrTopics = DevblocksPlatform::importGPC($_POST['topic_ids'], 'array', array()));
     $aFnrTopics = array_flip($aFnrTopics);
     DAO_CommunityToolProperty::set(UmPortalHelper::getCode(), self::PARAM_FNR_TOPICS, serialize($aFnrTopics));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:7,代码来源:resources.php

示例5: showTabAction

 function showTabAction()
 {
     @($ext_id = DevblocksPlatform::importGPC($_REQUEST['ext_id'], 'string', ''));
     if (null != ($tab_mft = DevblocksPlatform::getExtension($ext_id)) && null != ($inst = $tab_mft->createInstance()) && $inst instanceof Extension_ResearchTab) {
         $inst->showTab();
     }
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:7,代码来源:research.php

示例6: 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

示例7: 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

示例8: isDatabaseEmpty

 public static function isDatabaseEmpty()
 {
     $db = DevblocksPlatform::getDatabaseService();
     if (is_null($db)) {
         return true;
     }
     $tables = $db->MetaTables('TABLE', true);
     return empty($tables);
 }
开发者ID:sluther,项目名称:portsensor,代码行数:9,代码来源:classes.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: smarty_block_devblocks_url

function smarty_block_devblocks_url($params, $content, &$smarty)
{
    $url = DevblocksPlatform::getUrlService();
    $contents = $url->write($content, !empty($params['full']) ? true : false);
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $contents);
    } else {
        return $contents;
    }
}
开发者ID:sluther,项目名称:portsensor,代码行数:10,代码来源:block.devblocks_url.php

示例11: saveConfiguration

 function saveConfiguration()
 {
     // RSS Feeds
     @($aNewsRssTitles = DevblocksPlatform::importGPC($_POST['news_rss_title'], 'array', array()));
     @($aNewsRssUrls = DevblocksPlatform::importGPC($_POST['news_rss_url'], 'array', array()));
     $aNewsRss = array();
     foreach ($aNewsRssUrls as $idx => $rss) {
         if (empty($rss)) {
             unset($aNewsRss[$idx]);
             continue;
         }
         $aNewsRss[$aNewsRssTitles[$idx]] = $rss;
     }
     DAO_CommunityToolProperty::set(UmPortalHelper::getCode(), self::PARAM_NEWS_RSS, serialize($aNewsRss));
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:15,代码来源:announcements.php

示例12: authenticate

 function authenticate()
 {
     // Pull from $_POST
     @($email = DevblocksPlatform::importGPC($_POST['email']));
     @($password = DevblocksPlatform::importGPC($_POST['password']));
     $worker = DAO_Worker::login($email, $password);
     if (!is_null($worker)) {
         $session = DevblocksPlatform::getSessionService();
         $visit = new CerberusVisit();
         $visit->setWorker($worker);
         $session->setVisit($visit);
         // [TODO] Only direct to /welcome when tour is enabled
         return true;
     } else {
         return false;
     }
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:17,代码来源:login.classes.php

示例13: _renderRecentChangesRss

    private function _renderRecentChangesRss($portal)
    {
        header("Content-Type: text/xml");
        $xmlstr = <<<XML
\t\t<rss version='2.0' xmlns:atom='http://www.w3.org/2005/Atom'>
\t\t</rss>
XML;
        $xml = new SimpleXMLElement($xmlstr);
        $translate = DevblocksPlatform::getTranslationService();
        $url = DevblocksPlatform::getUrlService();
        // Portal details
        $portal_name = DAO_CommunityToolProperty::get($portal, UmScApp::PARAM_PAGE_TITLE, '');
        // Channel
        $channel = $xml->addChild('channel');
        $channel->addChild('title', (!empty($portal_name) ? '[' . $portal_name . '] ' : '') . "Recently Changed Articles");
        $channel->addChild('link', $url->write(sprintf('c=rss&kb=kb&a=recent_changes', $portal), true));
        $channel->addChild('description', '');
        // Limit topics to portal config
        @($topics = unserialize(DAO_CommunityToolProperty::get($portal, UmScKbController::PARAM_KB_ROOTS, '')));
        if (empty($topics)) {
            return;
        }
        // Search Results
        list($results, $null) = DAO_KbArticle::search(array(SearchFields_KbArticle::TOP_CATEGORY_ID => new DevblocksSearchCriteria(SearchFields_KbArticle::TOP_CATEGORY_ID, 'in', array_keys($topics))), 25, 0, SearchFields_KbArticle::UPDATED, false, false);
        // [TODO] We should probably be building this feed with Zend Framework for compliance
        foreach ($results as $article) {
            $created = intval($article[SearchFields_KbArticle::UPDATED]);
            if (empty($created)) {
                $created = time();
            }
            $eItem = $channel->addChild('item');
            $escapedSubject = htmlspecialchars($article[SearchFields_KbArticle::TITLE], null, LANG_CHARSET_CODE);
            //filter out a couple non-UTF-8 characters (0xC and ESC)
            $escapedSubject = preg_replace("/[\f]/", '', $escapedSubject);
            $eTitle = $eItem->addChild('title', $escapedSubject);
            $eDesc = $eItem->addChild('description', htmlspecialchars($article[SearchFields_KbArticle::CONTENT], null, LANG_CHARSET_CODE));
            $link = $url->write('c=kb&a=article&id=' . $article[SearchFields_KbArticle::ID], true);
            $eLink = $eItem->addChild('link', $link);
            $eDate = $eItem->addChild('pubDate', gmdate('D, d M Y H:i:s T', $created));
            $eGuid = $eItem->addChild('guid', md5($escapedSubject . $link . $created));
            $eGuid->addAttribute('isPermaLink', "false");
        }
        echo $xml->asXML();
    }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:44,代码来源:kb.php

示例14: showTab

 function showTab()
 {
     @($ticket_id = DevblocksPlatform::importGPC($_REQUEST['ticket_id'], 'integer', 0));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl_path = dirname(dirname(__FILE__)) . '/templates/';
     //		$tpl->assign('response_uri', 'config/attachments');
     $defaults = new C4_AbstractViewModel();
     $defaults->class_name = 'C4_AttachmentView';
     $defaults->name = 'Attachements View';
     $defaults->id = 'ticket_view_attachements';
     $defaults->renderLimit = 15;
     $view_attachements = C4_AbstractViewLoader::getView('ticket_view_attachements', $defaults);
     $view_attachements->params = array(SearchFields_Attachment::TICKET_ID => new DevblocksSearchCriteria(SearchFields_Attachment::TICKET_ID, DevblocksSearchCriteria::OPER_EQ, $ticket_id));
     $view_attachements->renderPage = 0;
     C4_AbstractViewLoader::setView($view_attachements->id, $view_attachements);
     $tpl->assign('view_attachements', $view_attachements);
     $tpl->display('file:' . $tpl_path . 'attachments/index.tpl');
 }
开发者ID:rmiddle,项目名称:cerb4_plugins,代码行数:19,代码来源:App.php

示例15: sendFax

 /**
  * exec_sendfax
  *
  * @param string command
  * @return array
  */
 function sendFax($phone_number, $message, $subject, $to, $account_name, $from = null)
 {
     // sendfax -f "robert.middleswarth@answernet.com" -D -R -r "Test Fax" -x "Account Name" -d "RecipientName@4106311699" /home/rmiddle/test.txt
     $settings = DevblocksPlatform::getPluginSettingsService();
     if (empty($from)) {
         @($from = $settings->get('feg.core', FegSettings::DEFAULT_REPLY_FROM, $_SERVER['SERVER_ADMIN']));
     }
     $command = "sendfax ";
     $command .= sprintf("-f '%s' ", $from);
     $command .= "-D -R ";
     $command .= sprintf("-r '%s' ", $subject);
     $command .= sprintf("-x '%s' ", $account_name);
     $command .= sprintf("-d '%s@%s' ", $to, $phone_number);
     $tempfilename = tempnam(APP_TEMP_PATH . "/fax_cache", 'fax_message-');
     $temp_fh = fopen($tempfilename, 'w') or die($php_errormsg);
     fputs($temp_fh, $message);
     fclose($temp_fh) or die($php_errormsg);
     // Generate Text file of message.
     $command .= sprintf("'%s' ", $tempfilename);
     $o = exec($command . " 2>&1", $sendfax_output, $retval);
     $debug = DEBUG_MODE;
     if ($retval == 0) {
         // success
         if ($debug) {
             echo "<p>{$command}";
         }
         $result = str_replace("(", "", $sendfax_output[0]);
         $result = str_replace(")", "", $result);
         //	request id is 80 (group id 80) for host localhost (3 files)
         //	request id is 81 (group id 81) for host localhost (1 file)
         $output = split(" ", $result);
         return array('status' => true, 'jobid' => $output[3], 'groupid' => $output[6], 'host' => $output[9], 'numfiles' => $output[10]);
     }
     if ($debug) {
         echo "<p>";
         print_r($o);
         echo "<p>";
         print_r($sendfax_output);
         echo "<p>{$command}<br>";
     }
     $forlog = implode("\n", $sendfax_output);
     return array('status' => false, 'output' => $forlog);
 }
开发者ID:rmiddle,项目名称:feg,代码行数:49,代码来源:Hylafax.php


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