Цитата:
Сообщение от Sergey M Nikitin
|
а может использовать чтото подобное этому
Код:
* lib.members = CONTENT
* lib.members {
* select {
* pidInList = {$styles.content.loginform.pid}
* orderBy = tx_lglalv_mysorting,uid
* }
* table = fe_users
* renderObj = USER
* renderObj {
* userFunc = tx_templavoila_pi1->main_record
* ds = 2
* to = 4
* table = fe_users
* }
* }
PHP код:
function main_record($content, $conf) {
$this->initVars($conf);
// Make a copy of the data, do not spoil original!
$data = $this->cObj->data;
// setup ds/to
$data['tx_templavoila_ds'] = $conf['ds'];
$data['tx_templavoila_to'] = $conf['to'];
// prepare fake flexform
$values = array();
foreach ($data as $k => $v) {
// Make correct language identifiers here!
if ($GLOBALS['TSFE']->sys_language_isocode) {
$srcPointer = $data['tx_templavoila_ds'];
if (t3lib_div::testInt($srcPointer)) { // If integer, then its a record we will look up:
$DSrec = $GLOBALS['TSFE']->sys_page->checkRecord('tx_templavoila_datastructure', $srcPointer);
$DS = t3lib_div::xml2array($DSrec['dataprot']);
} else { // Otherwise expect it to be a file:
$file = t3lib_div::getFileAbsFileName($srcPointer);
if ($file && @is_file($file)) {
$DS = t3lib_div::xml2array(t3lib_div::getUrl($file));
}
}
if (is_array($DS)) {
$langChildren = $DS['meta']['langChildren'] ? 1 : 0;
$langDisabled = $DS['meta']['langDisable'] ? 1 : 0;
$lKey = (!$langDisabled && !$langChildren) ? 'l'.$GLOBALS['TSFE']->sys_language_isocode : 'lDEF';
$vKey = (!$langDisabled && $langChildren) ? 'v'.$GLOBALS['TSFE']->sys_language_isocode : 'vDEF';
}
else {
return $this->formatError('
Couldn\'t find a Data Structure set with uid/file='.$conf['ds'].'
Please put correct DS and TO into your TS setup first.');
}
}
else {
$lKey = 'lDEF'; $vKey = 'vDEF';
}
$values['data']['sDEF'][$lKey][$k][$vKey] = $v;
}
$ff = t3lib_div::makeInstance('t3lib_flexformtools');
$data['tx_templavoila_flex'] = $ff->flexArray2xml($values);
return $this->renderElement($data, $conf['table']);
}
это отсюда
http://209.85.129.132/search?q=cache...ient=firefox-a
кажеться это стандартная функция в ТВ но как гласит коментарий она не задокументована.
на сколько я понял там можна задать ТО и ДС через которые можно прорендерить только часть полей которые мне нужны, а это ли не то что мне нужно?или я ошибаюсь
если обладателю ответа не влом-напишите плз. более менее работоспобный код ,ато я не потяну ковыряться в пхп.