diff options
Diffstat (limited to 'plugins/UserFlag/UserFlagPlugin.php')
-rw-r--r-- | plugins/UserFlag/UserFlagPlugin.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index fe4a74869..4d8671c72 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -48,16 +48,7 @@ class UserFlagPlugin extends Plugin $schema = Schema::get(); // For storing user-submitted flags on profiles - - $schema->ensureTable('user_flag_profile', - array(new ColumnDef('profile_id', 'integer', null, - false, 'PRI'), - new ColumnDef('user_id', 'integer', null, - false, 'PRI'), - new ColumnDef('created', 'datetime', null, - false, 'MUL'), - new ColumnDef('cleared', 'datetime', null, - true, 'MUL'))); + $schema->ensureDataObject('User_flag_profile'); return true; } @@ -122,7 +113,11 @@ class UserFlagPlugin extends Plugin 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); $form->show(); } @@ -140,4 +135,12 @@ class UserFlagPlugin extends Plugin 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; + } } |