allow to prefill - url/poke?f=&c=nn - nn is contact id
This commit is contained in:
parent
1a75507f78
commit
d1243c9ad7
19
mod/poke.php
19
mod/poke.php
@ -107,6 +107,21 @@ function poke_content(&$a) {
|
|||||||
return;
|
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();
|
$base = $a->get_baseurl();
|
||||||
|
|
||||||
$a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
|
$a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
|
||||||
@ -146,7 +161,9 @@ EOT;
|
|||||||
'$clabel' => t('Recipient'),
|
'$clabel' => t('Recipient'),
|
||||||
'$choice' => t('Choose what you wish to do to recipient'),
|
'$choice' => t('Choose what you wish to do to recipient'),
|
||||||
'$verbs' => $shortlist,
|
'$verbs' => $shortlist,
|
||||||
'$submit' => t('Submit')
|
'$submit' => t('Submit'),
|
||||||
|
'$name' => $name,
|
||||||
|
'$id' => $id
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
<div id="poke-recip-label">$clabel</div>
|
<div id="poke-recip-label">$clabel</div>
|
||||||
<br />
|
<br />
|
||||||
<input id="recip" type="text" size="64" maxlength="255" value="" name="pokename" autocomplete="off">
|
<input id="recip" type="text" size="64" maxlength="255" value="$name" name="pokename" autocomplete="off">
|
||||||
<input id="recip-complete" type="hidden" value="" name="cid">
|
<input id="recip-complete" type="hidden" value="$id" name="cid">
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user