node_form.tpl.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <?php defined('IN_ADMIN') or exit('No permission resources.');?>
  2. <?php include $this->admin_tpl('header', 'admin');?>
  3. <script type="text/javascript">
  4. $(document).ready(function() {
  5. $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'})}});
  6. $("#name").formValidator({onshow:"<?php echo L('input').L('nodename')?>",onfocus:"<?php echo L('input').L('nodename')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('nodename')?>"}).ajaxValidator({type : "get",url : "",data :"m=collection&c=node&a=public_name<?php if(ROUTE_A=='edit')echo "&nodeid=$data[nodeid]"?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('nodename').L('exists')?>",onwait : "<?php echo L('connecting')?>"})<?php if(ROUTE_A=='edit')echo ".defaultPassed()"?>;
  7. });
  8. </script>
  9. <div class="pad-10">
  10. <div class="col-tab">
  11. <ul class="tabBut cu-li">
  12. <li class="on" id="tab_1"><a href="javascript:show_div('1')"><?php echo L('url_rewrites')?></a></li>
  13. <li id="tab_2"><a href="javascript:show_div('2')"><?php echo L('content_rules')?></a></li>
  14. <li id="tab_3"><a href="javascript:show_div('3')"><?php echo L('custom_rule')?></a></li>
  15. <li id="tab_4"><a href="javascript:show_div('4')"><?php echo L('eigrp')?></a></li>
  16. </ul>
  17. <form name="myform" action="?m=collection&c=node&a=<?php echo ROUTE_A?>&nodeid=<?php if(isset($nodeid)) echo $nodeid?>" method="post" id="myform">
  18. <div class="content pad-10" id="show_div_1" style="height:auto">
  19. <div class="common-form">
  20. <fieldset>
  21. <legend><?php echo L('basic_configuration')?></legend>
  22. <table width="100%" class="table_form">
  23. <tr>
  24. <td width="120"><?php echo L('collection_items_of')?>:</td>
  25. <td>
  26. <input type="text" name="data[name]" id="name" class="input-text" value="<?php if(isset($data['name'])) echo $data['name']?>"></input>
  27. </td>
  28. </tr>
  29. <tr>
  30. <td width="120"><?php echo L('encode_varchar')?>:</td>
  31. <td>
  32. <?php echo form::radio(array('gbk'=>'GBK', 'utf-8'=>'UTF-8', 'big5'=>'BIG5'), (isset($data['sourcecharset']) ? $data['sourcecharset'] : 'gbk'), 'name="data[sourcecharset]"')?>
  33. </td>
  34. </tr>
  35. </table>
  36. </fieldset>
  37. <fieldset>
  38. <legend><?php echo L('web_sites_to_collect')?></legend>
  39. <table width="100%" class="table_form">
  40. <tr>
  41. <td width="120"><?php echo L('url_type')?>:</td>
  42. <td>
  43. <?php echo form::radio($this->url_list_type, (isset($data['sourcetype']) ? $data['sourcetype'] : '1'), 'name="data[sourcetype]" onclick="show_url_type(this.value)"')?>
  44. </td>
  45. </tr>
  46. <tbody id="url_type_1" <?php if (isset($data['sourcetype']) && $data['sourcetype'] != 1){echo ' style="display:none"';}?>>
  47. <tr>
  48. <td width="120"><?php echo L('url_configuration')?>:</td>
  49. <td>
  50. <input type="text" name="urlpage1" id="urlpage_1" size="100" value="<?php if(isset($data['sourcetype']) && $data['sourcetype'] == 1 && isset($data['urlpage'])) echo $data['urlpage'];?>"> <input type="button" class="button" onclick="show_url()" value="<?php echo L('test')?>"><br />
  51. <?php echo L('url_msg')?><br />
  52. <?php echo L('page_from')?>: <input type="text" name="data[pagesize_start]" value="<?php if(isset($data['sourcetype']) && $data['sourcetype'] == 1 && isset($data['pagesize_start'])) { echo $data['pagesize_start'];} else { echo '1';}?>" size="4"> <?php echo L('to')?> <input type="text" name="data[pagesize_end]" value="<?php if(isset($data['sourcetype']) && $data['sourcetype'] == 1 && isset($data['pagesize_end'])) { echo $data['pagesize_end'];} else { echo '10';}?>" size="4"> <?php echo L('increment_by')?><input type="text" name="data[par_num]" size="4" value="<?php if(isset($data['sourcetype']) && $data['sourcetype'] == 1 && isset($data['par_num'])) { echo $data['par_num'];} else { echo '1';}?>">
  53. </td>
  54. </tr>
  55. </tbody>
  56. <tbody id="url_type_2" <?php if (!isset($data['sourcetype']) || $data['sourcetype'] != 2){echo ' style="display:none"';}?>>
  57. <tr>
  58. <td width="120"><?php echo L('url_configuration')?>:</td>
  59. <td>
  60. <textarea rows="10" cols="80" name="urlpage2" id="urlpage_2" ><?php if(isset($data['sourcetype']) && $data['sourcetype'] == 2 && isset($data['urlpage'])) { echo $data['urlpage'];}?></textarea> <br><?php echo L('one_per_line')?>
  61. </td>
  62. </tr>
  63. </tbody>
  64. <tbody id="url_type_3" <?php if (!isset($data['sourcetype']) || $data['sourcetype'] != 3){echo ' style="display:none"';}?>>
  65. <tr>
  66. <td width="120"><?php echo L('url_configuration')?>:</td>
  67. <td>
  68. <input type="text" name="urlpage3" id="urlpage_3" size="100" value="<?php if(isset($data['sourcetype']) && $data['sourcetype'] == 3 && isset($data['urlpage'])) { echo $data['urlpage'];}?>">
  69. </td>
  70. </tr>
  71. </tbody>
  72. <tbody id="url_type_4" <?php if (!isset($data['sourcetype']) || $data['sourcetype'] != 4){echo ' style="display:none"';}?>>
  73. <tr>
  74. <td width="120"><?php echo L('url_configuration')?>:</td>
  75. <td>
  76. <input type="text" name="urlpage4" id="urlpage_4" size="100" value="<?php if(isset($data['sourcetype']) && $data['sourcetype'] == 4 && isset($data['urlpage'])) { echo $data['urlpage'];}?>">
  77. </td>
  78. </tr>
  79. </tbody>
  80. <tr>
  81. <td width="120"><?php echo L('url_configuration')?>:</td>
  82. <td>
  83. <?php echo L('site_must_contain')?><input type="text" name="data[url_contain]" value="<?php if(isset($data['url_contain'])) echo $data['url_contain']?>"> <?php echo L('the_web_site_does_not_contain')?><input type="text" name="data[url_except]" value="<?php if(isset($data['url_except'])) echo $data['url_except']?>">
  84. </td>
  85. </tr>
  86. <tr>
  87. <td width="120"><?php echo L('base_configuration')?>:</td>
  88. <td>
  89. <input type="text" name="data[page_base]" value="<?php if(isset($data['page_base'])) echo $data['page_base']?>" size="100" ><br>
  90. <?php echo L('base_msg')?>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td width="120"><?php echo L('get_url')?>:</td>
  95. <td>
  96. <?php echo L('from')?> <textarea rows="10" cols="40" name="data[url_start]"><?php if(isset($data['url_start'])) echo $data['url_start']?></textarea> <?php echo L('to')?> <textarea rows="10" name="data[url_end]" cols="40"><?php if(isset($data['url_end'])) echo $data['url_end']?></textarea> <?php echo L('finish')?>
  97. </td>
  98. </tr>
  99. </table>
  100. </fieldset>
  101. </div>
  102. </div>
  103. <div class="content pad-10" id="show_div_2" style="height:auto;display:none">
  104. <div class="explain-col">
  105. <?php echo L('rule_msg')?>
  106. </div>
  107. <div class="bk15"></div>
  108. <input type="button" class="button" value="<?php echo L('expand_all')?>" onclick="$('#show_div_2').children('fieldset').children('.table_form').show()"> <input type="button" class="button" value="<?php echo L('all_the')?>" onclick="$('#show_div_2').children('fieldset').children('.table_form').hide()">
  109. <fieldset>
  110. <legend><a href="javascript:void(0)" onclick="$(this).parent().parent().children('table').toggle()"><?php echo L('title').L('rule')?></a></legend>
  111. <table width="100%" class="table_form">
  112. <tr>
  113. <td width="120"><?php echo L('matching_rule')?>:</td>
  114. <td>
  115. <textarea rows="5" cols="40" name="data[title_rule]" id="title_rule"><?php if(isset($data['title_rule'])) {echo $data['title_rule'];}else{echo '<title>'.L('[content]').'</title>';}?></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText('title_rule', '<?php echo L('[content]')?>')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?>
  116. </td>
  117. <td width="120"><?php echo L('filtering')?>:</td>
  118. <td>
  119. <textarea rows="5" cols="50" name="data[title_html_rule]" id="title_html_rule"><?php if(isset($data['title_html_rule'])) echo $data['title_html_rule']?></textarea>
  120. <input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role('data[title_html_rule]')">
  121. </td>
  122. </tr>
  123. </table>
  124. </fieldset>
  125. <fieldset>
  126. <legend><a href="javascript:void(0)" onclick="$(this).parent().parent().children('table').toggle()"><?php echo L('author').L('rule')?></a></legend>
  127. <table width="100%" class="table_form" style="display:none">
  128. <tr>
  129. <td width="120"><?php echo L('matching_rule')?>:</td>
  130. <td>
  131. <textarea rows="5" cols="40" name="data[author_rule]" id="author_rule"><?php if(isset($data['author_rule'])) echo $data['author_rule']?></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText('author_rule', '<?php echo L('[content]')?>')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?>
  132. </td>
  133. <td width="120"><?php echo L('filtering')?>:</td>
  134. <td>
  135. <textarea rows="5" cols="50" name="data[author_html_rule]" id="author_html_rule"><?php if(isset($data['author_html_rule'])) echo $data['author_html_rule']?></textarea>
  136. <input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role('data[author_html_rule]')">
  137. </td>
  138. </tr>
  139. </table>
  140. </fieldset>
  141. <fieldset>
  142. <legend><a href="javascript:void(0)" onclick="$(this).parent().parent().children('table').toggle()"><?php echo L('comeform').L('rule')?></a></legend>
  143. <table width="100%" class="table_form" style="display:none">
  144. <tr>
  145. <td width="120"><?php echo L('matching_rule')?>:</td>
  146. <td>
  147. <textarea rows="5" cols="40" name="data[comeform_rule]" id="comeform_rule"><?php if(isset($data['comeform_rule'])) echo $data['comeform_rule']?></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText('comeform_rule', '<?php echo L('[content]')?>')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?>
  148. </td>
  149. <td width="120"><?php echo L('filtering')?>:</td>
  150. <td>
  151. <textarea rows="5" cols="50" name="data[comeform_html_rule]" id="comeform_html_rule"><?php if(isset($data['comeform_html_rule'])) echo $data['comeform_html_rule']?></textarea>
  152. <input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role('data[comeform_html_rule]')">
  153. </td>
  154. </tr>
  155. </table>
  156. </fieldset>
  157. <fieldset>
  158. <legend><a href="javascript:void(0)" onclick="$(this).parent().parent().children('table').toggle()"><?php echo L('time').L('rule')?></a></legend>
  159. <table width="100%" class="table_form" style="display:none">
  160. <tr>
  161. <td width="120"><?php echo L('matching_rule')?>:</td>
  162. <td>
  163. <textarea rows="5" cols="40" name="data[time_rule]" id="time_rule"><?php if(isset($data['time_rule'])) echo $data['time_rule']?></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText('time_rule', '<?php echo L('[content]')?>')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?>
  164. </td>
  165. <td width="120"><?php echo L('filtering')?>:</td>
  166. <td>
  167. <textarea rows="5" cols="50" name="data[time_html_rule]" id="time_html_rule"><?php if(isset($data['time_html_rule'])) echo $data['time_html_rule']?></textarea>
  168. <input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role('data[time_html_rule]')">
  169. </td>
  170. </tr>
  171. </table>
  172. </fieldset>
  173. <fieldset>
  174. <legend><a href="javascript:void(0)" onclick="$(this).parent().parent().children('table').toggle()"><?php echo L('content').L('rule')?></a></legend>
  175. <table width="100%" class="table_form" style="display:none">
  176. <tr>
  177. <td width="120"><?php echo L('matching_rule')?>:</td>
  178. <td>
  179. <textarea rows="5" cols="40" name="data[content_rule]" id="content_rule"><?php if(isset($data['content_rule'])) echo $data['content_rule']?></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText('content_rule', '<?php echo L('[content]')?>')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?>
  180. </td>
  181. <td width="120"><?php echo L('filtering')?>:</td>
  182. <td>
  183. <textarea rows="5" cols="50" name="data[content_html_rule]" id="content_html_rule"><?php if(isset($data['content_html_rule'])) echo $data['content_html_rule']?></textarea>
  184. <input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role('data[content_html_rule]')">
  185. </td>
  186. </tr>
  187. </table>
  188. </fieldset>
  189. <fieldset>
  190. <legend><a href="javascript:void(0)" onclick="$(this).parent().parent().children('table').toggle()"><?php echo L('content_page').L('rule')?></a></legend>
  191. <table width="100%" class="table_form" style="display:none">
  192. <tr>
  193. <td width="120"><?php echo L('page_mode')?>:</td>
  194. <td>
  195. <?php echo form::radio(array('1'=>L('all_are_models'), '2'=>L('down_the_pages_mode')), (isset($data['content_page_rule']) ? $data['content_page_rule'] : 1), 'name="data[content_page_rule]" onclick="show_nextpage(this.value)"')?>
  196. </td>
  197. </tr>
  198. <tbody id="nextpage" <?php if(!isset($data['content_page_rule']) || $data['content_page_rule']!=2) echo 'style="display:none"'?>>
  199. <tr>
  200. <td width="120"><?php echo L('nextpage_rule')?>:</td>
  201. <td>
  202. <input type="text" name="data[content_nextpage]" size="100" value="<?php if(isset($data['content_nextpage'])) echo $data['content_nextpage']?>"><br>
  203. <?php echo L('nextpage_rule_msg')?>
  204. </td>
  205. </tr>
  206. </tbody>
  207. <tr>
  208. <td width="120"><?php echo L('matching_rule')?>:</td>
  209. <td>
  210. <?php echo L('from')?> <textarea rows="5" cols="40" name="data[content_page_start]" id="content_page_start"><?php if(isset($data['content_page_start'])) echo $data['content_page_start']?></textarea> <?php echo L('to')?> <textarea rows="5" cols="40" name="data[content_page_end]" id="content_page_end"><?php if(isset($data['content_page_end'])) echo $data['content_page_end']?></textarea>
  211. </td>
  212. </tr>
  213. </table>
  214. </fieldset>
  215. </div>
  216. <div class="content pad-10" id="show_div_3" style="height:auto;display:none">
  217. <input type="button" class="button" value="<?php echo L('add_item')?>" onclick="add_caiji()">
  218. <div class="bk10"></div>
  219. <table width="100%" class="table_form" id="customize_config">
  220. <?php if(isset($data['customize_config']) && is_array($data['customize_config'])) foreach ($data['customize_config'] as $k=>$v):?>
  221. <tbody id="customize_config_<?php echo $k?>"><tr style="background-color:#FBFFE4"><td><?php echo L('rulename')?>:</td><td><input type="text" name="customize_config[name][<?php echo $k?>]" value="<?php echo $v['name']?>" class="input-text" /></td><td><?php echo L('rules_in_english')?>:</td><td><input type="text" name="customize_config[en_name][<?php echo $k?>]" value="<?php echo $v['en_name']?>" class="input-text" /></td></tr><tr><td width="120"><?php echo L('matching_rule')?>:</td><td><textarea rows="5" cols="40" name="customize_config[rule][<?php echo $k?>]" id="rule_<?php echo $k?>"><?php echo $v['rule']?></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText('rule_<?php echo $k?>', '<?php echo L('[content]')?>')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?></td><td width="120"><?php echo L('filtering')?>:</td><td><textarea rows="5" cols="50" name="customize_config[html_rule][<?php echo $k?>]"><?php echo $v['html_rule']?></textarea><input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role('customize_config[html_rule][<?php echo $k?>]')"></td></tr></tbody>
  222. <?php endforeach;?>
  223. </table>
  224. </div>
  225. <div class="content pad-10" id="show_div_4" style="height:auto;display:none">
  226. <table width="100%" class="table_form" >
  227. <tr>
  228. <td width="120"><?php echo L('download_pic')?>:</td>
  229. <td>
  230. <?php echo form::radio(array('1'=>L('download_pic'), '0'=>L('no_download')), (isset($data['down_attachment']) ? $data['down_attachment'] : '0'), 'name="data[down_attachment]"')?>
  231. </td>
  232. </tr>
  233. <tr>
  234. <td width="120"><?php echo L('watermark')?>:</td>
  235. <td>
  236. <?php echo form::radio(array('1'=>L('gfl_sdk'), '0'=>L('no_gfl_sdk')), (isset($data['watermark']) ? $data['watermark'] : '0'), 'name="data[watermark]"')?>
  237. </td>
  238. </tr>
  239. <tr>
  240. <td width="120"><?php echo L('content_page_models')?>:</td>
  241. <td>
  242. <?php echo form::radio(array('0'=>L('no_page'), '1'=>L('by_the_paging')), (isset($data['content_page']) ? $data['content_page'] : '1'), 'name="data[content_page]"')?>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td width="120"><?php echo L('sort_order')?>:</td>
  247. <td>
  248. <?php echo form::radio(array('1'=>L('with_goals_from_the_same'), '2'=>L('and_objectives_of_the_standing_opposite')), (isset($data['coll_order']) ? $data['coll_order'] : '1'), 'name="data[coll_order]"')?>
  249. </td>
  250. </tr>
  251. </table>
  252. </div>
  253. </div>
  254. <div class="bk15"></div>
  255. <input name="dosubmit" type="submit" id="dosubmit" value="<?php echo L('submit')?>" class="button">
  256. </div>
  257. </form>
  258. <script type="text/javascript">
  259. <!--
  260. function insertText(id, text)
  261. {
  262. $('#'+id).focus();
  263. var str = document.selection.createRange();
  264. str.text = text;
  265. }
  266. function show_url_type(obj) {
  267. var num = <?php echo count($this->url_list_type);?>;
  268. for (var i=1; i<=num; i++){
  269. if (obj==i){
  270. $('#url_type_'+i).show();
  271. } else {
  272. $('#url_type_'+i).hide();
  273. }
  274. }
  275. }
  276. function show_div(id) {
  277. for (var i=1;i<=4;i++) {
  278. if (id==i) {
  279. $('#tab_'+i).addClass('on');
  280. $('#show_div_'+i).show();
  281. } else {
  282. $('#tab_'+i).removeClass('on');
  283. $('#show_div_'+i).hide();
  284. }
  285. }
  286. }
  287. function show_url() {
  288. var type = $("input[type='radio'][name='data[sourcetype]']:checked").val();
  289. window.top.art.dialog({id:'test_url',iframe:'?m=collection&c=node&a=public_url&sourcetype='+type+'&urlpage='+$('#urlpage_'+type).val()+'&pagesize_start='+$("input[name='data[pagesize_start]']").val()+'&pagesize_end='+$("input[name='data[pagesize_end]']").val()+'&par_num='+$("input[name='data[par_num]']").val(), title:'<?php echo L('testpageurl')?>', width:'700', height:'450'}, '', function(){window.top.art.dialog({id:'test_url'}).close()});
  290. }
  291. function anti_selectall(obj) {
  292. $("input[name='"+obj+"']").each(function(i,n){
  293. if (this.checked) {
  294. this.checked = false;
  295. } else {
  296. this.checked = true;
  297. }});
  298. }
  299. function show_nextpage(value) {
  300. if (value == 2) {
  301. $('#nextpage').show();
  302. } else {
  303. $('#nextpage').hide();
  304. }
  305. }
  306. var i =<?php echo isset($data['customize_config']) ? count($data['customize_config']) : 0?>;
  307. function add_caiji() {
  308. var html = '<tbody id="customize_config_'+i+'"><tr style="background-color:#FBFFE4"><td><?php echo L('rulename')?>:</td><td><input type="text" name="customize_config[name][]" class="input-text" /></td><td><?php echo L('rules_in_english')?>:</td><td><input type="text" name="customize_config[en_name][]" class="input-text" /></td></tr><tr><td width="120"><?php echo L('matching_rule')?>:</td><td><textarea rows="5" cols="40" name="customize_config[rule][]" id="rule_'+i+'"></textarea> <br><?php echo L('use')?>"<a href="javascript:insertText(\'rule_'+i+'\', \'<?php echo L('[content]')?>\')"><?php echo L('[content]')?></a>"<?php echo L('w_wildmenu')?></td><td width="120"><?php echo L('filtering')?>:</td><td><textarea rows="5" cols="50" name="customize_config[html_rule][]" id="content_html_rule_'+i+'"></textarea><input type="button" value="<?php echo L('select')?>" class="button" onclick="html_role(\'content_html_rule_'+i+'\', 1)"></td></tr></tbody>';
  309. $('#customize_config').append(html);
  310. i++;
  311. }
  312. function html_role(id, type) {
  313. art.dialog({id:'test_url',content:'<?php echo form::checkbox(self::$html_tag, '', 'name="html_rule"', '', '120')?><br><div class="bk15"></div><center><input type="button" value="<?php echo L('select_all')?>" class="button" onclick="selectall(\'html_rule\')"> <input type="button" class="button" value="<?php echo L('invert')?>" onclick="anti_selectall(\'html_rule\')"></center>', width:'500', height:'150', lock: false}, function(){var old = $("textarea[name='"+id+"']").val();var str = '';$("input[name='html_rule']:checked").each(function(){str+=$(this).val()+"\n";});$((type == 1 ? "#"+id :"textarea[name='"+id+"']")).val((old ? old+"\n" : '')+str);}, function(){art.dialog({id:'test_url'}).close()});
  314. }
  315. <?php if (ROUTE_A == 'edit') echo '$(\'#show_div_2\').children(\'fieldset\').children(\'.table_form\').show();';?>
  316. //-->
  317. </script>
  318. </body>
  319. </html>