<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jobTypeOptions.aspx.cs" Inherits="PPFOR.Admin.DesignCenter.Label.jobTypeOptions" %>

<!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">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <script src="/ckeditor/ckeditor.js" type="text/javascript" ></script>
    <script src="../../JS/label.js" type="text/javascript"></script>   
    <link href="../../Css/global.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
    function saveContent()
    {
        var fStr=",<br />&nbsp;";
        var data=formatContent("[PPFOR:Loop","") + fStr + formatContent("PPFOR:Class","JobType");
        
        var objMenuId= document.getElementById("PPFOR_jobMenuId");            
        if(objMenuId!=null && objMenuId.style.display!="none" && objMenuId.selectedIndex>=0)
        {
            var menuId=objMenuId.options[objMenuId.selectedIndex].value;
            if(menuId!=null && menuId!="")
            {
                data+=fStr + formatContent("PPFOR:MenuID",menuId);
            }
        }
        
        var objTypeId= document.getElementById("jobTypeId");            
        if(objTypeId!=null && objTypeId.style.display!="none" && objTypeId.selectedIndex>=0)
        {
            var typeId=objTypeId.options[objTypeId.selectedIndex].value;
            if(typeId!=null && typeId!="")
            {
                data+=fStr + formatContent("PPFOR:ClassID",typeId);
            }
        }
            
        var objOutFormat= document.getElementById("outFormat");
        if(objOutFormat!=null && objOutFormat.style.display!='none')
        {
            data+=fStr + formatContent("PPFOR:Format",objOutFormat.value!='' ? objOutFormat.value : "Table");
        }   
        
        var objNewsColumnNumber= document.getElementById("PPFOR_jobColumnNumber");
        if(objNewsColumnNumber!=null && objNewsColumnNumber.value!="")
        {
            data+=fStr + formatContent("PPFOR:ColumnNumber",objNewsColumnNumber.value);
        }
        
        var objTitleNumber= document.getElementById("PPFOR_jobTitleNumber");
        if(objTitleNumber!=null && objTitleNumber.value!="")
        {
            data+=fStr + formatContent("PPFOR:TitleNumber",objTitleNumber.value);
        }  
        
        var objContentNumber= document.getElementById("PPFOR_jobDescNumber");
        if(objContentNumber!=null && objContentNumber.value!="")
        {
            data+=fStr + formatContent("PPFOR:ContentNumber",objContentNumber.value);
        }        
        
        data+=formatContent("]","") + "<br />" + ckEditor.getData() + "<br />" + formatContent("[/PPFOR:Loop]","");
        
        parent.window.resetHTML(data);
        if(document.all)
        {
            parent.document.getElementById("popupExit").fireEvent("onclick");
        }
        else
        {
            var evt = document.createEvent('HTMLEvents');   
            evt.initEvent('click',true,true);   
            parent.document.getElementById("popupExit").dispatchEvent(evt);   
        }
    }

    function getSelectValue(id)
    {
        var obj= document.getElementById(id);
        if(obj!=null)
        {
            return (obj.options[obj.selectedIndex].value);
        }
        else
        {     
            return "";
        }
    }

    function showTypeIds(objMenu)
    {
        var obj= document.getElementById("PPFOR_jobTypeId");
        var objTypeId=document.getElementById("jobTypeId");
        var id=objMenu.options[objMenu.selectedIndex].value;
        if(obj!=null && objTypeId!=null && id>=0)
        {
            while(objTypeId.options.length>0)
            {
                objTypeId.removeChild(objTypeId.options[0]);
            }
            objTypeId.options.add(new Option("--所有招聘类型--","0")); 
            for(var i=0;i<obj.options.length;i++)
            {                
                 if(obj.options[i].getAttribute("optionMenuId")==id)
                 {
                    objTypeId.options.add(new Option(obj.options[i].text,obj.options[i].value)); 
                 }
            }
            if(objTypeId.options.length==0)
            {
                objTypeId.style.display="none";
            }
            else
            {
                objTypeId.style.display="";
            }
        }
    }   
    </script>
    <title>招聘类型列表参数设置</title>
</head>
<body>
    <form id="form1" runat="server" onsubmit="saveContent();return false;">
    <table width="98%" cellpadding="0" cellspacing="0" class="fortable" style="margin:6px;">
    <thead>
      <tr>
        <td colspan="2" align="center">选择标签参数--招聘类型列表</td>
      </tr>     
    </thead> 
      <tr>
        <td align="right" style="width:15%">招聘栏目：</td>
        <td>
        <asp:DropDownList ID="PPFOR_jobMenuId" runat="server" Width="150px">
        <asp:ListItem Text="--全部栏目--" Value="0"></asp:ListItem>
        <asp:ListItem Text="*自适应栏目*" Value="0"></asp:ListItem>
        </asp:DropDownList>
        <select id="jobTypeId" style="display:none;"></select>
        <asp:DropDownList ID="PPFOR_jobTypeId" runat="server" Width="150px" Enabled="false">
        </asp:DropDownList>     
        </td>
      </tr>
      <tr>
        <td align="right" style="width:15%">输出格式：</td>
        <td align="left">
             <select id="outFormat" style="width:150px">               
                <option value="" selected="selected">--选择输出格式--</option>
                <option value="Table">Table(默认)</option>                
                <option value="None">无格式</option>
            </select>
        </td>
      </tr>
      <tr>
        <td align="right">列表参数：</td>
        <td align="left">
            <select id="jobParam" style="width:150px;" onchange="appenHTML(this.value);this.selectedIndex=0;">
            <option value="">01.&nbsp;选择基本参数</option>
            <option value="&lt;a href=&quot;{#ClassURL}&quot; title=&quot;{#Class}&quot;&gt;{#Class}&lt;/a&gt;">02.&nbsp;栏目名称</option>
            <option value="&lt;a href=&quot;{#URL}&quot; title=&quot;{#Title}&quot;&gt;{#Title}&lt;/a&gt;">03.&nbsp;类型名称</option>
            <option value="{#ID}">04.&nbsp;类型ID</option>
            <option value="{#Description}">05.&nbsp;类型描述</option>
            <option value="{#Date}">06.&nbsp;更新日期</option>
            <option value="{#Time}">07.&nbsp;更新时间</option>
            <option value="{#DateTime}">08.&nbsp;更新日期时间</option>
            <option value="&lt;img border='0' title='{#Title}' src='{#SmallPicture}' &gt;">09.&nbsp;类型图片</option>            
            </select>
            <asp:DropDownList ID="PPFOR_subLabelList" runat="server">
            <asp:ListItem Text="--选择二级标签--" Value=""></asp:ListItem>
            </asp:DropDownList>
            <br />
            <asp:TextBox ID="PPFOR_jobOptionContent" runat="server" TextMode="MultiLine" Rows="5" Width="98%"></asp:TextBox>
           <script type="text/javascript">
            var ckEditor=CKEDITOR.replace("PPFOR_jobOptionContent", {
             toolbar:'EditLabelOptions',
             height:'100'
            });
            function appenHTML(text)
            {
                ckEditor.insertHtml(text);
            }
            </script>
         </td>
      </tr>
      <tr>
        <td align="right">每行显示条数：</td>
        <td><asp:TextBox ID="PPFOR_jobColumnNumber" runat="server" Width="150px" />
            <asp:RangeValidator ID="RangeValidator5" ControlToValidate="PPFOR_jobColumnNumber" runat="server"  Display="Dynamic" SetFocusOnError="true" MinimumValue="1" MaximumValue="2147483647" Type="Integer">新闻条数必须填写正整数</asp:RangeValidator>            
        </td>
      </tr>      
      <tr>
        <td align="right">名称显示字数：</td>
        <td><asp:TextBox ID="PPFOR_jobTitleNumber" runat="server" Width="150px" />
            <asp:RangeValidator ID="RangeValidator2" ControlToValidate="PPFOR_jobTitleNumber" runat="server"  Display="Dynamic" SetFocusOnError="true" MinimumValue="1" MaximumValue="1000" Type="Integer">标题显示字数必须填写1至1000之间的整数</asp:RangeValidator>            
        </td>
      </tr>  
      <tr>
        <td align="right">介绍内容显示字数：</td>
        <td><asp:TextBox ID="PPFOR_jobDescNumber" runat="server" Width="150px" />
            <asp:RangeValidator ID="RangeValidator1" ControlToValidate="PPFOR_jobDescNumber" runat="server"  Display="Dynamic" SetFocusOnError="true" MinimumValue="1" MaximumValue="2147483647" Type="Integer">介绍内容显示字数必须填写正整数</asp:RangeValidator>            
        </td>
      </tr>       
      <tr style="display:none;">
        <td align="center" colspan="2" valign="middle" style="height:50px">            
            <asp:Button ID="PPFOR_setJobPostOptions" CssClass="inputbutton" runat="server" Text="确定" OnClick="PPFOR_setJobPostOptionsClick"/>
            <input name="reset" type="reset" id="reset1" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" />
            <script type="text/javascript"> 
                parent.popup_clearButtons();
                parent.popup_addButton(document.getElementById('PPFOR_setJobPostOptions'));
                parent.popup_addButton(document.getElementById('reset1'));
             </script>
        </td>
      </tr>
    </table>
    </form>
</body>
</html>
