/** * Apply TD parameters to appropriate template * * You can pass row template to use too. That's useful to set up totals rows, for example. * * @param string $field Fieldname * @param SQLite $row_template Optional row template * * @return void */ function applyTDParams($field, &$row_template = null) { // data row template by default if (!$row_template) { $row_template =& $this->row_t; } // setting cell parameters (tdparam) $tdparam = @$this->tdparam[$this->getCurrentIndex()][$field]; $tdparam_str = ''; if (is_array($tdparam)) { if (is_array($tdparam['style'])) { $tdparam_str .= 'style="'; foreach ($tdparam['style'] as $key => $value) { $tdparam_str .= $key . ':' . $value . ';'; } $tdparam_str .= '" '; unset($tdparam['style']); } //walking and combining string foreach ($tdparam as $id => $value) { $tdparam_str .= $id . '="' . $value . '" '; } // set TD param to appropriate row template $row_template->set("tdparam_{$field}", trim($tdparam_str)); } }