Project

General

Profile

Feature #15524 » bug2421-renderUploads.diff

Administrator Admin, 2009-05-15 12:07

View differences:

typo3/sysext/css_styled_content/static/v3.9/setup.txt (working copy)
20 = USER
20.userFunc = tx_cssstyledcontent_pi1->render_uploads
20.field = media
20 {
entryRendering = COA
entryRendering {
wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*|
10 = TEXT
10.data = register:linkedIcon
10.if.isTrue.field = layout
10.wrap = <td class="csc-uploads-icon">|</td>
20 = COA
20.wrap = <td class="csc-uploads-fileName">|</td>
20.1 = TEXT
20.1.data = register:linkedFilename
20.1.wrap = <p>|</p>
20.2 = TEXT
20.2.data = register:description
20.2.wrap = <p class="csc-uploads-description">|</p>
20.2.required = 1
30 = TEXT
30.wrap = <td class="csc-uploads-fileSize">|</td>
30.data = register:filesize
30.if.isTrue.field = filelink_size
30.bytes = 1
30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
}
}
20.color {
default =
typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php (working copy)
}
}
// Now, lets render the list!
$tRows = array();
foreach($filesData as $key => $fileD) {
// Setting class of table row for odd/even rows:
$oddEven = $key%2 ? 'tr-odd' : 'tr-even';
// optionSplit applied to conf to allow differnt settings per file
$splitConf = $GLOBALS['TSFE']->tmpl->splitConfArray($conf, count($filesData));
// Render row, based on the "layout" setting
$tRows[]='
<tr class="'.$oddEven.'">'.($type>0 ? '
<td class="csc-uploads-icon">
'.$fileD['linkedFilenameParts'][0].'
</td>' : '').'
<td class="csc-uploads-fileName">
<p>'.$fileD['linkedFilenameParts'][1].'</p>'.
($fileD['description'] ? '
<p class="csc-uploads-description">'.htmlspecialchars($fileD['description']).'</p>' : '').'
</td>'.($this->cObj->data['filelink_size'] ? '
<td class="csc-uploads-fileSize">
<p>' . $this->cObj->stdWrap($fileD['filesize'], $conf['filesize.']) . '</p>
</td>' : '').'
</tr>';
// Now, lets render the list!
$outputEntries = array();
foreach($filesData as $key => $fileData) {
$GLOBALS['TSFE']->register['linkedIcon'] = $fileData['linkedFilenameParts'][0];
$GLOBALS['TSFE']->register['linkedFileName'] = $fileData['linkedFilenameParts'][1];
$GLOBALS['TSFE']->register['path'] = $fileData['path'];
$GLOBALS['TSFE']->register['description'] = $fileData['description'];
$GLOBALS['TSFE']->register['fileSize'] = $fileData['filesize'];
$GLOBALS['TSFE']->register['fileExtension'] = $fileData['fileextension'];
$outputEntries[] = $this->cObj->cObjGetSingle($splitConf[$key]['entryRendering'], $splitConf[$key]['entryRendering.']);
}
// Table tag params.
$tableTagParams = $this->getTableAttributes($conf,$type);
$tableTagParams['class'] = 'csc-uploads csc-uploads-'.$type;
if (isset($conf['outerWrap'])) {
// Wrap around the whole content
$outerWrap = $conf['outerWrap'];
} else {
// Table tag params
$tableTagParams = $this->getTableAttributes($conf,$type);
$tableTagParams['class'] = 'csc-uploads csc-uploads-'.$type;
$outerWrap = '<table ' . t3lib_div::implodeAttributes($tableTagParams) . '>|</table>';
}
// Compile it all into table tags:
$out = '
<table '.t3lib_div::implodeAttributes($tableTagParams).'>
'.implode('',$tRows).'
</table>';
$out = $this->cObj->wrap(implode('',$outputEntries), $outerWrap);;
}
// Calling stdWrap:
typo3/sysext/css_styled_content/static/setup.txt (working copy)
20 = USER
20.userFunc = tx_cssstyledcontent_pi1->render_uploads
20.field = media
20 {
# Rendering for each file (e.g. rows of the table) as a cObject
entryRendering = COA
entryRendering {
wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*|
10 = TEXT
10.data = register:linkedIcon
10.wrap = <td class="csc-uploads-icon">|</td>
10.if.isPositive.field = layout
20 = COA
20.wrap = <td class="csc-uploads-fileName">|</td>
20.1 = TEXT
20.1 {
data = register:linkedFileName
wrap = <p>|</p>
}
20.2 = TEXT
20.2 {
data = register:description
wrap = <p class="csc-uploads-description">|</p>
required = 1
}
30 = TEXT
30.if.isTrue.field = filelink_size
30.data = register:fileSize
30.wrap = <td class="csc-uploads-fileSize">|</td>
30.bytes = 1
30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
}
}
20.color {
default =
typo3/sysext/css_styled_content/static/v3.8/setup.txt (working copy)
20.userFunc = tx_cssstyledcontent_pi1->render_uploads
20.field = media
20 {
entryRendering = COA
entryRendering {
wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*|
10 = TEXT
10.data = register:linkedIcon
10.if.isTrue.field = layout
10.wrap = <td class="csc-uploads-icon">|</td>
20 = COA
20.wrap = <td class="csc-uploads-fileName">|</td>
20.1 = TEXT
20.1.data = register:linkedFilename
20.1.wrap = <p>|</p>
20.2 = TEXT
20.2.data = register:description
20.2.wrap = <p class="csc-uploads-description">|</p>
20.2.required = 1
30 = TEXT
30.wrap = <td class="csc-uploads-fileSize">|</td>
30.data = register:filesize
30.if.isTrue.field = filelink_size
30.bytes = 1
30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
}
}
20.color {
default =
1 = #EDEBF1
typo3/sysext/css_styled_content/static/v4.2/setup.txt (working copy)
20.userFunc = tx_cssstyledcontent_pi1->render_uploads
20.field = media
20 {
entryRendering = COA
entryRendering {
wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*|
10 = TEXT
10.data = register:linkedIcon
10.if.isTrue.field = layout
10.wrap = <td class="csc-uploads-icon">|</td>
20 = COA
20.wrap = <td class="csc-uploads-fileName">|</td>
20.1 = TEXT
20.1.data = register:linkedFilename
20.1.wrap = <p>|</p>
20.2 = TEXT
20.2.data = register:description
20.2.wrap = <p class="csc-uploads-description">|</p>
20.2.required = 1
30 = TEXT
30.wrap = <td class="csc-uploads-fileSize">|</td>
30.data = register:filesize
30.if.isTrue.field = filelink_size
30.bytes = 1
30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
}
}
20.color {
default =
1 = #EDEBF1
(2-2/2)