Open Journal Systems  3.3.0
PKPPageRouter Class Reference
Inheritance diagram for PKPPageRouter:
PKPRouter PageRouter

Public Member Functions

 getCacheablePages ()
 
 getCacheFilename ($request)
 
 getHomeUrl ($request)
 
 getInstallationPages ()
 
 getRequestedAnchor ($request)
 
 getRequestedArgs ($request)
 
 getRequestedOp ($request)
 
 getRequestedPage ($request)
 
 handleAuthorizationFailure ($request, $authorizationMessage)
 
 isCacheable ($request, $testOnly=false)
 
 redirectHome ($request)
 
 route ($request)
 
 url ($request, $newContext=null, $page=null, $op=null, $path=null, $params=null, $anchor=null, $escape=false)
 
- Public Member Functions inherited from PKPRouter
 __construct ()
 
 _authorizeInitializeAndCallRequest (&$serviceEndpoint, $request, &$args, $validate=true)
 
 _contextLevelToContextName ($contextLevel)
 
 _contextNameToContextLevel ($contextName)
 
 _urlCanonicalizeNewContext ($newContext)
 
 _urlFromParts ($baseUrl, $pathInfoArray=array(), $queryParametersArray=array(), $anchor='', $escape=false)
 
 _urlGetAdditionalParameters ($request, $params=null, $escape=true)
 
 _urlGetBaseAndContext ($request, $newContext=array())
 
getApplication ()
 
getContext ($request, $requestedContextLevel=1, $forceReload=false)
 
getContextByName ($request, $requestedContextName)
 
getDispatcher ()
 
 getHandler ()
 
 getIndexUrl ($request)
 
 getRequestedContextPath ($request, $requestedContextLevel=1)
 
 getRequestedContextPaths ($request)
 
 isCacheable ($request)
 
 setApplication ($application)
 
 setDispatcher ($dispatcher)
 
 setHandler ($handler)
 
 supports ($request)
 

Data Fields

 $_cacheFilename
 
 $_indexUrl
 
 $_installationPages = array('install', 'help', 'header', 'sidebar')
 
 $_op
 
 $_page
 
- Data Fields inherited from PKPRouter
 $_application
 
 $_contextDepth
 
 $_contextList
 
 $_contextPaths = array()
 
 $_contexts = array()
 
 $_dispatcher
 
 $_flippedContextList
 
 $_handler
 

Detailed Description

Class mapping an HTTP request to a handler or context.

Definition at line 21 of file PKPPageRouter.inc.php.

Member Function Documentation

◆ getCacheablePages()

PKPPageRouter::getCacheablePages ( )

get the cacheable pages

Returns
array

Reimplemented in PageRouter.

Definition at line 66 of file PKPPageRouter.inc.php.

Referenced by isCacheable().

◆ getCacheFilename()

PKPPageRouter::getCacheFilename (   $request)

Determine the filename to use for a local cache file.

Parameters
$requestPKPRequest
Returns
string

Reimplemented from PKPRouter.

Definition at line 153 of file PKPPageRouter.inc.php.

References $_cacheFilename, $application, PKPRouter\getApplication(), Core\getBaseDir(), and AppLocale\getLocale().

◆ getHomeUrl()

PKPPageRouter::getHomeUrl (   $request)

Get the user's "home" page URL (e.g. where they are sent after login).

Parameters
$requestPKPRequest the request to be routed

Definition at line 432 of file PKPPageRouter.inc.php.

References PKPRouter\getContext(), Application\getContextDAO(), and DAORegistry\getDAO().

Referenced by redirectHome().

◆ getInstallationPages()

PKPPageRouter::getInstallationPages ( )

get the installation pages

Returns
array

Definition at line 58 of file PKPPageRouter.inc.php.

References $_installationPages.

Referenced by route().

◆ getRequestedAnchor()

PKPPageRouter::getRequestedAnchor (   $request)

Get the anchor (#anchor) requested in the URL

@para $request PKPRequest the request to be routed

Returns
string

Definition at line 137 of file PKPPageRouter.inc.php.

◆ getRequestedArgs()

PKPPageRouter::getRequestedArgs (   $request)

Get the arguments requested in the URL.

Parameters
$requestPKPRequest the request to be routed
Returns
array

Definition at line 127 of file PKPPageRouter.inc.php.

Referenced by route().

◆ getRequestedOp()

PKPPageRouter::getRequestedOp (   $request)

Get the operation requested in the URL (assumed to exist in the requested page handler).

Parameters
$requestPKPRequest the request to be routed
Returns
string

Definition at line 115 of file PKPPageRouter.inc.php.

References $_op.

Referenced by route(), and url().

◆ getRequestedPage()

PKPPageRouter::getRequestedPage (   $request)

Get the page requested in the URL.

Parameters
$requestPKPRequest the request to be routed
Returns
String the page path (under the "pages" directory)

Definition at line 103 of file PKPPageRouter.inc.php.

References $_page.

Referenced by isCacheable(), route(), and url().

◆ handleAuthorizationFailure()

PKPPageRouter::handleAuthorizationFailure (   $request,
  $authorizationMessage 
)

Handle an authorization failure.

Parameters
$requestRequest
$authorizationMessagestring a translation key with the authorization failure message.

Reimplemented from PKPRouter.

Definition at line 414 of file PKPPageRouter.inc.php.

References Validation\redirectLogin().

◆ isCacheable()

PKPPageRouter::isCacheable (   $request,
  $testOnly = false 
)

Determine whether or not the request is cacheable.

Parameters
$requestPKPRequest
$testOnlyboolean required for unit test to bypass session check.
Returns
boolean

Definition at line 78 of file PKPPageRouter.inc.php.

References $application, PKPRouter\getApplication(), getCacheablePages(), getRequestedPage(), Config\getVar(), and Validation\isLoggedIn().

◆ redirectHome()

PKPPageRouter::redirectHome (   $request)

Redirect to user home page (or the user group home page if the user has one user group).

Parameters
$requestPKPRequest the request to be routed

Definition at line 424 of file PKPPageRouter.inc.php.

References getHomeUrl().

◆ route()

◆ url()

PKPPageRouter::url (   $request,
  $newContext = null,
  $page = null,
  $op = null,
  $path = null,
  $params = null,
  $anchor = null,
  $escape = false 
)

Build a handler request URL into PKPApplication.

Parameters
$requestPKPRequest the request to be routed
$newContextmixed Optional contextual paths
$handlerstring Optional name of the handler to invoke
$opstring Optional name of operation to invoke
$pathmixed Optional string or array of args to pass to handler
$paramsarray Optional set of name => value pairs to pass as user parameters
$anchorstring Optional name of anchor to add to URL
$escapeboolean Whether or not to escape ampersands, square brackets, etc. for this URL; default false.
Returns
string the URL

Reimplemented from PKPRouter.

Definition at line 267 of file PKPPageRouter.inc.php.

References $op, PKPRouter\_urlCanonicalizeNewContext(), PKPRouter\_urlFromParts(), PKPRouter\_urlGetAdditionalParameters(), PKPRouter\_urlGetBaseAndContext(), getRequestedOp(), and getRequestedPage().

Field Documentation

◆ $_cacheFilename

string PKPPageRouter::$_cacheFilename

cache filename

Definition at line 52 of file PKPPageRouter.inc.php.

Referenced by getCacheFilename().

◆ $_indexUrl

string PKPPageRouter::$_indexUrl

index url

Definition at line 47 of file PKPPageRouter.inc.php.

◆ $_installationPages

array PKPPageRouter::$_installationPages = array('install', 'help', 'header', 'sidebar')

pages that don't need an installed system to be displayed

Definition at line 26 of file PKPPageRouter.inc.php.

Referenced by getInstallationPages().

◆ $_op

string PKPPageRouter::$_op

the requested operation

Definition at line 42 of file PKPPageRouter.inc.php.

Referenced by getRequestedOp().

◆ $_page

string PKPPageRouter::$_page

the requested page

Definition at line 37 of file PKPPageRouter.inc.php.

Referenced by getRequestedPage().


The documentation for this class was generated from the following file: