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


PHP XenForo_Helper_Cookie::deleteCookie方法代码示例

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


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

示例1: actionIndex

 /**
  *
  * @see XenForo_ControllerAdmin_Option::actionIndex()
  */
 public function actionIndex()
 {
     $response = parent::actionIndex();
     if ($response instanceof XenForo_ControllerResponse_View) {
         $addOns = $this->_getAddOnModel()->getAllAddOns();
         $addOnId = $this->_input->filterSingle('addon_id', XenForo_Input::STRING);
         if (!empty($GLOBALS['XenForo_Route_PrefixAdmin_Options']) && !$addOnId) {
             $addOnId = XenForo_Helper_Cookie::getCookie('edit_addon_id');
         }
         if ($addOnId) {
             XenForo_Helper_Cookie::setCookie('edit_addon_id', $addOnId);
         } else {
             XenForo_Helper_Cookie::deleteCookie('edit_addon_id');
         }
         $groupCount = count($response->params['groups']);
         if ($addOnId && !empty($addOns[$addOnId])) {
             XenForo_Helper_Cookie::setCookie('edit_addon_id', $addOnId);
             $addOn = $addOns[$addOnId];
             $response->params['addOnSelected'] = $addOnId;
             if ($addOnId) {
                 foreach ($response->params['groups'] as $groupKey => $group) {
                     if ($addOnId != $group['addon_id']) {
                         unset($response->params['groups'][$groupKey]);
                     }
                 }
             }
             $this->canonicalizeRequestUrl(XenForo_Link::buildAdminLink('add-ons/options', $addOn));
         } else {
             $this->canonicalizeRequestUrl(XenForo_Link::buildAdminLink('add-ons/options', array('addon_id' => '')));
         }
         $response->params['addOns'] = $addOns;
         $response->params['groupCount'] = $groupCount;
     }
     return $response;
 }
开发者ID:ThemeHouse-XF,项目名称:Options,代码行数:39,代码来源:Option.php

示例2: actionLanguage

 /**
  * Displays a form to change the visitor's language, or changes it if a language_id is present.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionLanguage()
 {
     $visitor = XenForo_Visitor::getInstance();
     if ($this->_input->inRequest('language_id')) {
         $this->_checkCsrfFromToken($this->_input->filterSingle('_xfToken', XenForo_Input::STRING));
         $languageId = $this->_input->filterSingle('language_id', XenForo_Input::UINT);
         if ($languageId) {
             $languages = XenForo_Application::isRegistered('languages') ? XenForo_Application::get('languages') : XenForo_Model::create('XenForo_Model_Language')->getAllLanguagesForCache();
             if (!isset($languages[$languageId])) {
                 $languageId = 0;
             }
         }
         if ($visitor['user_id']) {
             $dw = XenForo_DataWriter::create('XenForo_DataWriter_User');
             $dw->setExistingData($visitor['user_id']);
             $dw->set('language_id', $languageId);
             $dw->save();
             XenForo_Helper_Cookie::deleteCookie('language_id');
         } else {
             XenForo_Helper_Cookie::setCookie('language_id', $languageId, 86400 * 365);
         }
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(false, false));
     } else {
         $languages = XenForo_Application::isRegistered('languages') ? XenForo_Application::get('languages') : XenForo_Model::create('XenForo_Model_Language')->getAllLanguagesForCache();
         $viewParams = array('languages' => $this->getModelFromCache('XenForo_Model_Language')->getAllLanguages(), 'redirect' => $this->getDynamicRedirect(false, false));
         return $this->responseView('XenForo_ViewPublic_Misc_Language', 'language_chooser', $viewParams);
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:33,代码来源:Misc.php

示例3: getVisitor

 public static function getVisitor(XenForo_Visitor &$visitor)
 {
     if (class_exists('Sedo_DetectBrowser_Listener_Visitor') && isset($visitor->getBrowser['isMobile'])) {
         //External Addon
         $isMobile = $visitor->getBrowser['isMobile'];
         $isTablet = $visitor->getBrowser['isTablet'];
     } else {
         //XenForo
         $isMobile = XenForo_Visitor::isBrowsingWith('mobile');
         $isTablet = '';
     }
     if (!empty($isMobile)) {
         $options = XenForo_Application::get('options');
         $mobileStyle = $options->sedoDefaultMobileStyle;
         if (!empty($isTablet)) {
             $mobileStyle = $options->sedoDefaultTabletStyle;
         }
         if (!empty($visitor['user_id'])) {
             //Only for members => guests use the default style option (unless they have choosen to use another style =>cookie: style_id)
             XenForo_Helper_Cookie::deleteCookie('style_id');
             //case: visitor changed the default style, then log
             $getCookie = XenForo_Helper_Cookie::getCookie('mobile_style_id');
             // the mobile_style_id is set here: Sedo_MobileStyleSelector_ControllerPublic_Misc
             if ($getCookie == false) {
                 //No cookie => continue to force mobile style
                 $visitor['style_id'] = $mobileStyle;
             }
         }
         //Force style
         if ($options->sedoForceMobileStyle && $visitor->style_id != $mobileStyle) {
             $visitor['style_id'] = $mobileStyle;
         }
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:34,代码来源:Visitor.php

示例4: actionRevert

 public function actionRevert()
 {
     if ($cookies = XenForo_Helper_Cookie::getCookie('EWRporta')) {
         foreach ($cookies as $key => $cookie) {
             XenForo_Helper_Cookie::deleteCookie('EWRporta[' . $key . '][order]');
             XenForo_Helper_Cookie::deleteCookie('EWRporta[' . $key . '][position]');
         }
     }
     return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('portal/blocks'));
 }
开发者ID:Sywooch,项目名称:forums,代码行数:10,代码来源:Portal.php

示例5: actionIndex

 public function actionIndex()
 {
     $class = $this->_input->filterSingle('class', XenForo_Input::STRING);
     if ($class) {
         return $this->responseReroute(__CLASS__, 'view');
     }
     $addOns = $this->_getAddOnModel()->getAllAddOns();
     $xenOptions = XenForo_Application::get('options');
     $addOnSelected = '';
     if ($xenOptions->th_dataWriters_enableAddOnChooser) {
         $addOnId = $this->_input->filterSingle('addon_id', XenForo_Input::STRING);
         if (!empty($GLOBALS['ThemeHouse_DataWriters_Route_PrefixAdmin_DataWriters']) && !$addOnId) {
             $addOnId = XenForo_Helper_Cookie::getCookie('edit_addon_id');
         }
         if ($addOnId && !empty($addOns[$addOnId])) {
             XenForo_Helper_Cookie::setCookie('edit_addon_id', $addOnId);
             $addOn = $addOns[$addOnId];
             $addOnSelected = $addOnId;
             $this->canonicalizeRequestUrl(XenForo_Link::buildAdminLink('add-ons/data-writers', $addOn));
         } else {
             $this->canonicalizeRequestUrl(XenForo_Link::buildAdminLink('add-ons/data-writers'));
             XenForo_Helper_Cookie::deleteCookie('edit_addon_id');
         }
     }
     $addOns['XenForo'] = array('addon_id' => 'XenForo', 'active' => true, 'title' => 'XenForo');
     $rootPath = XenForo_Autoloader::getInstance()->getRootDir();
     $dataWriters = array();
     $dataWriterCount = 0;
     $totalDataWriters = 0;
     foreach ($addOns as $addOnId => $addOn) {
         $dataWriterPath = $rootPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $addOnId) . DIRECTORY_SEPARATOR . 'DataWriter';
         if (!file_exists($dataWriterPath)) {
             continue;
         }
         $directory = new RecursiveDirectoryIterator($dataWriterPath);
         $iterator = new RecursiveIteratorIterator($directory);
         $regex = new RegexIterator($iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH);
         foreach ($regex as $fileinfo) {
             $classPath = str_replace($rootPath, '', $fileinfo[0]);
             $classPath = pathinfo($classPath, PATHINFO_DIRNAME) . DIRECTORY_SEPARATOR . pathinfo($classPath, PATHINFO_FILENAME);
             $dirs = explode(DIRECTORY_SEPARATOR, $classPath);
             $dirs = array_filter($dirs);
             $className = implode('_', $dirs);
             if (!$xenOptions->th_dataWriters_enableAddOnChooser || !$addOnSelected || $addOnId == $addOnSelected) {
                 $dataWriters[$addOnId][$className] = array('class' => $className, 'filename' => pathinfo($classPath, PATHINFO_FILENAME));
                 $dataWriterCount++;
             }
             $totalDataWriters++;
         }
     }
     unset($addOns['XenForo']);
     $viewParams = array('addOns' => $addOns, 'addOnSelected' => $addOnSelected, 'dataWriters' => $dataWriters, 'dataWriterCount' => $dataWriterCount, 'totalDataWriters' => $totalDataWriters);
     return $this->responseView('ThemeHouse_DataWriters_ViewAdmin_DataWriter_List', 'th_datawriter_list_datawriters', $viewParams);
 }
开发者ID:ThemeHouse-XF,项目名称:DataWriters,代码行数:54,代码来源:DataWriter.php

示例6: actionLocation

 /**
  * Displays a form to change the visitor's location, or changes it if a location_id is present.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionLocation()
 {
     $visitor = XenForo_Visitor::getInstance();
     if ($this->_input->inRequest('location')) {
         $this->_checkCsrfFromToken($this->_input->filterSingle('_xfToken', XenForo_Input::STRING));
         $localtion = $this->_input->filterSingle('location', XenForo_Input::STRING);
         if ($localtion) {
             $locations = array();
             $options = XenForo_Application::get('options');
             if (!empty($options->BRTC_locations) && is_array($options->BRTC_locations)) {
                 $locations = $options->BRTC_locations;
             }
             if (!isset($locations[$localtion])) {
                 $localtion = '';
             }
         }
         if ($visitor['user_id']) {
             $dw = XenForo_DataWriter::create('XenForo_DataWriter_User');
             $dw->setExistingData($visitor['user_id']);
             $dw->set('location', $localtion);
             $dw->save();
             XenForo_Helper_Cookie::deleteCookie('location');
         } else {
             if ($localtion) {
                 XenForo_Helper_Cookie::setCookie('location', $localtion, 86400 * 365);
             } else {
                 XenForo_Helper_Cookie::deleteCookie('location');
             }
         }
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(false, false));
     } else {
         $locations = array();
         $options = XenForo_Application::get('options');
         if (!empty($options->BRTC_locations) && is_array($options->BRTC_locations)) {
             $locations = $options->BRTC_locations;
         }
         $viewParams = array('locations' => $locations, 'redirect' => $this->_input->filterSingle('redirect', XenForo_Input::STRING));
         return $this->responseView('XenForo_ViewPublic_Misc_Location', 'BRTC_location_chooser', $viewParams);
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:45,代码来源:Misc.php

示例7: actionRunDeferred

 public function actionRunDeferred()
 {
     $redirect = $this->getDynamicRedirectIfNot(XenForo_Link::buildAdminLink('tools/run-deferred'));
     $input = $this->_input->filter(array('execute' => XenForo_Input::UINT));
     /* @var $deferModel XenForo_Model_Deferred */
     $deferModel = $this->getModelFromCache('XenForo_Model_Deferred');
     $status = '';
     $canCancel = false;
     if (XenForo_Helper_Cookie::getCookie('cancel_defer')) {
         $deferModel->cancelFirstRunnableDeferred();
         XenForo_Helper_Cookie::deleteCookie('cancel_defer');
     }
     if ($input['execute'] && $this->_request->isPost()) {
         $continued = $deferModel->run(true, null, $status, $canCancel);
         if (!$continued) {
             return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $redirect);
         }
     }
     $viewParams = array('status' => $status, 'canCancel' => $canCancel, 'redirect' => $redirect);
     $containerParams = array('containerTemplate' => 'PAGE_CONTAINER_SIMPLE', 'allowManualDeferredRun' => false);
     return $this->responseView('XenForo_ViewAdmin_Tools_RunDeferred', 'tools_run_deferred', $viewParams, $containerParams);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:22,代码来源:Tools.php

示例8: actionMultiQuote

 public function actionMultiQuote()
 {
     $input = $this->_input->filter(array('formId' => XenForo_Input::STRING, 'quoteSelections' => array(XenForo_Input::STRING, 'array' => true)));
     if ($this->_request->has('postIds')) {
         $mode = 'quote';
         $quoteIds = $this->_input->filterSingle('postIds', array(XenForo_Input::STRING, 'array' => true));
         $postIds = array();
         foreach ($quoteIds as $quoteId) {
             $postId = preg_replace('/^(\\d+)(-\\d+)?$/', '$1', $quoteId);
             $postIds[$postId] = $postId;
         }
     } else {
         $mode = 'overlay';
         $cookieValue = XenForo_Helper_Cookie::getCookie('MultiQuote');
         $postIds = explode(',', $cookieValue);
     }
     if (empty($postIds)) {
         return $this->responseError(new XenForo_Phrase('no_messages_selected'));
     }
     $visitor = XenForo_Visitor::getInstance();
     $threadModel = $this->_getThreadModel();
     $postModel = $this->_getPostModel();
     $posts = $postModel->getPostsByIds($postIds, array('join' => XenForo_Model_Post::FETCH_USER | XenForo_Model_Post::FETCH_THREAD | XenForo_Model_Post::FETCH_FORUM, 'permissionCombinationId' => $visitor['permission_combination_id']));
     // permission filter
     foreach ($posts as $postId => $post) {
         $post['permissions'] = XenForo_Permission::unserializePermissions($post['node_permission_cache']);
         if (!$postModel->canViewPostAndContainer($post, $post, $post, $null, $post['permissions'])) {
             unset($posts[$postId]);
         }
     }
     $viewParams = array('formId' => $input['formId']);
     $bbCodeModel = $this->getModelFromCache('XenForo_Model_BbCode');
     if ($mode == 'overlay') {
         $datedPosts = array();
         foreach ($posts as $postId => $post) {
             $i = 1;
             $quoteId = $postId . '-1';
             if (array_key_exists($quoteId, $input['quoteSelections'])) {
                 do {
                     $message = $bbCodeModel->getBbCodeFromSelectionHtml($input['quoteSelections'][$quoteId]);
                     $datedPosts[$post['post_date']][$quoteId] = $post;
                     $datedPosts[$post['post_date']][$quoteId]['message'] = $message;
                     $quoteId = $postId . '-' . ++$i;
                 } while (array_key_exists($quoteId, $input['quoteSelections']));
             } else {
                 $datedPosts[$post['post_date']][$postId] = $post;
             }
         }
         ksort($datedPosts);
         $posts = array();
         foreach ($datedPosts as $postDate => $postIds) {
             foreach ($postIds as $postId => $post) {
                 $posts[$postId] = $post;
             }
         }
         if (empty($posts)) {
             // clear the cookie, as its value is invalid or unusable
             XenForo_Helper_Cookie::deleteCookie('MultiQuote');
             return $this->responseError(new XenForo_Phrase('selected_messages_not_found'));
         }
         $viewParams['posts'] = $posts;
         return $this->responseView('XenForo_ViewPublic_Thread_MultiQuoteOverlay', 'thread_multi_quote_overlay', $viewParams);
     } else {
         $orderedPosts = array();
         foreach ($quoteIds as $quoteId) {
             $postId = $this->_getPostIdFromQuoteId($quoteId);
             if (isset($posts[$postId])) {
                 $orderedPosts[$quoteId] = $posts[$postId];
                 if (array_key_exists($quoteId, $input['quoteSelections'])) {
                     $message = $bbCodeModel->getBbCodeFromSelectionHtml($input['quoteSelections'][$quoteId]);
                     $orderedPosts[$quoteId]['message'] = $message;
                 }
             }
         }
         $viewParams['posts'] = $orderedPosts;
         $quotes = '';
         foreach ($orderedPosts as $post) {
             $quotes .= trim($postModel->getQuoteTextForPost($post)) . "\n\n";
         }
         $viewParams['quote'] = trim($quotes);
         return $this->responseView('XenForo_ViewPublic_Thread_MultiQuote', '', $viewParams);
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:83,代码来源:Thread.php

示例9: delete

 /**
  * Deletes the current session. The session cookie will be removed as well.
  */
 public function delete()
 {
     if ($this->_sessionExists) {
         $this->deleteSessionFromSource($this->_sessionId);
         if (!headers_sent()) {
             XenForo_Helper_Cookie::deleteCookie($this->_config['cookie'], true);
         }
     }
     $this->_session = array();
     $this->_dataChanged = false;
     $this->_sessionId = '';
     $this->_sessionExists = false;
     $this->_saved = false;
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:17,代码来源:Session.php

示例10: clearCookie

 /**
  * Clears the inline mod cookie for the given type.
  */
 public function clearCookie()
 {
     XenForo_Helper_Cookie::deleteCookie('inlinemod_' . $this->inlineModKey);
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:7,代码来源:Abstract.php

示例11: actionChangeStyle

 public function actionChangeStyle()
 {
     $visitor = XenForo_Visitor::getInstance()->toArray();
     $styleModel = $this->_getStyleModel();
     $styleModel->setAdminStyles(true);
     if ($this->_input->inRequest('style_id')) {
         $styleId = $this->_input->filterSingle('style_id', XenForo_Input::UINT);
         if ($styleId) {
             $styles = XenForo_Application::isRegistered('adminStyles') ? XenForo_Application::get('adminStyles') : $styleModel->getAllStyles();
             if (!isset($styles[$styleId]) || !$styles[$styleId]['brass_user_selectable'] && !$visitor['is_admin']) {
                 $styleId = 0;
             }
         }
         if ($visitor['user_id']) {
             $dw = XenForo_DataWriter::create('XenForo_DataWriter_User');
             $dw->setExistingData($visitor['user_id']);
             $dw->set('brass_admin_style_id', $styleId);
             $dw->save();
             XenForo_Helper_Cookie::deleteCookie('brass_admin_style_id');
         } else {
             XenForo_Helper_Cookie::setCookie('brass_admin_style_id', $styleId, 86400 * 365);
         }
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(false, false));
     } else {
         $styles = $styleModel->getAllStylesAsFlattenedTree();
         $styleId = $this->_input->filterSingle('style_id', XenForo_Input::UINT);
         if ($styleId && !empty($styles[$styleId]['brass_user_selectable'])) {
             $style = $styles[$styleId];
         } else {
             $style = false;
         }
         $viewParams = array('styles' => $styles, 'targetStyle' => $style, 'redirect' => $this->_input->filterSingle('redirect', XenForo_Input::STRING), 'isManagerAdminStyle' => XenForo_Visitor::getInstance()->hasAdminPermission('BRASS_adminStyle'));
         return $this->responseView('Brivium_AdminStyleSystem_ViewAdmin_Style', 'BRASS_style_chooser', $viewParams);
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:35,代码来源:AdminTemplate.php


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