Plugin Directory

Changeset 709902


Ignore:
Timestamp:
05/08/2013 02:13:16 PM (13 years ago)
Author:
Yuttadhammo
Message:

group actions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • buddypress-xml-rpc-receiver/trunk/bp-xmlrpc.php

    r709870 r709902  
    785785     *
    786786     *
    787      * @param array $args ($username, $password, $data['max'] )
     787     * @param array $args ($username, $password, $data['max', 'user', 'action', 'action_id'] )
    788788     *
    789789     * max = max to return
    790790     * user = true?for logged in user
    791      *
     791     * action performs some action on action_id first
    792792     *
    793793     * @return array groups;
     
    811811        if ( !$user = $this->login( $username, $password ) )
    812812            return $this->error;
     813
     814        $action_data = $data['action_data'];
     815        $action_id = $data['action_id'];
     816
     817        // actions
     818       
     819        if(isset($data['action'])) {
     820            switch($data['action']) {
     821                case 'join':
     822                    groups_join_group( $action_id, $bp->loggedin_user->id );
     823                    break;
     824                case 'leave':
     825                    groups_leave_group( $action_id, $bp->loggedin_user->id );
     826                    break;
     827                case 'delete':
     828                    groups_delete_group( $action_id );
     829                    break;
     830            }
     831        }
     832
    813833
    814834        $max = @$data['max']?(int)$data['max']:0;
Note: See TracChangeset for help on using the changeset viewer.