Ejemplo n.º 1
0
function ach_render_mnode(&$menu, $sub)
{
    global $_CONF;
    #	echo "1";
    $iter = $menu->getIterator();
    while ($iter->hasNext()) {
        $curr = $iter->getNext();
        #$sz = $menu->getSize();
        #for($i=0;$i<$sz;$i++) {
        #	$curr = $menu->getChild($i);
        $html .= "<span class='ach_mspan'><table class='ach_menu'>\r\n\t\t\t\t<tr>";
        if ($sub == 0) {
            $html .= "<td><img src='" . $_CONF['image_url'] . "pic/menu/" . $curr->getImage() . "' /></td>";
        }
        $html .= "<td style='font-size:" . (20 - $sub) . "px;font-weight:bold;' width='100%'>";
        if ($curr->inDev()) {
            $html .= "<s>";
        }
        $html .= $curr->getName();
        if ($curr->inDev()) {
            $html .= "</s>";
        }
        $html .= "<a name='cat_" . $curr->getID() . "'></td>\r\n\t\t\t\t\t<td style='background-color:#FFFFFF;padding:3px;'><nobr><a href='?mode=menu&act=dev&state=" . $curr->getDev() . "&ac_id=" . $curr->getID() . "#cat_" . $curr->getID() . "'><img src='pic/";
        if ($curr->inDev()) {
            $html .= "red";
        } else {
            $html .= "green";
        }
        $html .= ".gif' /></a>&nbsp;<a href='javascript:hs(\"edit_m" . $curr->getID() . "\",\"block\");'><img src='pic/icon_edit.gif'></a>";
        if ($sub == 0) {
            $html .= "&nbsp;<a href='javascript:hs(\"ins_m" . $curr->getID() . "\",\"block\");'><img src='pic/b_insrow.png'></a>";
        }
        $html .= "&nbsp;&nbsp;&nbsp;<a href='?mode=menu&confirm=delete&ac_id=" . $curr->getID() . "'><img src='pic/b_drop.png'></a></nobr></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></span>";
        if ($sub == 0) {
            $html .= "<div style='display:none;color:#000000;background-color:#FFFFFF;' id='ins_m" . $curr->getID() . "'>\r\n\t\t\t\t\t<form method='post' action='?mode=menu&act=insert#cat_" . $curr->getID() . "'>\r\n\t\t\t\t\t\t<fieldset>\r\n\t\t\t\t\t\t<legend>create new sub-category</legend>\r\n\t\t\t\t\t\t<input type='hidden' name='ac_parent' value='" . $curr->getID() . "' />\r\n\t\t\t\t\t\t<input type='hidden' name='ac_image' value='NULL' />\r\n\t\t\t\t\t\t<table>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td>name</td>\r\n\t\t\t\t\t\t\t\t<td><input type='text' name='acl_name' /></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t\t\t\t\t<td><input type='submit' value='create' /></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</div>";
        }
        $html .= "<div style='display:none;color:#000000;background-color:#FFFFFF;' id='edit_m" . $curr->getID() . "'>\r\n\t\t\t\t\t<form method='post' action='?mode=menu&act=update&ac_id=" . $curr->getID() . "#cat_" . $curr->getID() . "'>\r\n\t\t\t\t\t\t<fieldset>\r\n\t\t\t\t\t\t<legend>edit category</legend>";
        if ($sub != 0) {
            $html .= "<input type='hidden' name='ac_image' value='NULL' />";
        }
        $html .= "<table>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td>name</td>\r\n\t\t\t\t\t\t\t\t<td><input type='text' name='acl_name' value='" . htmlspecialchars($curr->getName(), ENT_QUOTES) . "' /></td>\r\n\t\t\t\t\t\t\t</tr>";
        if ($sub == 0) {
            $html .= "<tr>\r\n\t\t\t\t\t\t\t\t\t<td>image</td>\r\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='ac_image' value='" . htmlspecialchars($curr->getImage(), ENT_QUOTES) . "' /></td>\r\n\t\t\t\t\t\t\t\t</tr>";
        }
        $html .= "<tr>\r\n\t\t\t\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t\t\t\t\t<td><input type='submit' value='save' /></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</div>";
        if (!$curr->isEmpty()) {
            $html .= "<div style='display:block;margin-left:25px;'>" . ach_render_mnode($curr, $sub + 4) . "</div>";
        }
    }
    return $html;
}
Ejemplo n.º 2
0
function ach_render_mnode(&$menu, $sub)
{
    global $_CONF;
    $html = "";
    $iter = $menu->getIterator();
    while ($iter->hasNext()) {
        $curr = $iter->getNext();
        if ($curr->inDev()) {
            continue;
        }
        $html .= "<span class='ach_mspan'><a href='?cat=" . $curr->getID() . "'><table class='ach_menu'>\n\t\t\t\t<tr>";
        if ($sub == 0) {
            $html .= "<td style='width:32px;'><img src='" . $_CONF['image_url'] . "pic/menu/" . $curr->getImage() . "' /></td>";
        }
        $html .= "<td style='font-size:" . (20 - $sub) . "px;font-weight:bold;";
        if ($curr->isOpen()) {
            $html .= "color:orange;";
        }
        $html .= "'>" . $curr->getName() . "</td>\n\t\t\t\t</tr>\n\t\t\t</table></a></span>";
        if ($curr->hasOpenCat() != 0) {
            $html .= "<div style='display:block;margin-left:25px;'>" . ach_render_mnode($curr, $sub + 4) . "</div>";
        }
    }
    return $html;
}