*
*
*/
function snautofollow_install() {
register_hook('connector_settings', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings');
register_hook('connector_settings_post', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings_post');
}
function snautofollow_uninstall() {
unregister_hook('connector_settings', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings');
unregister_hook('connector_settings_post', 'addon/snautofollow/snautofollow.php', 'snautofollow_settings_post');
}
function snautofollow_settings_post($a,$post) {
if(! local_user() || (! x($_POST,'snautofollow-submit')))
return;
set_pconfig(local_user(),'system','ostatus_autofriend',intval($_POST['snautofollow']));
info( t('StatusNet AutoFollow settings updated.') . EOL);
}
function snautofollow_settings(&$a,&$s) {
if(! local_user())
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 */
$snautofollow = get_pconfig(local_user(),'system','ostatus_autofriend');
if($snautofollow === false)
$snautofollow = false;
$snautofollow_checked = (($snautofollow) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
$s .= '';
$s .= '' . t('StatusNet AutoFollow Settings') . '
';
$s .= '';
$s .= '