PHP Class PostController, vanilla

Inheritance: extends AppController
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Свойство Type Description
$DiscussionModel DiscussionModel
$Form Gdn_Form
$FormCollection An associative array of form types and their locations.
$ShowCategorySelector Whether or not to show the category dropdown.
$Uses Models to include.

Méthodes publiques

Méthode Description
announceOptions ( ) : array Get available announcement options for discussions.
comment ( integer $DiscussionID = '' ) Create or update a comment.
comment2 ( integer $CommentID, boolean $Inserted = false ) Triggers saving the extra info about a comment like notifications and unread totals.
discussion ( $CategoryUrlCode = '' ) Create or update a discussion.
editComment ( integer $CommentID = '', integer $DraftID = '' ) Edit a comment (wrapper for PostController::Comment).
editDiscussion ( integer $DiscussionID = '', integer $DraftID = '' ) Edit a discussion (wrapper for PostController::Discussion).
index ( $CurrentFormName = 'discussion' ) General "post" form, allows posting of any kind of form. Attach to PostController_AfterFormCollection_Handler.
initialize ( ) Include CSS for all methods.
notifyNewDiscussion ( $DiscussionID )

Méthodes protégées

Méthode Description
populateForm ( Gdn_Form $Form ) Pre-populate the form with values from the query string.

Method Details

announceOptions() public méthode

Get available announcement options for discussions.
Since: 2.1
public announceOptions ( ) : array
Résultat array

comment() public méthode

Create or update a comment.
Since: 2.0.0
public comment ( integer $DiscussionID = '' )
$DiscussionID integer Unique ID to add the comment to. If blank, this method will throw an error.

comment2() public méthode

Triggers saving the extra info about a comment like notifications and unread totals.
Since: 2.0.?
public comment2 ( integer $CommentID, boolean $Inserted = false )
$CommentID integer Unique ID of the comment.
$Inserted boolean

discussion() public méthode

Create or update a discussion.
Since: 2.0.0
public discussion ( $CategoryUrlCode = '' )

editComment() public méthode

Will throw an error if both params are blank.
Since: 2.0.0
public editComment ( integer $CommentID = '', integer $DraftID = '' )
$CommentID integer Unique ID of the comment to edit.
$DraftID integer Unique ID of the draft to edit.

editDiscussion() public méthode

Will throw an error if both params are blank.
Since: 2.0.0
public editDiscussion ( integer $DiscussionID = '', integer $DraftID = '' )
$DiscussionID integer Unique ID of the discussion to edit.
$DraftID integer Unique ID of draft discussion to edit.

index() public méthode

General "post" form, allows posting of any kind of form. Attach to PostController_AfterFormCollection_Handler.
Since: 2.0.0
public index ( $CurrentFormName = 'discussion' )

initialize() public méthode

Always called by dispatcher before controller's requested method.
Since: 2.0.0
public initialize ( )

notifyNewDiscussion() public méthode

public notifyNewDiscussion ( $DiscussionID )

populateForm() protected méthode

Pre-populate the form with values from the query string.
protected populateForm ( Gdn_Form $Form )
$Form Gdn_Form

Property Details

$DiscussionModel public_oe property

public DiscussionModel $DiscussionModel
Résultat DiscussionModel

$Form public_oe property

public Gdn_Form $Form
Résultat Gdn_Form

$FormCollection public_oe property

An associative array of form types and their locations.
public $FormCollection

$ShowCategorySelector public_oe property

Whether or not to show the category dropdown.
public $ShowCategorySelector

$Uses public_oe property

Models to include.
public $Uses