Example #1
0
function select_catalog($currentid = "0", $cid = "0", $level = 1, $optgroup = '0', $type = '0')
{
    global $_catalog_array;
    if (isset($_catalog_array[$cid])) {
        foreach ($_catalog_array[$cid] as $root => $cata) {
            $t = $level == '1' ? "" : "├ ";
            $c = $level == '1' ? "p3" : "p4";
            $selected = $currentid == $cata['id'] ? "selected='selected'" : "";
            if (empty($cata['url']) && $cata['issend'] == "1") {
                if ($type == 'page') {
                    ($cata['attrib'] == 'channel' || $cata['attrib'] == 'list') && ($_option .= select_catalog($currentid, $cata['id'], $level + 1, 0, 'page'));
                    $cata['attrib'] == 'page' && ($_option .= "<option value='{$cata['id']}' class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[p:{$cata['dir']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1, 0, 'page'));
                } else {
                    if ($optgroup == 1) {
                        if ($cata['attrib'] == 'channel') {
                            $_option .= "<optgroup label=\"{$cata['name']}\"></optgroup>" . select_catalog($currentid, $cata['id'], $level + 1, 1);
                        } elseif ($cata['attrib'] == 'list') {
                            $_option .= "<option value='{$cata['id']}' class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[ID:{$cata['id']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1, 1);
                        }
                    } else {
                        $cata['attrib'] != 'page' && ($_option .= "<option value='{$cata['id']}' class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[ID:{$cata['id']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1));
                    }
                }
            }
        }
    }
    unset($_catalog_array);
    return $_option;
}
Example #2
0
function select_catalog($currentid = "0", $cid = "0", $level = 1, $optgroup = '0', $type = '0', $edit_add = '', $urltiao = 'yes')
{
    //zhaoyanmin,添加$catalog ,添加或编辑内容时  $urltiao 值不为空时不显示添加了外部链接的栏目
    global $_catalog_array;
    if (isset($_catalog_array[$cid])) {
        $edit_add = $edit_add ? $edit_add : '';
        //zhaoyanmin gbk上面的
        foreach ($_catalog_array[$cid] as $root => $cata) {
            $t = $level == '1' ? "" : "├ ";
            $c = $level == '1' ? "p3" : "p4";
            $selected = $currentid == $cata['id'] ? "selected='selected'" : "";
            //if(empty($cata['url'])){
            if ($urltiao || empty($cata['url'])) {
                if ($type == 'page') {
                    /*($cata['attrib']=='channel'|| $cata['attrib']=='list') && $_option.=select_catalog($currentid,$cata['id'],$level+1,0,'page');
                    		$cata['attrib']=='page' && $_option.="<option value='{$cata['id']}' class='$c' $selected>".str_repeat("│ ", $level-1).$t.$cata['name']."[p:{$cata['dir']}] </option>".select_catalog($currentid,$cata['id'],$level+1,0,'page');*/
                    ($cata['attrib'] == 'channel' || $cata['attrib'] == 'list') && ($_option .= select_catalog($currentid, $cata['id'], $level + 1, 0, 'page', $edit_add, $urltiao));
                    //zhaoyanmin
                    $cata['attrib'] == 'page' && ($_option .= "<option value='{$cata['id']}' class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[p:{$cata['dir']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1, 0, 'page', $edit_add, $urltiao));
                    //zhaoyanmin
                } else {
                    if ($optgroup == 1) {
                        if ($cata['attrib'] == 'channel') {
                            //$_option.="<optgroup label=\"{$cata['name']}\"></optgroup>".select_catalog($currentid,$cata['id'],$level+1,1);
                            $_option .= "<optgroup label=\"{$cata['name']}\"></optgroup>" . select_catalog($currentid, $cata['id'], $level + 1, 1, $type, $edit_add, $urltiao);
                            //zhaoyanmin
                        } elseif ($cata['attrib'] == 'list') {
                            //$_option.="<option value='{$cata['id']}' class='$c' $selected>".str_repeat("│ ", $level-1).$t.$cata['name']."[ID:{$cata['id']}] </option>".select_catalog($currentid,$cata['id'],$level+1,1);
                            //zhaoyanmin start
                            if ($edit_add) {
                                $_option .= "<option value='{$cata['id']}' onclick=\"redirect('admincp.php?do=article&operation=add&cid=" . $cata['id'] . "&topid=" . $cata['topid'] . "&level=" . $cata['level'] . "');\" class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[ID:{$cata['id']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1, 1, $type, $edit_add, $urltiao);
                            } else {
                                //$_option.="<option value='{$cata['id']}' class='$c' $selected>".str_repeat("│ ", $level-1).$t.$cata['name']."[ID:{$cata['id']}] </option>".select_catalog($currentid,$cata['id'],$level+1,1);
                                $_option .= "<option value='{$cata['id']}' class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[ID:{$cata['id']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1, 1, $type, $edit_add, $urltiao);
                            }
                            //zhaoyanmin end
                        }
                    } else {
                        //$cata['attrib']!='page' && $_option.="<option value='{$cata['id']}' class='$c' $selected>".str_repeat("│ ", $level-1).$t.$cata['name']."[ID:{$cata['id']}] </option>".select_catalog($currentid,$cata['id'],$level+1);
                        $cata['attrib'] != 'page' && ($_option .= "<option value='{$cata['id']}' class='{$c}' {$selected}>" . str_repeat("│ ", $level - 1) . $t . $cata['name'] . "[ID:{$cata['id']}] </option>" . select_catalog($currentid, $cata['id'], $level + 1, $type, $edit_add, $urltiao));
                        //zhaoyanmin
                    }
                }
            }
        }
    }
    unset($_catalog_array);
    return $_option;
}
Example #3
0
<link rel="stylesheet" href="images/style.css" type="text/css" media="all" />
<script type="text/JavaScript">admincpnav('首页&nbsp;&raquo;&nbsp;HTML更新&nbsp;&raquo;&nbsp更新独立页面','');</script>
<div class="container" id="cpcontainer">
  <h3>更新独立页面</h3>
  <form name="cpform" method="get" action="admincp.php" id="cpform" >
    <input type="hidden" name="do" value="html" />
    <input type="hidden" name="operation" value="create" />
    <input type="hidden" name="action" value="page" />
    <table class="tb tb2 ">
      <tr>
        <td class="vtop tips2" width="120">独立页面:</td>
        <td class="vtop rowform"><select name="cid[]" id="cid" multiple="multiple" size="15">
          <option value='all'>所有独立页面</option>
    	  <optgroup label="======================================"></optgroup>
          <?php 
        echo select_catalog(0, 0, 1, 0, 'page');
        ?>

        </select></td>
      </tr>
      <tr>
        <td colspan="2" class="td21"><input type="submit" class="btn" name="cleanupsubmit" value="提交" /></td>
      </tr>
    </table>
  </form>
</div>
</body></html>
<?php 
        break;
    case 'create':
        set_time_limit(0);
Example #4
0
" size="36"/>
            <input name="pinyin" type="checkbox" id="pinyin" value="1" class="checkbox"/>
            拼音 </td>
          <td class="vtop tips2"><?php 
        echo $DreamCMS->config['ishtm'] ? '本栏目生成静态文件保存目录' : '为空时程序将自动以栏目名称拼音填充';
        ?>
 </td>
        </tr>
        <tr class="nobg">
          <td colspan="2" class="td27">上级栏目:</td>
        </tr>
        <tr>
          <td class="vtop rowform"><select name="rootid">
              <option value="0">无[顶级栏目]</option>
              <?php 
        echo select_catalog($rootid, 0, 1, 0, $p);
        ?>
            </select></td>
          <td class="vtop tips2">本栏目的上级栏目或分类</td>
        </tr>
        <tr class="nobg">
          <td colspan="2" class="td27">显示栏目:</td>
        </tr>
        <tr>
          <td class="vtop rowform"><ul onmouseover="altStyle(this);">
              <li<?php 
        if ($rs['ishidden'] == '0') {
            echo ' class="checked"';
        }
        ?>
>
Example #5
0
		<select name="type[]" size="10" multiple="multiple" id="type" style="width:98%;">
		<option value="0">普通文章[type='0']</option>
		<?php 
        echo $type_option;
        ?>
		</select><br />按住Ctrl可多选
	 </td>
    </tr>
  </table>
</div>
	<input name="action" type="radio" class="radio" value="articletype" id="articletype"/>文章属性
            <input name="action" type="radio" class="radio" onclick="this.form.cataid.disabled=false" value="move" /> 移动到栏目
            <select name="cataid" id="cataid" disabled>
              <option value="0">请选择栏目</option>
              <?php 
        echo select_catalog(0, 0, 1, 1);
        ?>
            </select>
            <input name="action" type="radio" class="radio" value="del" onclick="return confirm('确定要删除');"/> 删除</div></td>
      </tr>
    </table>
  </form>
</div>
<style type="text/css">
#articletypediv {position:absolute;z-index:10;top:-400px;left:-400px;display:none;width:210px; background-color:#FFFFFF; border:#CCCCCC 1px solid;}
</style>
</body></html><?php 
        break;
    case 'visible':
        $id = (int) $_GET['id'];
        $v = (int) $_GET['v'];