Perforce Chronicle 2012.2/486814
API Documentation

Flickr_Form_Configure Class Reference

This is the flickr module config form. More...

Inheritance diagram for Flickr_Form_Configure:
P4Cms_Form

List of all members.

Public Member Functions

 init ()
 Defines the elements that make up the config form.
 isValid ($data)
 Extend isValid to verify values.

Detailed Description

This is the flickr module config 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

Flickr_Form_Configure::init ( )

Defines the elements that make up the config form.

Called automatically when the form object is created.

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

        // set the method for the form to POST
        $this->setMethod('post');

        // add a field to collect the api key.
        $this->addElement(
            'text',
            'key',
            array(
                'label'         => 'Flickr API Key',
                'required'      => true,
                'description'   => 'Enter your Flickr API key.',
                'filters'       => array('StringTrim')
            )
        );

        $this->addElement(
            'SubmitButton',
            'save',
            array(
                'label'     => 'Save',
                'required'  => false,
                'ignore'    => true,
                'class'     => 'preferred'
            )
        );

        // put the buttons in a fieldset.
        $this->addDisplayGroup(
            array('save'),
            'buttons',
            array('class' => 'buttons')
        );
    }
Flickr_Form_Configure::isValid ( data)

Extend isValid to verify values.

Parameters:
array$dataarray of submitted form values
Returns:
boolean whether or not the form data is valid

Reimplemented from P4Cms_Form.

    {
        if (!parent::isValid($data)) {
            return false;
        }

        return true;
    }

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