Open Monograph Press  3.3.0
Request.inc.php
1 <?php
2 
19 import('lib.pkp.classes.core.PKPRequest');
20 
21 class Request extends PKPRequest {
26  public function getRequestedPressPath() {
27  $press = $this->_delegateToRouter('getRequestedContextPath', 1);
28  HookRegistry::call('Request::getRequestedPressPath', array(&$press));
29  return $press;
30  }
31 
36  public function &getPress() {
37  $returner = $this->_delegateToRouter('getContext', 1);
38  return $returner;
39  }
40 
45  public function getRequestedContextPath($contextLevel = null) {
46  // Emulate the old behavior of getRequestedContextPath for
47  // backwards compatibility.
48  if (is_null($contextLevel)) {
49  return $this->_delegateToRouter('getRequestedContextPaths');
50  } else {
51  return array($this->_delegateToRouter('getRequestedContextPath', $contextLevel));
52  }
53  }
54 
59  public function &getContext($level = 1) {
60  $returner = $this->_delegateToRouter('getContext', $level);
61  return $returner;
62  }
63 
68  public function &getContextByName($contextName) {
69  $returner = $this->_delegateToRouter('getContextByName', $contextName);
70  return $returner;
71  }
72 
77  public function url($pressPath = null, $page = null, $op = null, $path = null,
78  $params = null, $anchor = null, $escape = false) {
79  return $this->_delegateToRouter('url', $pressPath, $page, $op, $path,
80  $params, $anchor, $escape);
81  }
82 
87  public function redirectHome() {
88  return $this->_delegateToRouter('redirectHome');
89  }
90 
94  public function getUserAgent() {
95  static $userAgent;
96  $userAgent = parent::getUserAgent();
97 
98  if (strpos($userAgent, 'Shockwave Flash')) {
99  $userAgent = $_SERVER['HTTP_BROWSER_USER_AGENT'];
100  }
101 
102  return $userAgent;
103  }
104 }
105 
106 
$op
$op
Definition: lib/pkp/pages/help/index.php:18
Request\getContext
& getContext($level=1)
Definition: Request.inc.php:59
PKPRequest\_delegateToRouter
& _delegateToRouter($method)
Definition: PKPRequest.inc.php:765
PKPRequest
Class providing operations associated with HTTP requests.
Definition: PKPRequest.inc.php:17
Request\url
url($pressPath=null, $page=null, $op=null, $path=null, $params=null, $anchor=null, $escape=false)
Definition: Request.inc.php:77
Request\getUserAgent
getUserAgent()
Definition: Request.inc.php:94
Request
Class providing operations associated with HTTP requests. Requests are assumed to be in the format ht...
Definition: Request.inc.php:21
Request\getRequestedPressPath
getRequestedPressPath()
Definition: Request.inc.php:26
Request\getContextByName
& getContextByName($contextName)
Definition: Request.inc.php:68
Request\getRequestedContextPath
getRequestedContextPath($contextLevel=null)
Definition: Request.inc.php:45
HookRegistry\call
static call($hookName, $args=null)
Definition: HookRegistry.inc.php:86
Request\getPress
& getPress()
Definition: Request.inc.php:36
Request\redirectHome
redirectHome()
Definition: Request.inc.php:87