|
From: <gem...@li...> - 2011-11-02 12:35:03
|
Revision: 165
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=165&view=rev
Author: mennodekker
Date: 2011-11-02 12:34:57 +0000 (Wed, 02 Nov 2011)
Log Message:
-----------
Updated docs
Modified Paths:
--------------
trunk/library/classes/Gems/Form/TableForm.php
trunk/library/classes/Gems/TabForm.php
Modified: trunk/library/classes/Gems/Form/TableForm.php
===================================================================
--- trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 11:35:57 UTC (rev 164)
+++ trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 12:34:57 UTC (rev 165)
@@ -159,8 +159,13 @@
/**
* Add element to stack
*
- * @param Zend_Form_Element $element
- * @return Zend_Form_Element
+ * Takes care of setting the right decorators for table display
+ *
+ * @param string|Zend_Form_Element $element
+ * @param string $name
+ * @param array|Zend_Config $options
+ * @throws Zend_Form_Exception on invalid element
+ * @return Gems_Form_TableForm
*/
public function addElement($element, $name = null, $options = null)
{
Modified: trunk/library/classes/Gems/TabForm.php
===================================================================
--- trunk/library/classes/Gems/TabForm.php 2011-11-02 11:35:57 UTC (rev 164)
+++ trunk/library/classes/Gems/TabForm.php 2011-11-02 12:34:57 UTC (rev 165)
@@ -1,5 +1,4 @@
<?php
-
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -45,7 +44,17 @@
* @var Gems_Form_TabSubForm
*/
private $currentTab = null;
-
+
+ /**
+ * Add an element to the form, when a tab (subform) had been added, it will return
+ * the subform instead of the form, keep this in mind when chaining methods
+ *
+ * @param string|Zend_Form_Element $element
+ * @param string $name
+ * @param array|Zend_Config $options
+ * @throws Zend_Form_Exception on invalid element
+ * @return Gems_TabForm|Gems_Form_TabSubForm
+ */
public function addElement($element, $name = null, $options = null)
{
if ($this->currentTab) {
@@ -54,7 +63,14 @@
return parent::addElement($element, $name, $options);
}
}
-
+
+ /**
+ * Add a tab to the form
+ *
+ * @param string $name
+ * @param string $title
+ * @return Gems_Form_TabSubForm
+ */
public function addTab($name, $title)
{
if ($title instanceof MUtil_Html_Sequence) $title = $title->render($form->getView());
@@ -64,6 +80,16 @@
return $tab;
}
+ /**
+ * Add an element to the form, when a tab (subform) had been added, it will return
+ * the subform instead of the form, keep this in mind when chaining methods
+ *
+ * @param array $elements
+ * @param string $name
+ * @param array|Zend_Config $options
+ * @return Gems_TabForm|Gems_Form_TabSubForm
+ * @throws Zend_Form_Exception if no valid elements provided
+ */
public function addDisplayGroup(array $elements, $name, $options = null) {
if ($this->currentTab) {
return $this->currentTab->addDisplayGroup($elements, $name, $options);
@@ -80,6 +106,13 @@
}
}
+ /**
+ * Return a display group, use recursive search in subforms to provide a transparent experience
+ * with tabs
+ *
+ * @param string $name
+ * @return Zend_Form_DisplayGroup|null
+ */
public function getDisplayGroup($name)
{
if ($group = parent::getDisplayGroup($name)) {
@@ -95,6 +128,13 @@
}
}
+ /**
+ * Retrieve a single element, use recursive search in subforms to provide a transparent experience
+ * with tabs
+ *
+ * @param string $name
+ * @return Zend_Form_Element|null
+ */
public function getElement($name)
{
if ($element = parent::getElement($name)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|