<!--<?php
include_once PrintEot('left');
if(!$action){print <<<EOT
-->
<div class="nav3 mb10 ta">
  <ul class="cc">
    <li class="current"><a href="$basename">風格列表</a></li>
    <li><a href="$basename&action=add">添加風格</a></li>
  </ul>
</div>
<h3 class="h1">css設置</h3>
<form action="$basename" method="post">
  <input type="hidden" name="action" value="setcss" />
  <div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tr class="tr1 vt">
        <td class="td1">css顯示方式設置</td>
        <td class="td2"><ul class="cc">
            <li>
              <input type="radio" value="0" name="showcss" $showcss_N>
              直接 html 顯示</li>
            <li>
              <input type="radio" value="1" name="showcss" $showcss_Y>
              以 link 方式外部引用樣式</li>
          </ul></td>
		       </tr>
    </table>
  </div>
  <div class="mb10 tac"> <span class="btn"><span>
    <button type="submit" value="提 交">提 交</button>
    </span></span> </div>
</form>
<form action="$basename" method="post">
  <input type="hidden" name="action" value="listedit" />
  <h2 class="h1">風格列表</h2>
  <div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tr class="tr2">
        <td>ID</td>
        <td>風格文件名</td>
        <td>自定義風格名</td>
        <td>開啟</td>
        <td>默認</td>
        <td>操作</td>
      </tr>
<!--
EOT;
$i=0;
foreach($allstyles as $key => $value){
$i++;
$checked = $value[1] == '1' ? "checked=CHECKED" : "";
$disabled = ($value[1] == '1' || $key == 'wind') ? '' : "disabled=true";
$rdchecked = $db_defaultstyle == $key ? "checked=CHECKED" : "";
$j_url = EncodeUrl("$basename&action=del&sid=$key");
print <<<EOT
-->
      <tr class="tr1 vt">
        <td class="td2">$i</td>
        <td class="td2">$key</td>
        <td class="td2"><input type="text" class="input input_wa" name="customname[$key]" value="$value[0]"></td>
        <td class="td2"><input type="checkbox" $checked name="ifopen[$key]" value="1"></td>
        <td class="td2"><input type="radio" name="defaultstyle" value="$key" $disabled $rdchecked></td>
        <td class="td2"><a href="$basename&action=edit&sid=$key" title="編輯" class="mr20">[編輯]</a><a title="刪除" href="$j_url">[刪除]</a></td>
<!--
EOT;
if($key!='wind'){print <<<EOT
-->
        <a title="刪除" href="$j_url"></a>
<!--
EOT;
}print <<<EOT
-->
      </tr>
<!--
EOT;
}print <<<EOT
-->
    </table>
  </div>
  <div class="mb10 tac"> <span class="btn"><span>
    <button type="submit" value="提 交">提 交</button>
    </span></span> </div>
</form>
<!--
EOT;
}elseif($action=='edit' || $action=='add'){print <<<EOT
-->
<script type="text/javascript">
function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	} else if (obj.x) {
		curleft += obj.x;
	}
	return curleft - getLeft();
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	} else if (obj.y) {
		curtop += obj.y;
	}
	return curtop - getTop();
}
function pickReback(obj,color){
	if (typeof obj == 'string') {
		obj = getObj(obj);
	}
	obj.style.color = color;
}
</script>
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript" src="js/pw_ajax.js"></script>
<script type="text/javascript" src="js/color_picker.js"></script>
<div class="nav3 mb10 ta">
  <ul class="cc">
    <li><a href="$basename">風格列表</a></li>
<!--
EOT;
if($action=='add'){ print <<<EOT
-->
    <li class="current"><a href="$basename&action=$action">添加風格</a></li>
<!--
EOT;
}else{ print <<<EOT
-->
    <li><a href="$basename&action=add">添加風格</a></li>
    <li class="current"><a href="$basename&action=$action">編輯風格</a></li>
<!--
EOT;
}print <<<EOT
-->
  </ul>
</div>
<form action="$basename" method="post">
  <input type="hidden" name="action" value="$action" />
  <input type="hidden" name="step" value="3" />
  <h2 class="h1"><b>風格核心文件編輯</b></h2>
  <div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
      <input type="hidden" name="sid" value="$sid" />
      <tr class="tr1 vt">
        <td class="td1">風格名稱</td>
        <td class="td2">$sid</td>
		<td class="td2"><div class="help_a">編輯的風格名稱</div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">image下的風格文件夾</td>
        <td class="td2"><input value="$stylepath" class="input input_wa" name="setting[0]" /></td>
		<td class="td2"><div class="help_a">此風格在image目錄下的文件夾名稱<br ／>請不要隨意修改,如果需要請先手動修改image下的目錄名</div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">template下的風格文件夾</td>
        <td class="td2"><input value="$tplpath" class="input input_wa" name="setting[1]" /></td>
		<td class="td2"><div class="help_a">此風格在template目錄下的風格文件夾名稱</div></td>
      </tr>
    </table>
  </div>
  <h2 class="h1">整體風格設置</h2>
  <div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tr class="tr1 vt">
        <td class="td1">表格內部樣式</td>
        <td class="td2"><ul class="cc list_80 list_A mr10 fl">
            <li>
              <input type="radio" value="1" name="setting[2]" $yes_Y />
              豎線風格</li>
            <li>
              <input type="radio" value="0" name="setting[2]" $yes_N />
              橫線風格</li>
          </ul></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格寬度</td>
        <td class="td2"><input value="$tablewidth" class="input input_wa" name="setting[7]" /></td>
		<td class="td2"><div class="help_a">填寫百分比或像素值。例: 98% 或 960px</div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">頭尾部表格寬度</td>
        <td class="td2"><input value="$mtablewidth" class="input input_wa" name="setting[8]" /></td>
		<td class="td2"><div class="help_a">填寫百分比或像素值。例: 98% 或 960px</div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">全局背景顏色</td>
        <td class="td2"><div class="input_img fl mr5"><i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'bgcolor',function(){pickReback('bgcolor_s',color_picker)})">選擇顏色</i>
            <input id="bgcolor" value="$bgcolor" name="setting[3]" />
          </div>
          <span id='bgcolor_s' style="background:$bgcolor;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">全局鏈接顏色</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'linkcolor',function(){pickReback('linkcolor_s',color_picker)})">選擇顏色</i>
            <input id="linkcolor" value="$linkcolor" name="setting[4]" />
          </div>
          <span id="linkcolor_s" style="background:$linkcolor;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格外邊框顏色</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'tablecolor',function(){pickReback('tablecolor_s',color_picker)})">選擇顏色</i>
            <input id="tablecolor" value="$tablecolor" name="setting[5]" />
          </div>
          <span id="tablecolor_s" style="background:$tablecolor;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格內邊框顏色</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'tdcolor',function(){pickReback('tdcolor_s',color_picker)})">選擇顏色</i>
            <input id="tdcolor" value="$tdcolor" name="setting[6]" />
          </div>
          <span id="tdcolor_s" style="background:$tdcolor;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
    </table>
  </div>
  <h2 class="h1">表格樣式顏色設置</h2>
  <div class="admin_table mb10">
    <table cellspacing="0" cellpadding="0" width="100%">
      <tr class="tr1 vt">
        <td class="td1">表格標題欄顏色</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'headcolor',function(){pickReback('headcolor_s',color_picker)})">選擇顏色</i>
            <input id="headcolor" value="$headcolor" name="setting[9]" />
          </div>
          <span id="headcolor_s" style="background:$headcolor;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		   <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格標題欄下邊框顏色</td>
        <td class="td2"><div class="input_img fl mr5"><i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'headborder',function(){pickReback('headborder_s',color_picker)})">選擇顏色</i>
            <input id="headborder" value="$headborder" name="setting[10]" />
          </div>
          <span id="headborder_s" style="background:$headborder;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		   <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">標題欄主要字體鏈接顏色</td>
        <td class="td2"><div class="input_img fl mr5"><i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'headfontone',function(){pickReback('headfontone_s',color_picker)})">選擇顏色</i>
            <input id="headfontone" value="$headfontone" name="setting[11]" />
          </div>
          <span id="headfontone_s" style="background:$headfontone;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">標題欄次要字體鏈接顏色</td>
        <td class="td2"><div class="input_img fl mr5"><i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'headfonttwo',function(){pickReback('headfonttwo_s',color_picker)})">選擇顏色</i>
            <input id="headfonttwo" value="$headfonttwo" name="setting[12]" />
          </div>
          <span id="headfonttwo_s" style="background:$headfonttwo;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格副標題欄顏色</td>
        <td class="td2"><div class="input_img fl mr5"><i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'cbgcolor',function(){pickReback('cbgcolor_s',color_picker)})">選擇顏色</i>
            <input id="cbgcolor" value="$cbgcolor" name="setting[13]" />
          </div>
          <span id="cbgcolor_s" style="background:$cbgcolor;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
<td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格副標題欄下邊框顏色</td>
        <td class="td2"><div class="input_img fl mr5"><i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'cbgborder',function(){pickReback('cbgborder_s',color_picker)})">選擇顏色</i>
            <input id="cbgborder" value="$cbgborder" name="setting[14]" />
          </div>
          <span id="cbgborder_s" style="background:$cbgborder;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">表格副標題欄字體顏色</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'cbgfont',function(){pickReback('cbgfont_s',color_picker)})">選擇顏色</i>
            <input id="cbgfont" value="$cbgfont" name="setting[15]" />
          </div>
          <span id="cbgfont_s" style="background:$cbgfont;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">論壇列表顏色一</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'forumcolorone',function(){pickReback('forumcolorone_s',color_picker)})">選擇顏色</i>
            <input id="forumcolorone" value="$forumcolorone" name="setting[16]" />
          </div>
          <span id="forumcolorone_s" style="background:$forumcolorone;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">論壇列表顏色二</td>
        <td class="td2"><div class="input_img fl mr5"> <i title="選擇顏色" class="input_color" onclick="showColorPicker(this,'forumcolortwo',function(){pickReback('forumcolortwo_s',color_picker)})">選擇顏色</i>
            <input id="forumcolortwo" value="$forumcolortwo" name="setting[17]" />
          </div>
          <span id="forumcolortwo_s" style="background:$forumcolortwo;width:50px;height:22px;border:1px solid #aaa;" class="fl"></span></td>
		  <td class="td2"><div class="help_a"></div></td>
      </tr>
      <tr class="tr1 vt">
        <td class="td1">自定義css樣式</td>
        <td class="td2"><textarea name="setting[18]" class="textarea">$extcss</textarea></td>
		 <td class="td2"><div class="help_a"></div></td>
      </tr>
    </table>
  </div>
  <div class="mb10 tac"> <span class="btn"><span>
    <button type="submit" value="提 交">提 交</button>
    </span></span> </div>
</form>
<!--
EOT;
if(0 && $action=='edit'){print <<<EOT
-->
<form action="$basename&" method="post">
<h2 class="h1"><span class="mr20">編輯風格($sid)的CSS樣式</span><span class="linka">CSS樣式文件 (“data/style/{$tplpath}_css.htm”) 不存在或不可寫，請將其設為777可寫模式</span></h2>
<div class="admin_table mb10">
<table width="100%" cellpadding="0" cellspacing="0">
<!--
EOT;
if($css_777){print <<<EOT
-->
  <tr class="tr1 vt">
    <td class="td2"><!--.toptool　　頂端自定義導航樣式
.guide　　　導航欄樣式
.t 　　　　 為表格外邊框樣式，
            表格外邊框顏色在此設置
.h 　　　　 為表格正標題欄樣式，
            設置背景顏色，邊框樣式，字體樣式
.tr2 　　　 為副標題欄樣式，即原.cbg樣式，
            可使用背景圖片等css樣式
.f9--.f14　 為字體大小控制，不建議修改
.s1--.s5　　細節字體顏色
.gray　　　 次要文字顏色
h2　　　　　首頁版塊列表(index.php)版塊名稱樣式
h3　　　　　主題列表頁文章標題名稱樣式
h4          為帖子標題的字體大小
.tpc_content帖子內容樣式
blockquote  引用內容樣式
.pages      翻頁模塊樣式，建議只修改顏色
.menu td與.menu li 下拉菜單內容背景色
.f_one,.f_two, 版塊列表(首頁)表格背景
.t_one,.t_two, 主題列表(thread.php)表格背景
.r_one,.r_two, 帖子頁面(read.php)表格背景
.btn   按鈕樣式
.input,textarea 輸入框樣式-->&nbsp;</td>
    <td class="td2">
    <textarea name="style_css" class="textarea" style="width:98%;height:420px;" title="請慎重,這里的一舉一動將改變站點整個風格">{$style_css}</textarea>
    </td>
  </tr>
<!--
EOT;
}else{print <<<EOT
-->
  <!--
EOT;
}print <<<EOT
-->
</table>
</div>
<input type="hidden" name="action" value="editcss" />
<input type="hidden" name="sid" value="$sid" />
<div class="mb10 tac"> <span class="btn"><span>
  <button type="submit" value="提 交">提 交</button>
  </span></span> </div>
</form>
<!--
EOT;
}print <<<EOT
-->
<script type="text/javascript">
var bgcolor = getObj('bgcolor').value;
if(bgcolor.search(/\#[a-fA-F0-9]{6}/) != -1){
	var color = bgcolor.substr(bgcolor.search(/\#[a-fA-F0-9]{6}/),7);
	getObj('bgcolor_s').style.color=color;
}else if(bgcolor.search(/\#[a-fA-F0-9]{3}/) != -1){
	var color = bgcolor.substr(bgcolor.search(/\#[a-fA-F0-9]{3}/),4);
	getObj('bgcolor_s').style.color=color;
}else{
	getObj('bgcolor_s').style.color='#FFFFFF';
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
