From fc2f3ef757baa1fd0b16b3fe2a0f456b67b591f1 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Tue, 28 Aug 2012 09:17:35 +0200 Subject: [PATCH] jappixmini: made the settings strings translateable and the insertion of the chat widget optional --- jappixmini/jappixmini.php | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 5d6f8446..df0d474e 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -221,6 +221,8 @@ function jappixmini_settings(&$a, &$s) { $activate = get_pconfig(local_user(),'jappixmini','activate'); $activate = intval($activate) ? ' checked="checked"' : ''; + $insertchat = get_pconfig(local_user(),'jappixmini','insertchat'); + $insertchat = intval($insertchat) ? ' checked="checked"' : ''; $username = get_pconfig(local_user(),'jappixmini','username'); $username = htmlentities($username); @@ -261,46 +263,49 @@ function jappixmini_settings(&$a, &$s) { $s .= '
'; - $s .= '

Jappix Mini addon settings

'; + $s .= '

'.t('Jappix Mini addon settings').'

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; + $s .= ''; + $s .= '
'; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= ' '; $s .= '
'; $onchange = "document.getElementById('jappixmini-friendica-password').disabled = !this.checked;jappixmini_set_password();"; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ' '; $s .= '
'; if ($info_text) $s .= '
Configuration help:

'.$info_text.'

'; $s .= '
Status:

Addon knows '.$address_cnt.' Jabber addresses of '.$contact_cnt.' Friendica contacts (takes some time, usually 10 minutes, to update).

'; $s .= ''; - $s .= ' '; + $s .= ' '; $s .= '
'; $s .= '
'; @@ -379,6 +384,7 @@ function jappixmini_settings_post(&$a,&$b) { set_pconfig($uid,'jappixmini','autosubscribe',intval($b['jappixmini-autosubscribe'])); set_pconfig($uid,'jappixmini','autoapprove',intval($b['jappixmini-autoapprove'])); set_pconfig($uid,'jappixmini','activate',intval($b['jappixmini-activate'])); + set_pconfig($uid,'jappixmini','insertchat',intval($b['jappixmini-insertchat'])); set_pconfig($uid,'jappixmini','encrypt',$encrypt); info( 'Jappix Mini settings saved.' ); @@ -395,7 +401,8 @@ function jappixmini_script(&$a,&$s) { if(! local_user()) return; $activate = get_pconfig(local_user(),'jappixmini','activate'); - if (!$activate) return; + $insertchat = get_pconfig(local_user(), 'jappixmini','insertchat'); + if (!$activate or !$insertchat) return; $a->page['htmlhead'] .= ''."\r\n"; $a->page['htmlhead'] .= ''."\r\n";