\n";
}
/**
*
* Write the smileies to an (hidden) div
*
*/
if ($deactivated){
return;
}
else
{
if ($nobutton) {
$b .= "\t
\n";
} else {
$b .= "\t
\n";
}
}
$b .= $s . "\n";
$b .= "
\n";
/**
*
* Function to show and hide the smiley-list in the hidden div
*
*/
$b .= "\n";
}
/**
*
* Set the configuration
*
*/
function smileybutton_settings_post($a,$post) {
if(! local_channel())
return;
if($_POST['smileybutton-submit'])
set_pconfig(local_channel(),'smileybutton','nobutton',intval($_POST['smileybutton']));
set_pconfig(local_channel(),'smileybutton','deactivated',intval($_POST['deactivated']));
}
/**
*
* Add configuration-dialog to form
*
*/
function smileybutton_settings(&$a,&$s) {
if(! local_channel())
return;
/* Add our stylesheet to the page so we can make our settings look nice */
//$a->page['htmlhead'] .= '' . "\r\n";
/* Get the current state of our config variable */
$nobutton = get_pconfig(local_channel(),'smileybutton','nobutton');
$checked['nobutton'] = (($nobutton) ? 1 : false);
$deactivated = get_pconfig(local_channel(),'smileybutton','deactivated');
$checked['deactivated'] = (($deactivated) ? 1 : false);
/* Add some HTML to the existing form */
$sc .= replace_macros(get_markup_template('field_checkbox.tpl'), array(
'$field' => array('deactivated', t('Deactivate the feature'), $checked['deactivated'], '', array(t('No'),t('Yes'))),
));
$sc .= replace_macros(get_markup_template('field_checkbox.tpl'), array(
'$field' => array('smileybutton', t('Hide the button and show the smilies directly.'), $checked['nobutton'], '', array(t('No'),t('Yes'))),
));
$s .= replace_macros(get_markup_template('generic_addon_settings.tpl'), array(
'$addon' => array('smileybutton', t('Smileybutton Settings'), '', t('Submit')),
'$content' => $sc
));
}