/** * * @see XenForo_Route_PrefixAdmin_AddOns::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $parts = explode('/', $routePath, 3); switch ($parts[0]) { case 'languages': $parts = array_slice($parts, 1); $routePath = implode('/', $parts); $action = $router->resolveActionWithIntegerParam($routePath, $request, 'language_id'); return $router->getRouteMatch('XenForo_ControllerAdmin_Language', $action, 'languages'); case 'phrases': $parts = array_slice($parts, 1); $routePath = implode('/', $parts); return $router->getRouteMatch('XenForo_ControllerAdmin_Phrase', $routePath, 'phrases'); } if (count($parts) > 1) { switch ($parts[1]) { case 'languages': $action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id'); $parts = array_slice($parts, 2); $routePath = implode('/', $parts); $action = $router->resolveActionWithIntegerParam($routePath, $request, 'language_id'); return $router->getRouteMatch('XenForo_ControllerAdmin_Language', $action, 'languages'); case 'phrases': $action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id'); $parts = array_slice($parts, 2); $routePath = implode('/', $parts); return $router->getRouteMatch('XenForo_ControllerAdmin_Phrase', $routePath, 'phrases'); } } return parent::match($routePath, $request, $router); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $components = explode('/', $routePath); $action = strtolower(array_shift($components)); if (count($components) == 1) { // permission/<action>, etc $action .= reset($components); } else { switch ($action) { case 'permission': // permission/<group>/<permission>/<action> $request->setParam('permission_group_id', array_shift($components)); $request->setParam('permission_id', array_shift($components)); break; case 'permission-group': // permission-group/<group>/<action> $request->setParam('permission_group_id', array_shift($components)); break; case 'interface-group': // interface-group/<group>/<action> $request->setParam('interface_group_id', array_shift($components)); break; } $action .= implode('', $components); } return $router->getRouteMatch('XenForo_ControllerAdmin_Permission', $action, 'permissionsDevelopment'); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $components = explode('/', $routePath); $subPrefix = strtolower(array_shift($components)); $strParams = ''; $slice = false; switch ($subPrefix) { case 'options': $controllerName = '_Options'; $strParams = 'option_id'; $slice = true; break; case 'layouts': $controllerName = '_Layouts'; $strParams = 'layout_id'; $slice = true; break; case 'blocks': $controllerName = '_Blocks'; $strParams = 'block_id'; $slice = true; break; case 'categories': $controllerName = '_Categories'; $strParams = 'category_slug'; $slice = true; break; default: $controllerName = '_Blocks'; } $routePathAction = $slice ? implode('/', array_slice($components, 0, 2)) : $routePath; $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams); return $router->getRouteMatch('EWRporta_ControllerAdmin' . $controllerName, $action, 'EWRporta', $routePath); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $controller = 'QCPlayers_ControllerPublic_Player'; $routePath .= '/'; $action = $router->resolveActionWithStringParam($routePath, $request, 'username'); return $router->getRouteMatch($controller, $action, 'players', $routePath); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $components = explode('/', $routePath); $subPrefix = strtolower(array_shift($components)); $controllerName = ''; $action = ''; $intParams = 'page_id'; $strParams = ''; $slice = false; switch ($subPrefix) { case 'special': if (!empty($components[1]) && ($components[0] == 'edit-template' || $components[0] == 'delete-template')) { unset($components[1]); } $controllerName = '_Special'; $slice = true; break; case 'archive': $controllerName = '_Archive'; $intParams = 'history_id'; $slice = true; break; default: $strParams = 'page_slug'; } $routePathAction = implode('/', array_slice($slice ? $components : explode('/', $routePath), 0, 2)) . '/'; $routePathAction = str_replace('//', '/', $routePathAction); if ($strParams) { $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams); } else { $action = $router->resolveActionWithIntegerParam($routePathAction, $request, $intParams); } $action = $router->resolveActionAsPageNumber($action, $request); return $router->getRouteMatch('EWRcarta_ControllerPublic_Wiki' . $controllerName, $action, 'wiki', $routePath); }
/** * Attempts to match the routing path. See {@link XenForo_Route_Interface} for further details. * * @param string Routing path * @param Zend_Controller_Request_Http Request object * @param XenForo_Router Routing object * * @return false|XenForo_RouteMatch */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $lastDot = strrpos($routePath, '.'); if ($lastDot === false) { return false; } $lastSlash = strrpos($routePath, '/'); if ($lastSlash !== false && $lastDot < $lastSlash) { return false; } $responseType = substr($routePath, $lastDot + 1); if ($responseType === strval(intval($responseType))) { return false; } $newRoutePath = substr($routePath, 0, $lastDot); if (!is_string($newRoutePath)) { $newRoutePath = ''; } $match = $router->getRouteMatch(); $match->setModifiedRoutePath($newRoutePath); if ($responseType !== '') { $match->setResponseType($responseType); } return $match; }
/** * Handles routing for view page. **/ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { // Many thanks to Jaxel for his documentation on this (http://xenforo.com/community/threads/13605/) $components = explode('/', $routePath); $subPrefix = strtolower(array_shift($components)); $subSplits = explode('.', $subPrefix); $slice = false; switch ($subPrefix) { case 'confirm': $controller = "Confirm"; break; case 'delete': $controller = "Delete"; break; case 'api': $controller = "Api"; break; case 'view': default: $controller = 'View'; } $routePathAction = ($slice ? implode('/', array_slice($components, 0, 2)) : $routePath) . '/'; $routePathAction = str_replace('//', '/', $routePathAction); $action = $router->resolveActionWithStringParam($routePathAction, $request, "string_id"); return $router->getRouteMatch('AssociationMc_ControllerPublic_' . $controller, $action, 'view'); }
/** * Attempts to match the routing path. See {@link XenForo_Route_Interface} for further details. * * @param string $routePath Routing path * @param Zend_Controller_Request_Http $request Request object * @param XenForo_Router $router Routing object * * @return XenForo_RouteMatch|bool */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { if (!XenForo_Application::isRegistered('routeFiltersIn')) { return false; } $filters = XenForo_Application::get('routeFiltersIn'); if (!$filters) { return false; } foreach ($filters as $filter) { if (isset($filter['match_regex'])) { $from = $filter['match_regex']; $to = $filter['match_replace']; } else { list($from, $to) = XenForo_Link::translateRouteFilterToRegex(urldecode($filter['replace_route']), urldecode($filter['find_route'])); } $newRoutePath = preg_replace($from, $to, $routePath); if ($newRoutePath != $routePath) { $match = $router->getRouteMatch(); $match->setModifiedRoutePath($newRoutePath); return $match; } } return false; }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $components = explode('/', $routePath); if (isset($components[1]) && preg_match('#^([0-9]*)$#', $components[1], $matches)) { $request->setParam('chapter', $components[1]); $request->setParam('url_portion', $components[0]); unset($components[0], $components[1]); $action = implode('', $components); } elseif (isset($components[1]) && preg_match('#^([0-9]*):([0-9]*)$#', $components[1], $matches)) { $request->setParam('chapter', $matches[1]); $request->setParam('verse', $matches[2]); $request->setParam('url_portion', $components[0]); unset($components[0], $components[1]); $action = implode('', $components); } elseif (isset($components[1]) && preg_match('#^([0-9]*):([0-9]*)-([0-9]*)$#', $components[1], $matches)) { $request->setParam('chapter', $matches[1]); $request->setParam('verse', $matches[2]); $request->setParam('verse_to', $matches[3]); $request->setParam('url_portion', $components[0]); unset($components[0], $components[1]); $action = implode('', $components); } else { $action = $router->resolveActionWithStringParam($routePath, $request, 'url_portion'); } return $router->getRouteMatch('ThemeHouse_Bible_ControllerPublic_Bible', $action, 'bible'); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'id'); $routeMatch = $router->getRouteMatch('Dark_TaigaChat_ControllerPublic_TaigaChat', $action, 'taigachat', $routePath); //$routeMatch->setResponseType('jsonText'); return $routeMatch; }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $parts = explode('/', $routePath, 2); $controllerPart = str_replace(array('-', '/'), ' ', strtolower($parts[0])); $controllerPart = str_replace(' ', '', ucwords($controllerPart)); $action = isset($parts[1]) ? $parts[1] : ''; return $router->getRouteMatch('XenForo_ControllerPublic_InlineMod_' . $controllerPart, $action, 'forums'); }
/** * * @see XenForo_Route_Prefix_Index::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $xenOptions = XenForo_Application::get('options'); if ($xenOptions->th_noForo_noForum) { return $router->getRouteMatch('XenForo_ControllerPublic_Index', 'index', 'home'); } return parent::match($routePath, $request, $router); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller); if ($action === false) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'profile_post_id'); } return $router->getRouteMatch('XenForo_ControllerPublic_ProfilePost', $action, 'members'); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { if (preg_match('#^auto/(.*)$#i', $routePath, $match)) { $action = 'auto' . $router->resolveActionWithIntegerParam($match[1], $request, 'auto_warning_id'); return $router->getRouteMatch('XenForo_ControllerAdmin_Warning', $action, 'userWarnings'); } return parent::match($routePath, $request, $router); }
/** * @see XenForo_Route_Interface::match() * @param $routePath * @param \Zend_Controller_Request_Http $request * @param \XenForo_Router $router * @return \XenForo_RouteMatch */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $customIndex = XenForo_Application::get('customIndex'); if ($customIndex->params) { $request->setParams($customIndex->params->toArray()); } return $router->getRouteMatch($customIndex->controllerClass, $routePath, $customIndex->majorSection, $customIndex->minorSection); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $controller = 'XenGallery_ControllerPublic_Redirects_XenMedio'; $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller); if ($action == false) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'media_id'); } return $router->getRouteMatch($controller, $action); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { if (in_array($routePath, array('add', 'save'))) { $action = $routePath; } else { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'log_id'); } return $router->getRouteMatch('bdApi_ControllerAdmin_Log', $action, 'bdApi'); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $controller = 'ThreePointStudio_CustomMarkupForUser_ControllerAdmin_CMFU'; $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller); if ($action === false) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'preset_id'); } return $router->getRouteMatch($controller, $action, 'users', '3ps-cmfu/'); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'node_id'); if (!class_exists('XFCP_ThemeHouse_SocialGroups_ControllerAdmin_SocialCategory', false)) { $createClass = XenForo_Application::resolveDynamicClass('XenForo_ControllerAdmin_Forum', 'controller'); eval('class XFCP_ThemeHouse_SocialGroups_ControllerAdmin_SocialCategory extends ' . $createClass . ' {}'); } return $router->getRouteMatch('ThemeHouse_SocialGroups_ControllerAdmin_SocialCategory', $action, 'nodeTree'); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'tag_id'); $majorSection = 'Tinhte_XenTag_Tag'; if (empty($action) or strtolower($action) == 'index') { $majorSection = 'threadsPosts'; } return $router->getRouteMatch('Tinhte_XenTag_ControllerAdmin_Tag', $action, $majorSection); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { if ($routePath == 'heatmap' || $routePath == 'test-setup') { $tab = 'tools'; } else { $tab = 'users'; } return $router->getRouteMatch('DigitalPointBetterAnalytics_ControllerAdmin_Analytics', $routePath, $tab); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { if (preg_match('#^action/(.*)$#i', $routePath, $match)) { $action = 'action' . $router->resolveActionWithIntegerParam($match[1], $request, 'warning_action_id'); } else { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'warning_definition_id'); } return $router->getRouteMatch('XenForo_ControllerAdmin_Warning', $action, 'userWarnings'); }
/** * @param $routePath * @param Zend_Controller_Request_Http $request * @param XenForo_Router $router * @return false|XenForo_RouteMatch */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $controller = 'sonnb_XenGallery_ControllerAdmin_XenGallery'; $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller); if ($action === false) { $action = $router->resolveActionWithIntegerParam($routePath, $request, ''); } return $router->getRouteMatch($controller, $action, 'sonnb_xengallery'); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $controller = 'XenResource_ControllerPublic_Resource'; $action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller); if ($action === false) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'resource_id'); } return $router->getRouteMatch($controller, $action, 'resources'); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $action = $router->resolveActionWithIntegerOrStringParam($routePath, $request, 'social_forum_id', 'url_portion'); $action = $router->resolveActionAsPageNumber($action, $request); if (!class_exists('XFCP_ThemeHouse_SocialGroups_ControllerPublic_SocialForum', false)) { $createClass = XenForo_Application::resolveDynamicClass('XenForo_ControllerPublic_Forum', 'controller'); eval('class XFCP_ThemeHouse_SocialGroups_ControllerPublic_SocialForum extends ' . $createClass . ' {}'); } return $router->getRouteMatch('ThemeHouse_SocialGroups_ControllerPublic_SocialForum', $action, 'forums'); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $subcomponents = $this->_getSubcomponents(); $defaultController = $subcomponents['categories']['controller']; $action = $router->getSubComponentAction($subcomponents, $routePath, $request, $defaultController); if ($action === false) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'portalItem_id'); } return $router->getRouteMatch($defaultController, $action, 'portal'); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $action = $router->resolveActionWithIntegerParam($routePath, $request, 'profile_post_id'); $prefixComments = sprintf('%s/', self::PREFIX_COMMENTS); if (strpos($action, $prefixComments) === 0) { $request->setParam(self::PARAM_COMMENT_ID, intval(substr($action, strlen($prefixComments)))); $action = self::PREFIX_COMMENTS; } return $router->getRouteMatch('bdApi_ControllerApi_ProfilePost', $action); }
/** * Match a specific route for an already matched prefix. * * @see XenForo_Route_Interface::match() */ public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $routePath = trim($routePath, '/'); $parts = explode('/', $routePath); @(list($id, $action) = $parts); $field = $this->getField($action); $action = $router->resolveActionWithIntegerParam($routePath, $request, $field[0]); $param = ''; return $router->getRouteMatch('XenGallery_ControllerPublic_Redirects_XFRUserAlbums', $action); }
public function match($routePath, \Zend_Controller_Request_Http $request, \XenForo_Router $router) { if (is_null($this->_controller)) { throw new \XenForo_Exception(get_class($this) . ' must define $_controller or overwrite match'); } $action = $routePath; if (!is_null($this->_getKey())) { $action = $router->resolveActionWithIntegerParam($routePath, $request, $this->_getKey()); } return $router->getRouteMatch($this->_controller, $action, $this->_parent); }
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router) { $ourAction = 'tagged'; if (strpos($routePath, $ourAction . '/') === 0) { // this is our request $action = $ourAction; $request->setParam('entity_id', str_replace('/', ',', trim(substr($routePath, strlen($ourAction)), '/'))); return $router->getRouteMatch('XenForo_ControllerPublic_Member', $action, 'members'); } return parent::match($routePath, $request, $router); }