2a03afed2b6c4f4e9dfcf0f560510317.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '<?php echo ($_W['uniacid']); ?>',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '<?php echo ($_W['acid']); ?>',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '<?php echo ($_W['openid']); ?>',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '<?php echo ($_W['uid']); ?>',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '<?php echo ($_W['siteroot']); ?>',
  27. 'siteurl': '<?php echo ($_W['siteurl']); ?>',
  28. 'attachurl': '<?php echo ($_W['attachurl']); ?>',
  29. 'attachurl_local': '<?php echo ($_W['attachurl_local']); ?>',
  30. 'attachurl_remote': '<?php echo ($_W['attachurl_remote']); ?>',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : <?php echo json_encode($_W['account']);?>,
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">附件设置</span></div>
  49. <div class="layui-card-body" style="padding:15px;">
  50. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">远程附件</label>
  53. <div class="layui-input-block attclass">
  54. <label class='radio-inline'>
  55. <input type='radio' name='parameter[attachment_type]' value='0' <?php if( empty($data) || $data['attachment_type'] ==0){ ?>checked <?php } ?> title="关闭" />
  56. </label>
  57. <label class='radio-inline'>
  58. <input type='radio' name='parameter[attachment_type]' value='1' <?php if(!empty($data) && $data['attachment_type'] ==1){ ?>checked <?php } ?> title="七牛云存储" />
  59. </label>
  60. <label class='radio-inline'>
  61. <input type='radio' name='parameter[attachment_type]' value='2' <?php if(!empty($data) && $data['attachment_type'] ==2){ ?>checked <?php } ?> title="阿里云OSS" />
  62. </label>
  63. <label class='radio-inline'>
  64. <input type='radio' name='parameter[attachment_type]' value='3' <?php if(!empty($data) && $data['attachment_type'] ==3){ ?>checked <?php } ?> title="腾讯云" />
  65. </label>
  66. </div>
  67. </div>
  68. <div class="row qiniu_row" style="<?php if(!empty($data) && $data['attachment_type'] ==1){ ?> <?php }else{ ?> display:none;<?php } ?>">
  69. <div class="layui-form-item qiniu_class">
  70. <label class="layui-form-label"></label>
  71. <div class="layui-input-block">
  72. <div class="summary_box">
  73. <div class="summary_lg">
  74. 启用七牛云存储后,请把/Uploads目录(包括此目录)下的子文件及子目录上传至七牛云存储 :
  75. <p><a href="https://portal.qiniu.com/signin" target="_blank">七牛云存储</a></p>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="layui-form-item qiniu_class">
  81. <label class="layui-form-label">Accesskey</label>
  82. <div class="layui-input-block">
  83. <input type="text" name="parameter[qiniu_accesskey]" class="form-control" value="<?php echo ($data['qiniu_accesskey']); ?>" />
  84. <span class='help-block'>用于签名的公钥</span>
  85. </div>
  86. </div>
  87. <div class="layui-form-item qiniu_class">
  88. <label class="layui-form-label">Secretkey</label>
  89. <div class="layui-input-block">
  90. <input type="text" name="parameter[qiniu_secretkey]" class="form-control" value="<?php echo ($data['qiniu_secretkey']); ?>" />
  91. <span class='help-block'>用于签名的私钥</span>
  92. </div>
  93. </div>
  94. <div class="layui-form-item qiniu_class">
  95. <label class="layui-form-label">Bucket</label>
  96. <div class="layui-input-block">
  97. <input type="text" name="parameter[qiniu_bucket]" class="form-control" value="<?php echo ($data['qiniu_bucket']); ?>" />
  98. <span class='help-block'>请保证bucket为可公共读取的</span>
  99. </div>
  100. </div>
  101. <div class="layui-form-item qiniu_class">
  102. <label class="layui-form-label">Url</label>
  103. <div class="layui-input-block">
  104. <input type="text" name="parameter[qiniu_url]" class="form-control" value="<?php echo ($data['qiniu_url']); ?>" />
  105. <span class='help-block'>七牛支持用户自定义访问域名。注:url开头加http://或https://结尾加 ‘/’例:http://abc.com/</span>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="row alioss_row" style="<?php if(!empty($data) && $data['attachment_type'] ==2){ ?> <?php }else{ ?> display:none;<?php } ?>">
  110. <div class="layui-form-item">
  111. <label class="layui-form-label"></label>
  112. <div class="layui-input-block">
  113. <div class="summary_box">
  114. <div class="summary_lg">
  115. <p>启用阿里oss后,请把/Uploads目录(包括此目录)下的子文件及子目录上传至阿里云oss, 相关工具:</p>
  116. <p><a href="http://bbs.aliyun.com/read/247023.html?spm=5176.383663.9.29.faitxp" target="_blank">官方推荐工具</a></p>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="layui-form-item">
  122. <label class="layui-form-label">Access Key ID</label>
  123. <div class="layui-input-block">
  124. <input type="text" name="parameter[alioss_key]" class="form-control" value="<?php echo ($data['alioss_key']); ?>" />
  125. <span class='help-block'>Access Key ID是您访问阿里云API的密钥,具有该账户完全的权限,请您妥善保管。</span>
  126. </div>
  127. </div>
  128. <div class="layui-form-item">
  129. <label class="layui-form-label">Access Key Secret</label>
  130. <div class="layui-input-block">
  131. <input type="text" name="parameter[alioss_secret]" class="form-control" value="<?php echo ($data['alioss_secret']); ?>" />
  132. <span class='help-block'>Access Key Secret是您访问阿里云API的密钥,具有该账户完全的权限,请您妥善保管。(填写完Access Key ID 和 Access Key Secret 后请选择bucket)</span>
  133. </div>
  134. </div>
  135. <div class="layui-form-item qiniu_class">
  136. <label class="layui-form-label">Bucket</label>
  137. <div class="layui-input-block">
  138. <input type="text" name="parameter[alioss_bucket]" class="form-control" value="<?php echo ($data['alioss_bucket']); ?>" />
  139. <span class='help-block'>请保证bucket为可公共读取的</span>
  140. </div>
  141. </div>
  142. <div class="layui-form-item">
  143. <label class="layui-form-label">内网上传</label>
  144. <div class="layui-input-block">
  145. <label class='radio-inline'>
  146. <input type='radio' name='parameter[alioss_internal]' value='1' <?php if(!empty($data) && $data['alioss_internal'] ==1){ ?>checked <?php } ?> title="是" />
  147. </label>
  148. <label class='radio-inline'>
  149. <input type='radio' name='parameter[alioss_internal]' value='0' <?php if( empty($data) || $data['alioss_internal'] ==0){ ?>checked <?php } ?> title="否" />
  150. </label>
  151. <span class='help-block'>
  152. 如果此站点使用的是阿里云ecs服务器,并且服务器与bucket在同一地区(如:同在华北一区),您可以选择通过内网上传的方式上传附件,以加快上传速度、节省带宽。
  153. </span>
  154. </div>
  155. </div>
  156. <div class="layui-form-item">
  157. <label class="layui-form-label">自定义URL</label>
  158. <div class="layui-input-block">
  159. <input type="text" name="parameter[alioss_url]" class="form-control" value="<?php echo ($data['alioss_url']); ?>" />
  160. <span class='help-block'>
  161. 阿里云oss支持用户自定义访问域名,如果自定义了URL则用自定义的URL,如果未自定义,则用系统生成出来的URL。
  162. 注:自定义url开头加http://或https://结尾加 ‘/’例:http://abc.com/
  163. </span>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="row txyun_row" style="<?php if(!empty($data) && $data['attachment_type'] ==3){ ?> <?php }else{ ?> display:none;<?php } ?>">
  168. <div class="layui-form-item">
  169. <label class="layui-form-label"></label>
  170. <div class="layui-input-block">
  171. <div class="summary_box">
  172. <div class="summary_lg">
  173. <p>启用腾讯云存储后,请把/Uploads目录(包括此目录)下的子文件及子目录上传至腾讯云存储, 相关工具:</p>
  174. <p><a href="https://console.qcloud.com/cos/bucket" target="_blank">官方推荐工具</a></p>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="layui-form-item">
  180. <label class="layui-form-label">APPID</label>
  181. <div class="layui-input-block">
  182. <input type="text" name="parameter[tx_appid]" class="form-control" value="<?php echo ($data['tx_appid']); ?>" />
  183. <span class='help-block'>APPID 是您项目的唯一ID</span>
  184. </div>
  185. </div>
  186. <div class="layui-form-item">
  187. <label class="layui-form-label">SecretID</label>
  188. <div class="layui-input-block">
  189. <input type="text" name="parameter[tx_secretid]" class="form-control" value="<?php echo ($data['tx_secretid']); ?>" />
  190. <span class='help-block'>SecretID 是您项目的安全密钥,具有该账户完全的权限,请妥善保管</span>
  191. </div>
  192. </div>
  193. <div class="layui-form-item">
  194. <label class="layui-form-label">SecretKEY</label>
  195. <div class="layui-input-block">
  196. <input type="text" name="parameter[tx_secretkey]" class="form-control" value="<?php echo ($data['tx_secretkey']); ?>" />
  197. <span class='help-block'>SecretKEY 是您项目的安全密钥,具有该账户完全的权限,请妥善保管</span>
  198. </div>
  199. </div>
  200. <div class="layui-form-item">
  201. <label class="layui-form-label">Bucket</label>
  202. <div class="layui-input-block">
  203. <input type="text" name="parameter[tx_bucket]" class="form-control" value="<?php echo ($data['tx_bucket']); ?>" />
  204. <span class='help-block'>请保证bucket为可公共读取的</span>
  205. </div>
  206. </div>
  207. <?php $tx_area_list = array( 'ap-beijing-1' => '北京一区(已售罄)', 'ap-beijing' => '北京', 'ap-shanghai' => '上海(华东)', 'ap-guangzhou' => '广州(华南)', 'ap-chengdu' => '成都(西南)', 'ap-chongqing' => '重庆', 'ap-shenzhen-fsi' => '深圳金融', 'ap-shanghai-fsi' => '上海金融', 'ap-beijing-fsi' => '北京金融', 'ap-hongkong' => '中国香港', 'ap-singapore' => '新加坡', 'ap-mumbai' => '孟买', 'ap-seoul' => '首尔', 'ap-bangkok' => '曼谷', 'ap-tokyo' => '东京', 'na-siliconvalley' => '硅谷', 'na-ashburn' => '弗吉尼亚', 'na-toronto' => '多伦多', 'eu-frankfurt' => '法兰克福', 'eu-moscow' => '莫斯科', ); ?>
  208. <div class="layui-form-item">
  209. <label class="layui-form-label">地区</label>
  210. <div class="layui-input-block">
  211. <select name="parameter[tx_area]">
  212. <?php foreach($tx_area_list as $key => $val){ ?>
  213. <option value="<?php echo ($key); ?>" <?php if( !empty($data['tx_area']) && $data['tx_area'] == $key ){ ?> selected<?php } ?> ><?php echo ($val); ?></option>
  214. <?php } ?>
  215. </select>
  216. </div>
  217. </div>
  218. <div class="layui-form-item">
  219. <label class="layui-form-label">Url</label>
  220. <div class="layui-input-block">
  221. <input type="text" name="parameter[tx_url]" class="form-control" value="<?php echo ($data['tx_url']); ?>" />
  222. <span class='help-block'>腾讯云支持用户自定义访问域名。注:url开头加http://或https://结尾加 ‘/’例:http://abc.com/</span>
  223. </div>
  224. </div>
  225. </div>
  226. <div class="layui-form-item">
  227. <label class="layui-form-label"> </label>
  228. <div class="layui-input-block">
  229. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  230. </div>
  231. </div>
  232. </form>
  233. </div>
  234. </div>
  235. </div>
  236. <script src="/layuiadmin/layui/layui.js"></script>
  237. <script>
  238. layui.config({
  239. base: '/layuiadmin/' //静态资源所在路径
  240. }).extend({
  241. index: 'lib/index' //主入口模块
  242. }).use('index');
  243. </script>
  244. <script>
  245. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  246. var layer = layui.layer;
  247. var $;
  248. layui.use(['jquery', 'layer','form','colorpicker'], function(){
  249. $ = layui.$;
  250. var form = layui.form;
  251. var colorpicker = layui.colorpicker;
  252. //表单赋值
  253. colorpicker.render({
  254. elem: '#minicolors'
  255. ,color: '<?php echo ($data['nav_bg_color']); ?>'
  256. ,done: function(color){
  257. $('#test-colorpicker-form-input').val(color);
  258. }
  259. });
  260. colorpicker.render({
  261. elem: '#minicolors2'
  262. ,color: '<?php echo ($data['index_top_font_color']); ?>'
  263. ,done: function(color){
  264. $('#test-colorpicker-form-input2').val(color);
  265. }
  266. });
  267. //监听提交
  268. form.on('submit(formDemo)', function(data){
  269. $.ajax({
  270. url: data.form.action,
  271. type: data.form.method,
  272. data: data.field,
  273. dataType:'json',
  274. success: function (info) {
  275. if(info.status == 0)
  276. {
  277. layer.msg(info.result.message,{icon: 1,time: 2000});
  278. }else if(info.status == 1){
  279. var go_url = location.href;
  280. if( info.result.hasOwnProperty("url") )
  281. {
  282. go_url = info.result.url;
  283. }
  284. layer.msg('操作成功',{time: 1000,
  285. end:function(){
  286. location.href = info.result.url;
  287. }
  288. });
  289. }
  290. }
  291. });
  292. return false;
  293. });
  294. })
  295. </script>
  296. <script language="javascript">
  297. $('.attclass input[type=radio]').click(function(){
  298. var s_r = $(this).val();
  299. if(s_r == 0)
  300. {
  301. $('.qiniu_row').hide();
  302. $('.alioss_row').hide();
  303. $('.txyun_row').hide();
  304. }else if(s_r == 1){
  305. $('.qiniu_row').show();
  306. $('.alioss_row').hide();
  307. $('.txyun_row').hide();
  308. }else if(s_r == 2){
  309. $('.qiniu_row').hide();
  310. $('.alioss_row').show();
  311. $('.txyun_row').hide();
  312. }else if( s_r == 3 )
  313. {
  314. $('.txyun_row').show();
  315. $('.qiniu_row').hide();
  316. $('.alioss_row').hide();
  317. }
  318. })
  319. </script>
  320. </body>