Commit 2236baa7 authored by Zachary Doll's avatar Zachary Doll

Update doc blocks to mark new functionality as since 1.1

parent 378a123f
......@@ -313,6 +313,8 @@ class BadgeController extends DashboardController {
* This takes in a sort array and updates the badge sort order.
*
* Renders the Save tree and/or the Result of the sort update.
*
* @since 1.1
*/
public function Sort() {
// Check permission
......
......@@ -35,6 +35,8 @@ class YagaController extends DashboardController {
/**
* Redirect to settings by default
*
* @since 1.0
*/
public function Index() {
$this->Settings();
......@@ -42,6 +44,8 @@ class YagaController extends DashboardController {
/**
* This handles all the core settings for the gamification application.
*
* @since 1.0
*/
public function Settings() {
$this->Permission('Garden.Settings.Manage');
......@@ -85,6 +89,12 @@ class YagaController extends DashboardController {
$this->Render('settings');
}
/**
* Performs the necessary functions to change a backend controller into a
* frontend controller
*
* @since 1.1
*/
private function FrontendStyle() {
$this->RemoveCssFile('admin.css');
unset($this->Assets['Panel']['SideMenuModule']);
......@@ -98,6 +108,12 @@ class YagaController extends DashboardController {
$this->AddModule($AllTimeModule);
}
/**
* Displays a summary of ranks currently configured on a frontend page to help
* users understand what is valued in this community
*
* @since 1.1
*/
public function Ranks() {
$this->permission('Yaga.Ranks.View');
$this->FrontendStyle();
......@@ -110,6 +126,16 @@ class YagaController extends DashboardController {
$this->Render('ranks');
}
/**
* Displays a summary of badges currently configured on a frontend page to
* help users understand what is valued in this community.
*
* Also provides a convenience redirect to badge details
*
* @param int $BadgeID The badge ID you want to see details
* @param string $Slug The badge slug you want to see details
* @since 1.1
*/
public function Badges($BadgeID = FALSE, $Slug = NULL) {
$this->permission('Yaga.Badges.View');
$this->FrontendStyle();
......@@ -130,6 +156,13 @@ class YagaController extends DashboardController {
$this->Render('badges');
}
/**
* Displays information about the specified badge including recent recipients
* of the badge.
*
* @param int $BadgeID
* @param string $Slug
*/
public function BadgeDetail($BadgeID, $Slug = NULL) {
$this->permission('Yaga.Badges.View');
$Badge = Yaga::BadgeModel()->GetByID($BadgeID);
......@@ -157,6 +190,8 @@ class YagaController extends DashboardController {
/**
* Import a Yaga transport file
*
* @since 1.0
*/
public function Import() {
$this->Title(T('Yaga.Import'));
......@@ -204,6 +239,8 @@ class YagaController extends DashboardController {
/**
* Create a Yaga transport file
*
* @since 1.0
*/
public function Export() {
$this->Title(T('Yaga.Export'));
......@@ -237,6 +274,7 @@ class YagaController extends DashboardController {
* Yaga sections to be included in the transport file.
*
* @return array
* @since 1.0
*/
protected function _FindIncludes() {
$FormValues = $this->Form->FormValues();
......@@ -257,6 +295,7 @@ class YagaController extends DashboardController {
* @param array An array containing the config areas to transfer
* @param string Where to save the transport file
* @return mixed False on failure, the path to the transport file on success
* @since 1.0
*/
protected function _ExportData($Include = array(), $Path = NULL) {
$StartTime = microtime(TRUE);
......@@ -361,6 +400,7 @@ class YagaController extends DashboardController {
*
* @param string The transport file path
* @return boolean Whether or not the transport file was extracted successfully
* @since 1.0
*/
protected function _ExtractZip($Filename) {
if(!file_exists($Filename)) {
......@@ -405,6 +445,7 @@ class YagaController extends DashboardController {
* @param array Which tables should be overwritten
* @return bool Pass/Fail on the import being executed. Errors can exist on the
* form with a passing return value.
* @since 1.0
*/
protected function _ImportData($Info, $Include) {
if(!$Info) {
......@@ -447,6 +488,7 @@ class YagaController extends DashboardController {
* @param array The nested array
* @param string What should the configuration strings be prefixed with
* @return array
* @since 1.0
*/
protected function _NestedToDotNotation($Configs, $Prefix = '') {
$ConfigStrings = array();
......@@ -468,6 +510,7 @@ class YagaController extends DashboardController {
*
* @param stdClass The metadata object read in from the transport file
* @return boolean Whether or not the checksum is valid
* @since 1.0
*/
protected function _ValidateChecksum($MetaData) {
$Hashes = array();
......@@ -507,19 +550,20 @@ class YagaController extends DashboardController {
}
/**
* Returns a list of all files in a directory, recursively (Thanks @businessdad)
*
* @param string Directory The directory to scan for files
* @return array A list of Files and, optionally, Directories.
*/
protected function _GetFiles($Directory) {
* Returns a list of all files in a directory, recursively (Thanks @businessdad)
*
* @param string Directory The directory to scan for files
* @return array A list of Files and, optionally, Directories.
* @since 1.0
*/
protected function _GetFiles($Directory) {
$Files = array_diff(scandir($Directory), array('.', '..'));
$Result = array();
foreach($Files as $File) {
$FileName = $Directory . '/' . $File;
if(is_dir($FileName)) {
$Result = array_merge($Result, $this->_GetFiles($FileName));
continue;
$Result = array_merge($Result, $this->_GetFiles($FileName));
continue;
}
$Result[] = $FileName;
}
......
......@@ -66,6 +66,7 @@ class Yaga {
/**
* Get a reference to the action model
* @since 1.0
* @return ActionModel
*/
public static function ActionModel() {
......@@ -77,6 +78,7 @@ class Yaga {
/**
* Get a reference to the reaction model
* @since 1.0
* @return ReactionModel
*/
public static function ReactionModel() {
......@@ -88,6 +90,7 @@ class Yaga {
/**
* Get a reference to the badge model
* @since 1.0
* @return BadgeModel
*/
public static function BadgeModel() {
......@@ -99,6 +102,7 @@ class Yaga {
/**
* Get a reference to the badge award model
* @since 1.0
* @return BadgeAwardModel
*/
public static function BadgeAwardModel() {
......@@ -110,6 +114,7 @@ class Yaga {
/**
* Get a reference to the rank model
* @since 1.0
* @return RankModel
*/
public static function RankModel() {
......@@ -124,6 +129,7 @@ class Yaga {
*
* May be expanded in future versions.
*
* @since 1.1
* @param int $UserID
* @param int $Value
* @param string $Source
......@@ -139,6 +145,7 @@ class Yaga {
* @param mixed $Sender The sending object
* @param string $Handler The event handler to check associated rules for awards
* (e.g. BadgeAwardModel_AfterBadgeAward_Handler or Base_AfterConnection)
* @since 1.1
*/
public static function ExecuteBadgeHooks($Sender, $Handler) {
$Session = Gdn::Session();
......
......@@ -12,6 +12,7 @@ if(!function_exists('RenderReactionList')) {
* Renders a list of available actions that also contains the current count of
* reactions an item has received if allowed
*
* @since 1.0
* @param int $ID
* @param string $Type 'discussion', 'activity', or 'comment'
* @return string Rendered list of actions available
......@@ -44,6 +45,7 @@ if(!function_exists('RenderReactionRecord')) {
/**
* Renders the reaction record for a specific item
*
* @since 1.0
* @param int $ID
* @param string $Type 'discussion', 'activity', or 'comment'
* @return string Rendered list of existing reactions
......@@ -80,6 +82,7 @@ if(!function_exists('RenderActionRow')) {
/**
* Renders an action row used to construct the action admin screen
*
* @since 1.0
* @param stdClass $Action
* @return string
*/
......@@ -104,6 +107,7 @@ if(!function_exists('RenderPerkPermissionForm')) {
/**
* Render a simple permission perk form
*
* @since 1.0
* @param string $Perm The permission you want to grant/revoke
* @param string $Label Translation code used on the form
*/
......@@ -127,6 +131,7 @@ if(!function_exists('RenderPerkConfigurationForm')) {
/**
* Render a perk form for the specified configuration
*
* @since 1.0
* @param string $Config The configuration you want to override (i.e. 'Vanilla.EditTimeout')
* @param string $Label Translation code used on the form
* @param array $Options The options you want shown instead of default/enable/disable.
......
......@@ -12,6 +12,7 @@ interface YagaRule {
* This performs the grunt work of an award rule. Given an expected criteria,
* it determines if a specific user meets muster.
*
* @since 1.0
* @param mixed $Sender The object calling the award method.
* @param UserObject $User the user object of the calling user
* @param stdClass $Criteria This is a standard object with properties that
......@@ -24,6 +25,8 @@ interface YagaRule {
/**
* This determines what hook(s) the rule should be checked on.
*
* @since 1.0
* @return array The hook name(s) in lower case to fire our calculations on
*/
public function Hooks();
......@@ -31,6 +34,7 @@ interface YagaRule {
/**
* Returns the needed criteria form for this rule's criteria.
*
* @since 1.0
* @param Gdn_Form $Form
* @return string The fully rendered form.
*/
......@@ -39,6 +43,7 @@ interface YagaRule {
/**
* This validates the submitted criteria and does what it wants with the form
*
* @since 1.0
* @param array $Criteria
* @param Gdn_Form $Form
*/
......@@ -47,6 +52,7 @@ interface YagaRule {
/**
* Returns a string representing a user friendly name of this rule.
*
* @since 1.0
* @return string Name shown on forms
*/
public function Name();
......@@ -54,6 +60,7 @@ interface YagaRule {
/**
* Returns a string representing the in depth description of how to use this rule.
*
* @since 1.0
* @return string The description
*/
public function Description();
......@@ -63,6 +70,7 @@ interface YagaRule {
* other than the calling user. Rules that depend on interaction should return
* true.
*
* @since 1.0
* @return bool Whether or not interactions need to be checked
*/
public function Interacts();
......
......@@ -468,6 +468,7 @@ class ActedModel extends Gdn_Model {
/**
* Wrapper for GetRecord()
*
* @since 1.1
* @param string $RecordType
* @param int $ID
* @return array
......
......@@ -171,6 +171,7 @@ class BadgeModel extends Gdn_Model {
/**
* Updates the sort field for each badge in the sort array
*
* @since 1.1
* @param array $SortArray
* @return boolean
*/
......
......@@ -219,6 +219,7 @@ class ReactionModel extends Gdn_Model {
/**
* Fills the memory cache with the specified reaction records
*
* @since 1.1
* @param string $Type
* @param array $IDs
*/
......
......@@ -582,6 +582,7 @@ class YagaHooks implements Gdn_IPlugin {
/**
* Insert JS and CSS files into the appropiate controllers
*
* @since 1.1
* @param DiscussionsController $Sender
*/
public function DiscussionsController_Render_Before($Sender) {
......@@ -748,6 +749,12 @@ class YagaHooks implements Gdn_IPlugin {
}
}
/**
* Adds links to the frontend
*
* @since 1.1
* @param MenuModule $Menu
*/
protected function AddMenuLinks($Menu) {
if(C('Yaga.Badges.Enabled')) {
$Menu->AddLink('Yaga', T('Badges'), 'yaga/badges');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment