1 | <?php |
||
14 | class AsciiArtItem implements MenuItemInterface |
||
15 | { |
||
16 | /** |
||
17 | * Possible positions of the ascii art |
||
18 | */ |
||
19 | const POSITION_CENTER = 'center'; |
||
20 | const POSITION_LEFT = 'left'; |
||
21 | const POSITION_RIGHT = 'right'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $text; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $position; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | private $artLength; |
||
37 | |||
38 | /** |
||
39 | * @param string $text |
||
40 | * @param string $position |
||
41 | */ |
||
42 | public function __construct($text, $position = self::POSITION_CENTER) |
||
51 | |||
52 | /** |
||
53 | * The output text for the item |
||
54 | * |
||
55 | * @param MenuStyle $style |
||
56 | * @param bool $selected |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getRows(MenuStyle $style, $selected = false) |
||
70 | |||
71 | /** |
||
72 | * Can the item be selected |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function canSelect() |
||
80 | |||
81 | /** |
||
82 | * Execute the items callable if required |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | public function getSelectAction() |
||
90 | |||
91 | /** |
||
92 | * Return the raw string of text |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getText() |
||
100 | |||
101 | /** |
||
102 | * Whether or not the menu item is showing the menustyle extra value |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function showsItemExtra() |
||
110 | } |
||
111 |