summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-12-08 00:55:11 -0500
committerEvan Prodromou <evan@controlyourself.ca>2008-12-08 00:55:11 -0500
commit9b4df5056f2dba6b6fa7ac392c2114fd3c1400a0 (patch)
tree58d4bf8057559b3175ade6f25908ce8da194091d /lib/util.php
parent71b682453d558de25592bbf9633fc214e94b6067 (diff)
add block form to subscribers list and profile page
I added a small form for blocking users to profiles in the profile list, and also to the profile page. I also added an action to handle the results of blocking someone. This required some changes to the profile list class (so I could add the block form), so I made them. And the gallery class lets its subclasses return a subclass of ProfileList for their profile list. darcs-hash:20081208055511-5ed1f-e2e09986bd3b9cbb6a00a0c6b94f49ea78b7bdab.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 4fb58e7dc..df736cf01 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -2183,3 +2183,20 @@ function common_compatible_license($from, $to) {
# XXX: better compatibility check needed here!
return ($from == $to);
}
+
+function common_block_form($profile) {
+ common_element_start('form', array('id' => 'block-' . $profile->id,
+ 'method' => 'post',
+ 'class' => 'block',
+ 'action' => common_local_url('block')));
+ common_hidden('token', common_session_token());
+ common_element('input', array('id' => 'blockto-' . $profile->id,
+ 'name' => 'blockto',
+ 'type' => 'hidden',
+ 'value' => $profile->id));
+ common_element('input', array('type' => 'submit',
+ 'class' => 'submit',
+ 'value' => _('Block')));
+ common_element_end('form');
+ return;
+}