Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AjaxAction.inc.php
1 <?php
16 define('AJAX_REQUEST_TYPE_GET', 'get');
17 define('AJAX_REQUEST_TYPE_POST', 'post');
18 
19 import('lib.pkp.classes.linkAction.request.LinkActionRequest');
20 
22 
24  var $_remoteAction;
25 
27  var $_requestType;
28 
29 
35  function AjaxAction($remoteAction, $requestType = AJAX_REQUEST_TYPE_POST) {
36  parent::LinkActionRequest();
37  $this->_remoteAction = $remoteAction;
38  $this->_requestType = $requestType;
39  }
40 
41 
42  //
43  // Getters and Setters
44  //
49  function getRemoteAction() {
50  return $this->_remoteAction;
51  }
52 
57  function getRequestType() {
58  return $this->_requestType;
59  }
60 
61 
62  //
63  // Overridden protected methods from LinkActionRequest
64  //
68  function getJSLinkActionRequest() {
69  return '$.pkp.classes.linkAction.AjaxRequest';
70  }
71 
75  function getLocalizedOptions() {
76  return array(
77  'url' => $this->getRemoteAction(),
78  'requestType' => $this->getRequestType()
79  );
80  }
81 }
82 
83 ?>
getJSLinkActionRequest()
Class defining an AJAX action.
Abstract base class defining an action to be taken when a link action is activated.
AjaxAction($remoteAction, $requestType=AJAX_REQUEST_TYPE_POST)