Open Journal Systems  3.3.0
LinkAction.inc.php
1 <?php
22 class LinkAction {
24  var $_id;
25 
28 
30  var $_title;
31 
33  var $_toolTip;
34 
36  var $_image;
37 
48  function __construct($id, $actionRequest, $title = null, $image = null, $toolTip = null) {
49  $this->_id = $id;
50  assert(is_a($actionRequest, 'LinkActionRequest'));
51  $this->_actionRequest = $actionRequest;
52  $this->_title = $title;
53  $this->_image = $image;
54  $this->_toolTip = $toolTip;
55  HookRegistry::call('LinkAction::construct', array($this));
56  }
57 
58 
59  //
60  // Getters and Setters
61  //
66  function getId() {
67  return $this->_id;
68  }
69 
74  function getActionRequest() {
75  return $this->_actionRequest;
76  }
77 
82  function getTitle() {
83  return $this->_title;
84  }
85 
90  function setTitle($title) {
91  $this->_title = $title;
92  }
93 
98  function getToolTip() {
99  return $this->_toolTip;
100  }
101 
107  function getHoverTitle() {
108  if ($this->getToolTip()) {
109  return $this->getToolTip();
110  } else {
111  // for the locale key, remove any unique ids from the id.
112  $id = preg_replace('/([^-]+)\-.+$/', '$1', $this->getId());
113  $title = __('grid.action.' . $id);
114  return $title;
115  }
116  }
117 
122  function getImage() {
123  return $this->_image;
124  }
125 }
126 
127 
LinkAction\setTitle
setTitle($title)
Definition: LinkAction.inc.php:105
LinkAction\getTitle
getTitle()
Definition: LinkAction.inc.php:97
LinkAction\getActionRequest
getActionRequest()
Definition: LinkAction.inc.php:89
LinkAction\getImage
getImage()
Definition: LinkAction.inc.php:137
LinkAction\getId
getId()
Definition: LinkAction.inc.php:81
LinkAction\getToolTip
getToolTip()
Definition: LinkAction.inc.php:113
LinkAction
Base class defining an action that can be performed by the user in the user interface.
Definition: LinkAction.inc.php:22
LinkAction\$_actionRequest
$_actionRequest
Definition: LinkAction.inc.php:33
LinkAction\__construct
__construct($id, $actionRequest, $title=null, $image=null, $toolTip=null)
Definition: LinkAction.inc.php:63
LinkAction\$_image
$_image
Definition: LinkAction.inc.php:51
LinkAction\$_title
$_title
Definition: LinkAction.inc.php:39
LinkAction\$_id
$_id
Definition: LinkAction.inc.php:27
LinkAction\$_toolTip
$_toolTip
Definition: LinkAction.inc.php:45
HookRegistry\call
static call($hookName, $args=null)
Definition: HookRegistry.inc.php:86
LinkAction\getHoverTitle
getHoverTitle()
Definition: LinkAction.inc.php:122