2013-11-11 14:45:31 -06:00
|
|
|
<?php if(!defined('APPLICATION')) exit();
|
|
|
|
include_once 'interface.yagarule.php';
|
|
|
|
/**
|
2013-11-12 09:35:07 -06:00
|
|
|
* This rule awards badges when a user mentions another user in a discussion,
|
|
|
|
* comment, or activity
|
|
|
|
*
|
|
|
|
* @todo Implement HasMentioned rule
|
2013-11-11 14:45:31 -06:00
|
|
|
*
|
|
|
|
* @author Zachary Doll
|
|
|
|
* @since 1.0
|
|
|
|
* @package Yaga
|
|
|
|
*/
|
|
|
|
class HasMentioned implements YagaRule{
|
|
|
|
|
|
|
|
public function Award($Sender, $User, $Criteria) {
|
|
|
|
$Result = FALSE;
|
2013-11-12 09:35:07 -06:00
|
|
|
|
2013-11-11 14:45:31 -06:00
|
|
|
return $Result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function Form($Form) {
|
2013-11-12 09:35:07 -06:00
|
|
|
return $this->Description();
|
2013-11-11 14:45:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
public function Hooks() {
|
2013-11-12 09:35:07 -06:00
|
|
|
return array('CommentModel_AfterSaveComment', 'DiscussionModel_AfterSaveDiscussion', 'ActivityModel_BeforeSaveComment');
|
2013-11-11 14:45:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
public function Description() {
|
2013-11-12 09:35:07 -06:00
|
|
|
$Description = 'This rule checks a users comment for mentions. If the user mentions someone, this will return true.';
|
2013-11-11 14:45:31 -06:00
|
|
|
return $Description;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function Name() {
|
2013-11-12 09:35:07 -06:00
|
|
|
return 'Mention';
|
2013-11-11 14:45:31 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|