function theme_imagepicker_browser in Image Picker 6.2
Same name and namespace in other branches
- 7 imagepicker.module \theme_imagepicker_browser()
2 theme calls to theme_imagepicker_browser()
File
- ./
imagepicker.module, line 1377 - Enables permitted roles to upload images for insertion into configured nodes.
Code
function theme_imagepicker_browser($content, $forms = '', $message = '', $help = '', $label = '') {
$rows = $content[0];
$max = $content[1];
$cols = $content[2];
$pref1 = $content[3][0];
$pref2 = $content[3][1];
$suff1 = $content[4][0];
$suff2 = $content[4][1];
$output = $label ? '<fieldset><legend>' . $label . '</legend>' : '';
// forms
if ($forms) {
$output .= $forms['browse_search'];
$output .= $forms['browse_groups'];
$output .= $forms['browse_public'];
$output .= $forms['browse_public_groups'];
$output .= $forms['browse_order'];
}
if ($rows) {
// help message
if ($help) {
$output .= '<div class="imgp_help">' . $help . '</div>';
}
$pager = theme('pager', NULL, $max);
$output .= $pref1;
$ct = 0;
foreach ($rows as $row) {
$tooltip = $row['img_name'] . ': ' . $row['img_title'] . ' ' . $row['img_description'];
$imglink = '<img src="' . $row['imgpath'] . '" alt="' . $row['img_title'] . '" title="' . $tooltip . '" />';
$output .= $pref2 . l($imglink, $row['imgurl'] . $row['img_id'], array(
'html' => TRUE,
)) . $suff2;
$ct++;
if ($cols > 0 && $ct >= $cols) {
$output .= $suff1 . $pref1;
$ct = 0;
}
}
$output .= $suff1 . $pager;
}
else {
$output .= '<div class="messages">' . $message . '</div>';
}
$output .= $label ? '</fieldset>' : '';
return $output;
}