1 | <?php |
||
13 | class Carbon_Breadcrumb_Item_Renderer { |
||
14 | |||
15 | /** |
||
16 | * The item to render. |
||
17 | * |
||
18 | * @access protected |
||
19 | * @var Carbon_Breadcrumb_Item |
||
20 | */ |
||
21 | protected $item; |
||
22 | |||
23 | /** |
||
24 | * The trail object this item belongs to. |
||
25 | * |
||
26 | * @access protected |
||
27 | * @var Carbon_Breadcrumb_Trail |
||
28 | */ |
||
29 | protected $trail; |
||
30 | |||
31 | /** |
||
32 | * The trail renderer. |
||
33 | * |
||
34 | * @access protected |
||
35 | * @var Carbon_Breadcrumb_Trail_Renderer |
||
36 | */ |
||
37 | protected $trail_renderer; |
||
38 | |||
39 | /** |
||
40 | * Index of this item among the rest of the items, zero-based. |
||
41 | * |
||
42 | * @access protected |
||
43 | * @var int |
||
44 | */ |
||
45 | protected $index = 0; |
||
46 | |||
47 | /** |
||
48 | * Constructor. |
||
49 | * |
||
50 | * Creates and configures a new breadcrumb item renderer. |
||
51 | * |
||
52 | * @access public |
||
53 | * |
||
54 | * @param Carbon_Breadcrumb_Item $item The item to render. |
||
55 | * @param Carbon_Breadcrumb_Trail $trail The trail this item belongs to. |
||
56 | * @param Carbon_Breadcrumb_Trail_Renderer $trail_renderer The trail renderer. |
||
57 | * @param int $index Index of this item. |
||
58 | */ |
||
59 | public function __construct( Carbon_Breadcrumb_Item $item, Carbon_Breadcrumb_Trail $trail, Carbon_Breadcrumb_Trail_Renderer $trail_renderer, $index = 0 ) { |
||
65 | |||
66 | /** |
||
67 | * Render the item. |
||
68 | * |
||
69 | * @access public |
||
70 | * |
||
71 | * @return string $item_output The HTML of this item. |
||
72 | */ |
||
73 | public function render() { |
||
92 | |||
93 | /** |
||
94 | * Retrieve the item link URL. |
||
95 | * |
||
96 | * @access public |
||
97 | * |
||
98 | * @return string $item_link The link URL of this item. |
||
99 | */ |
||
100 | public function get_item_link() { |
||
105 | |||
106 | /** |
||
107 | * Render the item link opening tag and its "before" wrapper. |
||
108 | * |
||
109 | * @access public |
||
110 | * |
||
111 | * @return string $output The output HTML. |
||
112 | */ |
||
113 | public function render_link_before() { |
||
127 | |||
128 | /** |
||
129 | * Render the item link closing tag and its "after" wrapper. |
||
130 | * |
||
131 | * @access public |
||
132 | * |
||
133 | * @return string $output The output HTML. |
||
134 | */ |
||
135 | public function render_link_after() { |
||
150 | |||
151 | /** |
||
152 | * Render the item title, along with its before & after wrappers. |
||
153 | * |
||
154 | * @access public |
||
155 | * |
||
156 | * @return string $output The output HTML. |
||
157 | */ |
||
158 | public function render_title() { |
||
173 | |||
174 | /** |
||
175 | * Retrieve the attributes of the item link. |
||
176 | * |
||
177 | * @access public |
||
178 | * |
||
179 | * @return string $attributes_html The HTML of the item attributes. |
||
180 | */ |
||
181 | public function get_item_attributes_html() { |
||
195 | |||
196 | /** |
||
197 | * Whether the link of this item is enabled. |
||
198 | * |
||
199 | * @access public |
||
200 | * |
||
201 | * @return bool |
||
202 | */ |
||
203 | public function is_link_enabled() { |
||
211 | |||
212 | /** |
||
213 | * Retrieve the item to render. |
||
214 | * |
||
215 | * @access public |
||
216 | * |
||
217 | * @return Carbon_Breadcrumb_Item $item Item to render. |
||
218 | */ |
||
219 | public function get_item() { |
||
222 | |||
223 | /** |
||
224 | * Modify the item to render. |
||
225 | * |
||
226 | * @access public |
||
227 | * |
||
228 | * @param Carbon_Breadcrumb_Item $item Item to render. |
||
229 | */ |
||
230 | public function set_item( $item ) { |
||
233 | |||
234 | /** |
||
235 | * Retrieve the trail this item belongs to. |
||
236 | * |
||
237 | * @access public |
||
238 | * |
||
239 | * @return Carbon_Breadcrumb_Trail $trail Trail this item belongs to. |
||
240 | */ |
||
241 | public function get_trail() { |
||
244 | |||
245 | /** |
||
246 | * Modify the trail this item belongs to. |
||
247 | * |
||
248 | * @access public |
||
249 | * |
||
250 | * @param Carbon_Breadcrumb_Trail $trail Trail this item belongs to. |
||
251 | */ |
||
252 | public function set_trail( $trail ) { |
||
255 | |||
256 | /** |
||
257 | * Retrieve the trail renderer. |
||
258 | * |
||
259 | * @access public |
||
260 | * |
||
261 | * @return Carbon_Breadcrumb_Trail_Renderer $trail_renderer Trail renderer. |
||
262 | */ |
||
263 | public function get_trail_renderer() { |
||
266 | |||
267 | /** |
||
268 | * Modify the trail renderer. |
||
269 | * |
||
270 | * @access public |
||
271 | * |
||
272 | * @param Carbon_Breadcrumb_Trail_Renderer $trail_renderer Trail renderer. |
||
273 | */ |
||
274 | public function set_trail_renderer( $trail_renderer ) { |
||
277 | |||
278 | /** |
||
279 | * Retrieve the index of this item. |
||
280 | * |
||
281 | * @access public |
||
282 | * |
||
283 | * @return int $index Index of this item. |
||
284 | */ |
||
285 | public function get_index() { |
||
288 | |||
289 | /** |
||
290 | * Modify the index of this item. |
||
291 | * |
||
292 | * @access public |
||
293 | * |
||
294 | * @param int $index Index of this item. |
||
295 | */ |
||
296 | public function set_index( $index = 0 ) { |
||
299 | |||
300 | } |
||
301 |