function _smileys_select_table in Smileys 6
Same name and namespace in other branches
- 5 smileys.module \_smileys_select_table()
2 calls to _smileys_select_table()
File
- ./
smileys.module, line 150
Code
function _smileys_select_table($promoted = false) {
$content = '';
$show_titles = variable_get('smileys_dialog_titles', TRUE) && !$promoted;
if ($promoted == true) {
$list = _smileys_list(1, " WHERE promote_to_box='1' ORDER BY weight");
_smileys_list(1);
}
else {
$list = _smileys_list(0, " WHERE promote_to_box='0' ORDER by weight");
}
$first_package = NULL;
if (!empty($show_titles)) {
$first_package = $list[0]->package;
$content .= '<fieldset><legend class="smileyPackageTitle">' . check_plain($first_package) . '</legend>';
}
foreach ($list as $smiley) {
$acronyms = explode(' ', $smiley->acronyms);
if ($smiley->package != $first_package && !empty($show_titles)) {
$content .= '</fieldset><fieldset><legend class="smileyPackageTitle">' . check_plain($smiley->package) . '</legend>';
$first_package = $smiley->package;
}
$content .= '<span>';
$content .= theme_image($smiley->image, $acronyms[0], $smiley->description . ' — ' . $smiley->acronyms, array(
'class' => 'smiley-class',
));
$content .= '</span>';
}
$content .= !empty($show_titles) ? '</fieldset>' : '';
return $content . (!$promoted ? '<br /><br />' : '');
}