/** * Add the elements from the model to the bridge for the current step * * @param \MUtil_Model_Bridge_FormBridgeInterface $bridge * @param \MUtil_Model_ModelAbstract $model */ protected function addStep3(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) { if ($this->loadSourceModel()) { $this->displayHeader($bridge, $this->_('Upload successful!')); $this->displayErrors($bridge, $this->_('Check the input visually.')); // \MUtil_Echo::track($this->sourceModel->load()); $element = $bridge->getForm()->createElement('html', 'importdisplay'); $repeater = \MUtil_Lazy::repeat(new \LimitIterator($this->sourceModel->loadIterator(), 0, 20)); $table = new \MUtil_Html_TableElement($repeater, array('class' => $this->formatBoxClass)); foreach ($this->sourceModel->getItemsOrdered() as $name) { $table->addColumn($repeater->{$name}, $name); } // Extra div for CSS settings $element->setValue(new \MUtil_Html_HtmlElement('div', $table, array('class' => $this->formatBoxClass))); $bridge->addElement($element); } else { $this->displayHeader($bridge, $this->_('Upload error!')); $this->displayErrors($bridge); $this->nextDisabled = true; } }