original_string: public function addFormTabs($parentBridge, $name, $arrayOrKey1 = null) {
          $options = func_get_args();
          $options = \MUtil_Ra::pairs($options, 2);
  
          /* $options = $this->_mergeOptions($name, $options,
            self::SUBFORM_OPTIONS); */
          //\MUtil_Echo::track($options);
          if (isset($options['form'])) {
              $form = $options['form'];
              unset($options['form']);
          } else {
              $formClass = get_class($parentBridge->getForm());
              $form      = new $formClass();
          }
          $submodel = $parentBridge->getModel()->get($name, 'model');
          if ($submodel instanceof \MUtil_Model_ModelAbstract) {
              $bridge = $submodel->getBridgeFor('form', $form);
              foreach ($submodel->getItemsOrdered() as $itemName) {
                  if (!$form->getElement($name)) {
                      if ($submodel->has($itemName, 'label')) {
                          $bridge->add($itemName);
                      } else {
                          $bridge->addHidden($itemName);
                      }
                  }
              }
          }
          $form->activateJQuery();
          $element = new \Gems_Form_Element_Tabs($form, $name, $options);
  
          $parentBridge->getForm()->addElement($element);
          return $element;
      }
code: public function addFormTabs($parentBridge, $name, $arrayOrKey1 = null) {
          $options = func_get_args();
          $options = \MUtil_Ra::pairs($options, 2);
  
          /* $options = $this->_mergeOptions($name, $options,
            self::SUBFORM_OPTIONS); */
          //\MUtil_Echo::track($options);
          if (isset($options['form'])) {
              $form = $options['form'];
              unset($options['form']);
          } else {
              $formClass = get_class($parentBridge->getForm());
              $form      = new $formClass();
          }
          $submodel = $parentBridge->getModel()->get($name, 'model');
          if ($submodel instanceof \MUtil_Model_ModelAbstract) {
              $bridge = $submodel->getBridgeFor('form', $form);
              foreach ($submodel->getItemsOrdered() as $itemName) {
                  if (!$form->getElement($name)) {
                      if ($submodel->has($itemName, 'label')) {
                          $bridge->add($itemName);
                      } else {
                          $bridge->addHidden($itemName);
                      }
                  }
              }
          }
          $form->activateJQuery();
          $element = new \Gems_Form_Element_Tabs($form, $name, $options);
  
          $parentBridge->getForm()->addElement($element);
          return $element;
      }
code_tokens: public function addFormTabs ( $ parentBridge , $ name , $ arrayOrKey1 = null ) { $ options = func_get_args ( ) ; $ options = \ MUtil_Ra :: pairs ( $ options , 2 ) ; /* $options = $this->_mergeOptions($name, $options,
            self::SUBFORM_OPTIONS); */ //\MUtil_Echo::track($options); if ( isset ( $ options [ 'form' ] ) ) { $ form = $ options [ 'form' ] ; unset ( $ options [ 'form' ] ) ; } else { $ formClass = get_class ( $ parentBridge -> getForm ( ) ) ; $ form = new $ formClass ( ) ; } $ submodel = $ parentBridge -> getModel ( ) -> get ( $ name , 'model' ) ; if ( $ submodel instanceof \ MUtil_Model_ModelAbstract ) { $ bridge = $ submodel -> getBridgeFor ( 'form' , $ form ) ; foreach ( $ submodel -> getItemsOrdered ( ) as $ itemName ) { if ( ! $ form -> getElement ( $ name ) ) { if ( $ submodel -> has ( $ itemName , 'label' ) ) { $ bridge -> add ( $ itemName ) ; } else { $ bridge -> addHidden ( $ itemName ) ; } } } } $ form -> activateJQuery ( ) ; $ element = new \ Gems_Form_Element_Tabs ( $ form , $ name , $ options ) ; $ parentBridge -> getForm ( ) -> addElement ( $ element ) ; return $ element ; }
docstring: Adds a form multiple times in a table
  
  You can add your own 'form' either to the model or here in the parameters.
  Otherwise a form of the same class as the parent form will be created.
  
  All elements not yet added to the form are added using a new FormBridge
  instance using the default label / non-label distinction.
  
  @param \MUtil_Model_Bridge_FormBridgeInterface $parentBridge
  @param string $name Name of element
  @param mixed $arrayOrKey1 \MUtil_Ra::pairs() name => value array
  @return \MUtil_Form_Element_Table
docstring_tokens: Adds a form multiple times in a table