function showImage(&$row, &$params, &$menuImgStr, &$spanStyle) { /** /* Function Desc- If an image can be displayed it will set $menuImgStr to /* a string of html to be used */ $menuImage = mygosu_menus::getMenuImage($row->params); /*echo ("<script type='text/javascript'>alert ('name = ".$row->name." image = ".$menuImage."');</script>");*/ $imgLoc = $GLOBALS["mosConfig_absolute_path"] . "/images/stories/" . $menuImage; if (!file_exists($imgLoc)) { return ""; } // if image doesn't exist then return "" if ($menuImage != "" && $menuImage != "-1") { $spanStyle = " style='margin:0px 0px 0px " . ($params->get('img_resizew') + 2) . "px;'"; if ($params->get('img_resize')) { $thumb = mygosu_menus::resizeMenuImage($imgLoc, $params->get('img_resizew'), $params->get('img_resizeh')); if ($thumb) { $menuImgStr = "<img class='lftImg' border='0' src='" . htmlspecialchars($thumb) . "' alt='menu_thumb'/>"; } } if ($menuImgStr == "") { $menuImgStr = "<span><img class='lftImg' border='0' src='" . $GLOBALS["mosConfig_live_site"] . "/images/stories/" . htmlspecialchars($menuImage) . "' alt='menu_thumb'/></span>"; } } }
*****************************************************************************/ defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); /** /* Loads main class file */ $params->set('module_name', 'Mygosu Menus'); $params->set('module', 'infinity_menus'); $params->set('absPath', $mosConfig_absolute_path . '/modules/' . $params->get('module')); $params->set('LSPath', $mosConfig_live_site . '/modules/' . $params->get('module')); include_once $params->get('absPath') . '/mainclass.php'; /** /* Loads menu items */ $query = "SELECT * FROM #__menu " . "\n WHERE menutype = '" . $params->get('menu') . "' " . "\n AND access <= {$my->gid} " . "\n AND published = '1' " . "\n ORDER BY '" . $params->get('order') . "' ASC "; $database->setQuery($query); $menus = $database->loadObjectList(); /** /* Instantiate Menu */ $mensys = new mygosu_menus($params); /** /* Load Menu Items */ $mensys->mygosu_menu_items($database, $my->gid, $params, 0, 0, 0); /** /* End Menu */ $mensys->module_end($params); ?>
function NewItem(&$level, &$params, &$row, &$subMenus, &$name, &$cssRepeatNum, &$target, &$link) { /** /* Function Desc - Writes html for a new drop down item */ $parentImgStr = ""; $menuImage = ""; $menuImgStr = ""; $spanStyle = ""; $levTabs = str_repeat("\t", $level); if ($level == 0) { $itemClass = "parentItem"; } else { $itemClass = "subItem_{$cssRepeatNum}"; } // class for menu item if ($level == 0 && $this->DDownPositioning == "horizontal") { echo "\t\t<td>\n"; } if ($params->get('show_img')) { mygosu_menus::showImage($row, $params, $menuImgStr, $spanStyle); } if ($subMenus && $params->get('img_parent') != -1 && $params->get('show_img_rgt') == "1") { // bug fix by Srdan Mahmutovic 2005-06-21 (before it wasn't checking the show img_parent parameter) $parentImgStr = "<img class='rgtImg' border='0' src='" . $this->imgPath . $params->get('img_parent') . "' alt='" . $name . "'/>"; } if ($row->type != "separator") { // Search engine friendly url code mod by Srdan Mahmutovic 2005-06-30 print "\t\t\t" . $levTabs . "<div class='menuCont_{$cssRepeatNum}' ><a class='" . $itemClass . "' target=" . $target . " href='" . htmlspecialchars(sefRelToAbs($link)) . "'>" . $menuImgStr . "<span" . $spanStyle . ">" . htmlentities($row->name) . " </span>" . $parentImgStr . "</a></div>\n"; } else { print "\t\t\t" . $levTabs . "<div class='separator' ><a href='javascript:void();'>" . $row->name . "</a></div>\n"; } }