]> git.mxchange.org Git - friendica.git/commitdiff
allow to prefill - url/poke?f=&c=nn - nn is contact id
authorfriendica <info@friendica.com>
Fri, 20 Jul 2012 03:54:23 +0000 (20:54 -0700)
committerfriendica <info@friendica.com>
Fri, 20 Jul 2012 03:54:23 +0000 (20:54 -0700)
mod/poke.php
view/poke_content.tpl

index 851396e68b22bba972c6cb4c3e8247875705cd1c..f4660e624db2d4d86f71bee832b213795ee5e6cc 100644 (file)
@@ -107,6 +107,21 @@ function poke_content(&$a) {
                return;
        }
 
+       $name = '';
+       $id = '';
+
+       if(intval($_GET['c'])) {
+               $r = q("select id,name from contact where id = %d and uid = %d limit 1",
+                       intval($_GET['c']),
+                       intval(local_user())
+               );
+               if(count($r)) {
+                       $name = $r[0]['name'];
+                       $id = $r[0]['id'];
+               }
+       }
+
+
        $base = $a->get_baseurl();
 
        $a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
@@ -146,7 +161,9 @@ EOT;
                '$clabel' => t('Recipient'),
                '$choice' => t('Choose what you wish to do to recipient'),
                '$verbs' => $shortlist,
-               '$submit' => t('Submit')
+               '$submit' => t('Submit'),
+               '$name' => $name,
+               '$id' => $id
        ));
 
        return $o;
index 09b3d8db43b28992ca9ace57d41303b9ad05032c..f81d04c6c5e15f62850a8ec9ba1e778cad9258a1 100644 (file)
@@ -8,8 +8,8 @@
 
 <div id="poke-recip-label">$clabel</div>
 <br />
-<input id="recip" type="text" size="64" maxlength="255" value="" name="pokename" autocomplete="off">
-<input id="recip-complete" type="hidden" value="" name="cid">
+<input id="recip" type="text" size="64" maxlength="255" value="$name" name="pokename" autocomplete="off">
+<input id="recip-complete" type="hidden" value="$id" name="cid">
 
 <br />
 <br />