CMS  Version 3.9
comment_form.inc File Reference

Go to the source code of this file.

Functions

 saveNewComment ($form)
 

Variables

 $comment_id = checkNumeric($_GET["comment_id"])
 
 $xref_class = ConnectionManager::escape($_GET["xref_class"])
 
 $key_name = ConnectionManager::escape($_GET["key_name"])
 
 $key_value = checkNumeric($_GET["key_value"])
 
 $xref_component = ConnectionManager::escape($_GET["xref_component"])
 
global $user
 
 $comment = new Comment()
 
if($comment_id) else
 
$comment date_posted = today()
 
 $newPost = true
 
 $returnFn = "commentFormResult"
 
 $form = new AutoForm($comment, "POST", "/action/comment/comment_form?comment_id=$comment_id&xref_class=$xref_class&key_name=$key_name&key_value=$key_value&xref_component=$xref_component", "EditComment_form")
 
if(! $comment_id) $posted = new DateTimeFieldRenderer($form)
 
$posted template = "m/d/Y"
 
 $captchaMode = Settings::getValue("comment", "use_captcha")
 
if(! $comment_id &&($captchaMode=="Always"||($captchaMode=="Anonymous Only" &&! $user))) $form allowDelete = true
 
 if ( $method=="POST")
 

Function Documentation

◆ saveNewComment()

saveNewComment (   $form)

Definition at line 103 of file comment_form.inc.

104 {
106 }
static onSaveNewComment($form)
Called by comment_form handler to save xref and send email for new comments.
$form

Variable Documentation

◆ $captchaMode

$captchaMode = Settings::getValue("comment", "use_captcha")

Definition at line 75 of file comment_form.inc.

◆ $comment

$comment = new Comment()

Definition at line 20 of file comment_form.inc.

◆ $comment_id

$comment_id = checkNumeric($_GET["comment_id"])

Definition at line 11 of file comment_form.inc.

◆ $form

$form = new AutoForm($comment, "POST", "/action/comment/comment_form?comment_id=$comment_id&xref_class=$xref_class&key_name=$key_name&key_value=$key_value&xref_component=$xref_component", "EditComment_form")

Definition at line 36 of file comment_form.inc.

◆ $key_name

$key_name = ConnectionManager::escape($_GET["key_name"])

Definition at line 13 of file comment_form.inc.

◆ $key_value

$key_value = checkNumeric($_GET["key_value"])

Definition at line 14 of file comment_form.inc.

◆ $newPost

$newPost = true

Definition at line 32 of file comment_form.inc.

◆ $posted

if (! $comment_id) $posted = new DateTimeFieldRenderer($form)

Definition at line 48 of file comment_form.inc.

◆ $returnFn

$returnFn = "commentFormResult"

Definition at line 33 of file comment_form.inc.

◆ $user

global $user

Definition at line 16 of file comment_form.inc.

◆ $xref_class

$xref_class = ConnectionManager::escape($_GET["xref_class"])

Definition at line 12 of file comment_form.inc.

◆ $xref_component

$xref_component = ConnectionManager::escape($_GET["xref_component"])

Definition at line 15 of file comment_form.inc.

◆ allowDelete

if (! $comment_id &&( $captchaMode=="Always"||( $captchaMode=="Anonymous Only" &&! $user))) $form allowDelete = true

Definition at line 82 of file comment_form.inc.

◆ date_posted

$comment date_posted = today()

Definition at line 31 of file comment_form.inc.

◆ else

if (! $comment_id) if ( $comment->user_id) else
Initial value:
{
$comment->user_id = ($user) ? $user->get($user->primary_key) : 0
global $user
$comment

Definition at line 28 of file comment_form.inc.

◆ if

if (   $method = = "POST")
Initial value:
{
$title = "Add Article"

Definition at line 84 of file comment_form.inc.

◆ template

$posted template = "m/d/Y"

Definition at line 49 of file comment_form.inc.