@@ -27,7 +27,7 @@ public function getUsedModules()
27
27
28
28
$ tables = DBUtil::getTables ();
29
29
30
- $ table = $ tables ['EZComments ' ];
30
+ $ table = $ tables ['EZComments ' ];
31
31
$ column = $ tables ['EZComments_column ' ];
32
32
33
33
// TODO Port to DBUtil
@@ -49,7 +49,7 @@ public function getUsedModules()
49
49
*
50
50
* Used to clean up orphaned comments.
51
51
*
52
- * @param $args[module] the module for which to delete for
52
+ * @param $args [module] the module for which to delete for
53
53
* @return boolean sucess status
54
54
*/
55
55
public function deleteall ($ args )
@@ -64,18 +64,18 @@ public function deleteall($args)
64
64
}
65
65
66
66
// get tables
67
- $ tables = DBUtil::getTables ();
68
- $ column = $ tables ['EZComments_column ' ];
67
+ $ tables = DBUtil::getTables ();
68
+ $ column = $ tables ['EZComments_column ' ];
69
69
// construct where clause and delete...
70
- $ where = "WHERE $ column [modname] = ' $ args [module]' " ;
70
+ $ where = "WHERE $ column [modname] = ' $ args [module]' " ;
71
71
72
- return DBUtil::deleteWhere ('EZComments ' ,$ where );
72
+ return DBUtil::deleteWhere ('EZComments ' , $ where );
73
73
}
74
74
75
75
/**
76
76
* Delete an item
77
77
*
78
- * @param $args['id'] ID of the item
78
+ * @param $args ['id'] ID of the item
79
79
* @return bool true on success, false on failure
80
80
*/
81
81
public function delete ($ args )
@@ -94,10 +94,10 @@ public function delete($args)
94
94
95
95
// Security check
96
96
$ securityCheck = ModUtil::apiFunc ('EZComments ' , 'user ' , 'checkPermission ' ,
97
- array ('module ' => '' ,
98
- 'objectid ' => '' ,
99
- 'commentid ' => $ args ['id ' ],
100
- 'level ' => ACCESS_DELETE ));
97
+ array ('module ' => '' ,
98
+ 'objectid ' => '' ,
99
+ 'commentid ' => $ args ['id ' ],
100
+ 'level ' => ACCESS_DELETE ));
101
101
if (!$ securityCheck ) {
102
102
return LogUtil::registerPermissionError (ModUtil::url ('EZComments ' , 'admin ' , 'main ' ));
103
103
}
@@ -117,9 +117,9 @@ public function delete($args)
117
117
/**
118
118
* Update an item
119
119
*
120
- * @param $args['id'] the ID of the item
121
- * @param $args['subject'] the new subject of the item
122
- * @param $args['comment'] the new text of the item
120
+ * @param $args ['id'] the ID of the item
121
+ * @param $args ['subject'] the new subject of the item
122
+ * @param $args ['comment'] the new text of the item
123
123
* @return bool true on success, false on failure
124
124
*/
125
125
public function update ($ args )
@@ -133,8 +133,8 @@ public function update($args)
133
133
}
134
134
135
135
// optional arguments
136
- if (!isset ($ args ['anonname ' ])) $ args ['anonname ' ] = '' ;
137
- if (!isset ($ args ['anonmail ' ])) $ args ['anonmail ' ] = '' ;
136
+ if (!isset ($ args ['anonname ' ])) $ args ['anonname ' ] = '' ;
137
+ if (!isset ($ args ['anonmail ' ])) $ args ['anonmail ' ] = '' ;
138
138
if (!isset ($ args ['anonwebsite ' ])) $ args ['anonwebsite ' ] = '' ;
139
139
140
140
// Get the item
@@ -146,10 +146,10 @@ public function update($args)
146
146
147
147
// Security check.
148
148
$ securityCheck = ModUtil::apiFunc ('EZComments ' , 'user ' , 'checkPermission ' ,
149
- array ('module ' => '' ,
150
- 'objectid ' => '' ,
151
- 'commentid ' => (int )$ args ['id ' ],
152
- 'level ' => ACCESS_EDIT ));
149
+ array ('module ' => '' ,
150
+ 'objectid ' => '' ,
151
+ 'commentid ' => (int )$ args ['id ' ],
152
+ 'level ' => ACCESS_EDIT ));
153
153
154
154
if (!$ securityCheck ) {
155
155
return LogUtil::registerPermissionError (ModUtil::url ('EZComments ' , 'admin ' , 'main ' ));
@@ -171,8 +171,8 @@ public function update($args)
171
171
/**
172
172
* Delete an item
173
173
*
174
- * @param $args['purgerejected'] Purge all rejected comments
175
- * @param $args['purgepending'] Purge all pending comments
174
+ * @param $args ['purgerejected'] Purge all rejected comments
175
+ * @param $args ['purgepending'] Purge all pending comments
176
176
* @return bool true on success, false on failure
177
177
*/
178
178
public function purge ($ args )
@@ -191,8 +191,8 @@ public function purge($args)
191
191
}
192
192
193
193
// Get datbase setup
194
- $ tables = DBUtil::getTables ();
195
- $ column = $ tables ['EZComments_column ' ];
194
+ $ tables = DBUtil::getTables ();
195
+ $ column = $ tables ['EZComments_column ' ];
196
196
197
197
if ((bool )$ purgerejected ) {
198
198
$ where = "WHERE $ column [status] = '2' " ;
@@ -215,15 +215,15 @@ public function purge($args)
215
215
/**
216
216
* Update an item status
217
217
*
218
- * @param $args['id'] the ID of the item
219
- * @param $args['status'] the new status of the item
218
+ * @param $args ['id'] the ID of the item
219
+ * @param $args ['status'] the new status of the item
220
220
* @return bool true on success, false on failure
221
221
*/
222
222
public function updatestatus ($ args )
223
223
{
224
224
// get arguments
225
- $ id = $ args ['id ' ];
226
- $ status = $ args ['status ' ];
225
+ $ id = $ args ['id ' ];
226
+ $ status = $ args ['status ' ];
227
227
228
228
// Argument check
229
229
if (isset ($ id ) && !is_numeric ($ id ) && isset ($ status ) && !is_numeric ($ status )) {
@@ -239,10 +239,10 @@ public function updatestatus($args)
239
239
240
240
// Security check.
241
241
$ securityCheck = ModUtil::apiFunc ('EZComments ' , 'user ' , 'checkPermission ' ,
242
- array ('module ' => '' ,
243
- 'objectid ' => '' ,
244
- 'commentid ' => $ id ,
245
- 'level ' => ACCESS_EDIT ));
242
+ array ('module ' => '' ,
243
+ 'objectid ' => '' ,
244
+ 'commentid ' => $ id ,
245
+ 'level ' => ACCESS_EDIT ));
246
246
247
247
if (!$ securityCheck ) {
248
248
return LogUtil::registerPermissionError (ModUtil::url ('EZComments ' , 'admin ' , 'main ' ));
@@ -273,12 +273,12 @@ public function updatestatus($args)
273
273
$ renderer ->assign ('modifyurl ' , ModUtil::url ('EZComments ' , 'user ' , 'modify ' , array ('id ' => $ item ['id ' ]), null , null , true ));
274
274
275
275
ModUtil::apiFunc ('Mailer ' , 'user ' , 'sendmessage ' ,
276
- array ('toaddress ' => $ owner ['email ' ],
277
- 'toname ' => $ owner ['uname ' ],
278
- 'fromaddress ' => System::getVar ('adminmail ' ),
279
- 'fromname ' => System::getVar ('sitename ' ),
280
- 'subject ' => $ this ->__ ('A new comment was entered ' ),
281
- 'body ' => $ renderer ->fetch ('ezcomments_mail_newcomment.tpl ' )));
276
+ array ('toaddress ' => $ owner ['email ' ],
277
+ 'toname ' => $ owner ['uname ' ],
278
+ 'fromaddress ' => System::getVar ('adminmail ' ),
279
+ 'fromname ' => System::getVar ('sitename ' ),
280
+ 'subject ' => $ this ->__ ('A new comment was entered ' ),
281
+ 'body ' => $ renderer ->fetch ('ezcomments_mail_newcomment.tpl ' )));
282
282
}
283
283
}
284
284
return true ;
@@ -297,40 +297,4 @@ public function countitems($args)
297
297
{
298
298
return ModUtil::apiFunc ('EZComments ' , 'user ' , 'countitems ' , $ args );
299
299
}
300
-
301
- /**
302
- * Get available admin panel links
303
- *
304
- * @author Mark West
305
- * @return array array of admin links
306
- */
307
- public function getLinks ()
308
- {
309
- $ links = array ();
310
-
311
- if (SecurityUtil::checkPermission ('EZComments:: ' , ':: ' , ACCESS_ADMIN )) {
312
- $ links [] = array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'main ' ),
313
- 'text ' => $ this ->__ ('View comments ' ),
314
- 'class ' => 'z-icon-es-view ' );
315
- $ links [] = array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'stats ' ),
316
- 'text ' => $ this ->__ ('Comment statistics ' ),
317
- 'class ' => 'z-icon-es-cubes ' );
318
- $ links [] = array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'modifyconfig ' ),
319
- 'text ' => $ this ->__ ('Settings ' ),
320
- 'class ' => 'z-icon-es-config ' ,
321
- 'links ' => array (
322
- array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'modifyconfig ' ),
323
- 'text ' => $ this ->__ ('Settings ' )),
324
- array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'cleanup ' ),
325
- 'text ' => $ this ->__ ('Delete orphaned comments ' )),
326
- array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'migrate ' ),
327
- 'text ' => $ this ->__ ('Migrate comments ' )),
328
- array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'purge ' ),
329
- 'text ' => $ this ->__ ('Purge comments ' )),
330
- array ('url ' => ModUtil::url ('EZComments ' , 'admin ' , 'applyrules ' ),
331
- 'text ' => $ this ->__ ('Re-apply moderation rules ' ))
332
- ));
333
- }
334
- return $ links ;
335
- }
336
- }
300
+ }
0 commit comments