$action->elementStart('li', 'entity_flag');
if (User_flag_profile::exists($profile->id, $user->id)) {
- $action->element('p', array(),
- _('Flagged for review'));
+ $action->element('p', 'flagged', _('Flagged'));
} else {
$form = new FlagProfileForm($action, $profile,
array('action' => 'showstream',
if (!empty($user)) {
- $form = new FlagProfileForm($item->action, $item->profile);
+ list($action, $args) = $item->action->returnToArgs();
+ $args['action'] = $action;
+
+ $form = new FlagProfileForm($item->action, $item->profile, $args);
+
+ $item->action->elementStart('li', 'entity_flag');
$form->show();
+ $item->action->elementEnd('li');
}
return true;
function onEndShowStatusNetStyles($action)
{
- $action->elementStart('style', array('type' => 'text/css'));
- $action->raw('.entity_flag input, .entity_flag p {'.
- ' background:url('.common_path('plugins/UserFlag/flag.gif').') 5px 5px no-repeat;'.
- ' }');
- $action->elementEnd('style');
+ $action->cssLink(common_path('plugins/UserFlag/userflag.css'),
+ null, 'screen, projection, tv');
+ return true;
+ }
+ function onEndShowScripts($action)
+ {
+ $action->elementStart('script', array('type' => 'text/javascript'));
+ $action->raw('/*<![CDATA[*/ SN.U.FormXHR($(".form_entity_flag")); /*]]>*/');
+ $action->elementEnd('script');
return true;
}
}