|
From: <gem...@li...> - 2011-11-22 12:02:25
|
Revision: 258
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=258&view=rev
Author: mennodekker
Date: 2011-11-22 12:02:18 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
Modified Paths:
--------------
trunk/library/classes/Gems/Controller/BrowseEditAction.php
trunk/library/classes/Gems/TabForm.php
Modified: trunk/library/classes/Gems/Controller/BrowseEditAction.php
===================================================================
--- trunk/library/classes/Gems/Controller/BrowseEditAction.php 2011-11-21 16:49:32 UTC (rev 257)
+++ trunk/library/classes/Gems/Controller/BrowseEditAction.php 2011-11-22 12:02:18 UTC (rev 258)
@@ -293,16 +293,18 @@
public function beforeFormDisplay ($form, $isNew)
{
if ($this->useTabbedForms) {
+ /* Not needed anymore @@TODO: Remove when proven, as there is a set tab
//Create the tabs tried in $form->render() but somehow that is never reached
if ($form instanceof Gems_TabForm) {
Gems_TabForm::htmlElementsToTabs($form);
- }
+ }*/
//If needed, add a row of link buttons to the bottom of the form
if ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {
$element = new MUtil_Form_Element_Html('formLinks');
$element->setValue($links);
$element->setOrder(999);
+ $form->resetContext();
$form->addElement($element);
}
} else {
Modified: trunk/library/classes/Gems/TabForm.php
===================================================================
--- trunk/library/classes/Gems/TabForm.php 2011-11-21 16:49:32 UTC (rev 257)
+++ trunk/library/classes/Gems/TabForm.php 2011-11-22 12:02:18 UTC (rev 258)
@@ -60,6 +60,17 @@
if ($this->currentTab && !($element instanceof Zend_Form_Element_Hidden)) {
return $this->currentTab->addElement($element, $name, $options);
} else {
+ if ($element instanceof Zend_Form_Element_Hidden) {
+ //Remove decorators
+ $element->removeDecorator('htmlTag');
+ $element->removeDecorator('Label');
+ } else {
+ $error = $element->getDecorator('Errors');
+ if ($error instanceof Zend_Form_Decorator_Errors) {
+ $element->removeDecorator('Errors');
+ $element->addDecorator($error);
+ }
+ }
return parent::addElement($element, $name, $options);
}
}
@@ -306,6 +317,14 @@
}
}
+ /**
+ * As addElement and addDisplayGroup provide a fluent way of working with subforms
+ * we need to provide a method to skip back to the main form again.
+ */
+ public function resetContext() {
+ $this->currentTab = null;
+ }
+
public function selectTab($tabIdx) {
$this->getElement('tab')->setValue($tabIdx);
$this->setAttrib('selected', $tabIdx);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|