vanilla-application-yaga/library/rules/class.photoexists.php
Zachary Doll c0d11cf91e Interaction rules are now checked on all hooks
Added an Interacts method on the yagarule interface. Any badges using
interactive rules will be checked regardless of the calling user's award
status. Fixes issue #15
2014-02-19 08:48:21 -06:00

46 lines
841 B
PHP

<?php if(!defined('APPLICATION')) exit();
/**
* This rule awards badges if the user has a profile photo
*
* @author Zachary Doll
* @since 1.0
* @package Yaga
*/
class PhotoExists implements YagaRule {
public function Award($Sender, $User, $Criteria) {
if($User->Photo) {
return TRUE;
}
else {
return FALSE;
}
}
public function Form($Form) {
return '';
}
public function Validate($Criteria, $Form) {
return;
}
public function Hooks() {
return array('Gdn_Dispatcher_AppStartup');
}
public function Description() {
$Description = T('Yaga.Rules.PhotoExists.Desc');
return Wrap($Description, 'div', array('class' => 'InfoMessage'));
}
public function Name() {
return T('Yaga.Rules.PhotoExists');
}
public function Interacts() {
return FALSE;
}
}