|
1
|
|
|
<?php |
|
2
|
|
|
/************************************************************************/ |
|
3
|
|
|
/* Donations - Paypal financial management module for Xoops 2 */ |
|
4
|
|
|
/* Copyright (c) 2016 XOOPS Project */ |
|
5
|
|
|
/* http://dev.xoops.org/modules/xfmod/project/?group_id=1060 */ |
|
6
|
|
|
/* |
|
7
|
|
|
/************************************************************************/ |
|
8
|
|
|
/* */ |
|
9
|
|
|
/* Based on NukeTreasury for PHP-Nuke - by Dave Lawrence AKA Thrash */ |
|
10
|
|
|
/* NukeTreasury - Financial management for PHP-Nuke */ |
|
11
|
|
|
/* Copyright (c) 2004 by Dave Lawrence AKA Thrash */ |
|
12
|
|
|
/* [email protected] */ |
|
13
|
|
|
/* [email protected] */ |
|
14
|
|
|
/* */ |
|
15
|
|
|
/************************************************************************/ |
|
16
|
|
|
/* */ |
|
17
|
|
|
/* This program is free software; you can redistribute it and/or modify */ |
|
18
|
|
|
/* it under the terms of the GNU General Public License as published by */ |
|
19
|
|
|
/* the Free Software Foundation; either version 2 of the License. */ |
|
20
|
|
|
/* */ |
|
21
|
|
|
/* This program is distributed in the hope that it will be useful, but */ |
|
22
|
|
|
/* WITHOUT ANY WARRANTY; without even the implied warranty of */ |
|
23
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ |
|
24
|
|
|
/* General Public License for more details. */ |
|
25
|
|
|
/* */ |
|
26
|
|
|
/* You should have received a copy of the GNU General Public License */ |
|
27
|
|
|
/* along with this program; if not, write to the Free Software */ |
|
28
|
|
|
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ |
|
29
|
|
|
/* USA */ |
|
30
|
|
|
/************************************************************************/ |
|
31
|
|
|
|
|
32
|
|
|
$moduleDirName = basename(__DIR__); |
|
33
|
|
|
|
|
34
|
|
|
$modversion['name'] = ucfirst($moduleDirName); |
|
35
|
|
|
$modversion['version'] = '2.00'; |
|
36
|
|
|
$modversion['description'] = _MI_DON_DESC; |
|
37
|
|
|
$modversion['author'] = 'XOOPS Development Team, zyspec ([email protected]), Mamba'; |
|
38
|
|
|
$modversion['credits'] = 'Based on NukeTreasury for PHP-Nuke.<br />Xoops2 port maintained by the Xoops2 Donations Module Dev Team.'; |
|
39
|
|
|
$modversion['help'] = 'page=help'; |
|
40
|
|
|
$modversion['license'] = 'GNU GPL 2.0'; |
|
41
|
|
|
$modversion['license_url'] = 'www.gnu.org/licenses/gpl-2.0.html'; |
|
42
|
|
|
$modversion['official'] = 0; //1 indicates supported by XOOPS Dev Team, 0 means 3rd party supported |
|
43
|
|
|
$modversion['image'] = 'assets/images/logo_module.png'; |
|
44
|
|
|
$modversion['dirname'] = basename(__DIR__);//$xdonDir; |
|
45
|
|
|
$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin'; |
|
46
|
|
|
$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16'; |
|
47
|
|
|
$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32'; |
|
48
|
|
|
|
|
49
|
|
|
//about |
|
50
|
|
|
$modversion['release_file'] = XOOPS_URL . '/modules/' . $modversion['dirname'] . '/docs/changelog.txt'; |
|
51
|
|
|
$modversion['release_date'] = '2016/04/05'; |
|
52
|
|
|
$modversion['module_website_url'] = 'www.xoops.org/'; |
|
53
|
|
|
$modversion['module_website_name'] = 'XOOPS'; |
|
54
|
|
|
$modversion['release'] = '2016-04-05'; |
|
55
|
|
|
$modversion['module_status'] = 'Beta 1'; |
|
56
|
|
|
$modversion['author_website_url'] = 'http://xoops.org/'; |
|
57
|
|
|
$modversion['author_website_name'] = 'XOOPS'; |
|
58
|
|
|
$modversion['min_php'] = '5.5'; |
|
59
|
|
|
$modversion['min_xoops'] = '2.5.8'; |
|
60
|
|
|
$modversion['min_admin'] = '1.1'; |
|
61
|
|
|
$modversion['min_db'] = array('mysql' => '5.0.7', 'mysqli' => '5.0.7'); |
|
62
|
|
|
|
|
63
|
|
|
// Run Script After Installation |
|
64
|
|
|
$modversion['onInstall'] = 'include/installscript.php'; |
|
65
|
|
|
|
|
66
|
|
|
// Run Script On Update |
|
67
|
|
|
$modversion['onUpdate'] = 'include/onupdate.php'; |
|
68
|
|
|
|
|
69
|
|
|
// Run Script On Module Removal |
|
70
|
|
|
$modversion['onUninstall'] = 'include/uninstallscript.php'; |
|
71
|
|
|
|
|
72
|
|
|
// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin) |
|
73
|
|
|
// All tables should not have any prefix! |
|
74
|
|
|
$modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
|
75
|
|
|
|
|
76
|
|
|
// Tables created by sql file (without prefix!) |
|
77
|
|
|
$modversion['tables'][0] = 'donations_config'; |
|
78
|
|
|
$modversion['tables'][1] = 'donations_financial'; |
|
79
|
|
|
$modversion['tables'][2] = 'donations_transactions'; |
|
80
|
|
|
$modversion['tables'][3] = 'donations_translog'; |
|
81
|
|
|
|
|
82
|
|
|
// Admin things |
|
83
|
|
|
$modversion['hasAdmin'] = 1; |
|
84
|
|
|
$modversion['adminindex'] = 'admin/index.php'; |
|
85
|
|
|
$modversion['adminmenu'] = 'admin/menu.php'; |
|
86
|
|
|
$modversion['system_menu'] = 1; |
|
87
|
|
|
|
|
88
|
|
|
// Blocks |
|
89
|
|
|
$modversion['blocks'][1]['file'] = 'donat_o_meter.php'; |
|
90
|
|
|
$modversion['blocks'][1]['name'] = _MI_DON_BNAME1; |
|
91
|
|
|
$modversion['blocks'][1]['description'] = _MI_DON_BNAME1_DESC; |
|
92
|
|
|
$modversion['blocks'][1]['show_func'] = 'b_donations_donatometer_show'; |
|
93
|
|
|
$modversion['blocks'][1]['options'] = '10|1|0|' . _MI_DON_BUTTON_URL . '|110|23'; |
|
94
|
|
|
$modversion['blocks'][1]['edit_func'] = 'b_donations_donatometer_edit'; |
|
95
|
|
|
$modversion['blocks'][1]['template'] = 'donations_donatometer.tpl'; |
|
96
|
|
|
|
|
97
|
|
|
$modversion['blocks'][2]['file'] = 'donate.php'; |
|
98
|
|
|
$modversion['blocks'][2]['name'] = _MI_DON_BNAME2; |
|
99
|
|
|
$modversion['blocks'][2]['description'] = _MI_DON_BNAME2_DESC; |
|
100
|
|
|
$modversion['blocks'][2]['show_func'] = 'b_donations_donate_show'; |
|
101
|
|
|
$modversion['blocks'][2]['template'] = 'donations_donate.tpl'; |
|
102
|
|
|
|
|
103
|
|
|
$modversion['blocks'][3]['file'] = 'donors.php'; |
|
104
|
|
|
$modversion['blocks'][3]['name'] = _MI_DON_BNAME3; |
|
105
|
|
|
$modversion['blocks'][3]['description'] = _MI_DON_BNAME3_DESC; |
|
106
|
|
|
$modversion['blocks'][3]['show_func'] = 'b_donations_donors_show'; |
|
107
|
|
|
$modversion['blocks'][3]['options'] = '10|1|0'; |
|
108
|
|
|
$modversion['blocks'][3]['edit_func'] = 'b_donations_donors_edit'; |
|
109
|
|
|
$modversion['blocks'][3]['template'] = 'donations_donors.tpl'; |
|
110
|
|
|
|
|
111
|
|
|
// Menu |
|
112
|
|
|
$modversion['hasMain'] = 1; |
|
113
|
|
|
|
|
114
|
|
|
global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig; |
|
|
|
|
|
|
115
|
|
|
$hModConfig = xoops_getHandler('config'); |
|
116
|
|
|
$hModule = xoops_getHandler('module'); |
|
117
|
|
|
|
|
118
|
|
|
if (is_object($xoopsUser) && $xoopsUser->isAdmin()) { |
|
119
|
|
|
$modversion['sub'][1]['name'] = _MI_DON_ADMIN; |
|
120
|
|
|
$modversion['sub'][1]['url'] = 'admin/index.php'; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
// Templates |
|
124
|
|
|
$modversion['templates'][1]['file'] = 'donations_main.tpl'; |
|
125
|
|
|
$modversion['templates'][1]['description'] = 'Donations Main Template'; |
|
126
|
|
|
|
Instead of relying on
globalstate, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state