/** * Adds rows from the model to the bridge that creates the browse table. * * Overrule this function to add different columns to the browse table, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function addShowTableRows(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $items = $model->getItemsOrdered(); foreach ($items as $name) { if ($model->get($name, 'type') === \MUtil_Model::TYPE_CHILD_MODEL) { $this->submodel = $model->get($name, 'model'); $subitems = $this->submodel->getItemsOrdered(); } } if (isset($subitems) && is_array($subitems)) { $items = array_diff($items, $subitems); } foreach ($items as $name) { if ($label = $model->get($name, 'label')) { $bridge->addItem($name, $label); } } /*if ($subitems) { $bridge->addItem('gctt', 'moo'); }*/ if ($model->has('row_class')) { // Make sure deactivated rounds are show as deleted foreach ($bridge->getTable()->tbody() as $tr) { foreach ($tr as $td) { if ('td' === $td->tagName) { $td->appendAttrib('class', $bridge->row_class); } } } } }
/** * Adds rows from the model to the bridge that creates the browse table. * * Overrule this function to add different columns to the browse table, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function addShowTableRows(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { foreach ($model->getItemsOrdered() as $name) { if ($label = $model->get($name, 'label')) { $bridge->addItem($name, $label); } } if ($model->has('row_class')) { // Make sure deactivated rounds are show as deleted foreach ($bridge->getTable()->tbody() as $tr) { foreach ($tr as $td) { if ('td' === $td->tagName) { $td->appendAttrib('class', $bridge->row_class); } } } } }