setting.class.php
3.74 KB
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
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: setting.class.php 35206 2015-02-12 01:40:17Z nemohou $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class WeChatSetting {
function showResource() {
echo '<div id="rsel_menu" class="custom cmain" style="display:none;width:1000px;height:540px">'
. '<div class="cnote" style="width:100%"><span class="right"><a href="###" class="flbc" onclick="hideMenu();return false;"></a></span><h3>'.lang('plugin/wechat', 'resource_select').'</h3></div>'
. '<div id="rsel_content" style="overflow:hidden;height:95%"></div></div>';
$adminscript = ADMINSCRIPT;
echo <<<EOF
<script>
var showResourceId = null;
function showResource(id) {
showMenu({'ctrlid':'rsel','evt':'click','duration':3,'pos':'00'});
showResourceId = id;
ajaxget('$adminscript?action=plugins&operation=config&identifier=wechat&pmod=resource_setting&ac=select', 'rsel_content');
}
function selResource(id, text) {
$(showResourceId).value = '[resource=' + id + '] ' + text;
hideMenu();
}
</script>
EOF;
}
function menu() {
global $_G;
$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
echo <<<EOF
<style>
.floattop { display: none; }
.floattopempty { display: none; }
.mymenu { height:35px; }
.mymenu .floattop { display: inline; }
.mymenu .floattopempty { display: inline; }
</style>
EOF;
echo '<div class="mymenu">';
showsubmenu(lang('plugin/wechat', 'menu_root'), array(
array(array('menu' => lang('plugin/wechat', 'menu_wsq'), 'submenu' => array(
array(lang('plugin/wechat', 'menu_wsq_base'), 'plugins&operation=config&identifier=wechat&pmod=wsq_setting', $_GET['pmod'] == 'wsq_setting'),
array(lang('plugin/wechat', 'menu_wsq_show'), 'plugins&operation=config&identifier=wechat&pmod=showactivity_setting', $_GET['pmod'] == 'showactivity_setting'),
array(lang('plugin/wechat', 'menu_wsq_stat'), 'plugins&operation=config&identifier=wechat&pmod=wsq_stat', $_GET['pmod'] == 'wsq_stat'),
))),
array(array('menu' => lang('plugin/wechat', 'menu_wechat'), 'submenu' => array(
array(lang('plugin/wechat', 'menu_wechat_base'), 'plugins&operation=config&identifier=wechat&pmod=wechat_setting', $_GET['pmod'] == 'wechat_setting'),
array(lang('plugin/wechat', 'menu_wechat_msg'), 'plugins&operation=config&identifier=wechat&pmod=response_setting', $_GET['pmod'] == 'response_setting'),
array(lang('plugin/wechat', 'menu_wechat_menu'), 'plugins&operation=config&identifier=wechat&pmod=menu_setting', $_GET['pmod'] == 'menu_setting'),
array(lang('plugin/wechat', 'menu_wechat_resource'), 'plugins&operation=config&identifier=wechat&pmod=resource_setting', $_GET['pmod'] == 'resource_setting'),
array(lang('plugin/wechat', 'menu_wechat_masssend'), 'plugins&operation=config&identifier=wechat&pmod=masssend_setting', $_GET['pmod'] == 'masssend_setting'),
))),
array(lang('plugin/wechat', 'menu_app'), 'plugins&operation=config&identifier=wechat&pmod=wsq_app', $_GET['pmod'] == 'wsq_app'),
array(lang('plugin/wechat', 'menu_api'), 'plugins&operation=config&identifier=wechat&pmod=api_setting', $_GET['pmod'] == 'api_setting'),
));
echo '</div>';
if($_G['wechat']['setting']['wsq_siteid']) {
$time = TIMESTAMP;
echo <<<EOF
<script>
function pubEventCallbackCommon(re) {
if(re.errCode) {
return;
}
if(typeof re.data.event.peId != 'undefined') {
$('pubEventNum').innerHTML = 'New!';
$('pubEventNum').style.display = '';
}
}
</script>
<script src="http://api.wsq.qq.com/publicEvent?sId={$_G[wechat][setting][wsq_siteid]}&resType=jsonp&isAjax=1&_=$time&isDiscuz=1&callback=pubEventCallbackCommon">
</script>
EOF;
}
}
}