Perforce Chronicle 2012.2/486814
API Documentation

Content_Form_Delete Class Reference

This is the content delete form. More...

Inheritance diagram for Content_Form_Delete:
P4Cms_Form

List of all members.

Public Member Functions

 init ()
 Defines the elements that make up the content delete form.

Detailed Description

This is the content delete form.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

Content_Form_Delete::init ( )

Defines the elements that make up the content delete form.

Called automatically when the form object is created.

    {
        // form should use p4cms-ui styles.
        $this->setAttrib('class', 'p4cms-ui content-delete-form');

        // add a field to collect the entry ids to delete
        $this->addElement(
            'hidden',
            'ids',
            array(
                'required'  => true
            )
        );

        // add a blank note field to allow insert text later
        $this->addElement(
            'text',
            'note',
            array(
                'helper'    => 'FormNote'
            )
        );
        $this->getElement('note')
             ->getDecorator('htmlTag')
             ->setOption('class', 'delete-confirmation');

        // add a field to collect the comment
        $this->addElement(
            'textarea',
            'comment',
            array(
                'label'         => 'Comment',
                'description'   => "Shown in the version history.",
                'rows'          => 5
            )
        );

        // add delete button
        $this->addElement(
            'SubmitButton',
            'delete',
            array(
                'label'     => 'Delete',
                'required'  => false,
                'ignore'    => true,
                'class'     => 'preferred'
            )
        );

        $this->addDisplayGroup(
            array('delete'),
            'buttons',
            array('class' => 'buttons')
        );
    }

The documentation for this class was generated from the following file: