vanilla-application-yaga/library/rules/class.photoexists.php
Kasper Kronborg Isager 07c4d55572 Rely on Garden's autoloader for bringing classes and rules into scope
The Yaga rule interface as well as the static super class can be auto-
magically brought into scope using Garden's autoloader instead of being
manullay included where needed.

I also renamed `lib` to `library` as this is used everywhere else in
Vanilla and moved the rules into the `library` dir to keep everything
in the same place.
2013-12-18 21:19:15 -05:00

42 lines
778 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('UserModel_AfterSave');
}
public function Description() {
$Description = T('Yaga.Rules.PhotoExists.Desc');
return Wrap($Description, 'div', array('class' => 'InfoMessage'));
}
public function Name() {
return T('Yaga.Rules.PhotoExists');
}
}