first commit
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<LabelType>其他类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>txt</OutType>
|
||||
<LabelDataType>static</LabelDataType>
|
||||
<EnabelAjax>False</EnabelAjax>
|
||||
<LabelTemplate>
|
||||
<![CDATA[
|
||||
<div class="left_box">
|
||||
<dl>
|
||||
<dt>自定义表单</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<script type="text/javascript" src="{PE.SiteConfig.ApplicationPath/}js/jquery.pack.js"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery.noConflict();
|
||||
jQuery.fn.addOption = function(text,value)
|
||||
{
|
||||
jQuery(this).get(0).options.add(new Option(text,value));
|
||||
}
|
||||
|
||||
jQuery.fn.clearAll = function()
|
||||
{
|
||||
jQuery(this).get(0).options.length = 0;
|
||||
}
|
||||
function GetWorkCategory(value,depth)
|
||||
{
|
||||
if(value=="-1")
|
||||
return;
|
||||
var array1 = value.split('|');
|
||||
var formInfoArr = array1[2].split(',');
|
||||
jQuery('#selFormList').clearAll();
|
||||
if(formInfoArr.length <= 0)
|
||||
{
|
||||
if(depth > 0)
|
||||
{
|
||||
jQuery('#selFormList').addOption('没有绑定表单', '-1');
|
||||
jQuery('#ErrorMessage').css("display", "");
|
||||
jQuery('#ErrorMessage').html("<span style='color:Blue;'>此表单类别没有绑定表单!</span>");
|
||||
jQuery('#workcategory').css("display", "");
|
||||
jQuery('#CustomFormList').css("display", "none");
|
||||
jQuery('#DivJumpToForm').css("display", "none");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#ErrorMessage').css("display", "none");
|
||||
jQuery('#workcategory').css("display", "");
|
||||
jQuery('#CustomFormList').css("display", "");
|
||||
jQuery('#DivJumpToForm').css("display", "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(var index = 0;index < formInfoArr.length;index ++)
|
||||
{
|
||||
var formInfo = formInfoArr[index].split('$');
|
||||
if(formInfo.length == 2){
|
||||
jQuery('#selFormList').addOption(formInfo[1], formInfo[0]);}
|
||||
}
|
||||
if(jQuery('#selFormList').get(0).options.length == 0 && depth > 0)
|
||||
{
|
||||
jQuery('#selFormList').addOption('没有绑定表单', '-1');
|
||||
jQuery('#ErrorMessage').css("display", "");
|
||||
jQuery('#ErrorMessage').html("<span style='color:Blue;'>此表单类别没有绑定表单!</span>");
|
||||
jQuery('#workcategory').css("display", "");
|
||||
jQuery('#CustomFormList').css("display", "none");
|
||||
jQuery('#DivJumpToForm').css("display", "none");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#ErrorMessage').css("display", "none");
|
||||
jQuery('#workcategory').css("display", "");
|
||||
jQuery('#CustomFormList').css("display", "");
|
||||
jQuery('#DivJumpToForm').css("display", "");
|
||||
}
|
||||
}
|
||||
jQuery("#categoryidhidden").get(0).value = array1[1];
|
||||
var xml = "<root><type>GetWorkCateory</type><ParentID>" + array1[1] + "</ParentID></root>";
|
||||
jQuery.post('{PE.SiteConfig.ApplicationPath/}ajax.aspx', xml, function(s)
|
||||
{
|
||||
var categoryList = jQuery("WorkCategory", s);
|
||||
if(categoryList.length > 0)
|
||||
{
|
||||
var workcategory = jQuery('#workcategory');
|
||||
var workcategorySub = jQuery('#workcategory' + depth);
|
||||
if(workcategorySub.length == 0)
|
||||
{
|
||||
workcategory.append(jQuery("<select id='workcategory" + depth + "' onchange='GetWorkCategory(this.value,"+ (depth + 1) +")'></select>"));
|
||||
workcategory.append(jQuery("<br/>"));
|
||||
}
|
||||
jQuery('#workcategory' + depth).clearAll();
|
||||
jQuery('#workcategory' + depth).addOption("选择类别","-1");
|
||||
categoryList.each(function(i)
|
||||
{
|
||||
var category = jQuery(this).text();
|
||||
var array = category.split('|');
|
||||
var name = array[0];
|
||||
jQuery('#workcategory' + depth).addOption(name,category);
|
||||
});
|
||||
jQuery('#CustomFormList').css("display", "none");
|
||||
jQuery('#DivJumpToForm').css("display", "none");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(depth == 0)
|
||||
{
|
||||
jQuery('#ErrorMessage').css("display", "");
|
||||
jQuery('#ErrorMessage').html("<span style='color:Blue;'>很抱歉,还没有添加自定义表单类别,请联系管理员到后台添加!</span>");
|
||||
jQuery('#workcategory').css("display", "none");
|
||||
jQuery('#CustomFormList').css("display", "none");
|
||||
jQuery('#DivJumpToForm').css("display", "none");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
jQuery(document).ready(function() {
|
||||
GetWorkCategory("a|0|,",0);
|
||||
jQuery("#JumpToForm").click(function(){
|
||||
var formid = jQuery("#selFormList").get(0).value;
|
||||
var categoryid = jQuery("#categoryidhidden").get(0).value;
|
||||
if(formid != "-1" && formid != "")
|
||||
{
|
||||
window.location = "{PE.SiteConfig.ApplicationPath/}webform.aspx?workcategoryid=" + categoryid + "&customformid=" + formid ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("请选择表单!");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<input id="categoryidhidden" type="hidden" value="0" />
|
||||
|
||||
<div id="workcategory" style="display:none;">选择表单类别:</div>
|
||||
<div id="CustomFormList" style="display:none;">
|
||||
<span>选择表单:</span><select id="selFormList" name="selFormList"><option value="-1">请选择</option></select> <br/>
|
||||
</div>
|
||||
<div id="DivJumpToForm" style="display:none;text-align:center"><span style="text-align:center"><input type="button" id="JumpToForm" value="转到表单提交页" class="inputbutton"></span></div>
|
||||
<div id="ErrorMessage" style="display:none;"></div>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>]]>
|
||||
</LabelTemplate>
|
||||
</root>
|
||||
Reference in New Issue
Block a user