<%@ page language="C#" autoeventwireup="true" inherits="HL_Admin_admin_PagelablePa, WebApp_deploy" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>请输入参数</title>
    <script language="JavaScript" type="text/JavaScript">
<!--
    function returnValues(){
        var labelText;
        var containHead;
        var containFoot;
        containHead = "";
        containFoot = "";
        
        LabelId = document.getElementById("LabelId").value;
        if(LabelId==""){
            alert("请选择要分页的标签ID！");
            return false;
        }
        labelText = "{HL.ShowPageLabel ID=\"<%=LabelNamestr %>\" LabelID=\""+ LabelId +"\"";
        
        if(document.getElementById("contain").value!=""){
            containHead = "<" + document.getElementById("contain").value;
            if(document.getElementById("cssname").value!=""){
                containHead = containHead + " class=\"" + document.getElementById("cssname").value + "\" ";
            }
            containHead = containHead + ">";
            containFoot = "</"+document.getElementById("contain").value+">";
        }
        
        labelText = labelText + " }";
        window.returnValue = containHead + labelText + containFoot;
        window.close();
    }
    
    function SelectLabelID(){
        var TemplateContent = window.dialogArguments.document.getElementById("ctl00_ContentPlaceHolder1_TemplateContent").value;
        if(TemplateContent!=""){
            BindLabelID(TemplateContent);
        }
    }
    
    function BindLabelID(str){
        var re = new RegExp("{HL.Label (.*?) }");
        var arr = re.exec(str);
        if(arr!=null){
            AddOption(arr[0]);
            BindLabelID(str.replace(arr[0]));
        }
    }
    
    function AddOption(str){
        if(str!=""){
            var re = new RegExp(" ID=\"(.*?)\" ","i");
            var arr = re.exec(str);
            if(arr!=null){
                optionname = arr[1];
                obj = document.getElementById("LabelIdList");
                obj.options[obj.options.length] = new Option(optionname,optionname);
            }
        }
    }
    function changevalue(obj){
        document.getElementById("LabelId").value = obj.value;
    }
    
//-->
</script>
  <style type="text/css">
  body{
      font-size:12px;
      background:#E0EEF5;
  }
  </style>
</head>
<body>
    <form id="form1" runat="server">
     <div style="width:100%;">
       <div style="height:25px; width:100%; line-height:25px; padding-left:10px;">标签名称：<asp:Label ID="LabelName" runat="server"  Text="" ></asp:Label></div>
       <hr align="center" width="95%" size="1" />
       <div>
          <div style="width:100%;">
           <div style="float:left; width:40%; text-align:right; line-height:25px;">数据标签ID：</div>
           <div style="float:left; line-height:25px;"><input id="Text1" name="LabelId" /><br />
           <select name="LabelIdList" id="LabelIdList" onchange="return changevalue(this)">
           <option value="">模板上可用的标签</option>
           </select>
           </div>
         </div>
          
         <div style="width:100%;">
           <div style="float:left; width:40%; text-align:right; line-height:25px;">容器类型：</div>
           <div style="float:left; line-height:25px;"><input id="contain" name="contain" /></div>
         </div>
         <div style="width:100%;">
           <div style="float:left; width:40%; text-align:right; line-height:25px;">样式名：</div>
           <div style="float:left; line-height:25px;"><input id="cssname" name="cssname"/></div>
         </div>
       </div>
       <div style="text-align:center;"><input name="Ok" onclick="return returnValues()" type="button" value="确 定" /> <input name="canl" type="button" onclick="window.close();" value="取 消" /></div>
     </div>
    </form>
    <script language="javascript">
    SelectLabelID();
    </script>
</body>
</html>
