| 1 |
<?php |
<?php |
| 2 |
// $Id: taxonomy_image_blocks.module,v 1.1.2.18 2009/02/16 18:01:19 nancyw Exp $ |
// $Id: taxonomy_image_blocks.module,v 1.1.2.19 2009/03/13 17:27:27 nancyw Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Add a block to show the images attached to the terms of a node. |
* Add a block to show the images attached to the terms of a node. |
| 70 |
$edit_link = NULL; |
$edit_link = NULL; |
| 71 |
} |
} |
| 72 |
|
|
| 73 |
$rows[] = array(l($img, $term_path, array('html' => TRUE)) . $name_link . $edit_link); |
$rows[] = theme('taxonomy_image_block_rows', $img, $term_path, $name_link, $edit_link); |
| 74 |
++$count; |
++$count; |
| 75 |
} |
} |
| 76 |
// Have we hit the limit? |
// Have we hit the limit? |
| 88 |
); |
); |
| 89 |
$block = array( |
$block = array( |
| 90 |
'subject' => strtr(variable_get('taxonomy_image_block_title', 'Term Images for "@title"'), $subs), |
'subject' => strtr(variable_get('taxonomy_image_block_title', 'Term Images for "@title"'), $subs), |
| 91 |
'content' => theme('table', array() , $rows, array('id' => 'taxonomy_image_terms')), |
'content' => theme('taxonomy_image_block', $rows), |
| 92 |
); |
); |
| 93 |
} |
} |
| 94 |
break; |
break; |
| 232 |
} |
} |
| 233 |
} |
} |
| 234 |
} |
} |
| 235 |
|
|
| 236 |
|
function taxonomy_image_blocks_theme($existing, $type, $theme, $path) { |
| 237 |
|
return array( |
| 238 |
|
'taxonomy_image_block' => array( |
| 239 |
|
'arguments' => array('rows' => NULL), |
| 240 |
|
), |
| 241 |
|
'taxonomy_image_block_rows' => array( |
| 242 |
|
'arguments' => array('img' => NULL, 'term_path' => NULL, 'name_link' => NULL, 'edit_link' => NULL, ), |
| 243 |
|
), |
| 244 |
|
); |
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
function theme_taxonomy_image_block($rows) { |
| 248 |
|
return theme('table', array() , $rows, array('id' => 'taxonomy-image-terms')); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
function theme_taxonomy_image_block_rows($img, $term_path, $name_link, $edit_link) { |
| 252 |
|
return array(l($img, $term_path, array('html' => true)) . $name_link . $edit_link); |
| 253 |
|
} |