lcollong
FabriKant d'applications web
Hi,
My app has a class to manipulate mySQL table outside regular forms (computations/updates/crons).
For pdf rendering, I need to load data "as Fabrik" in order to get rendered values. Thus the method I wrote :
Almost everything is rendered as if it was displayed in a form/details view (fabrikData contains an array with both raw values and rendered ones). Except a very basic dropdown. Both regular and raw value contain the same data. The raw one indeed. Can't get the corresponding label.
Did I forget something ?
Thanks
My app has a class to manipulate mySQL table outside regular forms (computations/updates/crons).
For pdf rendering, I need to load data "as Fabrik" in order to get rendered values. Thus the method I wrote :
PHP:
public function loadFabrikRow($rowid, $listid = 0){
$rowid = intval($rowid);
$listid = intval($listid);
if ($rowid < 1 ) {
$this->JLog('loadFabrikRow - rowid invalide : '.$rowid, JLog::ERROR, 'Synapse');
return false;
}
if ($listid < 1) $listid = intval($this->fabrikListId);
if ($listid < 1) {
$this->JLog('loadFabrikRow - listid invalide : '.$listid, JLog::ERROR, 'Synapse');
return false;
}
$formModel = JModelLegacy::getInstance('Form', 'FabrikFEModel');
$formModel->setId($listid);
$listModel = $formModel->getlistModel();
$row = $listModel->getRow($rowid, true, true);
$this->fabrikData = is_object($row) ? FArrayHelper::fromObject($row, true) : $row;
// echo "<pre>";print_r($row);echo "</pre>";
return $this->fabrikData;
}
Almost everything is rendered as if it was displayed in a form/details view (fabrikData contains an array with both raw values and rendered ones). Except a very basic dropdown. Both regular and raw value contain the same data. The raw one indeed. Can't get the corresponding label.
Did I forget something ?
Thanks