+ {
+ $this->showFlagButton($action, $profile,
+ array('action' => 'showstream',
+ 'nickname' => $profile->nickname));
+
+ return true;
+ }
+
+ /**
+ * Add a 'flag' button to profiles in a list
+ *
+ * @param ProfileListItem $item item being shown
+ *
+ * @return boolean hook result
+ */
+ function onEndProfileListItemActionElements($item)
+ {
+ list($action, $args) = $item->action->returnToArgs();
+ $args['action'] = $action;
+ $this->showFlagButton($item->action, $item->profile, $args);
+
+ return true;
+ }
+
+ /**
+ * Actually output a flag button. If the target profile has already been
+ * flagged by the current user, a null-action faux button is shown.
+ *
+ * @param Action $action
+ * @param Profile $profile
+ * @param array $returnToArgs
+ */
+ protected function showFlagButton($action, $profile, $returnToArgs)