2013-11-04 17:32:04 -06:00
|
|
|
<?php if(!defined('APPLICATION')) exit();
|
|
|
|
/**
|
2013-11-07 11:19:32 -06:00
|
|
|
* Describes the functions required to create a new rule for badges in Yaga.
|
|
|
|
*
|
2013-11-04 17:32:04 -06:00
|
|
|
* @author Zachary Doll
|
|
|
|
* @since 1.0
|
|
|
|
* @package Yaga
|
|
|
|
*/
|
|
|
|
interface YagaRule {
|
2013-11-07 11:19:32 -06:00
|
|
|
/**
|
|
|
|
* This performs the grunt work of an award rule. Given an expected criteria,
|
|
|
|
* it determines if a specific user meets muster.
|
|
|
|
*
|
2013-11-08 15:30:20 -06:00
|
|
|
* @param UserObject $User the user object
|
|
|
|
* @param stdClass $Criteria This is a standard object with properties that
|
|
|
|
* match the criteria that were previously rendered
|
2013-11-07 11:19:32 -06:00
|
|
|
* @return bool True if the user meets the criteria, false otherwise
|
|
|
|
*/
|
2013-11-11 14:45:31 -06:00
|
|
|
public function Award($Sender, $User, $Criteria);
|
2013-11-07 11:19:32 -06:00
|
|
|
|
|
|
|
/**
|
2013-11-11 14:45:31 -06:00
|
|
|
* This determines what hook the rule should be checked on.
|
|
|
|
* @return string The hook name to fire our calculations on
|
|
|
|
*/
|
|
|
|
public function Hooks();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the needed criteria form for this rule's criteria.
|
2013-11-07 11:19:32 -06:00
|
|
|
*
|
|
|
|
* @param Gdn_Form $Form
|
2013-11-11 14:45:31 -06:00
|
|
|
* @return string The fully rendered form.
|
2013-11-07 11:19:32 -06:00
|
|
|
*/
|
2013-11-11 14:45:31 -06:00
|
|
|
public function Form($Form);
|
2013-11-07 11:19:32 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a string representing a user friendly name of this rule.
|
|
|
|
*
|
|
|
|
* @return string Name shown on forms
|
|
|
|
*/
|
2013-11-11 14:45:31 -06:00
|
|
|
public function Name();
|
2013-11-07 11:19:32 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a string representing the in depth description of how to use this rule.
|
|
|
|
*
|
|
|
|
* @return string The description
|
|
|
|
*/
|
2013-11-04 17:32:04 -06:00
|
|
|
public function Description();
|
|
|
|
}
|
|
|
|
?>
|