-
Notifications
You must be signed in to change notification settings - Fork 23
/
ckeditor_images.html
117 lines (116 loc) · 4.09 KB
/
ckeditor_images.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="expires" content="wed, 26 feb 1997 08:21:57 gmt">
<title>图片库</title>
<meta name="author" content="phpok.com" />
<link rel="stylesheet" type="text/css" href="{#css#}/artdialog.css" />
<link rel="stylesheet" type="text/css" href="static/admin/layui/{#css#}/layui.css" />
<link rel="stylesheet" type="text/css" href="static/bootstrap/{#css#}/bootstrap.css" />
{func phpok_head_css}
<script type="text/javascript" src="{url ctrl=js ext=jquery.phpok,jquery.artdialog _ext=global.admin.js /}"></script>
{func phpok_head_js}
<script type="text/javascript">
function check_search(obj)
{
var k = $("#keywords").val();
if(!k){
$.dialog.alert('请输入要搜索的关键字');
return false;
}
var url = $(obj).attr("action");
url += "&keywords="+$.str.encode(k);
$.phpok.go(url);
return false;
}
function update_cate(val)
{
var old = "{$cate.id}";
if(old != val){
var url = "{url ctrl=ckeditor func=images /}&cateid="+val;
$.phpok.go(url);
}
}
function dialogOK()
{
var id = $.checkbox.join('piclist');
if(!id){
$.dialog.tips(p_lang('请选择要插入的图片'));
return false;
}
var list = id.split(',');
var html = '';
for(var i in list){
var url = $("#t_"+list[i]).attr('data-url');
var tit = $("#t_"+list[i]).attr('data-title');
html += '<p><img src="'+url+'" alt="'+tit+'" title="'+tit+'" /></p>';
}
return html;
}
</script>
</head>
<body>
<div class="container-fluid mt-1 mb-1">
<form method="post" action="{url ctrl=ckeditor func=images cateid=$cate.id /}" onsubmit="return check_search(this)">
<div class="row">
<div class="col">
{$button}
</div>
<!-- if $catelist -->
<div class="col">
<select class="form-control form-control-sm" name="cateid" id="cateid" onchange="update_cate(this.value)">
<!-- loop from=$catelist key=$key value=$value id=$tmpid -->
<option value="{$value.id}"{if $cate && $value.id == $cate.id} selected{/if}>{$value.title}</option>
<!-- /loop -->
</select>
</div>
<!-- /if -->
<div class="col">
<input type="text" name="keywords" id="keywords" value="{$keywords}" placeholder="{lang请输入要搜索的关键字}" class="form-control form-control-sm" />
</div>
<div class="col">
<div class="btn-group" role="group" aria-label="">
<button type="submit" class="btn btn-primary btn-sm">{lang搜索}</button>
<a href="{url ctrl=ckeditor func=images cateid=$cate.id /}" class="btn btn-warning btn-sm">{lang取消搜索}</a>
</div>
</div>
<div class="col text-right">
<button type="button" class="btn btn-danger btn-sm" onclick="$.phpok.reload()">{lang刷新}</button>
</div>
</div>
</form>
</div>
<div class="container-fluid">
<div class="row" id="piclist">
<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
<div class="col-4 col-3 col-sm-2" id="li_{$value.id}" data="{$value.id}" title="名称:{$value.title} 时间:{func date 'Y-m-d H:i' $value.mtime}{if $value.width} 宽高:{$value.width}x{$value.height}{/if}">
<label class="position-relative">
<input type="checkbox" class="position-absolute" style="left:10px;top:10px;" id="t_{$value.id}" value="{$value.id}" data-url="{$value.url}" data-title="{$value.title}" />
<img src="{$value.ico}" class="figure-img img-thumbnail" />
<div class="position-absolute text-nowrap text-truncate" style="width:80%;bottom:20px;left:10px;text-shadow:1px 1px 0px #fff;">{$value.title}</div>
</label>
</div>
<!-- /loop -->
</div>
</div>
<!-- if $pagelist -->
<div class="container-fluid ">
<nav aria-label="Page navigation" class="">
<ul class="pagination pagination-sm justify-content-center">
<!-- loop from=$pagelist key=$key value=$value id=$tmpid -->
<li class="page-item{if $value.status} active{/if}"><a class="page-link" href="{$value.url}">{$value.title}</a></li>
<!-- /loop -->
</ul>
</nav>
</div>
<!-- /if -->
<script type="text/javascript" src="static/bootstrap/{#js#}/bootstrap.bundle.js"></script>
<script type="text/javascript">
function stop(){
return false;
}
document.oncontextmenu=stop;
</script>
</body>
</html>