allow to prefill - url/poke?f=&c=nn - nn is contact id
This commit is contained in:
parent
1a75507f78
commit
d1243c9ad7
2 changed files with 20 additions and 3 deletions
19
mod/poke.php
19
mod/poke.php
|
@ -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;
|
||||
|
|
|
@ -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 />
|
||||
|
|
Loading…
Reference in a new issue