]> git.mxchange.org Git - friendica-addons.git/blobdiff - jappixmini/jappixmini.php
Merge pull request #312 from annando/1509-pumpio-sync
[friendica-addons.git] / jappixmini / jappixmini.php
index 5f5c53e3921809800905818586c5874cc1b572f2..08d821128db7c34d3ce0507d2db4c40566ebf593 100644 (file)
@@ -294,10 +294,14 @@ function jappixmini_settings(&$a, &$s) {
         $a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/jappixmini/lib.js"></script>'."\r\n";
     }
 
-    $s .= '<div class="settings-block">';
+    $s .= '<span id="settings_jappixmini_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_jappixmini_expanded\'); openClose(\'settings_jappixmini_inflated\');">';
+    $s .= '<h3>'.t('Jappix Mini').'</h3>';
+    $s .= '</span>';
+    $s .= '<div id="settings_jappixmini_expanded" class="settings-block" style="display: none;">';
+    $s .= '<span class="fakelink" onclick="openClose(\'settings_jappixmini_expanded\'); openClose(\'settings_jappixmini_inflated\');">';
+    $s .= '<h3>'.t('Jappix Mini').'</h3>';
+    $s .= '</span>';
 
-    $s .= '<h3>'.t('Jappix Mini addon settings').'</h3>';
-    $s .= '<div>';
     $s .= '<label for="jappixmini-activate">'.t('Activate addon').'</label>';
     $s .= ' <input id="jappixmini-activate" type="checkbox" name="jappixmini-activate" value="1"'.$activate.' />';
     $s .= '<br />';
@@ -311,7 +315,7 @@ function jappixmini_settings(&$a, &$s) {
     $s .= ' <input id="jappixmini-server" type="text" name="jappixmini-server" value="'.$server.'" />';
     $s .= '<br />';
 
-    if (defaultbosh == "") {
+    if ($defaultbosh == "") {
        $s .= '<label for="jappixmini-bosh">'.t('Jabber BOSH host').'</label>';
        $s .= ' <input id="jappixmini-bosh" type="text" name="jappixmini-bosh" value="'.$bosh.'" />';
        $s .= '<br />';
@@ -340,9 +344,8 @@ function jappixmini_settings(&$a, &$s) {
     $s .= '<br />';
     if ($info_text) $s .= '<br />Configuration help:<p style="margin-left:2em;">'.$info_text.'</p>';
     $s .= '<br />Status:<p style="margin-left:2em;">Addon knows '.$address_cnt.' Jabber addresses of '.$contact_cnt.' Friendica contacts (takes some time, usually 10 minutes, to update).</p>';
-    $s .= '<input type="submit" name="jappixmini-submit" value="' . t('Submit') . '" />';
+    $s .= '<input type="submit" name="jappixmini-submit" value="' . t('Save Settings') . '" />';
     $s .= ' <input type="button" value="'.t('Add contact').'" onclick="jappixmini_addon_subscribe();" />';
-    $s .= '</div>';
 
     $s .= '</div>';
 
@@ -436,6 +439,9 @@ function jappixmini_script(&$a,&$s) {
 
     if(! local_user()) return;
 
+    if ($_GET["mode"] == "minimal")
+       return;
+
     $activate = get_pconfig(local_user(),'jappixmini','activate');
     $dontinsertchat = get_pconfig(local_user(), 'jappixmini','dontinsertchat');
     if (!$activate or $dontinsertchat) return;
@@ -482,7 +488,8 @@ function jappixmini_script(&$a,&$s) {
                dbesc($dfrn_id),
                dbesc($dfrn_id)
        );
-       $name = $r[0]["name"];
+       if (count($r))
+               $name = $r[0]["name"];
 
         $value = $row['v'];
         $pos = strpos($value, ":");