flexible-shipping
/
vendor_prefixed
/
wpdesk
/
wp-pointer
/
src
/
WPDesk
/
Pointer
/
PointerPosition.php
views
2 weeks ago
PointerConditions.php
2 weeks ago
PointerMessage.php
2 weeks ago
PointerPosition.php
2 weeks ago
PointersScripts.php
2 weeks ago
PointerPosition.php
65 lines
| 1 | <?php |
| 2 | |
| 3 | namespace FSVendor\WPDesk\Pointer; |
| 4 | |
| 5 | /** |
| 6 | * WordPress admin pointer message position. |
| 7 | * |
| 8 | * @package WPDesk\Pointer |
| 9 | */ |
| 10 | class PointerPosition |
| 11 | { |
| 12 | const TOP = 'top'; |
| 13 | const RIGHT = 'right'; |
| 14 | const BOTTOM = 'bottom'; |
| 15 | const LEFT = 'left'; |
| 16 | /** |
| 17 | * @var string |
| 18 | */ |
| 19 | private $edge = \false; |
| 20 | /** |
| 21 | * @var string |
| 22 | */ |
| 23 | private $align; |
| 24 | public function __construct($edge = 'left', $align = 'top') |
| 25 | { |
| 26 | $this->edge = $edge; |
| 27 | $this->align = $align; |
| 28 | } |
| 29 | /** |
| 30 | * @return string |
| 31 | */ |
| 32 | public function getEdge() |
| 33 | { |
| 34 | return $this->edge; |
| 35 | } |
| 36 | /** |
| 37 | * @param string $edge |
| 38 | */ |
| 39 | public function setEdge($edge) |
| 40 | { |
| 41 | $this->edge = $edge; |
| 42 | } |
| 43 | /** |
| 44 | * @return string |
| 45 | */ |
| 46 | public function getAlign() |
| 47 | { |
| 48 | return $this->align; |
| 49 | } |
| 50 | /** |
| 51 | * @param string $align |
| 52 | */ |
| 53 | public function setAlign($align) |
| 54 | { |
| 55 | $this->align = $align; |
| 56 | } |
| 57 | /** |
| 58 | * Render as JSON. |
| 59 | */ |
| 60 | public function render() |
| 61 | { |
| 62 | echo json_encode(array('edge' => $this->edge, 'align' => $this->align)); |
| 63 | } |
| 64 | } |
| 65 |