-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSpamReporterModule.php
40 lines (34 loc) · 1017 Bytes
/
SpamReporterModule.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* SpamReporterModule is responsible for allowing useres to report posts as spam.
*
* @author Marjana Pesic
*
*/
class SpamReporterModule extends HWebModule
{
// http://www.yiiframework.com/wiki/148/understanding-assets/
// getAssetsUrl()
// return the URL for this module's assets, performing the publish operation
// the first time, and caching the result for subsequent use.
private $_assetsUrl;
public function getAssetsUrl() {
if ($this->_assetsUrl === null)
$this->_assetsUrl = Yii::app()->getAssetManager()->publish(
Yii::getPathOfAlias('spamreporter.assets')
);
return $this->_assetsUrl;
}
public function init()
{
// this method is called when the module is being created
// you may place code here to customize the module or the application
}
public static function onWallEntryControlsInit($event) {
$event->sender->addWidget('application.modules.spamreporter.widgets.ReportSpamWidget', array(
'content' => $event->sender->object
)
);
}
}
?>