本文整理汇总了PHP中DevblocksPlatform::getHttpResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::getHttpResponse方法的具体用法?PHP DevblocksPlatform::getHttpResponse怎么用?PHP DevblocksPlatform::getHttpResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::getHttpResponse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render()
{
$active_worker = PortSensorApplication::getActiveWorker();
$translate = DevblocksPlatform::getTranslationService();
$visit = PortSensorApplication::getVisit();
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
$response = DevblocksPlatform::getHttpResponse();
$tpl->assign('request_path', implode('/', $response->path));
// View
$sensorsView = Ps_AbstractViewLoader::getView(self::VIEW_ALL_SENSORS);
if (null == $sensorsView) {
$sensorsView = new Ps_SensorView();
$sensorsView->id = self::VIEW_ALL_SENSORS;
$sensorsView->name = $translate->_('core.menu.sensors');
$sensorsView->renderLimit = 25;
$sensorsView->renderPage = 0;
$sensorsView->renderSortBy = SearchFields_Sensor::NAME;
$sensorsView->renderSortAsc = 1;
$sensorsView->params = array(SearchFields_Sensor::IS_DISABLED => new DevblocksSearchCriteria(SearchFields_Sensor::IS_DISABLED, '=', 0));
Ps_AbstractViewLoader::setView($sensorsView->id, $sensorsView);
}
/*
* [TODO] This doesn't need to save every display, but it was possible to
* lose the params in the saved version of the view in the DB w/o recovery.
* This should be moved back into the if(null==...) check in a later build.
*/
$tpl->assign('response_uri', 'sensors');
// $quick_search_type = $visit->get('crm.opps.quick_search_type');
// $tpl->assign('quick_search_type', $quick_search_type);
$tpl->assign('view', $sensorsView);
$tpl->assign('view_fields', Ps_SensorView::getFields());
$tpl->assign('view_searchable_fields', Ps_SensorView::getSearchFields());
$tpl->display('file:' . $this->_TPL_PATH . 'sensors/index.tpl');
}
示例2: render
function render()
{
$translate = DevblocksPlatform::getTranslationService();
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
$worker = CerberusApplication::getActiveWorker();
if (!$worker || !$worker->is_superuser) {
echo $translate->_('common.access_denied');
return;
}
if (file_exists(APP_PATH . '/install/')) {
$tpl->assign('install_dir_warning', true);
}
$tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.config.tab', false);
uasort($tab_manifests, create_function('$a, $b', "return strcasecmp(\$a->name,\$b->name);\n"));
$tpl->assign('tab_manifests', $tab_manifests);
// Selected tab
$response = DevblocksPlatform::getHttpResponse();
$stack = $response->path;
array_shift($stack);
// config
$tab_selected = array_shift($stack);
$tpl->assign('tab_selected', $tab_selected);
// [TODO] check showTab* hooks for active_worker->is_superuser (no ajax bypass)
$tpl->display('file:' . $this->_TPL_PATH . 'configuration/index.tpl');
}
示例3: 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;
}
}
示例4: render
function render()
{
$active_worker = FegApplication::getActiveWorker();
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->tpl_path);
$response = DevblocksPlatform::getHttpResponse();
$stack = $response->path;
array_shift($stack);
// reports
@($reportId = array_shift($stack));
$report = null;
// We're given a specific report to display
if (!empty($reportId)) {
if (null != ($reportMft = DevblocksPlatform::getExtension($reportId))) {
// Make sure we have a report group
if (null == ($report_group_mft_id = $reportMft->params['report_group'])) {
return;
}
// Make sure the report group exists
if (null == ($report_group_mft = DevblocksPlatform::getExtension($report_group_mft_id))) {
return;
}
// Check our permissions on the parent report group before rendering the report
if (isset($report_group_mft->params['acl']) && !$active_worker->hasPriv($report_group_mft->params['acl'])) {
return;
}
// Render
if (null != ($report = $reportMft->createInstance()) && $report instanceof Extension_Report) {
/* @var $report Extension_Report */
$report->render();
return;
}
}
}
// If we don't have a selected report yet
if (empty($report)) {
// Organize into report groups
$report_groups = array();
$reportGroupMfts = DevblocksPlatform::getExtensions('feg.report.group', false);
// [TODO] Alphabetize groups and nested reports
// Load report groups
if (!empty($reportGroupMfts)) {
foreach ($reportGroupMfts as $reportGroupMft) {
$report_groups[$reportGroupMft->id] = array('manifest' => $reportGroupMft, 'reports' => array());
}
}
$reportMfts = DevblocksPlatform::getExtensions('feg.report', false);
// Load reports and file them under groups according to manifest
if (!empty($reportMfts)) {
foreach ($reportMfts as $reportMft) {
$report_group = $reportMft->params['report_group'];
if (isset($report_group)) {
$report_groups[$report_group]['reports'][] = $reportMft;
}
}
}
$tpl->assign('report_groups', $report_groups);
}
$tpl->display('file:' . $this->tpl_path . '/reports/index.tpl');
}
示例5: render
function render()
{
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
$active_worker = CerberusApplication::getActiveWorker();
$response = DevblocksPlatform::getHttpResponse();
$stack = $response->path;
$command = array_shift($stack);
// groups
$groups = DAO_Group::getAll();
$tpl->assign('groups', $groups);
@($team_id = array_shift($stack));
// team_id
// Only group managers and superusers can configure
if (empty($team_id) || !$active_worker->isTeamManager($team_id) && !$active_worker->is_superuser) {
// do nothing (only show list)
} else {
$teams = DAO_Group::getAll();
$team =& $teams[$team_id];
$tpl->assign('team', $team);
@($tab_selected = array_shift($stack));
// tab
if (!empty($tab_selected)) {
$tpl->assign('tab_selected', $tab_selected);
}
}
$tpl->display('file:' . $this->_TPL_PATH . 'groups/index.tpl');
}
示例6: render
function render()
{
$active_worker = PortSensorApplication::getActiveWorker();
$visit = PortSensorApplication::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(PortSensorVisit::KEY_HOME_SELECTED_TAB, 'notifications');
}
$tpl->assign('selected_tab', $selected_tab);
$tab_manifests = DevblocksPlatform::getExtensions('portsensor.home.tab', false);
$tpl->assign('tab_manifests', $tab_manifests);
// Custom workspaces
$workspaces = DAO_Worklist::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');
}
示例7: 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;
}
}
示例8: 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');
}
示例9: render
function render()
{
$active_worker = FegApplication::getActiveWorker();
$visit = FegApplication::getVisit();
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
$response = DevblocksPlatform::getHttpResponse();
$tpl->assign('request_path', implode('/', $response->path));
// ====== 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 . 'stats/index.tpl');
}
示例10: 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');
}
示例11: render
function render()
{
$active_worker = CerberusApplication::getActiveWorker();
$visit = CerberusApplication::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(CerberusVisit::KEY_HOME_SELECTED_TAB, 'events');
}
$tpl->assign('selected_tab', $selected_tab);
$tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.home.tab', false);
$tpl->assign('tab_manifests', $tab_manifests);
// Custom workspaces
$workspaces = DAO_WorkerWorkspaceList::getWorkspaces($active_worker->id);
$tpl->assign('workspaces', $workspaces);
$tpl->display('file:' . $this->_TPL_PATH . 'home/index.tpl');
}
示例12: 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');
}
示例13: 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;
}
}
示例14: 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');
}
示例15: 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;
}
}