Perforce Chronicle 2012.2/486814
API Documentation

Content_Form_Element_Editor Class Reference

Extends Zend_Dojo_Form_Element_Editor to implement functionality that allows the user to define extra plugins via the options. More...

List of all members.

Public Member Functions

 addExtraPlugin ($plugin)
 Add a single editor extra plugin.
 addExtraPlugins (array $plugins)
 Add multiple extra plugins.
 clearExtraPlugins ()
 Clear all extra plugins.
 getExtraPlugins ()
 Get all extra plugins.
 hasExtraPlugin ($plugin)
 Is a given extra plugin registered?
 removeExtraPlugin ($plugin)
 Remove a given extra plugin.
 setExtraPlugins (array $plugins)
 Overwrite many extra plugins at once.

Detailed Description

Extends Zend_Dojo_Form_Element_Editor to implement functionality that allows the user to define extra plugins via the options.

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_Element_Editor::addExtraPlugin ( plugin)

Add a single editor extra plugin.

Parameters:
string$pluginplugin name
Returns:
Zend_Dojo_Form_Element_Editor
    {
        $plugin    = (string) $plugin;
        if ($this->hasExtraPlugin($plugin)) {
            return $this;
        }

        $plugins   = $this->getExtraPlugins();
        $plugins[] = $plugin;
        $this->setDijitParam('extraPlugins', $plugins);

        return $this;
    }
Content_Form_Element_Editor::addExtraPlugins ( array $  plugins)

Add multiple extra plugins.

Parameters:
array$pluginsarray of plugin names
Returns:
Zend_Dojo_Form_Element_Editor
    {
        foreach ($plugins as $plugin) {
            $this->addExtraPlugin($plugin);
        }

        return $this;
    }
Content_Form_Element_Editor::clearExtraPlugins ( )

Clear all extra plugins.

Returns:
Zend_Dojo_Form_Element_Editor
    {
        return $this->removeDijitParam('extraPlugins');
    }
Content_Form_Element_Editor::getExtraPlugins ( )

Get all extra plugins.

Returns:
array
    {
        if (!$this->hasDijitParam('extraPlugins')) {
            return array();
        }

        return $this->getDijitParam('extraPlugins');
    }
Content_Form_Element_Editor::hasExtraPlugin ( plugin)

Is a given extra plugin registered?

Parameters:
string$pluginplugin name
Returns:
bool
    {
        $plugins = $this->getExtraPlugins();

        return in_array((string) $plugin, $plugins);
    }
Content_Form_Element_Editor::removeExtraPlugin ( plugin)

Remove a given extra plugin.

Parameters:
string$pluginplugin name
Returns:
Zend_Dojo_Form_Element_Editor
    {
        $plugins = $this->getExtraPlugins();
        if (false === ($index = array_search($plugin, $plugins))) {
            return $this;
        }
        unset($plugins[$index]);
        $this->setDijitParam('extraPlugins', $plugins);

        return $this;
    }
Content_Form_Element_Editor::setExtraPlugins ( array $  plugins)

Overwrite many extra plugins at once.

Parameters:
array$pluginsarray of plugin names
Returns:
Zend_Dojo_Form_Element_Editor
    {
        $this->clearExtraPlugins();
        $this->addExtraPlugins($plugins);

        return $this;
    }

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