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


PHP OW::getResponse方法代码示例

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


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

示例1: renderJson

 private function renderJson()
 {
     OW::getResponse()->setHeader(OW_Response::HD_CNT_TYPE, "application/json");
     $body = $this->getBody();
     $apiResponse = array("type" => "success", "data" => empty($body) ? new stdClass() : $body);
     return json_encode($apiResponse);
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:7,代码来源:api_document.php

示例2: page403

 public function page403(array $params)
 {
     $language = OW::getLanguage();
     OW::getResponse()->setHeader('HTTP/1.0', '403 Forbidden');
     OW::getResponse()->setHeader('Status', '403 Forbidden');
     $this->setPageHeading($language->text('base', 'base_document_403_heading'));
     $this->setPageTitle($language->text('base', 'base_document_403_title'));
     $this->setDocumentKey('base_page403');
     $this->assign('message', !empty($params['message']) ? $params['message'] : $language->text('base', 'base_document_403'));
 }
开发者ID:vBulleteen,项目名称:oxwall,代码行数:10,代码来源:base_document.php

示例3: init

 /**
  * Application init actions.
  */
 public function init()
 {
     // router init - need to set current page uri and base url
     $router = OW::getRouter();
     $router->setBaseUrl(OW_URL_HOME);
     $this->urlHostRedirect();
     OW_Auth::getInstance()->setAuthenticator(new OW_SessionAuthenticator());
     $this->userAutoLogin();
     // setting default time zone
     date_default_timezone_set(OW::getConfig()->getValue('base', 'site_timezone'));
     // synchronize the db's time zone
     OW::getDbo()->setTimezone();
     //        OW::getRequestHandler()->setIndexPageAttributes('BASE_CTRL_ComponentPanel');
     OW::getRequestHandler()->setStaticPageAttributes('BASE_MCTRL_BaseDocument', 'staticDocument');
     $uri = OW::getRequest()->getRequestUri();
     // before setting in router need to remove get params
     if (strstr($uri, '?')) {
         $uri = substr($uri, 0, strpos($uri, '?'));
     }
     $router->setUri($uri);
     $defaultRoute = new OW_DefaultRoute();
     //$defaultRoute->setControllerNamePrefix('MCTRL');
     $router->setDefaultRoute($defaultRoute);
     $navService = BOL_NavigationService::getInstance();
     //
     //        // try to find static document with current uri
     //        $document = $navService->findStaticDocument($uri);
     //
     //        if ( $document !== null )
     //        {
     //            $this->documentKey = $document->getKey();
     //        }
     OW::getPluginManager()->initPlugins();
     $event = new OW_Event(OW_EventManager::ON_PLUGINS_INIT);
     OW::getEventManager()->trigger($event);
     $beckend = OW::getEventManager()->call('base.cache_backend_init');
     if ($beckend !== null) {
         OW::getCacheManager()->setCacheBackend($beckend);
         OW::getCacheManager()->setLifetime(3600);
         OW::getDbo()->setUseCashe(true);
     }
     $this->devActions();
     OW::getThemeManager()->initDefaultTheme(true);
     // setting current theme
     $activeThemeName = OW::getEventManager()->call('base.get_active_theme_name');
     $activeThemeName = $activeThemeName ? $activeThemeName : OW::getConfig()->getValue('base', 'selectedTheme');
     if ($activeThemeName !== BOL_ThemeService::DEFAULT_THEME && OW::getThemeManager()->getThemeService()->themeExists($activeThemeName)) {
         OW_ThemeManager::getInstance()->setCurrentTheme(BOL_ThemeService::getInstance()->getThemeObjectByName(trim($activeThemeName), true));
     }
     // adding static document routes
     $staticDocs = $navService->findAllMobileStaticDocuments();
     $staticPageDispatchAttrs = OW::getRequestHandler()->getStaticPageAttributes();
     /* @var $value BOL_Document */
     foreach ($staticDocs as $value) {
         OW::getRouter()->addRoute(new OW_Route($value->getKey(), $value->getUri(), $staticPageDispatchAttrs['controller'], $staticPageDispatchAttrs['action'], array('documentKey' => array(OW_Route::PARAM_OPTION_HIDDEN_VAR => $value->getKey()))));
         // TODO refactor - hotfix for TOS page
         if (UTIL_String::removeFirstAndLastSlashes($value->getUri()) == 'terms-of-use') {
             OW::getRequestHandler()->addCatchAllRequestsExclude('base.members_only', $staticPageDispatchAttrs['controller'], $staticPageDispatchAttrs['action'], array('documentKey' => $value->getKey()));
         }
     }
     //adding index page route
     $item = BOL_NavigationService::getInstance()->findFirstLocal(OW::getUser()->isAuthenticated() ? BOL_NavigationService::VISIBLE_FOR_MEMBER : BOL_NavigationService::VISIBLE_FOR_GUEST, OW_Navigation::MOBILE_TOP);
     if ($item !== null) {
         if ($item->getRoutePath()) {
             $route = OW::getRouter()->getRoute($item->getRoutePath());
             $ddispatchAttrs = $route->getDispatchAttrs();
         } else {
             $ddispatchAttrs = OW::getRequestHandler()->getStaticPageAttributes();
         }
         $router->addRoute(new OW_Route('base_default_index', '/', $ddispatchAttrs['controller'], $ddispatchAttrs['action'], array('documentKey' => array(OW_Route::PARAM_OPTION_HIDDEN_VAR => $item->getDocumentKey()))));
         $this->indexMenuItem = $item;
         OW::getEventManager()->bind(OW_EventManager::ON_AFTER_REQUEST_HANDLE, array($this, 'activateMenuItem'));
     } else {
         $router->addRoute(new OW_Route('base_default_index', '/', 'BASE_MCTRL_WidgetPanel', 'index'));
     }
     if (!OW::getRequest()->isAjax()) {
         OW::getResponse()->setDocument($this->newDocument());
         OW::getDocument()->setMasterPage(new OW_MobileMasterPage());
         OW::getResponse()->setHeader(OW_Response::HD_CNT_TYPE, OW::getDocument()->getMime() . '; charset=' . OW::getDocument()->getCharset());
     } else {
         OW::getResponse()->setDocument(new OW_AjaxDocument());
     }
     /* additional actions */
     if (OW::getUser()->isAuthenticated()) {
         BOL_UserService::getInstance()->updateActivityStamp(OW::getUser()->getId(), $this->getContext());
     }
     // adding global template vars
     $currentThemeImagesDir = OW::getThemeManager()->getCurrentTheme()->getStaticImagesUrl();
     $viewRenderer = OW_ViewRenderer::getInstance();
     $viewRenderer->assignVar('themeImagesUrl', $currentThemeImagesDir);
     $viewRenderer->assignVar('siteName', OW::getConfig()->getValue('base', 'site_name'));
     $viewRenderer->assignVar('siteTagline', OW::getConfig()->getValue('base', 'site_tagline'));
     $viewRenderer->assignVar('siteUrl', OW_URL_HOME);
     $viewRenderer->assignVar('isAuthenticated', OW::getUser()->isAuthenticated());
     $viewRenderer->assignVar('bottomPoweredByLink', '<a href="http://www.oxwall.org/" target="_blank" title="Powered by Oxwall Community Software"><img src="' . $currentThemeImagesDir . 'powered-by-oxwall.png" alt="Oxwall Community Software" /></a>');
     $viewRenderer->assignVar('adminDashboardIframeUrl', "http://static.oxwall.org/spotlight/?platform=oxwall&platform-version=" . OW::getConfig()->getValue('base', 'soft_version') . "&platform-build=" . OW::getConfig()->getValue('base', 'soft_build'));
     if (function_exists('ow_service_actions')) {
//.........这里部分代码省略.........
开发者ID:Taissas,项目名称:oxwall,代码行数:101,代码来源:mobile_application.php

示例4: base_post_handle_https_static_content

 function base_post_handle_https_static_content()
 {
     OW::getResponse()->setMarkup(preg_replace('/src="(http:)([^<>"]+)"/', "src=\"https:\$2\"", OW::getResponse()->getMarkup()));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:4,代码来源:application.php

示例5: returnResponse

 /**
  * Triggers response object to send rendered page.
  */
 public function returnResponse()
 {
     OW::getResponse()->respond();
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:api_application.php

示例6: base_post_handle_https_static_content

 function base_post_handle_https_static_content()
 {
     $markup = OW::getResponse()->getMarkup();
     $matches = array();
     preg_match_all("/<a([^>]+)>(.+?)<\\/a>/", $markup, $matches);
     $search = array_unique($matches[0]);
     $replace = array();
     for ($i = 0; $i < sizeof($search); $i++) {
         $replace[] = "<#|#|#" . $i . "#|#|#>";
     }
     $markup = str_replace($search, $replace, $markup);
     $markup = str_replace("http://", "https://", $markup);
     $markup = str_replace($replace, $search, $markup);
     OW::getResponse()->setMarkup($markup);
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:15,代码来源:application_22_04_live.php

示例7: base_post_handle_https_static_content

 function base_post_handle_https_static_content()
 {
     $markup = OW::getResponse()->getMarkup();
     $matches = array();
     preg_match_all("/<a([^>]+?)>(.+?)<\\/a>/", $markup, $matches);
     $search = array_unique($matches[0]);
     $replace = array();
     $contentReplaceArr = array();
     for ($i = 0; $i < sizeof($search); $i++) {
         $replace[] = "<#|#|#" . $i . "#|#|#>";
         if (mb_strstr($matches[2][$i], "http:")) {
             $contentReplaceArr[] = $i;
         }
     }
     $markup = str_replace($search, $replace, $markup);
     $markup = str_replace("http:", "https:", $markup);
     foreach ($contentReplaceArr as $index) {
         $search[$index] = str_replace($matches[2][$index], str_replace("http:", "https:", $matches[2][$index]), $search[$index]);
     }
     $markup = str_replace($replace, $search, $markup);
     OW::getResponse()->setMarkup($markup);
 }
开发者ID:Taissas,项目名称:oxwall,代码行数:22,代码来源:application.php

示例8: savelink

 public function savelink($param)
 {
     OW::getResponse()->setDocument(new OW_AjaxDocument());
     var_dump($param);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:5,代码来源:admin.php


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