Overview

Packages

  • None
  • Yaga

Classes

  • ActedModel
  • ActionController
  • ActionModel
  • AwardCombo
  • BadgeAwardModel
  • BadgeController
  • BadgeModel
  • BadgesController
  • BadgesModule
  • BestController
  • BestFilterModule
  • CakeDayPost
  • CommentCount
  • CommentMarathon
  • DiscussionBodyLength
  • DiscussionCategory
  • DiscussionCount
  • DiscussionPageCount
  • HasMentioned
  • HolidayVisit
  • LeaderBoardModule
  • LengthOfService
  • ManualAward
  • NecroPost
  • NewbieComment
  • PhotoExists
  • PostCount
  • PostReactions
  • QnAAnserCount
  • RankController
  • RankModel
  • ReactController
  • ReactionCount
  • ReactionModel
  • ReflexComment
  • RulesController
  • SocialConnection
  • Yaga
  • YagaController
  • YagaHooks

Interfaces

  • YagaRule
  • Overview
  • Package
  • Class
  • Tree
  • Todo
  • Download
 1: <?php if(!defined('APPLICATION')) exit();
 2: 
 3: /**
 4:  * This rule awards badges if the user has a profile photo
 5:  *
 6:  * @author Zachary Doll
 7:  * @since 1.0
 8:  * @package Yaga
 9:  */
10: class PhotoExists implements YagaRule {
11: 
12:   public function Award($Sender, $User, $Criteria) {
13:     if($User->Photo) {
14:       return TRUE;
15:     }
16:     else {
17:       return FALSE;
18:     }
19:   }
20: 
21:   public function Form($Form) {
22:     return '';
23:   }
24: 
25:   public function Validate($Criteria, $Form) {
26:     return;
27:   }
28: 
29:   public function Hooks() {
30:     return array('Gdn_Dispatcher_AppStartup');
31:   }
32: 
33:   public function Description() {
34:     $Description = T('Yaga.Rules.PhotoExists.Desc');
35:     return Wrap($Description, 'div', array('class' => 'InfoMessage'));
36:   }
37: 
38:   public function Name() {
39:     return T('Yaga.Rules.PhotoExists');
40:   }
41:   
42:   public function Interacts() {
43:     return FALSE;
44:   }
45: }
46: 
Yaga API documentation generated by ApiGen 2.8.0