poster_edit.tpl.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. //$show_header = $show_validator = $show_scroll = 1;
  4. $show_dialog = $show_header = 1;
  5. include $this->admin_tpl('header', 'admin');
  6. $thisExt = isset($this->M['ext'])?$this->M['ext']:'';
  7. $authkey = upload_key('1,'.$thisExt.',1');
  8. ?>
  9. <script language="javascript" type="text/javascript" src="<?php echo JS_PATH;?>formvalidator.js" charset="UTF-8"></script>
  10. <script language="javascript" type="text/javascript" src="<?php echo JS_PATH;?>formvalidatorregex.js" charset="UTF-8"></script>
  11. <div class="subnav">
  12. <div class="content-menu ib-a blue line-x">
  13. <?php if(isset($big_menu)) echo '<a class="add fb" href="'.$big_menu[0].'"><em>'.$big_menu[1].'</em></a> ';?>
  14. <?php echo admin::submenu($_GET['menuid'],$big_menu); ?><span>|</span><a href="javascript:window.top.art.dialog({id:'setting',iframe:'?m=poster&c=space&a=setting', title:'<?php echo L('module_setting')?>', width:'540', height:'320'}, function(){var d = window.top.art.dialog({id:'setting'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'setting'}).close()});void(0);"><em><?php echo L('module_setting')?></em></a>
  15. </div>
  16. </div>
  17. <form method="post" action="?m=poster&c=poster&a=edit&id=<?php echo $_GET['id']?>&spaceid=<?php echo $info['spaceid']?>" id="myform">
  18. <table class="table_form" width="100%" cellspacing="0">
  19. <tbody>
  20. <tr>
  21. <th width="100"><?php echo L('poster_title')?>:</th>
  22. <td><input name="poster[name]" id="name" value="<?php echo $info['name']?>" class="input-text" type="text" size="25"></td>
  23. </tr>
  24. <tr>
  25. <th><?php echo L('for_postion')?>:</th>
  26. <td><b style="color:#F60;"><?php echo $sinfo['name']?></b>&nbsp;[<?php echo $TYPES[$sinfo['type']]?>]</td>
  27. </tr>
  28. <tr>
  29. <th align="right" valign="top"><?php echo L('poster_type')?>:</th>
  30. <td valign="top" colspan="2"><?php echo form::select($setting['type'], trim($info['type']), 'name="poster[type]" id="type" onchange="AdsType(this.value)"', $default);?>
  31. </td>
  32. </tr>
  33. <tr>
  34. <th><?php echo L('line_time')?>:</th>
  35. <td><?php echo form::date('poster[startdate]', date('Y-m-d H:i:s', $info['startdate']), 1)?></td>
  36. </tr>
  37. <tr>
  38. <th><?php echo L('down_time')?>:</th>
  39. <td><?php echo form::date('poster[enddate]', date('Y-m-d H:i:s', $info['enddate']), 1)?></td>
  40. </tr>
  41. </tbody>
  42. </table><?php if(array_key_exists('images', $setting['type'])) {?><div class="pad-10" id="imagesdiv" style="display:<?php if($info['type']=='flash') {?>none;<?php }?>">
  43. <fieldset>
  44. <legend><?php echo L('photo_setting')?></legend>
  45. <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?>
  46. <table width="100%" class="table_form">
  47. <tbody>
  48. <tr>
  49. <th width="80"><?php echo L('linkurl')?>:</th>
  50. <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][linkurl]" id="linkurl<?php echo $i;?>" size="30" value="<?php echo $info['setting'][$i]['linkurl']?>" /></td>
  51. <td rowspan="2"><a href="javascript:flashupload('imgurl<?php echo $i;?>_images', '<?php echo L('upload_photo')?>','imgurl<?php echo $i;?>',preview,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo $info['setting'][$i]['imageurl']?>" id="imgurl<?php echo $i;?>_s" width="105" height="88" onerror="this.src='<?php echo IMG_PATH;?>nopic.gif'"></a><input type="hidden" id="imgurl<?php echo $i;?>" name="setting[images][<?php echo $i;?>][imageurl]" value="<?php echo $info['setting'][$i]['imageurl']?>"></td>
  52. </tr>
  53. <tr>
  54. <th><?php echo L('alt')?>:</th>
  55. <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][alt]" id="alt<?php echo $i;?>" value="<?php echo $info['setting'][$i]['alt']?>" size="30" /></td>
  56. </tr>
  57. </table>
  58. <?php } } else {?>
  59. <table width="100%" class="table_form">
  60. <tbody>
  61. <tr>
  62. <th width="80"><?php echo L('linkurl')?>:</th>
  63. <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][linkurl]" id="linkurl3" size="30" value="<?php echo $info['setting'][1]['linkurl']?>" /></td>
  64. <td rowspan="2"><a href="javascript:flashupload('imgurl_images', '<?php echo L('upload_photo')?>','imgurl',preview,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo $info['setting'][1]['imageurl']?>" id="imgurl_s" width="105" height="88" onerror="this.src='<?php echo IMG_PATH;?>nopic.gif'"></a><input type="hidden" id="imgurl" name="setting[images][1][imageurl]" value="<?php echo $info['setting'][1]['imageurl']?>"></td>
  65. </tr>
  66. <tr>
  67. <th><?php echo L('alt')?>:</th>
  68. <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][alt]" value="<?php echo $info['setting'][1]['alt']?>" id="alt3" size="30" /></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <?php } ?>
  73. </fieldset></div><?php } if(array_key_exists('flash', $setting['type'])) {?>
  74. <div class="pad-10" id="flashdiv" style="display:<?php if($info['type']=='images') {?>none<?php }?>;">
  75. <fieldset>
  76. <legend><?php echo L('flash_setting')?></legend>
  77. <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?>
  78. <table width="100%" class="table_form">
  79. <tbody>
  80. <tr>
  81. <th width="80"><?php echo L('flash_url')?>:</th>
  82. <td class="y-bg"><input type="text" class="input-text" name="setting[flash][<?php echo $i;?>][flashurl]" value="<?php echo $info['setting'][$i]['flashurl']?>" id="flashurl<?php echo $i;?>" size="40" /></td>
  83. <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl<?php echo $i;?>_images', '<?php echo L('flash_upload')?>','flashurl<?php echo $i;?>',submit_attachment,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <?php } } else {?>
  88. <table width="100%" class="table_form">
  89. <tbody>
  90. <tr>
  91. <th width="80"><?php echo L('flash_url')?>:</th>
  92. <td class="y-bg"><input type="text" class="input-text" name="setting[flash][1][flashurl]" id="flashurl" size="40" value="<?php echo $info['setting'][1]['flashurl']?>" /></td>
  93. <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl_images', '<?php echo L('flash_upload')?>','flashurl',submit_attachment,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. <?php } ?>
  98. </fieldset></div><?php } if(array_key_exists('text', $setting['type'])) {?><div class="pad-10" id="textdiv" style="display:">
  99. <fieldset>
  100. <legend><?php if ($sinfo['type']=='code') { echo L('code_setting'); } else { echo L('word_link'); } ?></legend>
  101. <table width="100%" class="table_form">
  102. <tbody>
  103. <?php if($sinfo['type']=='code') {?>
  104. <tr>
  105. <th width="80"><?php echo L('code_content')?>:</th>
  106. <td class="y-bg"><textarea name="setting[text][code]" id="code" cols="55" rows="6"><?php echo $info['setting']['code']?></textarea></td>
  107. </tr>
  108. <?php } else {?>
  109. <tr>
  110. <th width="80"><?php echo L('word_content')?>:</th>
  111. <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][title]" value="<?php echo $info['setting'][1]['title']?>" id="title" size="30" /></td>
  112. </tr>
  113. <tr>
  114. <th><?php echo L('linkurl')?>:</th>
  115. <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][linkurl]" id="link" size="30" value="<?php echo $info['setting'][1]['linkurl']?>" /></td>
  116. </tr><?php }?>
  117. </tbody>
  118. </table>
  119. </fieldset></div><?php }?>
  120. <div class="bk15" style="margin-left:10px; line-height:30px;"><input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="button">&nbsp;<input type="reset" value=" <?php echo L('goback')?> " class="button" onclick="history.go(-1)"></div>
  121. </form>
  122. </body>
  123. </html>
  124. <script type="text/javascript">
  125. function AdsType(type) {
  126. $('#imagesdiv').css('display', 'none');
  127. $('#flashdiv').css('display', 'none');
  128. $('#'+type+'div').css('display', '');
  129. }
  130. $(document).ready(function(){
  131. $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
  132. $('#name').formValidator({onshow:"<?php echo L('please_input_name')?>",onfocus:"<?php echo L('name_three_length')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:6,onerror:"<?php echo L('adsname_no_empty')?>"}).ajaxValidator({type:"get",url:"",data:"m=poster&c=poster&a=public_check_poster",datatype:"html",cached:false,async:'true',success : function(data) {
  133. if( data == "1" )
  134. {
  135. return true;
  136. }
  137. else
  138. {
  139. return false;
  140. }
  141. },
  142. error: function(){alert("<?php echo L('server_busy')?>");},
  143. onerror : "<?php echo L('ads_exist')?>",
  144. onwait : "<?php echo L('checking')?>"
  145. }).defaultPassed();
  146. $('#type').formValidator({onshow:"<?php echo L('choose_ads_type')?>",onfocus:"<?php echo L('type_selected')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:1,onerror: "<?php echo L('choose_ads_type')?>"});
  147. $('#startdate').formValidator({onshow:"<?php echo L('online_time')?>",onfocus:"<?php echo L('online_time')?>",oncorrect:"<?php echo L('correct')?>"}).functionValidator({fun:isDateTime});
  148. $('#enddate').formValidator({onshow:"<?php echo L('one_month_no_select')?>",onfocus:"<?php echo L('down_time')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator();
  149. <?php if(array_key_exists('text', $setting['type'])) {?>
  150. <?php if($sinfo['type']=='text') {?>
  151. $('#title').formValidator({onshow:'<?php echo L('link_content')?>',onfoucs:'<?php echo L('link_content')?>',oncorrect:'<?php echo L('correct')?>'}).inputValidator({min:1,onerror:'<?php echo L('no_link_content')?>'});
  152. <?php } elseif($sinfo['type']=='code') {?>
  153. $('#code').formValidator({onshow:"<?php echo L('input_code')?>",onfocus:"<?php echo L('input_code')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:1,onerror:'<?php echo L('input_code')?>'});
  154. <?php } }?>
  155. });
  156. function preview(uploadid,returnid){
  157. var d = window.top.art.dialog({id:uploadid}).data.iframe;
  158. var in_content = d.$("#att-status").html().substring(1);
  159. $('#'+returnid).val(in_content);
  160. $('#'+returnid+'_s').attr('src', in_content);
  161. }
  162. </script>
  163. <script type="text/javascript" src="<?php echo JS_PATH?>swfupload/swf2ckeditor.js"></script>