Example #1
0
function GetKindList($webid)
{
    global $dsql, $sys_webid;
    echo "<table width='100%' cellpadding='0' cellspacing='0' id='kindtable' class='tablelist'>";
    echo " <tr class='tdbg'>";
    echo " <td width='5%' align='center' style='padding-left:5px' class='header'>显示排序</td>";
    echo " <td width='10%' height='27' align='left' class='header' >导航名</td>";
    echo "<td width='25%' align='left' class='header'>链接地址</td>";
    echo "<td width='10%' align='left' class='header'>文字颜色</td>";
    echo "<td width='5%' align='left' class='header'>开启/关闭</td>";
    echo "<td width='5%' align='left' class='header'>管理</td>";
    echo "</tr>";
    $sql = "select id,kindname,linkurl,color,displayorder,isopen from #@__plugin_nav where pid=0 and webid={$webid} order by displayorder asc";
    $dsql->SetQuery($sql);
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        $kindname = "<input type='text' name='kindname' value=\"{$row['kindname']}\" onblur=\"kind_savekind('{$row['id']}',this.value)\">";
        $kindurl = "<input type='text' name='kindurl' style=\"width:360px;\" value=\"{$row['linkurl']}\" onblur=\"kind_saveurl('{$row['id']}',this.value)\">";
        $img = "<img style='cursor:pointer;padding-right:5px;' id='img{$row['id']}' onClick='ShowKindSon(this,{$row['id']})' src='img/explode.png' width=10 height=10 />";
        $displayorder = $row['displayorder'] == '9999' ? '' : $row['displayorder'];
        echo "<tr class='tdbg' onMouseOver=\"this.className='tdbgs'\" onMouseOut=\"this.className='tdbg'\">";
        echo "<td width='5%' align='center' style='padding-left:5px'><span style=\"display:block;width:80px;height:23px;margin:auto;\"  class=\"name{$row['id']}\" onClick=\"kind_tdclick('{$row['id']}')\">{$displayorder}</span></td>";
        echo "<td width='10%' align='left'  height=30>";
        echo "<div>{$img}<span class='areaname'>{$kindname}</span></div></td>";
        echo "<td width='25%' align='left'>";
        echo "<span class='areaname'>{$kindurl}</span>";
        echo "</td>";
        $color = "<input name=\"color\" type=\"text\" id=\"color\" size=\"12\"  onclick=\"colordialog(event)\"  value=\" {$row['color']}\" onMouseOver=\"this.className='txts'\" onMouseOut=\"this.className='txt'\" class=\"txt\" onblur=\"kind_savecolor('{$row['id']}',this.value)\" />";
        echo "<td width='10%' align='left'>{$color}</td>";
        echo "<td width='5%' align='center'>";
        $stropen = GetSymbolHtml($row['id'], $row['isopen']);
        echo $stropen;
        echo "</td>";
        echo "<td width='10%' align='left' id='td{$cid}'>&nbsp;</td>";
        echo "</tr>";
    }
    /*echo "<tr class='tdbg'><td class='order'>&nbsp;</td><td colspan='4'><div style=''><div class='lastnode'> <input type='button' class='btn_sub'  onClick='javascript:addchild_child(this,{$getrow['id']})' value='自定义链接' onMouseOver=\"this.className='btn_sub_1'\" onMouseOut=\"this.className='btn_sub'\"></div></div></td></tr>";	  */
    //echo "</td>";
    echo "</table>";
}
Example #2
0
}
//添加子链接
if ($dopost == "AddNavChild") {
    $output = array();
    $sql = "insert into #@__plugin_nav (kindname,pid,linkurl,color,webid) values('自定义','{$pid}','','','{$sys_webid}')";
    if ($dsql->ExecuteNoneQuery($sql)) {
        $id = $dsql->GetLastID();
        $kindname = "<input type='text' name='kindname' value=\"自定义\" onblur=\"kind_savekind('{$id}',this.value)\">";
        $displayorder = '';
        $kindurl = "<input type='text' name='kindurl' style=\"width:360px;\" value=\"\" onblur=\"kind_saveurl('{$id}',this.value)\">";
        $color = "<input name=\"color\" type=\"text\" id=\"color\" size=\"12\"  onclick=\"colordialog(event)\" readonly=\"true\" value=\" \" onMouseOver=\"this.className='txts'\" onMouseOut=\"this.className='txt'\" class=\"txt\" onblur=\"kind_savecolor('{$id}',this.value)\" />";
        $cell1 = "<span  class=\"name{$id}\" onClick=\"kind_tdclick('{$id}')\">&nbsp;&nbsp;</span>";
        $cell2 = "<div style='padding-left:30px;'><span class='areaname'>{$kindname}</span></div>";
        $cell3 = "<span class='areaname'>{$kindurl}</span>";
        $cell4 = $color;
        $cell5 = GetSymbolHtml($id, 1);
        $cell6 = "<span><a href='#' onclick=\"javascript:DeleteKind(this,{$row['id']})\">删除</a></span>";
        array_push($output, $cell1, $cell2, $cell3, $cell4, $cell5, $id);
        $json_string = json_encode($output);
        print_r($json_string);
    }
}
if ($dopost == 'kind_saveorder') {
    $updatesql = "update #@__plugin_nav set displayorder='{$displayorder}' where id='{$kindid}'";
    echo $updatesql;
    $dsql->ExecuteNoneQuery($updatesql);
}
//分类名称保存操作
if ($dopost == 'kind_savekind') {
    $updatesql = "update #@__plugin_nav set kindname='{$kindname}' where id='{$kindid}'";
    $dsql->ExecuteNoneQuery($updatesql);