當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。