19 defined(
'XOOPS_ROOT_PATH' ) or die();
27 var $_menutop = array();
28 var $_menutabs = array();
36 function __construct()
42 function getAddon($addon)
44 $this->_obj =& $addon;
47 function addMenuTop($value, $name =
"")
50 $this->_menutop[$value] = $name;
52 $this->_menutop[$value] = $value;
56 function addMenuTopArray(
$options, $multi =
true)
61 $this->addOptionTop($k, $v);
65 $this->addOptiontop($k, $k);
71 function addMenuTabs($value, $name =
"")
74 $this->_menutabs[$value] = $name;
76 $this->_menutabs[$value] = $value;
80 function addMenuTabsArray(
$options, $multi =
true)
85 $this->addMenuTabsTop($k, $v);
89 $this->addMenuTabsTop($k, $k);
95 function addHeader($value)
97 $this->_header = $value;
100 function addSubHeader($value)
102 $this->_subheader = $value;
105 function breadcrumb_nav($basename =
"Home")
107 global $bc_site, $bc_label;
109 $return_str =
"<a href=\"/\">$basename</a>";
112 $arr = explode(
'/', $str);
116 foreach($arr as $val) {
117 $return_str .=
' > <a href="' . $site . $val .
'/">' . $bc_label[$val] .
'</a>';
120 }
else if (
$num == 1) {
122 $return_str .=
' > <a href="' . $bc_site . $arr .
'/">' . $bc_label[$arr] .
'</a>';
127 function render($currentoption = 1, $display =
true)
130 $_dirname = $this->_obj->getVar(
'dirname');
136 foreach ($this->_menutabs as $k => $menus) {
137 $menuItems[] = $menus;
140 $menuItems[$currentoption] =
'current';
141 $menu =
"<div id='buttontop_mod'>";
142 $menu .=
"<table style='width: 100%; padding: 0;' cellspacing='0'>\n<tr>";
143 $menu .=
"<td style='font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;'>";
144 foreach ($this->_menutop as $k => $v) {
145 $menu .=
" <a href=\"$k\">$v</a> |";
150 $menu .=
"<td style='text-align: right;'><strong>" . $this->_obj->getVar(
'name' ) .
"</strong> : " .
$breadcrumb .
"</td>";
151 $menu .=
"</tr>\n</table>\n";
153 $menu .=
"<div id='buttonbar_mod'><ul>";
154 foreach ($this->_menutabs as $k => $v) {
155 $menu .=
"<li id='" . $menuItems[
$i] .
"'><a href='" . XOOPS_URL .
"/modules/" . $this->_obj->getVar(
'dirname' ) .
"/" . $k .
"'><span>$v</span></a></li>\n";
158 $menu .=
"</ul>\n</div>\n";
159 if ($this->_header) {
160 $menu .=
"<h4 class='admin_header'>";
161 if (isset( $modversion[
'name'])) {
162 if ($modversion[
'image'] && $this->_obj->getVar(
'mid' ) == 1) {
163 $system_image = XOOPS_URL .
'/modules/system/images/system/' . $modversion[
'image'];
165 $system_image = XOOPS_URL .
'/modules/' . $_dirname .
'/images/' . $modversion[
'image'];
167 $menu .=
"<img src='$system_image' align='middle' height='32' width='32' alt='' />";
168 $menu .=
" " . $modversion[
'name'] .
"</h4>\n";
170 $menu .=
" " . $this->_header .
"</h4>\n";
173 if ($this->_subheader) {
174 $menu .=
"<div class='admin_subheader'>" . $this->_subheader .
"</div>\n";
176 $menu .=
'<div class="clear"> </div>';
178 if ($display ==
true) {