function ajax_load() { if (isset($_GET['action'])) { if ($_GET['action'] == 'menu') { get_menu_list(); exit; } if ($_GET['action'] == 'category_list') { get_category_list(); exit; } if ($_GET['action'] == 'blog_list') { get_blog_list(); exit; } if ($_GET['action'] == 'lol_list') { get_lol_list(); exit; } if ($_GET['action'] == 'lol_hero_list') { get_lol_hero_list(); exit; } if ($_GET['action'] == 'lol_info') { get_lol_info(); exit; } } }
function get_menu_list($pid = 0, $child = false) { global $menu_lev; $menu_lev++; $rearr = array(); if (!$child and empty($rearr)) { $rearr[0] = '顶级菜单'; } $where['status'] = 1; $where['pid'] = $pid; //if(!APP_DEBUG)$where['no_del']=0; $list = M('menu')->where($where)->order('sort asc,`group` desc')->select(); if ($list) { foreach ($list as $val) { if ($child) { $rearr[$val['id']] = get_space($menu_lev) . $val['title'] . "->({$val['url']})"; } else { $rearr[$val['id']] = $val['title'] . "->({$val['url']})"; } $temarr = get_menu_list($val['id'], true); foreach ($temarr as $key => $v) { $rearr[$key] = $v; } } } $menu_lev--; return $rearr; }
?> <input type="checkbox" name="id[]" value="<?php echo trim($row[menuid]); ?> " style="border:0px;"/> <?php } ?> </td> <td><div class="parentboard"><?php echo trim($row[menuname]); ?> </div></td> </tr> <?php get_menu_list($row['menuid'], 0, 0, $ac, $fileurl, $bghome['homemana']); ?> <!--add--> <?php } ?> <tr><td colspan="15"><div class="fixsel"><input type="submit" class="btn" id="submit_editsubmit" name="editsubmit" title="按 Enter 键可随时提交你的修改" value="提交桌面设置" /></div></td></tr> <script type="text/JavaScript">_attachEvent(document.documentElement, 'keydown', function (e) { entersubmit(e, 'editsubmit'); });</script></table>
function display_form($id = 0) { $type_event = "onClick=\"javascript: document.getElementById('menu_link').disabled="; $group_en_sw = "document.getElementById('menu_group').disabled="; $group_beg = "<select name=\"MenuGroup\" id=\"menu_group\""; $group_end = "</select>"; if ($id != 0) { $res = db_arr("SELECT * FROM `MemberMenu` WHERE `ID` = {$id}"); $name = $res['Name']; $capt = $res['Caption']; $link = $res['Link']; $group = $res['MenuGroup']; $vis_v = strpos($res['Visible'], "non") !== FALSE ? "checked" : ""; $vis_m = strpos($res['Visible'], "memb") !== FALSE ? "checked" : ""; $type = $res['MenuType']; $Onclick = htmlspecialchars_adv($res['Onclick']); //hidden params of item's editing $ed = $res['Editable']; //disabling name and link for sript's menu items $set = $ed == '0' ? "disabled" : ""; //type_group/type_link - check for enabling group/link in load process of curent item $type_group = $res['MenuType'] == 'group' ? $type_group = "checked=\"checked\"" : ""; $type_link = $res['MenuType'] == 'link' ? $type_link = "checked=\"checked\"" : ""; //enable/disable of group and link for script menu items $type_event_group = $res['Editable'] == '1' ? $type_event . "true;" . $group_en_sw . "true;\"" : ""; $type_event_link = $res['Editable'] == '1' ? $type_event . "false;" . $group_en_sw . "false;\"" : ""; //enabling of group choice $group_en = $res['MenuType'] == 'group' ? "disabled=\"disabled\">" : ">"; //group body $group_body = $group_beg . " " . $group_en . get_menu_group($res['MenuGroup']) . $group_end; $sTargetChecked = $res['Target'] == '_blank' ? ' checked="checked"' : ''; } else { $name = ""; $link = ""; $group = ""; $vis_v = ""; $vis_m = ""; $set = ""; $ed = 1; $Onclick = ""; $type_group = ""; $type_link = ""; $type_event_group = $type_event . "true;" . $group_en_sw . "true;\""; $type_event_link = $type_event . "false;" . $group_en_sw . "false;\""; $group_body = $group_beg . " " . $group_en . get_menu_group() . $group_end; $sTargetChecked = ''; } echo "<form name=\"add_field\" action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n"; echo "<table style=\"font-size: 11px\" width=\"100%\" cellspacing=\"10px\">\n"; echo "<tr>"; echo "<td>Name</td><td><input type=\"text\" name=\"Name\" {$set} value=\"{$name}\" />\n\t\t \t<input type=\"hidden\" name=\"NameH\" value = \"{$name}\" /></td></tr>\n\t\t \t<input type=\"hidden\" name=\"Onclick\" value = \"{$Onclick}\" /></td></tr>"; echo "<tr><td>Type</td><td>\n\t\t \t<input type=\"radio\" name=\"MenuType\" {$type_group} value=\"group\" {$type_event_group} />Group\n\t\t \t<input type=\"radio\" name=\"MenuType\" {$type_link} value=\"link\" {$type_event_link} />Link\n\t\t </td></tr>"; echo "<tr><td>Link</td><td><input type=\"text\" id=\"menu_link\" name=\"Link\" {$set} value=\"{$link}\" />\n\t\t Use http:// prefix if you want use URL out of your site\n\t\t <input type=\"hidden\" name=\"LinkH\" value = \"{$link}\"/></td></tr>"; echo "<tr><td>Caption</td><td><input type=\"text\" name=\"Caption\" value=\"{$capt}\" />\n\t\t Don't forget add Language Key to your Language File ! </td></tr>"; echo "<tr><td>Group</td>\n\t\t <td>{$group_body}</td></tr>"; if ($id == 0) { echo "<tr><td>After item</td><td>" . get_menu_list() . "</td></tr>"; } echo "<tr><td>Visible</td><td>\n\t\t\t<input type=\"checkbox\" name=\"VisibleVisitor\" value=\"non\" {$vis_v}/>Visitors\n\t\t\t<input type=\"checkbox\" name=\"VisibleMember\" value=\"memb\" {$vis_m}/>Members\n\t\t </td></tr>"; echo "<tr><td width=\"70\">Open in new window</td><td style=\"padding-left:35px\">\n\t\t\t<input type=\"checkbox\" name=\"Target\" {$sTargetChecked} />\n\t\t </td></tr>"; echo "<input type=\"hidden\" name=\"ItemID\" value=\"{$id}\" />"; echo "<input type=\"hidden\" name=\"Editable\" value=\"{$ed}\" />"; echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"Add\" value=\"Add\"/></td></tr>"; echo "</form><tr><td colspan=\"2\">"; echo "<a href=\"{$_SERVER['PHP_SELF']}\">Back</a></td></tr></table>"; }
echo $fileurl; ?> &do=update&id=<?php echo trim($row[menuid]); ?> " class="act">删除</a> <?php } ?> </td> </tr> <!--view--> <?php get_menu_list($row['menuid'], 0, 0, $ac, $fileurl); ?> <!--add--> <tr><td></td><td colspan="4"><div class="lastboard"><a href="###" onclick="addrow(this, 1, 1)" class="addtr">添加新菜单</a></div></td><td> </td></tr> <?php } ?>