zasobObj (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($zasobObj);echo''; $userAcl = User::getAcl(); $userAcl->fetchGroups(); //echo'
'; if (!$userAcl->hasTableAcl($zasobObj->ID)) { die("Brak uprawnień do tabeli ID={$zasobObj->ID}"); } $tblAcl = $userAcl->getTableAcl($zasobObj->ID); //echo'tblAcl (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($tblAcl);echo''; $forceTblAclInit = ('1' == V::get('_force', '', $_GET)); $tblAcl->init($forceTblAclInit); if($DBG){echo'
post (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($_POST);echo'';}
if($DBG){echo'get (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($_GET);echo'';}
$exportFlds = V::get('flds', '', $_GET);
$exportFldList = explode(',', $exportFlds);
if (!$exportFlds || 0 == count($exportFldList)) {
echo "Nie wybrano żandych pól do exportu.";
return;
}
$dataSource = $tblAcl->getExportDataSource($exportFldList);
if($DBG){echo'dataSource (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($dataSource);echo'';}
$args = $_GET;
$currSortCol = V::get('sortCol', '', $args);
$currSortFlip = V::get('sortDir', '', $args);
$params = array();
$params['limit'] = $exportLimit;
// $params['limitstart'] = 0;
$params['order_by'] = ($currSortCol)? $currSortCol : '';
$params['order_dir'] = $currSortFlip;
foreach ($args as $k => $v) {
if (strlen($k) > 3 && substr($k, 0, 2) == 'f_' && strlen($v) > 0) {// filter prefix
$params[$k] = $v;
}
else if (strlen($k) > 4 && substr($k, 0, 3) == 'sf_' && strlen($v) > 0) {// special filter prefix
$params[$k] = $v;
}
}
if($DBG){echo'params (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($params);echo'';} $total = $dataSource->getTotal($params); if($DBG){echo'
total (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($total);echo'';} if ($total > $exportLimit) { $params['limit'] = $exportLimit; } $items = $dataSource->getItems($params); if($DBG){echo'
items (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($items);echo'';}
$flds = reset($items);
$flds = get_object_vars($flds);
$flds = array_keys($flds);
$labels = array();
foreach ($flds as $fldName) {
$fldId = $tblAcl->getFieldIdByName($fldName);
$label = $tblAcl->getFieldLabel($fldId);
$labels[$fldName] = ($label)? $label : $fldName;
}
$format = V::get('format', 'html', $_GET);
if ('html' == $format) {
?>
| {$fldName}; ?> |