1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: namespace Xmf\Template;
13:
14: /**
15: * Breadcrumb
16: *
17: * @category Xmf\Template\Breadcrumb
18: * @package Xmf
19: * @author trabis <lusopoemas@gmail.com>
20: * @author The SmartFactory <www.smartfactory.ca>
21: * @copyright 2011-2013 XOOPS Project (http://xoops.org)
22: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
23: * @version Release: 1.0
24: * @link http://xoops.org
25: * @since 1.0
26: */
27: class Breadcrumb extends AbstractTemplate
28: {
29: /**
30: * @var array
31: */
32: private $items = array();
33:
34: /**
35: * initialization run by parent::__construct
36: *
37: * @return void
38: */
39: protected function init()
40: {
41: $this->setTemplate('module:xmf/xmf_breadcrumb.tpl');
42: }
43:
44: /**
45: * Set the items to be shown. Items are specified as an array of
46: * breadcrumb items. Each breadcrumb item is an array of:
47: * - 'caption' => ready to display string item,
48: * - 'link' => url (omit to disable link on this item)
49: *
50: * @param array $items array of breadcrumb items
51: *
52: * @return void
53: */
54: public function setItems($items)
55: {
56: $this->items = $items;
57: }
58:
59: /**
60: * Assigning content to template
61: *
62: * @return void
63: */
64: protected function render()
65: {
66: $this->tpl->assign('xmf_breadcrumb_items', $this->items);
67: }
68: }
69: