parent
62f2f92ae8
commit
59dceb4729
|
@ -20,42 +20,6 @@ class DeleteCommentCommandForm extends CommandForm
|
|||
$this->setAttrib('class', 'inline');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(
|
||||
array(
|
||||
array(
|
||||
'hidden',
|
||||
'comment_id',
|
||||
array(
|
||||
'required' => true,
|
||||
'validators' => array('NotEmpty'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
),
|
||||
array(
|
||||
'hidden',
|
||||
'comment_is_service',
|
||||
array(
|
||||
'filters' => array('Boolean'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
),
|
||||
array(
|
||||
'hidden',
|
||||
'redirect',
|
||||
array(
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -80,14 +44,59 @@ class DeleteCommentCommandForm extends CommandForm
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(
|
||||
array(
|
||||
array(
|
||||
'hidden',
|
||||
'comment_id',
|
||||
array(
|
||||
'required' => true,
|
||||
'validators' => array('NotEmpty'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
),
|
||||
array(
|
||||
'hidden',
|
||||
'comment_is_service',
|
||||
array(
|
||||
'filters' => array('Boolean'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
),
|
||||
array(
|
||||
'hidden',
|
||||
'comment_name',
|
||||
array(
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
),
|
||||
array(
|
||||
'hidden',
|
||||
'redirect',
|
||||
array(
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onSuccess()
|
||||
{
|
||||
$cmd = new DeleteCommentCommand();
|
||||
$cmd->setIsService($this->getElement('comment_is_service')->getValue())
|
||||
->setCommentId($this->getElement('comment_id')->getValue());
|
||||
$cmd
|
||||
->setCommentId($this->getElement('comment_id')->getValue())
|
||||
->setCommentName($this->getElement('comment_name')->getValue())
|
||||
->setIsService($this->getElement('comment_is_service')->getValue());
|
||||
$this->getTransport($this->request)->send($cmd);
|
||||
$redirect = $this->getElement('redirect')->getValue();
|
||||
if (! empty($redirect)) {
|
||||
|
|
Loading…
Reference in New Issue