|
|
ɳ

楼主 |
发表于 2017-11-18 04:15:19
|
只看该作者
已处理
已修改category_edit.tpl.php
增加 类型选择
- <tr>
- <th><?php echo L('type');?>:</th>
- <td>
- <label for="category_list" > <input id="category_list" onclick="selecttype(this.value)" type='radio' name='info[type]' value='0'
- <?php if($type==0) echo 'checked';?> > 列表 </label>
- <label for="category_page" > <input id="category_page" onclick="selecttype(this.value)" type='radio' name='info[type]' value='1'
- <?php if($type==1) echo 'checked';?> > 单页 </label>
- <label for="category_link" > <input id="category_link" onclick="selecttype(this.value)" type='radio' name='info[type]' value='2'
- <?php if($type==2) echo 'checked';?> > 外链 </label>
- </td>
- </tr>
复制代码 外链显示- <tr id="link_url" >
- <th><?php echo L('link_url')?>:</th>
- <td><input type="text" name="info[url]" id="url" size="50" class="input-text" value="<?php echo $url;?>"></td>
- </tr>
复制代码 增加切换函数
- function selecttype(type){
- switch(type){
- case "0": $("#link_url").hide(); break;
- case "1": $("#link_url").hide(); break;
- case "2": $("#link_url").show(); break;
- default:$("#link_url").hide(); break;
- }
- }
- selecttype('<?php echo $type;?>');
复制代码 取消验证部分 链接规则和选择模型判断
- $(function(){
- $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
- //$("#modelid").formValidator({onshow:"<?php echo L('select_model');?>",onfocus:"<?php echo L('select_model');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('select_model');?>"}).defaultPassed();
- $("#catname").formValidator({onshow:"<?php echo L('input_catname');?>",onfocus:"<?php echo L('input_catname');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_catname');?>"}).defaultPassed();
- $("#catdir").formValidator({onshow:"<?php echo L('input_dirname');?>",onfocus:"<?php echo L('input_dirname');?>"}).regexValidator({regexp:"^([a-zA-Z0-9、-]|[_]){0,30}$",onerror:"<?php echo L('enter_the_correct_catname');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_dirname');?>"}).ajaxValidator({type : "get",url : "",data :"m=admin&c=category&a=public_check_catdir&old_dir=<?php echo $catdir;?>",datatype : "html",cached:false,getdata:{parentid:'parentid'},async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('catname_have_exists');?>",onwait : "<?php echo L('connecting');?>"}).defaultPassed();
- // $("#url").formValidator({onshow:" ",onfocus:"<?php echo L('domain_name_format');?>",tipcss:{width:'300px'},empty:true}).inputValidator({onerror:"<?php echo L('domain_name_format');?>"}).regexValidator({regexp:"http:\/\/(.+)\/$",onerror:"<?php echo L('domain_end_string');?>"});
- $("#template_list").formValidator({onshow:"<?php echo L('template_setting');?>",onfocus:"<?php echo L('template_setting');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('template_setting');?>"}).defaultPassed();
- })
复制代码
|
|