Esempio n. 1
1
 /**
  *
  * @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);
 }
Esempio n. 2
0
 /**
  * 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 /**
  * 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');
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 /**
  * 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');
 }
Esempio n. 7
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     if (in_array($routePath, array('add', 'save'))) {
         $action = $routePath;
     } else {
         $action = $router->resolveActionWithStringParam($routePath, $request, 'client_id');
     }
     return $router->getRouteMatch('bdApi_ControllerAdmin_Client', $action, 'bdApi');
 }
Esempio n. 8
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     if (in_array($routePath, array('', 'index'))) {
         $action = $routePath;
     } else {
         $action = $router->resolveActionWithStringParam($routePath, $request, Tinhte_XenTag_Constants::URI_PARAM_TAG_TEXT);
         if (preg_match('/^page-(\\d+)$/', $action, $matches)) {
             // supports matching /tags/text/page-n links
             $request->setParam('page', $matches[1]);
             $action = 'view';
         }
     }
     return $router->getRouteMatch('Tinhte_XenTag_ControllerPublic_Tag', $action, Tinhte_XenTag_Option::get('majorSection'));
 }
Esempio n. 9
0
 /**
  * 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)
 {
     $xenOptions = XenForo_Application::get('options');
     if ($xenOptions->th_models_enableAddOnChooser) {
         $action = $router->resolveActionWithStringParam($routePath, $request, 'addon_id');
         if ($request->getParam('addon_id') == 'data-writers') {
             $action = 'data-writers' . $action;
             $request->setParam('addon_id', '');
         }
         if (strlen($action) >= strlen('data-writers') && substr($action, 0, strlen('data-writers')) == 'data-writers') {
             return $router->getRouteMatch('ThemeHouse_DataWriters_ControllerAdmin_DataWriter', substr($action, strlen('data-writers')), 'dataWriters');
         }
     }
     return parent::match($routePath, $request, $router);
 }
Esempio n. 10
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     $subPrefix = strtolower(array_shift($components));
     $subSplits = explode('.', $subPrefix);
     $controllerName = '';
     $action = '';
     $intParams = 'event_id';
     $strParams = '';
     $slice = false;
     switch ($subPrefix) {
         case 'monthly':
             $controllerName = '_Monthly';
             $strParams = 'date_select';
             $slice = true;
             break;
         case 'weekly':
             $controllerName = '_Weekly';
             $strParams = 'date_select';
             $slice = true;
             break;
         case 'daily':
             $controllerName = '_Daily';
             $strParams = 'date_select';
             $slice = true;
             break;
         case 'birthdays':
             $controllerName = '_Birthdays';
             $strParams = 'date_select';
             $slice = true;
             break;
         default:
             if (is_numeric(end($subSplits))) {
                 $controllerName = '_Event';
             }
     }
     $routePathAction = ($slice ? implode('/', array_slice($components, 0, 2)) : $routePath) . '/';
     $routePathAction = str_replace('//', '/', $routePathAction);
     $routePathAction = preg_replace('#create/\\d+#i', 'create/', $routePathAction);
     if ($strParams) {
         $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
     } elseif ($intParams) {
         $action = $router->resolveActionWithIntegerParam($routePathAction, $request, $intParams);
     }
     $action = $router->resolveActionAsPageNumber($action, $request);
     return $router->getRouteMatch('EWRatendo_ControllerPublic_Events' . $controllerName, $action, 'events', $routePath);
 }
Esempio n. 11
0
 /**
  * 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 = '';
     $action = $router->resolveActionWithStringParam($routePath, $request, 'game_title');
     $action = $router->resolveActionWithIntegerParam($routePath, $request, 'game_id');
     $actions = array_filter(explode('/', $action));
     switch (count($actions)) {
         case 4:
             $controller = '_Field';
             $request->setParam('profile_id', intval($actions[1]));
             $request->setParam('field_id', intval($actions[3]));
             $action = 'index';
             break;
         case 3:
             $controller = '_Field';
             $request->setParam('profile_id', intval($actions[1]));
             $action = 'index';
             break;
         case 2:
             if ($actions[0] == 'profiles') {
                 $controller = '_Profile';
                 $request->setParam('profile_id', intval($actions[1]));
             }
             if ($actions[0] == 'users') {
                 $controller = '_User';
                 $request->setParam('user_id', intval($actions[1]));
             }
             $action = 'edit';
             break;
         case 1:
             if ($actions[0] == 'profiles') {
                 $controller = '_Profile';
                 $action = 'index';
             } else {
                 if ($actions[0] == 'users') {
                     $controller = '_User';
                     $action = 'index';
                 }
             }
             break;
         default:
             $action = 'index';
     }
     return $router->getRouteMatch('autocraft_ControllerAdmin_Game' . $controller, $action, 'autocraft');
 }
Esempio n. 12
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $controllerName = '';
     $components = explode('/', $routePath);
     $subPrefix = strtolower(array_shift($components));
     $strParams = '';
     $slice = false;
     // Add additional portal widgets controllers here
     switch ($subPrefix) {
         case 'carousel':
             $controllerName = $controllerName . 'Carousel';
             $strParams = 'widget_id';
             $slice = true;
             break;
         default:
             $controllerName = 'Portal';
             $strParams = 'slug';
     }
     $routePathAction = $slice ? implode('/', array_slice($components, 0, 2)) : $routePath;
     $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
     return $router->getRouteMatch('WidgetPortal_ControllerPublic_Widget_' . $controllerName, $action, 'BuzzTags', $routePath);
 }
Esempio n. 13
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'addon_id');
     return $router->getRouteMatch('XenForo_ControllerAdmin_AddOn', $action, 'addOns');
 }
Esempio n. 14
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'shortName');
     return $router->getRouteMatch('Shorten_Admin_Render', $action, 'shortURL');
 }
Esempio n. 15
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithStringParam($routePath, $request, 'hook_id');
     return $router->getRouteMatch('Turki_Adv_ControllerAdmin_Hooks', $action, 'adfxf-hook');
 }
Esempio n. 16
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'bible_id');
     return $router->getRouteMatch('ThemeHouse_Bible_ControllerAdmin_Bible', $action, 'bibles');
 }
Esempio n. 17
0
 /**
  * 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)
 {
     $GLOBALS['ThemeHouse_DataWriters_Route_PrefixAdmin_DataWriters'] = $this;
     $action = $router->resolveActionWithStringParam($routePath, $request, 'class');
     return $router->getRouteMatch('ThemeHouse_DataWriters_ControllerAdmin_DataWriter', $action, 'dataWriters');
 }
Esempio n. 18
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'field_id');
     return $router->getRouteMatch('Nobita_Teams_ControllerAdmin_Field', $action, 'teamFields');
 }
Esempio n. 19
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithStringParam($routePath, $request, 'tsid');
     return $router->getRouteMatch('Moturdrn_TS3GW2Auth_ControllerPublic_Auth', $action, 'TS3Auth');
 }
Esempio n. 20
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithStringParam($routePath, $request, '');
     return $router->getRouteMatch('BBM_ControllerAdmin_Bbm', $action);
 }
Esempio n. 21
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'handler_type_id');
     $action = $router->resolveActionAsPageNumber($action, $request);
     return $router->getRouteMatch('ThemeHouse_Objects_ControllerAdmin_HandlerType', $action, 'applications');
 }
Esempio n. 22
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'identity_service_id');
     return $router->getRouteMatch('XenForo_ControllerAdmin_IdentityService', $action, 'identityServices');
 }
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'field_id');
     return $router->getRouteMatch('Waindigo_CustomFields_ControllerAdmin_SocialForumField', $action, 'socialForumFields');
 }
Esempio n. 24
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithStringParam($routePath, $request, 'code');
     return $router->getRouteMatch('ThemeHouse_ImageRestrict_ControllerPublic_Masked', $action, 'forums');
 }
Esempio n. 25
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'tag_url');
     $action = $router->resolveActionAsPageNumber($action, $request);
     return $router->getRouteMatch('XenForo_ControllerPublic_Tag', $action);
 }
Esempio n. 26
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'media_site_id');
     return $router->getRouteMatch('XenForo_ControllerAdmin_BbCodeMediaSite', $action, 'bbCodeMediaSites');
 }
Esempio n. 27
0
 /**
  * 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->resolveActionWithStringParam($routePath, $request, 'field_id');
     return $router->getRouteMatch('ThemeHouse_ObjectFields_ControllerAdmin_ObjectField', $action, 'objectFields');
 }
Esempio n. 28
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithStringParam($routePath, $request, 'layout_id');
     $action = $router->resolveActionAsPageNumber($action, $request);
     return $router->getRouteMatch('EWRporta_ControllerPublic_Portal', $action, 'portal');
 }
Esempio n. 29
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $action = $router->resolveActionWithStringParam($routePath, $request, 'drive_id');
     return $router->getRouteMatch('EWRporta_Block_Controller_Donations', $action, 'donations');
 }
Esempio n. 30
0
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     $subPrefix = strtolower(array_shift($components));
     $subSplits = explode('.', $subPrefix);
     $controllerName = '';
     $action = '';
     $intParams = 'media_id';
     $strParams = '';
     $slice = false;
     switch ($subPrefix) {
         case 'comment':
             $controllerName = '_Comment';
             $intParams = 'comment_id';
             $slice = true;
             break;
         case 'playlist':
             $controllerName = '_Playlist';
             $intParams = 'playlist_id';
             $slice = true;
             break;
         case 'category':
             $controllerName = '_Category';
             $intParams = 'category_id';
             $slice = true;
             break;
         case 'user':
             $controllerName = '_User';
             $intParams = 'user_id';
             $slice = true;
             break;
         case 'keyword':
             $controllerName = '_Keyword';
             $strParams = 'keyword_text';
             $slice = true;
             break;
         case 'service':
             $controllerName = '_Service';
             $strParams = 'service_slug';
             $slice = true;
             break;
         case 'admin':
             $controllerName = '_Admin';
             $slice = true;
             break;
         default:
             if (is_numeric(end($subSplits))) {
                 $controllerName = '_Media';
             }
     }
     if (!empty($components[1]) && is_numeric($components[1])) {
         unset($components[1]);
     }
     $routePathAction = $slice ? implode('/', array_slice($components, 0, 2)) : $routePath;
     if ($strParams) {
         $action = $router->resolveActionWithStringParam($routePathAction, $request, $strParams);
     } else {
         $action = $router->resolveActionWithIntegerParam($routePathAction, $request, $intParams);
     }
     $action = $router->resolveActionAsPageNumber($action, $request);
     $action = (int) $action > 0 ? '' : $action;
     return $router->getRouteMatch('EWRmedio_ControllerPublic_Media' . $controllerName, $action, 'media', $routePath);
 }