/** * Shows the admin navigation * * @return string $ret the generated HTML for the admin navigation */ function adminNav($id = NULL, $separador = "/", $list = FALSE, $style="style='font-weight:bold'") { global $target, $type; $admin_url = $_SERVER['SCRIPT_NAME'] . '?target=' . $target . '&type=' . $type; if ($id === FALSE) { return FALSE; } else { if ($id > 0) { $id = (int) $id; $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get($id); if ($imagecategory->getVar('imgcat_id') > 0) { if ($list) { $ret = $imagecategory->getVar('imgcat_name'); } else { $ret = "<a href='" . $admin_url . "&imgcat_id=" . $imagecategory->getVar('imgcat_id') . "'>" . $imagecategory->getVar('imgcat_name') . "</a>"; } if ($imagecategory->getVar('imgcat_pid') == 0) { return "<a href='" . $admin_url . "'>" . _MD_IMGMAIN . "</a> $separador " . $ret; }elseif ($imagecategory->getVar('imgcat_pid') > 0) { $ret = adminNav($imagecategory->getVar('imgcat_pid'), $separador) . " $separador ". $ret; } } } else { return FALSE; } } return $ret; }
/** * Function to create a navigation menu in content pages. * This function was based on the function that do the same in mastop publish module * * @param int $id * @param str $separador * @param bln $list * @param str $style * @return str */ function adminNav($id = NULL, $separador = "/", $list = FALSE, $style="style='font-weight:bold'") { $admin_url = ICMS_MODULES_URL . "/system/admin.php?fct=images"; if ($id === FALSE) { return FALSE; } else { if ($id > 0) { $id = (int) $id; $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get($id); if ($imagecategory->getVar('imgcat_id') > 0) { if ($list) { $ret = $imagecategory->getVar('imgcat_name'); } else { $ret = "<a href='" . $admin_url . "&imgcat_id=" . $imagecategory->getVar('imgcat_id') . "'>" . $imagecategory->getVar('imgcat_name') . "</a>"; } if ($imagecategory->getVar('imgcat_pid') == 0) { return "<a href='" . $admin_url . "'>" . _MD_IMGMAIN . "</a> $separador " . $ret; } elseif ($imagecategory->getVar('imgcat_pid') > 0) { $ret = adminNav($imagecategory->getVar('imgcat_pid'), $separador) . " $separador ". $ret; } } } else { return FALSE; } } return $ret; }
function adminNav($id = null, $separador = "/", $list = false, $style = "style='font-weight:bold'") { global $target, $type; $admin_url = $_SERVER['PHP_SELF'] . '?target=' . $target . '&type=' . $type; if ($id == false) { return false; } else { if ($id > 0) { $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get((int) $id); if ($imagecategory->getVar('imgcat_id') > 0) { if ($list) { $ret = $imagecategory->getVar('imgcat_name'); } else { $ret = "<a href='" . $admin_url . "&imgcat_id=" . $imagecategory->getVar('imgcat_id') . "'>" . $imagecategory->getVar('imgcat_name') . "</a>"; } if ($imagecategory->getVar('imgcat_pid') == 0) { return "<a href='" . $admin_url . "'>" . _MD_IMGMAIN . "</a> {$separador} " . $ret; } elseif ($imagecategory->getVar('imgcat_pid') > 0) { $ret = adminNav($imagecategory->getVar('imgcat_pid'), $separador) . " {$separador} " . $ret; } } } else { return false; } } return $ret; }
</head> <body> <header> <div id="head-cont"> <a href="dashboard.php" id="head-logo"> </a> <button class="user-btn"><?php echo $_SESSION['username']; ?> </button> <ul id="usernav"> <li><a href="dashboard.php?page=profile">Account Settings</a></li> <li><a href="logout.php" title="Logout">Logout</a></li> </ul> <ul class="nav"> <?php $array = adminNav($_SESSION['role']); if (isset($_GET['page'])) { array_walk_recursive($array, 'genAdminNav', $_GET['page']); } else { array_walk_recursive($array, 'genAdminNav'); } ?> </ul> </div> </header> <?php if (!isset($_GET['page']) || $_GET['page'] != 'update') { echo Update::checkUpdate(); }