- Patch #373177 by Moshe Weitzman: node upload table should use late rendering.

merge-requests/26/head
Dries Buytaert 2009-03-25 16:43:02 +00:00
parent 3da1418d06
commit 617ccc1da3
1 changed files with 5 additions and 4 deletions

View File

@ -28,7 +28,7 @@ function upload_help($path, $arg) {
function upload_theme() {
return array(
'upload_attachments' => array(
'arguments' => array('files' => NULL),
'arguments' => array('elements' => NULL),
),
'upload_form_current' => array(
'arguments' => array('form' => NULL),
@ -347,7 +347,8 @@ function upload_node_view($node, $teaser, $page) {
if (count($node->files)) {
if (!$teaser) {
$node->content['files'] = array(
'#markup' => theme('upload_attachments', $node->files),
'#files' => $node->files,
'#theme' => 'upload_attachments',
'#weight' => 50,
);
}
@ -442,10 +443,10 @@ function upload_node_rss_item($node) {
*
* @ingroup themeable
*/
function theme_upload_attachments($files) {
function theme_upload_attachments($elements) {
$header = array(t('Attachment'), t('Size'));
$rows = array();
foreach ($files as $file) {
foreach ($elements['#files'] as $file) {
$file = (object)$file;
if ($file->list && empty($file->remove)) {
$href = file_create_url($file->filepath);