Completed
Push — master ( 88111b...b3fce7 )
by Michael
05:58
created
admin/update.php 1 patch
Indentation   +298 added lines, -298 removed lines patch added patch discarded remove patch
@@ -21,188 +21,188 @@  discard block
 block discarded – undo
21 21
 // =========================================================================================
22 22
 function update_tables_to_300()
23 23
 {
24
-    $dbupdater = new Wfdownloads\Dbupdater();
24
+	$dbupdater = new Wfdownloads\Dbupdater();
25 25
 
26
-    if (!wfdownloads_TableExists('wfdownloads_meta')) {
27
-        // Create table wfdownloads_meta
28
-        $table = new Wfdownloads\DbupdaterTable('wfdownloads_meta');
29
-        $table->setStructure("CREATE TABLE `%s` (
26
+	if (!wfdownloads_TableExists('wfdownloads_meta')) {
27
+		// Create table wfdownloads_meta
28
+		$table = new Wfdownloads\DbupdaterTable('wfdownloads_meta');
29
+		$table->setStructure("CREATE TABLE `%s` (
30 30
                                 metakey varchar(50) NOT NULL default '',
31 31
                                 metavalue varchar(255) NOT NULL default '',
32 32
                                 PRIMARY KEY (metakey))
33 33
                                 ENGINE=MyISAM;");
34 34
 
35
-        $table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2)));
36
-        if ($dbupdater->updateTable($table)) {
37
-            echo 'wfdownloads_meta table created<br>';
38
-        }
39
-    }
40
-
41
-    $download_fields = [
42
-        'lid'           => ['Type' => 'int(11) unsigned NOT NULL auto_increment', 'Default' => false],
43
-        'cid'           => ['Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true],
44
-        'title'         => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
45
-        'url'           => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
46
-        'filename'      => ['Type' => "varchar(150) NOT NULL default ''", 'Default' => true],
47
-        'filetype'      => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
48
-        'homepage'      => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
49
-        'version'       => ['Type' => "varchar(20) NOT NULL default ''", 'Default' => true],
50
-        'size'          => ['Type' => "int(8) NOT NULL default '0'", 'Default' => true],
51
-        'platform'      => ['Type' => "varchar(50) NOT NULL default ''", 'Default' => true],
52
-        'screenshot'    => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
53
-        'submitter'     => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
54
-        'publisher'     => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
55
-        'status'        => ['Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true],
56
-        'date'          => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
57
-        'hits'          => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
58
-        'rating'        => ['Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true],
59
-        'votes'         => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
60
-        'comments'      => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
61
-        'license'       => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
62
-        'mirror'        => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
63
-        'price'         => ['Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true],
64
-        'paypalemail'   => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
65
-        'features'      => ['Type' => 'text NOT NULL', 'Default' => false],
66
-        'requirements'  => ['Type' => 'text NOT NULL', 'Default' => false],
67
-        'homepagetitle' => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
68
-        'forumid'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
69
-        'limitations'   => ['Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true],
70
-        'dhistory'      => ['Type' => 'text NOT NULL', 'Default' => false],
71
-        'published'     => ['Type' => "int(11) NOT NULL default '1089662528'", 'Default' => true],
72
-        'expired'       => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
73
-        'updated'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
74
-        'offline'       => ['Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true],
75
-        'description'   => ['Type' => 'text NOT NULL', 'Default' => false],
76
-        'ipaddress'     => ['Type' => "varchar(120) NOT NULL default '0'", 'Default' => true],
77
-        'notifypub'     => ['Type' => "int(1) NOT NULL default '0'", 'Default' => true],
78
-        'summary'       => ['Type' => 'text NOT NULL', 'Default' => false]
79
-    ];
80
-
81
-    $renamed_fields = [
82
-        'logourl' => 'screenshot'
83
-    ];
84
-
85
-    echo '<br><b>Checking Download table</b><br>';
86
-    $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
87
-    $downloadHandler = $helperWfdownloads->getHandler('Download');
88
-    $download_table  = new Wfdownloads\DbupdaterTable('wfdownloads_downloads');
89
-    $fields          = get_table_info($downloadHandler->table, $download_fields);
90
-    // Check for renamed fields
91
-    rename_fields($download_table, $renamed_fields, $fields, $download_fields);
92
-    update_table($download_fields, $fields, $download_table);
93
-    if ($dbupdater->updateTable($download_table)) {
94
-        echo 'Downloads table updated<br>';
95
-    }
96
-    unset($fields);
97
-
98
-    $mod_fields = [
99
-        'requestid'       => ['Type' => 'int(11) NOT NULL auto_increment', 'Default' => false],
100
-        'lid'             => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
101
-        'cid'             => ['Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true],
102
-        'title'           => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
103
-        'url'             => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
104
-        'filename'        => ['Type' => "varchar(150) NOT NULL default ''", 'Default' => true],
105
-        'filetype'        => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
106
-        'homepage'        => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
107
-        'version'         => ['Type' => "varchar(20) NOT NULL default ''", 'Default' => true],
108
-        'size'            => ['Type' => "int(8) NOT NULL default '0'", 'Default' => true],
109
-        'platform'        => ['Type' => "varchar(50) NOT NULL default ''", 'Default' => true],
110
-        'screenshot'      => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
111
-        'submitter'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
112
-        'publisher'       => ['Type' => 'text NOT NULL', 'Default' => false],
113
-        'status'          => ['Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true],
114
-        'date'            => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
115
-        'hits'            => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
116
-        'rating'          => ['Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true],
117
-        'votes'           => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
118
-        'comments'        => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
119
-        'license'         => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
120
-        'mirror'          => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
121
-        'price'           => ['Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true],
122
-        'paypalemail'     => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
123
-        'features'        => ['Type' => 'text NOT NULL', 'Default' => false],
124
-        'requirements'    => ['Type' => 'text NOT NULL', 'Default' => false],
125
-        'homepagetitle'   => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
126
-        'forumid'         => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
127
-        'limitations'     => ['Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true],
128
-        'dhistory'        => ['Type' => 'text NOT NULL', 'Default' => false],
129
-        'published'       => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
130
-        'expired'         => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
131
-        'updated'         => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
132
-        'offline'         => ['Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true],
133
-        'summary'         => ['Type' => 'text NOT NULL', 'Default' => false],
134
-        'description'     => ['Type' => 'text NOT NULL', 'Default' => false],
135
-        'modifysubmitter' => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
136
-        'requestdate'     => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true]
137
-    ];
138
-
139
-    $renamed_fields = [
140
-        'logourl' => 'screenshot'
141
-    ];
142
-
143
-    echo '<br><b>Checking Modified Downloads table</b><br>';
35
+		$table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2)));
36
+		if ($dbupdater->updateTable($table)) {
37
+			echo 'wfdownloads_meta table created<br>';
38
+		}
39
+	}
40
+
41
+	$download_fields = [
42
+		'lid'           => ['Type' => 'int(11) unsigned NOT NULL auto_increment', 'Default' => false],
43
+		'cid'           => ['Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true],
44
+		'title'         => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
45
+		'url'           => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
46
+		'filename'      => ['Type' => "varchar(150) NOT NULL default ''", 'Default' => true],
47
+		'filetype'      => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
48
+		'homepage'      => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
49
+		'version'       => ['Type' => "varchar(20) NOT NULL default ''", 'Default' => true],
50
+		'size'          => ['Type' => "int(8) NOT NULL default '0'", 'Default' => true],
51
+		'platform'      => ['Type' => "varchar(50) NOT NULL default ''", 'Default' => true],
52
+		'screenshot'    => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
53
+		'submitter'     => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
54
+		'publisher'     => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
55
+		'status'        => ['Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true],
56
+		'date'          => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
57
+		'hits'          => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
58
+		'rating'        => ['Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true],
59
+		'votes'         => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
60
+		'comments'      => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
61
+		'license'       => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
62
+		'mirror'        => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
63
+		'price'         => ['Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true],
64
+		'paypalemail'   => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
65
+		'features'      => ['Type' => 'text NOT NULL', 'Default' => false],
66
+		'requirements'  => ['Type' => 'text NOT NULL', 'Default' => false],
67
+		'homepagetitle' => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
68
+		'forumid'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
69
+		'limitations'   => ['Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true],
70
+		'dhistory'      => ['Type' => 'text NOT NULL', 'Default' => false],
71
+		'published'     => ['Type' => "int(11) NOT NULL default '1089662528'", 'Default' => true],
72
+		'expired'       => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
73
+		'updated'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
74
+		'offline'       => ['Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true],
75
+		'description'   => ['Type' => 'text NOT NULL', 'Default' => false],
76
+		'ipaddress'     => ['Type' => "varchar(120) NOT NULL default '0'", 'Default' => true],
77
+		'notifypub'     => ['Type' => "int(1) NOT NULL default '0'", 'Default' => true],
78
+		'summary'       => ['Type' => 'text NOT NULL', 'Default' => false]
79
+	];
80
+
81
+	$renamed_fields = [
82
+		'logourl' => 'screenshot'
83
+	];
84
+
85
+	echo '<br><b>Checking Download table</b><br>';
86
+	$helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
87
+	$downloadHandler = $helperWfdownloads->getHandler('Download');
88
+	$download_table  = new Wfdownloads\DbupdaterTable('wfdownloads_downloads');
89
+	$fields          = get_table_info($downloadHandler->table, $download_fields);
90
+	// Check for renamed fields
91
+	rename_fields($download_table, $renamed_fields, $fields, $download_fields);
92
+	update_table($download_fields, $fields, $download_table);
93
+	if ($dbupdater->updateTable($download_table)) {
94
+		echo 'Downloads table updated<br>';
95
+	}
96
+	unset($fields);
97
+
98
+	$mod_fields = [
99
+		'requestid'       => ['Type' => 'int(11) NOT NULL auto_increment', 'Default' => false],
100
+		'lid'             => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
101
+		'cid'             => ['Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true],
102
+		'title'           => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
103
+		'url'             => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
104
+		'filename'        => ['Type' => "varchar(150) NOT NULL default ''", 'Default' => true],
105
+		'filetype'        => ['Type' => "varchar(100) NOT NULL default ''", 'Default' => true],
106
+		'homepage'        => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
107
+		'version'         => ['Type' => "varchar(20) NOT NULL default ''", 'Default' => true],
108
+		'size'            => ['Type' => "int(8) NOT NULL default '0'", 'Default' => true],
109
+		'platform'        => ['Type' => "varchar(50) NOT NULL default ''", 'Default' => true],
110
+		'screenshot'      => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
111
+		'submitter'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
112
+		'publisher'       => ['Type' => 'text NOT NULL', 'Default' => false],
113
+		'status'          => ['Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true],
114
+		'date'            => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
115
+		'hits'            => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
116
+		'rating'          => ['Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true],
117
+		'votes'           => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
118
+		'comments'        => ['Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true],
119
+		'license'         => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
120
+		'mirror'          => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
121
+		'price'           => ['Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true],
122
+		'paypalemail'     => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
123
+		'features'        => ['Type' => 'text NOT NULL', 'Default' => false],
124
+		'requirements'    => ['Type' => 'text NOT NULL', 'Default' => false],
125
+		'homepagetitle'   => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
126
+		'forumid'         => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
127
+		'limitations'     => ['Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true],
128
+		'dhistory'        => ['Type' => 'text NOT NULL', 'Default' => false],
129
+		'published'       => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
130
+		'expired'         => ['Type' => "int(10) NOT NULL default '0'", 'Default' => true],
131
+		'updated'         => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
132
+		'offline'         => ['Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true],
133
+		'summary'         => ['Type' => 'text NOT NULL', 'Default' => false],
134
+		'description'     => ['Type' => 'text NOT NULL', 'Default' => false],
135
+		'modifysubmitter' => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
136
+		'requestdate'     => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true]
137
+	];
138
+
139
+	$renamed_fields = [
140
+		'logourl' => 'screenshot'
141
+	];
142
+
143
+	echo '<br><b>Checking Modified Downloads table</b><br>';
144 144
 //    $moduleHandler = xoops_getModuleHandler('modification', 'wfdownloads');
145
-    $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
146
-    $moduleHandler = $helperWfdownloads->getHandler('Modification');
147
-    $mod_table     = new Wfdownloads\DbupdaterTable('wfdownloads_mod');
148
-    $fields        = get_table_info($moduleHandler->table, $mod_fields);
149
-    rename_fields($mod_table, $renamed_fields, $fields, $mod_fields);
150
-    update_table($mod_fields, $fields, $mod_table);
151
-    if ($dbupdater->updateTable($mod_table)) {
152
-        echo 'Modified Downloads table updated <br>';
153
-    }
154
-    unset($fields);
155
-
156
-    $cat_fields = [
157
-        'cid'          => ['Type' => 'int(5) unsigned NOT NULL auto_increment', 'Default' => false],
158
-        'pid'          => ['Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true],
159
-        'title'        => ['Type' => "varchar(50) NOT NULL default ''", 'Default' => true],
160
-        'imgurl'       => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
161
-        'description'  => ['Type' => 'text NULL', 'Default' => true],
162
-        'total'        => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
163
-        'summary'      => ['Type' => 'text NOT NULL', 'Default' => false],
164
-        'spotlighttop' => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
165
-        'spotlighthis' => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
166
-        'dohtml'       => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
167
-        'dosmiley'     => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
168
-        'doxcode'      => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
169
-        'doimage'      => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
170
-        'dobr'         => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
171
-        'weight'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true]
172
-    ];
173
-    echo '<br><b>Checking Category table</b><br>';
145
+	$helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
146
+	$moduleHandler = $helperWfdownloads->getHandler('Modification');
147
+	$mod_table     = new Wfdownloads\DbupdaterTable('wfdownloads_mod');
148
+	$fields        = get_table_info($moduleHandler->table, $mod_fields);
149
+	rename_fields($mod_table, $renamed_fields, $fields, $mod_fields);
150
+	update_table($mod_fields, $fields, $mod_table);
151
+	if ($dbupdater->updateTable($mod_table)) {
152
+		echo 'Modified Downloads table updated <br>';
153
+	}
154
+	unset($fields);
155
+
156
+	$cat_fields = [
157
+		'cid'          => ['Type' => 'int(5) unsigned NOT NULL auto_increment', 'Default' => false],
158
+		'pid'          => ['Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true],
159
+		'title'        => ['Type' => "varchar(50) NOT NULL default ''", 'Default' => true],
160
+		'imgurl'       => ['Type' => "varchar(255) NOT NULL default ''", 'Default' => true],
161
+		'description'  => ['Type' => 'text NULL', 'Default' => true],
162
+		'total'        => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
163
+		'summary'      => ['Type' => 'text NOT NULL', 'Default' => false],
164
+		'spotlighttop' => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
165
+		'spotlighthis' => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
166
+		'dohtml'       => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
167
+		'dosmiley'     => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
168
+		'doxcode'      => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
169
+		'doimage'      => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
170
+		'dobr'         => ['Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true],
171
+		'weight'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true]
172
+	];
173
+	echo '<br><b>Checking Category table</b><br>';
174 174
 //    $catHandler = xoops_getModuleHandler('category', 'wfdownloads');
175
-    $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
176
-    $catHandler = $helperWfdownloads->getHandler('Report');
177
-
178
-    $cat_table  = new Wfdownloads\DbupdaterTable('wfdownloads_cat');
179
-    $fields     = get_table_info($catHandler->table, $cat_fields);
180
-    update_table($cat_fields, $fields, $cat_table);
181
-    if ($dbupdater->updateTable($cat_table)) {
182
-        echo 'Category table updated<br>';
183
-    }
184
-    unset($fields);
185
-
186
-    $broken_fields = [
187
-        'reportid'     => ['Type' => 'int(5) NOT NULL auto_increment', 'Default' => false],
188
-        'lid'          => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
189
-        'sender'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
190
-        'ip'           => ['Type' => "varchar(20) NOT NULL default ''", 'Default' => true],
191
-        'date'         => ['Type' => "varchar(11) NOT NULL default '0'", 'Default' => true],
192
-        'confirmed'    => ['Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true],
193
-        'acknowledged' => ['Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true]
194
-    ];
195
-    echo '<br><b>Checking Broken Report table</b><br>';
196
-    $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
197
-    $brokenHandler = $helperWfdownloads->getHandler('Report');
175
+	$helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
176
+	$catHandler = $helperWfdownloads->getHandler('Report');
177
+
178
+	$cat_table  = new Wfdownloads\DbupdaterTable('wfdownloads_cat');
179
+	$fields     = get_table_info($catHandler->table, $cat_fields);
180
+	update_table($cat_fields, $fields, $cat_table);
181
+	if ($dbupdater->updateTable($cat_table)) {
182
+		echo 'Category table updated<br>';
183
+	}
184
+	unset($fields);
185
+
186
+	$broken_fields = [
187
+		'reportid'     => ['Type' => 'int(5) NOT NULL auto_increment', 'Default' => false],
188
+		'lid'          => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
189
+		'sender'       => ['Type' => "int(11) NOT NULL default '0'", 'Default' => true],
190
+		'ip'           => ['Type' => "varchar(20) NOT NULL default ''", 'Default' => true],
191
+		'date'         => ['Type' => "varchar(11) NOT NULL default '0'", 'Default' => true],
192
+		'confirmed'    => ['Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true],
193
+		'acknowledged' => ['Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true]
194
+	];
195
+	echo '<br><b>Checking Broken Report table</b><br>';
196
+	$helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
197
+	$brokenHandler = $helperWfdownloads->getHandler('Report');
198 198
 //    $brokenHandler = xoops_getModuleHandler('report', 'wfdownloads');
199
-    $broken_table  = new Wfdownloads\DbupdaterTable('wfdownloads_broken');
200
-    $fields        = get_table_info($brokenHandler->table, $broken_fields);
201
-    update_table($broken_fields, $fields, $broken_table);
202
-    if ($dbupdater->updateTable($broken_table)) {
203
-        echo 'Broken Reports table updated<br>';
204
-    }
205
-    unset($fields);
199
+	$broken_table  = new Wfdownloads\DbupdaterTable('wfdownloads_broken');
200
+	$fields        = get_table_info($brokenHandler->table, $broken_fields);
201
+	update_table($broken_fields, $fields, $broken_table);
202
+	if ($dbupdater->updateTable($broken_table)) {
203
+		echo 'Broken Reports table updated<br>';
204
+	}
205
+	unset($fields);
206 206
 }
207 207
 
208 208
 // =========================================================================================
@@ -215,49 +215,49 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function invert_nohtm_dohtml_values()
217 217
 {
218
-    $ret = [];
219
-    global $xoopsDB;
220
-    $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
221
-    $catHandler = $helperWfdownloads->getHandler('Category');
222
-    $result     = $xoopsDB->query('SHOW COLUMNS FROM ' . $catHandler->table);
223
-    while (false !== ($existing_field = $xoopsDB->fetchArray($result))) {
224
-        $fields[$existing_field['field']] = $existing_field['type'];
225
-    }
226
-    if (in_array('nohtml', array_keys($fields))) {
227
-        $dbupdater = new Wfdownloads\Dbupdater();
228
-        //Invert column values
229
-        // alter options in wfdownloads_cat
230
-        $table = new Wfdownloads\DbupdaterTable('wfdownloads_cat');
231
-        $table->addAlteredField('nohtml', "dohtml tinyint(1) NOT NULL DEFAULT '1'");
232
-        $table->addAlteredField('nosmiley', "dosmiley tinyint(1) NOT NULL DEFAULT '1'");
233
-        $table->addAlteredField('noxcodes', "doxcode tinyint(1) NOT NULL DEFAULT '1'");
234
-        $table->addAlteredField('noimages', "doimage tinyint(1) NOT NULL DEFAULT '1'");
235
-        $table->addAlteredField('nobreak', "dobr tinyint(1) NOT NULL DEFAULT '1'");
236
-
237
-        //inverting values no=1 <=> do=0
238
-        // have to store teporarly as value = 2 to
239
-        // avoid putting everithing to same value
240
-        // if you change 1 to 0, then 0 to one,
241
-        // every value will be 1, follow me?
242
-        $table->addUpdatedWhere('dohtml', 2, '=1');
243
-        $table->addUpdatedWhere('dohtml', 1, '=0');
244
-        $table->addUpdatedWhere('dohtml', 0, '=2');
245
-
246
-        $table->addUpdatedWhere('dosmiley', 2, '=1');
247
-        $table->addUpdatedWhere('dosmiley', 1, '=0');
248
-        $table->addUpdatedWhere('dosmiley', 0, '=2');
249
-
250
-        $table->addUpdatedWhere('doxcode', 2, '=1');
251
-        $table->addUpdatedWhere('doxcode', 1, '=0');
252
-        $table->addUpdatedWhere('doxcode', 0, '=2');
253
-
254
-        $table->addUpdatedWhere('doimage', 2, '=1');
255
-        $table->addUpdatedWhere('doimage', 1, '=0');
256
-        $table->addUpdatedWhere('doimage', 0, '=2');
257
-        $ret = $dbupdater->updateTable($table);
258
-    }
259
-
260
-    return $ret;
218
+	$ret = [];
219
+	global $xoopsDB;
220
+	$helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
221
+	$catHandler = $helperWfdownloads->getHandler('Category');
222
+	$result     = $xoopsDB->query('SHOW COLUMNS FROM ' . $catHandler->table);
223
+	while (false !== ($existing_field = $xoopsDB->fetchArray($result))) {
224
+		$fields[$existing_field['field']] = $existing_field['type'];
225
+	}
226
+	if (in_array('nohtml', array_keys($fields))) {
227
+		$dbupdater = new Wfdownloads\Dbupdater();
228
+		//Invert column values
229
+		// alter options in wfdownloads_cat
230
+		$table = new Wfdownloads\DbupdaterTable('wfdownloads_cat');
231
+		$table->addAlteredField('nohtml', "dohtml tinyint(1) NOT NULL DEFAULT '1'");
232
+		$table->addAlteredField('nosmiley', "dosmiley tinyint(1) NOT NULL DEFAULT '1'");
233
+		$table->addAlteredField('noxcodes', "doxcode tinyint(1) NOT NULL DEFAULT '1'");
234
+		$table->addAlteredField('noimages', "doimage tinyint(1) NOT NULL DEFAULT '1'");
235
+		$table->addAlteredField('nobreak', "dobr tinyint(1) NOT NULL DEFAULT '1'");
236
+
237
+		//inverting values no=1 <=> do=0
238
+		// have to store teporarly as value = 2 to
239
+		// avoid putting everithing to same value
240
+		// if you change 1 to 0, then 0 to one,
241
+		// every value will be 1, follow me?
242
+		$table->addUpdatedWhere('dohtml', 2, '=1');
243
+		$table->addUpdatedWhere('dohtml', 1, '=0');
244
+		$table->addUpdatedWhere('dohtml', 0, '=2');
245
+
246
+		$table->addUpdatedWhere('dosmiley', 2, '=1');
247
+		$table->addUpdatedWhere('dosmiley', 1, '=0');
248
+		$table->addUpdatedWhere('dosmiley', 0, '=2');
249
+
250
+		$table->addUpdatedWhere('doxcode', 2, '=1');
251
+		$table->addUpdatedWhere('doxcode', 1, '=0');
252
+		$table->addUpdatedWhere('doxcode', 0, '=2');
253
+
254
+		$table->addUpdatedWhere('doimage', 2, '=1');
255
+		$table->addUpdatedWhere('doimage', 1, '=0');
256
+		$table->addUpdatedWhere('doimage', 0, '=2');
257
+		$ret = $dbupdater->updateTable($table);
258
+	}
259
+
260
+	return $ret;
261 261
 }
262 262
 
263 263
 /**
@@ -270,22 +270,22 @@  discard block
 block discarded – undo
270 270
  */
271 271
 function update_table($new_fields, $existing_fields, &$table)
272 272
 {
273
-    foreach ($new_fields as $field => $fieldinfo) {
274
-        $type = $fieldinfo['Type'];
275
-        if (!in_array($field, array_keys($existing_fields))) {
276
-            //Add field as it is missing
277
-            $table->addNewField($field, $type);
278
-        //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type);
279
-            //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br>";
280
-        } elseif ($existing_fields[$field] != $type) {
281
-            $table->addAlteredField($field, $field . ' ' . $type);
282
-        // check $fields[$field]['type'] for things like "int(10) unsigned"
283
-            //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type);
284
-            //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br>";
285
-        } else {
286
-            //echo $field." <FONT COLOR='#0033FF'>Uptodate</FONT><br>";
287
-        }
288
-    }
273
+	foreach ($new_fields as $field => $fieldinfo) {
274
+		$type = $fieldinfo['Type'];
275
+		if (!in_array($field, array_keys($existing_fields))) {
276
+			//Add field as it is missing
277
+			$table->addNewField($field, $type);
278
+		//$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type);
279
+			//echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br>";
280
+		} elseif ($existing_fields[$field] != $type) {
281
+			$table->addAlteredField($field, $field . ' ' . $type);
282
+		// check $fields[$field]['type'] for things like "int(10) unsigned"
283
+			//$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type);
284
+			//echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br>";
285
+		} else {
286
+			//echo $field." <FONT COLOR='#0033FF'>Uptodate</FONT><br>";
287
+		}
288
+	}
289 289
 }
290 290
 
291 291
 /**
@@ -298,22 +298,22 @@  discard block
 block discarded – undo
298 298
  */
299 299
 function get_table_info($table, $default_fields)
300 300
 {
301
-    global $xoopsDB;
302
-    $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table);
303
-    while (false !== ($existing_field = $xoopsDB->fetchArray($result))) {
304
-        $fields[$existing_field['Field']] = $existing_field['Type'];
305
-        if ('YES' !== $existing_field['Null']) {
306
-            $fields[$existing_field['Field']] .= ' NOT NULL';
307
-        }
308
-        if ($existing_field['Extra']) {
309
-            $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra'];
310
-        }
311
-        if ($default_fields[$existing_field['Field']]['Default']) {
312
-            $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'";
313
-        }
314
-    }
315
-
316
-    return $fields;
301
+	global $xoopsDB;
302
+	$result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table);
303
+	while (false !== ($existing_field = $xoopsDB->fetchArray($result))) {
304
+		$fields[$existing_field['Field']] = $existing_field['Type'];
305
+		if ('YES' !== $existing_field['Null']) {
306
+			$fields[$existing_field['Field']] .= ' NOT NULL';
307
+		}
308
+		if ($existing_field['Extra']) {
309
+			$fields[$existing_field['Field']] .= ' ' . $existing_field['Extra'];
310
+		}
311
+		if ($default_fields[$existing_field['Field']]['Default']) {
312
+			$fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'";
313
+		}
314
+	}
315
+
316
+	return $fields;
317 317
 }
318 318
 
319 319
 /**
@@ -327,60 +327,60 @@  discard block
 block discarded – undo
327 327
  */
328 328
 function rename_fields(&$table, $renamed_fields, &$fields, $new_fields)
329 329
 {
330
-    foreach (array_keys($fields) as $field) {
331
-        if (in_array($field, array_keys($renamed_fields))) {
332
-            $new_field_name = $renamed_fields[$field];
333
-            $new_field_type = $new_fields[$new_field_name]['Type'];
334
-            $table->addAltered($field, $new_field_name . ' ' . $new_field_type);
335
-            //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type);
336
-            //echo $field." Renamed to ".$new_field_name."<br>";
337
-            $fields[$new_field_name] = $new_field_type;
338
-        }
339
-    }
340
-    //return $fields;
330
+	foreach (array_keys($fields) as $field) {
331
+		if (in_array($field, array_keys($renamed_fields))) {
332
+			$new_field_name = $renamed_fields[$field];
333
+			$new_field_type = $new_fields[$new_field_name]['Type'];
334
+			$table->addAltered($field, $new_field_name . ' ' . $new_field_type);
335
+			//$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type);
336
+			//echo $field." Renamed to ".$new_field_name."<br>";
337
+			$fields[$new_field_name] = $new_field_type;
338
+		}
339
+	}
340
+	//return $fields;
341 341
 }
342 342
 
343 343
 $op = isset($_REQUEST['op']) ? (int)$_REQUEST['op'] : 0;
344 344
 switch ($op) {
345
-    case 1:
346
-        // Make sure that nohtml is properly changed to dohtml
347
-        invert_nohtm_dohtml_values();
348
-        // Ensure that the proper tables are present
349
-        update_tables_to_300();
350
-        // Import data from MyDownloads
351
-        import_mydownloads_to_wfdownloads();
352
-        break;
353
-
354
-    case 2:
355
-        // Update WF-Downloads
356
-        $log = invert_nohtm_dohtml_values();
357
-        update_tables_to_300();
358
-        break;
359
-
360
-    default:
361
-        //ask what to do
362
-        include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
363
-        $form = new \XoopsThemeForm('Upgrade WF-Downloads', 'form', $_SERVER['REQUEST_URI']);
364
-
365
-        //Is MyDownloads installed?
366
-        /** @var XoopsModuleHandler $moduleHandler */
367
-        $moduleHandler     = xoops_getHandler('module');
368
-        $mydownloadsModule = $moduleHandler->getByDirname('mydownloads');
369
-        if (is_object($mydownloadsModule)) {
370
-            $mydownloadsButton = new \XoopsFormButton('Import data from MyDownloads', 'myd_button', 'Import', 'submit');
371
-            $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'");
372
-            $form->addElement($mydownloadsButton);
373
-        }
374
-
375
-        if (!wfdownloads_TableExists('wfdownloads_meta')) {
376
-            $updateButton = new \XoopsFormButton('Update WF-Downloads', 'upd_button', 'Update', 'submit');
377
-            $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'");
378
-            $form->addElement($updateButton);
379
-        }
380
-
381
-        $form->addElement(new \XoopsFormHidden('op', 0));
382
-        $form->display();
383
-        break;
345
+	case 1:
346
+		// Make sure that nohtml is properly changed to dohtml
347
+		invert_nohtm_dohtml_values();
348
+		// Ensure that the proper tables are present
349
+		update_tables_to_300();
350
+		// Import data from MyDownloads
351
+		import_mydownloads_to_wfdownloads();
352
+		break;
353
+
354
+	case 2:
355
+		// Update WF-Downloads
356
+		$log = invert_nohtm_dohtml_values();
357
+		update_tables_to_300();
358
+		break;
359
+
360
+	default:
361
+		//ask what to do
362
+		include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
363
+		$form = new \XoopsThemeForm('Upgrade WF-Downloads', 'form', $_SERVER['REQUEST_URI']);
364
+
365
+		//Is MyDownloads installed?
366
+		/** @var XoopsModuleHandler $moduleHandler */
367
+		$moduleHandler     = xoops_getHandler('module');
368
+		$mydownloadsModule = $moduleHandler->getByDirname('mydownloads');
369
+		if (is_object($mydownloadsModule)) {
370
+			$mydownloadsButton = new \XoopsFormButton('Import data from MyDownloads', 'myd_button', 'Import', 'submit');
371
+			$mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'");
372
+			$form->addElement($mydownloadsButton);
373
+		}
374
+
375
+		if (!wfdownloads_TableExists('wfdownloads_meta')) {
376
+			$updateButton = new \XoopsFormButton('Update WF-Downloads', 'upd_button', 'Update', 'submit');
377
+			$updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'");
378
+			$form->addElement($updateButton);
379
+		}
380
+
381
+		$form->addElement(new \XoopsFormHidden('op', 0));
382
+		$form->display();
383
+		break;
384 384
 }
385 385
 //wfdownloads_modFooter();
386 386
 //xoops_cp_footer();
Please login to merge, or discard this patch.
admin/adsense.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -14,32 +14,32 @@  discard block
 block discarded – undo
14 14
 
15 15
 function editclass($showmenu = false, $adsenseid = 0, $clone = false)
16 16
 {
17
-    global $smartobjectAdsenseHandler;
18
-
19
-    $adsenseObj = $smartobjectAdsenseHandler->get($adsenseid);
20
-
21
-    if (!$clone && !$adsenseObj->isNew()) {
22
-        if ($showmenu) {
23
-            //Smartobject\Utility::getAdminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING);
24
-        }
25
-        Smartobject\Utility::getCollapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO);
26
-
27
-        $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense');
28
-        $sform->display();
29
-        Smartobject\Utility::closeCollapsable('adsenseedit');
30
-    } else {
31
-        $adsenseObj->setVar('adsenseid', 0);
32
-        $adsenseObj->setVar('tag', '');
33
-
34
-        if ($showmenu) {
35
-            //Smartobject\Utility::getAdminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW);
36
-        }
37
-
38
-        Smartobject\Utility::getCollapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO);
39
-        $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true);
40
-        $sform->display();
41
-        Smartobject\Utility::closeCollapsable('adsensecreate');
42
-    }
17
+	global $smartobjectAdsenseHandler;
18
+
19
+	$adsenseObj = $smartobjectAdsenseHandler->get($adsenseid);
20
+
21
+	if (!$clone && !$adsenseObj->isNew()) {
22
+		if ($showmenu) {
23
+			//Smartobject\Utility::getAdminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING);
24
+		}
25
+		Smartobject\Utility::getCollapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO);
26
+
27
+		$sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense');
28
+		$sform->display();
29
+		Smartobject\Utility::closeCollapsable('adsenseedit');
30
+	} else {
31
+		$adsenseObj->setVar('adsenseid', 0);
32
+		$adsenseObj->setVar('tag', '');
33
+
34
+		if ($showmenu) {
35
+			//Smartobject\Utility::getAdminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW);
36
+		}
37
+
38
+		Smartobject\Utility::getCollapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO);
39
+		$sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true);
40
+		$sform->display();
41
+		Smartobject\Utility::closeCollapsable('adsensecreate');
42
+	}
43 43
 }
44 44
 
45 45
 require_once __DIR__ . '/admin_header.php';
@@ -56,72 +56,72 @@  discard block
 block discarded – undo
56 56
 $op = '';
57 57
 
58 58
 if (isset($_GET['op'])) {
59
-    $op = $_GET['op'];
59
+	$op = $_GET['op'];
60 60
 }
61 61
 if (isset($_POST['op'])) {
62
-    $op = $_POST['op'];
62
+	$op = $_POST['op'];
63 63
 }
64 64
 
65 65
 switch ($op) {
66
-    case 'mod':
66
+	case 'mod':
67 67
 
68
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
68
+		$adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
69 69
 
70
-        Smartobject\Utility::getXoopsCpHeader();
71
-        $adminObject->displayNavigation(basename(__FILE__));
70
+		Smartobject\Utility::getXoopsCpHeader();
71
+		$adminObject->displayNavigation(basename(__FILE__));
72 72
 
73
-        editclass(true, $adsenseid);
74
-        break;
73
+		editclass(true, $adsenseid);
74
+		break;
75 75
 
76
-    case 'clone':
76
+	case 'clone':
77 77
 
78
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
78
+		$adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
79 79
 
80
-        Smartobject\Utility::getXoopsCpHeader();
81
-        $adminObject->displayNavigation(basename(__FILE__));
80
+		Smartobject\Utility::getXoopsCpHeader();
81
+		$adminObject->displayNavigation(basename(__FILE__));
82 82
 
83
-        editclass(true, $adsenseid, true);
84
-        break;
83
+		editclass(true, $adsenseid, true);
84
+		break;
85 85
 
86
-    case 'addadsense':
87
-        if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
88
-            $xoopsCaptcha = XoopsCaptcha::getInstance();
89
-            if (!$xoopsCaptcha->verify()) {
90
-                redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
91
-            }
92
-        }
86
+	case 'addadsense':
87
+		if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
88
+			$xoopsCaptcha = XoopsCaptcha::getInstance();
89
+			if (!$xoopsCaptcha->verify()) {
90
+				redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
91
+			}
92
+		}
93 93
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
94
-        $controller = new XoopsModules\Smartobject\ObjectController($smartobjectAdsenseHandler);
95
-        $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
96
-        break;
94
+		$controller = new XoopsModules\Smartobject\ObjectController($smartobjectAdsenseHandler);
95
+		$controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
96
+		break;
97 97
 
98
-    case 'del':
98
+	case 'del':
99 99
 
100 100
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
101
-        $controller = new XoopsModules\Smartobject\ObjectController($smartobjectAdsenseHandler);
102
-        $controller->handleObjectDeletion();
101
+		$controller = new XoopsModules\Smartobject\ObjectController($smartobjectAdsenseHandler);
102
+		$controller->handleObjectDeletion();
103 103
 
104
-        break;
104
+		break;
105 105
 
106
-    default:
106
+	default:
107 107
 
108
-        Smartobject\Utility::getXoopsCpHeader();
109
-        $adminObject->displayNavigation(basename(__FILE__));
108
+		Smartobject\Utility::getXoopsCpHeader();
109
+		$adminObject->displayNavigation(basename(__FILE__));
110 110
 
111
-        //Smartobject\Utility::getAdminMenu(3, _AM_SOBJECT_ADSENSES);
111
+		//Smartobject\Utility::getAdminMenu(3, _AM_SOBJECT_ADSENSES);
112 112
 
113
-        Smartobject\Utility::getCollapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
113
+		Smartobject\Utility::getCollapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
114 114
 
115 115
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
116
-        $objectTable = new XoopsModules\Smartobject\Table($smartobjectAdsenseHandler);
117
-        $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('description', 'left'));
118
-        $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
116
+		$objectTable = new XoopsModules\Smartobject\Table($smartobjectAdsenseHandler);
117
+		$objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('description', 'left'));
118
+		$objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
119 119
 
120
-        //      $objectTable->addCustomAction('getCreateItemLink');
121
-        //      $objectTable->addCustomAction('getCreateAttributLink');
120
+		//      $objectTable->addCustomAction('getCreateItemLink');
121
+		//      $objectTable->addCustomAction('getCreateAttributLink');
122 122
 
123
-        $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE);
124
-        /*
123
+		$objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE);
124
+		/*
125 125
                 $criteria_upcoming = new \CriteriaCompo();
126 126
                 $criteria_upcoming->add(new \Criteria('start_date', time(), '>'));
127 127
                 $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array(
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
                                             'criteria' => $criteria_last30days
146 146
                 ));
147 147
         */
148
-        $objectTable->addQuickSearch(['title', 'summary', 'description']);
149
-        $objectTable->addCustomAction('getCloneLink');
148
+		$objectTable->addQuickSearch(['title', 'summary', 'description']);
149
+		$objectTable->addCustomAction('getCloneLink');
150 150
 
151
-        $objectTable->render();
151
+		$objectTable->render();
152 152
 
153
-        echo '<br>';
154
-        Smartobject\Utility::closeCollapsable('createdadsenses');
155
-        echo '<br>';
153
+		echo '<br>';
154
+		Smartobject\Utility::closeCollapsable('createdadsenses');
155
+		echo '<br>';
156 156
 
157
-        break;
157
+		break;
158 158
 }
159 159
 
160 160
 //Smartobject\Utility::getModFooter();
Please login to merge, or discard this patch.
admin/link.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -26,81 +26,81 @@
 block discarded – undo
26 26
 $op = '';
27 27
 
28 28
 if (isset($_GET['op'])) {
29
-    $op = $_GET['op'];
29
+	$op = $_GET['op'];
30 30
 }
31 31
 if (isset($_POST['op'])) {
32
-    $op = $_POST['op'];
32
+	$op = $_POST['op'];
33 33
 }
34 34
 
35 35
 switch ($op) {
36 36
 
37
-    case 'del':
37
+	case 'del':
38 38
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
39
-        $controller = new XoopsModules\Smartobject\ObjectController($smartobjectLinkHandler);
40
-        $controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM);
39
+		$controller = new XoopsModules\Smartobject\ObjectController($smartobjectLinkHandler);
40
+		$controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM);
41 41
 
42
-        break;
42
+		break;
43 43
 
44
-    case 'view':
45
-        $linkid  = isset($_GET['linkid']) ? $_GET['linkid'] : 0;
46
-        $linkObj = $smartobjectLinkHandler->get($linkid);
44
+	case 'view':
45
+		$linkid  = isset($_GET['linkid']) ? $_GET['linkid'] : 0;
46
+		$linkObj = $smartobjectLinkHandler->get($linkid);
47 47
 
48
-        if ($linkObj->isNew()) {
49
-            redirect_header(SMARTOBJECT_URL . 'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND);
50
-        }
48
+		if ($linkObj->isNew()) {
49
+			redirect_header(SMARTOBJECT_URL . 'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND);
50
+		}
51 51
 
52
-        Smartobject\Utility::getXoopsCpHeader();
52
+		Smartobject\Utility::getXoopsCpHeader();
53 53
 
54
-        //Smartobject\Utility::getAdminMenu(1, _AM_SOBJECT_SENT_LINK_DISPLAY);
54
+		//Smartobject\Utility::getAdminMenu(1, _AM_SOBJECT_SENT_LINK_DISPLAY);
55 55
 
56
-        Smartobject\Utility::getCollapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO);
56
+		Smartobject\Utility::getCollapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO);
57 57
 
58
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
58
+		require_once XOOPS_ROOT_PATH . '/class/template.php';
59 59
 
60
-        // ---
61
-        // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated.
62
-        //      $xoopsTpl = new \XoopsTpl();
63
-        $xoopsTpl = new \XoopsTpl();
64
-        //---
60
+		// ---
61
+		// 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated.
62
+		//      $xoopsTpl = new \XoopsTpl();
63
+		$xoopsTpl = new \XoopsTpl();
64
+		//---
65 65
 
66
-        $xoopsTpl->assign('link', $linkObj->toArray());
67
-        $xoopsTpl->display('db:smartobject_sentlink_display.tpl');
66
+		$xoopsTpl->assign('link', $linkObj->toArray());
67
+		$xoopsTpl->display('db:smartobject_sentlink_display.tpl');
68 68
 
69
-        echo '<br>';
70
-        Smartobject\Utility::closeCollapsable('sentlinks');
71
-        echo '<br>';
69
+		echo '<br>';
70
+		Smartobject\Utility::closeCollapsable('sentlinks');
71
+		echo '<br>';
72 72
 
73
-        break;
73
+		break;
74 74
 
75
-    default:
75
+	default:
76 76
 
77
-        Smartobject\Utility::getXoopsCpHeader();
77
+		Smartobject\Utility::getXoopsCpHeader();
78 78
 
79
-        $adminObject->displayNavigation(basename(__FILE__));
79
+		$adminObject->displayNavigation(basename(__FILE__));
80 80
 
81
-        //Smartobject\Utility::getAdminMenu(1, _AM_SOBJECT_SENT_LINKS);
81
+		//Smartobject\Utility::getAdminMenu(1, _AM_SOBJECT_SENT_LINKS);
82 82
 
83
-        Smartobject\Utility::getCollapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO);
83
+		Smartobject\Utility::getCollapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO);
84 84
 
85 85
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
86
-        $objectTable = new Smartobject\Table($smartobjectLinkHandler, null, ['delete']);
87
-        $objectTable->addColumn(new Smartobject\ObjectColumn('date'));
88
-        $objectTable->addColumn(new Smartobject\ObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo'));
89
-        $objectTable->addColumn(new Smartobject\ObjectColumn(_AM_SOBJECT_SENT_LINKS_TO, $align = 'left', $width = false, 'getToInfo'));
90
-        $objectTable->addColumn(new Smartobject\ObjectColumn('link'));
86
+		$objectTable = new Smartobject\Table($smartobjectLinkHandler, null, ['delete']);
87
+		$objectTable->addColumn(new Smartobject\ObjectColumn('date'));
88
+		$objectTable->addColumn(new Smartobject\ObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo'));
89
+		$objectTable->addColumn(new Smartobject\ObjectColumn(_AM_SOBJECT_SENT_LINKS_TO, $align = 'left', $width = false, 'getToInfo'));
90
+		$objectTable->addColumn(new Smartobject\ObjectColumn('link'));
91 91
 
92
-        $objectTable->addCustomAction('getViewItemLink');
92
+		$objectTable->addCustomAction('getViewItemLink');
93 93
 
94
-        $objectTable->setDefaultSort('date');
95
-        $objectTable->setDefaultOrder('DESC');
94
+		$objectTable->setDefaultSort('date');
95
+		$objectTable->setDefaultOrder('DESC');
96 96
 
97
-        $objectTable->render();
97
+		$objectTable->render();
98 98
 
99
-        echo '<br>';
100
-        Smartobject\Utility::closeCollapsable('sentlinks');
101
-        echo '<br>';
99
+		echo '<br>';
100
+		Smartobject\Utility::closeCollapsable('sentlinks');
101
+		echo '<br>';
102 102
 
103
-        break;
103
+		break;
104 104
 }
105 105
 
106 106
 //Smartobject\Utility::getModFooter();
Please login to merge, or discard this patch.
admin/tag.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -17,45 +17,45 @@  discard block
 block discarded – undo
17 17
 
18 18
 function edittag($tagid = 0, $language = false, $fct = false)
19 19
 {
20
-    global $smartobjectTagHandler;
21
-
22
-    $tagObj = $smartobjectTagHandler->get($tagid);
23
-
24
-    if ($tagObj->isNew()) {
25
-        $breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE;
26
-        $title                 = _AM_SOBJECT_TAG_CREATE;
27
-        $info                  = _AM_SOBJECT_TAG_CREATE_INFO;
28
-        $collaps_name          = 'tagcreate';
29
-        $form_name             = _AM_SOBJECT_TAG_CREATE;
30
-        $submit_button_caption = null;
31
-    //$tagObj->stripMultilanguageFields();
32
-    } else {
33
-        if ($language) {
34
-            $breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE;
35
-            $title                 = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
36
-            $info                  = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO;
37
-            $collaps_name          = 'tageditlanguage';
38
-            $form_name             = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
39
-            $submit_button_caption = null;
40
-            $tagObj->makeNonMLFieldReadOnly();
41
-        } else {
42
-            $breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING;
43
-            $title                 = _AM_SOBJECT_TAG_EDIT;
44
-            $info                  = _AM_SOBJECT_TAG_EDIT_INFO;
45
-            $collaps_name          = 'tagedit';
46
-            $form_name             = _AM_SOBJECT_TAG_EDIT;
47
-            $submit_button_caption = null;
48
-            $tagObj->stripMultilanguageFields();
49
-        }
50
-    }
51
-
52
-    //Smartobject\Utility::getAdminMenu(2, $breadcrumb);
53
-
54
-    Smartobject\Utility::getCollapsableBar($collaps_name, $title, $info);
55
-
56
-    $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption);
57
-    $sform->display();
58
-    Smartobject\Utility::closeCollapsable($collaps_name);
20
+	global $smartobjectTagHandler;
21
+
22
+	$tagObj = $smartobjectTagHandler->get($tagid);
23
+
24
+	if ($tagObj->isNew()) {
25
+		$breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE;
26
+		$title                 = _AM_SOBJECT_TAG_CREATE;
27
+		$info                  = _AM_SOBJECT_TAG_CREATE_INFO;
28
+		$collaps_name          = 'tagcreate';
29
+		$form_name             = _AM_SOBJECT_TAG_CREATE;
30
+		$submit_button_caption = null;
31
+	//$tagObj->stripMultilanguageFields();
32
+	} else {
33
+		if ($language) {
34
+			$breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE;
35
+			$title                 = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
36
+			$info                  = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO;
37
+			$collaps_name          = 'tageditlanguage';
38
+			$form_name             = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
39
+			$submit_button_caption = null;
40
+			$tagObj->makeNonMLFieldReadOnly();
41
+		} else {
42
+			$breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING;
43
+			$title                 = _AM_SOBJECT_TAG_EDIT;
44
+			$info                  = _AM_SOBJECT_TAG_EDIT_INFO;
45
+			$collaps_name          = 'tagedit';
46
+			$form_name             = _AM_SOBJECT_TAG_EDIT;
47
+			$submit_button_caption = null;
48
+			$tagObj->stripMultilanguageFields();
49
+		}
50
+	}
51
+
52
+	//Smartobject\Utility::getAdminMenu(2, $breadcrumb);
53
+
54
+	Smartobject\Utility::getCollapsableBar($collaps_name, $title, $info);
55
+
56
+	$sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption);
57
+	$sform->display();
58
+	Smartobject\Utility::closeCollapsable($collaps_name);
59 59
 }
60 60
 
61 61
 require_once __DIR__ . '/admin_header.php';
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 $op = '';
68 68
 
69 69
 if (isset($_GET['op'])) {
70
-    $op = $_GET['op'];
70
+	$op = $_GET['op'];
71 71
 }
72 72
 if (isset($_POST['op'])) {
73
-    $op = $_POST['op'];
73
+	$op = $_POST['op'];
74 74
 }
75 75
 
76 76
 $tagid    = isset($_GET['tagid']) ? $_GET['tagid'] : 0;
@@ -79,65 +79,65 @@  discard block
 block discarded – undo
79 79
 
80 80
 switch ($op) {
81 81
 
82
-    case 'del':
82
+	case 'del':
83 83
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
84
-        $controller = new ObjectController($smartobjectTagHandler);
85
-        $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM);
84
+		$controller = new ObjectController($smartobjectTagHandler);
85
+		$controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM);
86 86
 
87
-        break;
87
+		break;
88 88
 
89
-    case 'addtag':
89
+	case 'addtag':
90 90
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
91
-        $controller = new ObjectController($smartobjectTagHandler);
92
-        $tagObj     = $controller->storeSmartObject();
93
-        if ($tagObj->hasError()) {
94
-            redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors());
95
-        }
91
+		$controller = new ObjectController($smartobjectTagHandler);
92
+		$tagObj     = $controller->storeSmartObject();
93
+		if ($tagObj->hasError()) {
94
+			redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors());
95
+		}
96 96
 
97
-        if ($tagObj->hasError()) {
98
-            redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors());
99
-        } else {
100
-            redirect_header(Smartobject\Utility::getPageBeforeForm(), 3, _CO_SOBJECT_SAVE_SUCCESS);
101
-        }
102
-        exit;
103
-        break;
97
+		if ($tagObj->hasError()) {
98
+			redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors());
99
+		} else {
100
+			redirect_header(Smartobject\Utility::getPageBeforeForm(), 3, _CO_SOBJECT_SAVE_SUCCESS);
101
+		}
102
+		exit;
103
+		break;
104 104
 
105
-    case 'mod':
106
-        Smartobject\Utility::getXoopsCpHeader();
107
-        edittag($tagid, $language, $fct);
108
-        break;
105
+	case 'mod':
106
+		Smartobject\Utility::getXoopsCpHeader();
107
+		edittag($tagid, $language, $fct);
108
+		break;
109 109
 
110
-    default:
110
+	default:
111 111
 
112
-        Smartobject\Utility::getXoopsCpHeader();
112
+		Smartobject\Utility::getXoopsCpHeader();
113 113
 
114
-        //Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_TAGS);
114
+		//Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_TAGS);
115 115
 
116
-        Smartobject\Utility::getCollapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO);
116
+		Smartobject\Utility::getCollapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO);
117 117
 
118 118
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
119
-        $objectTable = new Table($smartobjectTagHandler, false, ['delete']);
120
-        $objectTable->addColumn(new ObjectColumn('name'));
121
-        $objectTable->addColumn(new ObjectColumn('language'));
122
-        $objectTable->addColumn(new ObjectColumn('value'));
123
-        //      $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo'));
119
+		$objectTable = new Table($smartobjectTagHandler, false, ['delete']);
120
+		$objectTable->addColumn(new ObjectColumn('name'));
121
+		$objectTable->addColumn(new ObjectColumn('language'));
122
+		$objectTable->addColumn(new ObjectColumn('value'));
123
+		//      $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo'));
124 124
 
125
-        $objectTable->addFilter('language', 'getLanguages');
125
+		$objectTable->addFilter('language', 'getLanguages');
126 126
 
127
-        $objectTable->addCustomAction('getEditLanguageLink');
128
-        $objectTable->addCustomAction('getEditItemLink');
127
+		$objectTable->addCustomAction('getEditLanguageLink');
128
+		$objectTable->addCustomAction('getEditItemLink');
129 129
 
130
-        $objectTable->setDefaultSort('tagid');
130
+		$objectTable->setDefaultSort('tagid');
131 131
 
132
-        $objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE);
132
+		$objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE);
133 133
 
134
-        $objectTable->render();
134
+		$objectTable->render();
135 135
 
136
-        echo '<br>';
137
-        Smartobject\Utility::closeCollapsable('tags');
138
-        echo '<br>';
136
+		echo '<br>';
137
+		Smartobject\Utility::closeCollapsable('tags');
138
+		echo '<br>';
139 139
 
140
-        break;
140
+		break;
141 141
 }
142 142
 
143 143
 //Smartobject\Utility::getModFooter();
Please login to merge, or discard this patch.
admin/currency.php 1 patch
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 
16 16
 function editclass($showmenu = false, $currencyid = 0)
17 17
 {
18
-    global $smartobjectCurrencyHandler;
19
-
20
-    $currencyObj = $smartobjectCurrencyHandler->get($currencyid);
21
-
22
-    if (!$currencyObj->isNew()) {
23
-        if ($showmenu) {
24
-            //Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _AM_SOBJECT_EDITING);
25
-        }
26
-        Smartobject\Utility::getCollapsableBar('currencyedit', _AM_SOBJECT_CURRENCIES_EDIT, _AM_SOBJECT_CURRENCIES_EDIT_INFO);
27
-
28
-        $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_EDIT, 'addcurrency');
29
-        $sform->display();
30
-        Smartobject\Utility::closeCollapsable('currencyedit');
31
-    } else {
32
-        if ($showmenu) {
33
-            //Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _CO_SOBJECT_CREATINGNEW);
34
-        }
35
-
36
-        Smartobject\Utility::getCollapsableBar('currencycreate', _AM_SOBJECT_CURRENCIES_CREATE, _AM_SOBJECT_CURRENCIES_CREATE_INFO);
37
-        $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_CREATE, 'addcurrency');
38
-        $sform->display();
39
-        Smartobject\Utility::closeCollapsable('currencycreate');
40
-    }
18
+	global $smartobjectCurrencyHandler;
19
+
20
+	$currencyObj = $smartobjectCurrencyHandler->get($currencyid);
21
+
22
+	if (!$currencyObj->isNew()) {
23
+		if ($showmenu) {
24
+			//Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _AM_SOBJECT_EDITING);
25
+		}
26
+		Smartobject\Utility::getCollapsableBar('currencyedit', _AM_SOBJECT_CURRENCIES_EDIT, _AM_SOBJECT_CURRENCIES_EDIT_INFO);
27
+
28
+		$sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_EDIT, 'addcurrency');
29
+		$sform->display();
30
+		Smartobject\Utility::closeCollapsable('currencyedit');
31
+	} else {
32
+		if ($showmenu) {
33
+			//Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _CO_SOBJECT_CREATINGNEW);
34
+		}
35
+
36
+		Smartobject\Utility::getCollapsableBar('currencycreate', _AM_SOBJECT_CURRENCIES_CREATE, _AM_SOBJECT_CURRENCIES_CREATE_INFO);
37
+		$sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_CREATE, 'addcurrency');
38
+		$sform->display();
39
+		Smartobject\Utility::closeCollapsable('currencycreate');
40
+	}
41 41
 }
42 42
 
43 43
 require_once __DIR__ . '/admin_header.php';
@@ -48,36 +48,36 @@  discard block
 block discarded – undo
48 48
 $op = '';
49 49
 
50 50
 if (isset($_GET['op'])) {
51
-    $op = $_GET['op'];
51
+	$op = $_GET['op'];
52 52
 }
53 53
 if (isset($_POST['op'])) {
54
-    $op = $_POST['op'];
54
+	$op = $_POST['op'];
55 55
 }
56 56
 
57 57
 switch ($op) {
58
-    case 'mod':
59
-        $currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0;
58
+	case 'mod':
59
+		$currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0;
60 60
 
61
-        Smartobject\Utility::getXoopsCpHeader();
61
+		Smartobject\Utility::getXoopsCpHeader();
62 62
 
63
-        editclass(true, $currencyid);
64
-        break;
63
+		editclass(true, $currencyid);
64
+		break;
65 65
 
66
-    case 'updateCurrencies':
66
+	case 'updateCurrencies':
67 67
 
68
-        if (!isset($_POST['SmartobjectCurrency_objects']) || 0 == count($_POST['SmartobjectCurrency_objects'])) {
69
-            redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE);
70
-        }
68
+		if (!isset($_POST['SmartobjectCurrency_objects']) || 0 == count($_POST['SmartobjectCurrency_objects'])) {
69
+			redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE);
70
+		}
71 71
 
72
-        if (isset($_POST['default_currency'])) {
73
-            $newDefaultCurrency = $_POST['default_currency'];
74
-            $sql                = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0';
75
-            $smartobjectCurrencyHandler->query($sql);
76
-            $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency;
77
-            $smartobjectCurrencyHandler->query($sql);
78
-        }
72
+		if (isset($_POST['default_currency'])) {
73
+			$newDefaultCurrency = $_POST['default_currency'];
74
+			$sql                = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0';
75
+			$smartobjectCurrencyHandler->query($sql);
76
+			$sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency;
77
+			$smartobjectCurrencyHandler->query($sql);
78
+		}
79 79
 
80
-        /*
80
+		/*
81 81
         $criteria = new \CriteriaCompo();
82 82
         $criteria->add(new \Criteria('currencyid', '(' . implode(', ', $_POST['SmartobjectCurrency_objects']) . ')', 'IN'));
83 83
         $currenciesObj = $smartobjectCurrencyHandler->getObjects($criteria, true);
@@ -87,49 +87,49 @@  discard block
 block discarded – undo
87 87
             $smartobjectCurrencyHandler->insert($currencyObj);
88 88
         }
89 89
         */
90
-        redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED);
91
-        break;
90
+		redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED);
91
+		break;
92 92
 
93
-    case 'addcurrency':
93
+	case 'addcurrency':
94 94
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
95
-        $controller = new ObjectController($smartobjectCurrencyHandler);
96
-        $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php');
95
+		$controller = new ObjectController($smartobjectCurrencyHandler);
96
+		$controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php');
97 97
 
98
-        break;
98
+		break;
99 99
 
100
-    case 'del':
100
+	case 'del':
101 101
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
102
-        $controller = new ObjectController($smartobjectCurrencyHandler);
103
-        $controller->handleObjectDeletion();
102
+		$controller = new ObjectController($smartobjectCurrencyHandler);
103
+		$controller->handleObjectDeletion();
104 104
 
105
-        break;
105
+		break;
106 106
 
107
-    default:
107
+	default:
108 108
 
109
-        Smartobject\Utility::getXoopsCpHeader();
109
+		Smartobject\Utility::getXoopsCpHeader();
110 110
 
111
-        //Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES);
111
+		//Smartobject\Utility::getAdminMenu(5, _AM_SOBJECT_CURRENCIES);
112 112
 
113
-        Smartobject\Utility::getCollapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC);
113
+		Smartobject\Utility::getCollapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC);
114 114
 
115 115
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
116
-        $objectTable = new Table($smartobjectCurrencyHandler);
117
-        $objectTable->addColumn(new ObjectColumn('name', 'left', false, 'getCurrencyLink'));
118
-        $objectTable->addColumn(new ObjectColumn('rate', 'center', 150));
119
-        $objectTable->addColumn(new ObjectColumn('iso4217', 'center', 150));
120
-        $objectTable->addColumn(new ObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl'));
116
+		$objectTable = new Table($smartobjectCurrencyHandler);
117
+		$objectTable->addColumn(new ObjectColumn('name', 'left', false, 'getCurrencyLink'));
118
+		$objectTable->addColumn(new ObjectColumn('rate', 'center', 150));
119
+		$objectTable->addColumn(new ObjectColumn('iso4217', 'center', 150));
120
+		$objectTable->addColumn(new ObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl'));
121 121
 
122
-        $objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE);
122
+		$objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE);
123 123
 
124
-        $objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL);
124
+		$objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL);
125 125
 
126
-        $objectTable->render();
126
+		$objectTable->render();
127 127
 
128
-        echo '<br>';
129
-        Smartobject\Utility::closeCollapsable('createdcurrencies');
130
-        echo '<br>';
128
+		echo '<br>';
129
+		Smartobject\Utility::closeCollapsable('createdcurrencies');
130
+		echo '<br>';
131 131
 
132
-        break;
132
+		break;
133 133
 }
134 134
 
135 135
 //Smartobject\Utility::getModFooter();
Please login to merge, or discard this patch.
admin/customtag.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -17,32 +17,32 @@  discard block
 block discarded – undo
17 17
 
18 18
 function editcustomtag($showmenu = false, $customtagid = 0, $clone = false)
19 19
 {
20
-    global $smartobjectCustomtagHandler;
21
-
22
-    $customtagObj = $smartobjectCustomtagHandler->get($customtagid);
23
-
24
-    if (!$clone && !$customtagObj->isNew()) {
25
-        if ($showmenu) {
26
-            //Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING);
27
-        }
28
-        Smartobject\Utility::getCollapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO);
29
-
30
-        $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag');
31
-        $sform->display();
32
-        Smartobject\Utility::closeCollapsable('customtagedit');
33
-    } else {
34
-        $customtagObj->setVar('customtagid', 0);
35
-        $customtagObj->setVar('tag', '');
36
-
37
-        if ($showmenu) {
38
-            //Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW);
39
-        }
40
-
41
-        Smartobject\Utility::getCollapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO);
42
-        $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag');
43
-        $sform->display();
44
-        Smartobject\Utility::closeCollapsable('customtagcreate');
45
-    }
20
+	global $smartobjectCustomtagHandler;
21
+
22
+	$customtagObj = $smartobjectCustomtagHandler->get($customtagid);
23
+
24
+	if (!$clone && !$customtagObj->isNew()) {
25
+		if ($showmenu) {
26
+			//Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING);
27
+		}
28
+		Smartobject\Utility::getCollapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO);
29
+
30
+		$sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag');
31
+		$sform->display();
32
+		Smartobject\Utility::closeCollapsable('customtagedit');
33
+	} else {
34
+		$customtagObj->setVar('customtagid', 0);
35
+		$customtagObj->setVar('tag', '');
36
+
37
+		if ($showmenu) {
38
+			//Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW);
39
+		}
40
+
41
+		Smartobject\Utility::getCollapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO);
42
+		$sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag');
43
+		$sform->display();
44
+		Smartobject\Utility::closeCollapsable('customtagcreate');
45
+	}
46 46
 }
47 47
 
48 48
 require_once __DIR__ . '/admin_header.php';
@@ -57,70 +57,70 @@  discard block
 block discarded – undo
57 57
 $op = '';
58 58
 
59 59
 if (isset($_GET['op'])) {
60
-    $op = $_GET['op'];
60
+	$op = $_GET['op'];
61 61
 }
62 62
 if (isset($_POST['op'])) {
63
-    $op = $_POST['op'];
63
+	$op = $_POST['op'];
64 64
 }
65 65
 
66 66
 switch ($op) {
67
-    case 'mod':
67
+	case 'mod':
68 68
 
69
-        $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0;
69
+		$customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0;
70 70
 
71
-        Smartobject\Utility::getXoopsCpHeader();
72
-        $adminObject->displayNavigation(basename(__FILE__));
71
+		Smartobject\Utility::getXoopsCpHeader();
72
+		$adminObject->displayNavigation(basename(__FILE__));
73 73
 
74
-        editcustomtag(true, $customtagid);
75
-        break;
74
+		editcustomtag(true, $customtagid);
75
+		break;
76 76
 
77
-    case 'clone':
77
+	case 'clone':
78 78
 
79
-        $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0;
79
+		$customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0;
80 80
 
81
-        Smartobject\Utility::getXoopsCpHeader();
82
-        $adminObject->displayNavigation(basename(__FILE__));
81
+		Smartobject\Utility::getXoopsCpHeader();
82
+		$adminObject->displayNavigation(basename(__FILE__));
83 83
 
84
-        editcustomtag(true, $customtagid, true);
85
-        break;
84
+		editcustomtag(true, $customtagid, true);
85
+		break;
86 86
 
87
-    case 'addcustomtag':
87
+	case 'addcustomtag':
88 88
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
89
-        $controller = new XoopsModules\Smartobject\ObjectController($smartobjectCustomtagHandler);
90
-        $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED);
91
-        break;
89
+		$controller = new XoopsModules\Smartobject\ObjectController($smartobjectCustomtagHandler);
90
+		$controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED);
91
+		break;
92 92
 
93
-    case 'del':
93
+	case 'del':
94 94
 
95 95
 //        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
96
-        $controller = new XoopsModules\Smartobject\ObjectController($smartobjectCustomtagHandler);
97
-        $controller->handleObjectDeletion();
96
+		$controller = new XoopsModules\Smartobject\ObjectController($smartobjectCustomtagHandler);
97
+		$controller->handleObjectDeletion();
98 98
 
99
-        break;
99
+		break;
100 100
 
101
-    default:
101
+	default:
102 102
 
103
-        Smartobject\Utility::getXoopsCpHeader();
104
-        $adminObject->displayNavigation(basename(__FILE__));
105
-        $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', '');
106
-        $adminObject->displayButton('left', '');
103
+		Smartobject\Utility::getXoopsCpHeader();
104
+		$adminObject->displayNavigation(basename(__FILE__));
105
+		$adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', '');
106
+		$adminObject->displayButton('left', '');
107 107
 
108
-        //Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_CUSTOMTAGS);
108
+		//Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_CUSTOMTAGS);
109 109
 
110
-        Smartobject\Utility::getCollapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC);
110
+		Smartobject\Utility::getCollapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC);
111 111
 
112 112
 //        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
113
-        $objectTable = new XoopsModules\Smartobject\Table($smartobjectCustomtagHandler);
114
-        $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('name', 'left', 150, 'getCustomtagName'));
115
-        $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('description', 'left'));
116
-        $objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('language', 'center', 150));
113
+		$objectTable = new XoopsModules\Smartobject\Table($smartobjectCustomtagHandler);
114
+		$objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('name', 'left', 150, 'getCustomtagName'));
115
+		$objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('description', 'left'));
116
+		$objectTable->addColumn(new XoopsModules\Smartobject\ObjectColumn('language', 'center', 150));
117 117
 
118
-        //      $objectTable->addCustomAction('getCreateItemLink');
119
-        //      $objectTable->addCustomAction('getCreateAttributLink');
118
+		//      $objectTable->addCustomAction('getCreateItemLink');
119
+		//      $objectTable->addCustomAction('getCreateAttributLink');
120 120
 
121
-        //      $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button
121
+		//      $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button
122 122
 
123
-        /*
123
+		/*
124 124
                 $criteria_upcoming = new \CriteriaCompo();
125 125
                 $criteria_upcoming->add(new \Criteria('start_date', time(), '>'));
126 126
                 $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array(
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
                                             'criteria' => $criteria_last30days
145 145
                 ));
146 146
         */
147
-        $objectTable->addQuickSearch(['title', 'summary', 'description']);
148
-        $objectTable->addCustomAction('getCloneLink');
147
+		$objectTable->addQuickSearch(['title', 'summary', 'description']);
148
+		$objectTable->addCustomAction('getCloneLink');
149 149
 
150
-        $objectTable->render();
150
+		$objectTable->render();
151 151
 
152
-        echo '<br>';
153
-        Smartobject\Utility::closeCollapsable('createdcustomtags');
154
-        echo '<br>';
152
+		echo '<br>';
153
+		Smartobject\Utility::closeCollapsable('createdcustomtags');
154
+		echo '<br>';
155 155
 
156
-        break;
156
+		break;
157 157
 }
158 158
 
159 159
 //Smartobject\Utility::getModFooter();
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 $adminmenu = [];
19 19
 
20 20
 $adminmenu[] = [
21
-    'title' => _MI_SOBJECT_HOME,
22
-    'link'  => 'admin/index.php',
23
-    'icon'  => $pathIcon32 . '/home.png',
21
+	'title' => _MI_SOBJECT_HOME,
22
+	'link'  => 'admin/index.php',
23
+	'icon'  => $pathIcon32 . '/home.png',
24 24
 ];
25 25
 
26 26
 //$adminmenu[] = [
@@ -30,33 +30,33 @@  discard block
 block discarded – undo
30 30
 //];
31 31
 
32 32
 $adminmenu[] = [
33
-    'title' => _MI_SOBJECT_SENT_LINKS,
34
-    'link'  => 'admin/link.php',
35
-    'icon'  => $pathIcon32 . '/addlink.png',
33
+	'title' => _MI_SOBJECT_SENT_LINKS,
34
+	'link'  => 'admin/link.php',
35
+	'icon'  => $pathIcon32 . '/addlink.png',
36 36
 ];
37 37
 
38 38
 $adminmenu[] = [
39
-    'title' => _MI_SOBJECT_TAGS,
40
-    'link'  => 'admin/customtag.php',
41
-    'icon'  => $pathIcon32 . '/identity.png',
39
+	'title' => _MI_SOBJECT_TAGS,
40
+	'link'  => 'admin/customtag.php',
41
+	'icon'  => $pathIcon32 . '/identity.png',
42 42
 ];
43 43
 
44 44
 $adminmenu[] = [
45
-    'title' => _MI_SOBJECT_ADSENSES,
46
-    'link'  => 'admin/adsense.php',
47
-    'icon'  => $pathIcon32 . '/alert.png',
45
+	'title' => _MI_SOBJECT_ADSENSES,
46
+	'link'  => 'admin/adsense.php',
47
+	'icon'  => $pathIcon32 . '/alert.png',
48 48
 ];
49 49
 
50 50
 $adminmenu[] = [
51
-    'title' => _MI_SOBJECT_RATINGS,
52
-    'link'  => 'admin/rating.php',
53
-    'icon'  => $pathIcon32 . '/stats.png',
51
+	'title' => _MI_SOBJECT_RATINGS,
52
+	'link'  => 'admin/rating.php',
53
+	'icon'  => $pathIcon32 . '/stats.png',
54 54
 ];
55 55
 
56 56
 $adminmenu[] = [
57
-    'title' => _MI_SOBJECT_ABOUT,
58
-    'link'  => 'admin/about.php',
59
-    'icon'  => $pathIcon32 . '/about.png',
57
+	'title' => _MI_SOBJECT_ABOUT,
58
+	'link'  => 'admin/about.php',
59
+	'icon'  => $pathIcon32 . '/about.png',
60 60
 ];
61 61
 
62 62
 //---------------------------------
@@ -68,38 +68,38 @@  discard block
 block discarded – undo
68 68
 $smartobjectConfig = Smartobject\Utility::getModuleConfig('smartobject');
69 69
 
70 70
 if (isset($smartobjectConfig['enable_currencyman']) && true === $smartobjectConfig['enable_currencyman']) {
71
-    $adminmenu[] = [
72
-        'title' => _MI_SOBJECT_CURRENCIES,
73
-        'link'  => 'admin/currency.php',
74
-        'icon'  => $pathIcon32 . '/cash_stack.png',
75
-    ];
71
+	$adminmenu[] = [
72
+		'title' => _MI_SOBJECT_CURRENCIES,
73
+		'link'  => 'admin/currency.php',
74
+		'icon'  => $pathIcon32 . '/cash_stack.png',
75
+	];
76 76
 }
77 77
 
78 78
 global $xoopsModule;
79 79
 if (isset($xoopsModule)) {
80
-    $i = -1;
81
-
82
-    // --- for XCL ---
83
-    //  $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule->getVar('mid');
84
-    $mid = $xoopsModule->getVar('mid');
85
-    if (defined('XOOPS_CUBE_LEGACY')) {
86
-        $link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid;
87
-    } else {
88
-        $link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid;
89
-    }
90
-    $headermenu[$i]['link'] = $link_pref;
91
-    // -----
92
-
93
-    // --- for XCL ---
94
-    //  $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname');
95
-    $dirname = $xoopsModule->getVar('dirname');
96
-    if (defined('XOOPS_CUBE_LEGACY')) {
97
-        $link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname;
98
-    } else {
99
-        $link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname;
100
-    }
101
-    $headermenu[$i]['link'] = $link_module;
102
-    // -----
103
-
104
-    ++$i;
80
+	$i = -1;
81
+
82
+	// --- for XCL ---
83
+	//  $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule->getVar('mid');
84
+	$mid = $xoopsModule->getVar('mid');
85
+	if (defined('XOOPS_CUBE_LEGACY')) {
86
+		$link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid;
87
+	} else {
88
+		$link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid;
89
+	}
90
+	$headermenu[$i]['link'] = $link_pref;
91
+	// -----
92
+
93
+	// --- for XCL ---
94
+	//  $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname');
95
+	$dirname = $xoopsModule->getVar('dirname');
96
+	if (defined('XOOPS_CUBE_LEGACY')) {
97
+		$link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname;
98
+	} else {
99
+		$link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname;
100
+	}
101
+	$headermenu[$i]['link'] = $link_module;
102
+	// -----
103
+
104
+	++$i;
105 105
 }
Please login to merge, or discard this patch.