public function getSnippetRevisions($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        //Ensure logged in
        if(!Permission::check('CODE_BANK_ACCESS')) {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.PERMISSION_DENINED', '_Permission Denied');
            
            return $response;
        }
        
        
        $snippet=Snippet::get()->byID($data->id);
        if(!empty($snippet) && $snippet!==false && $snippet->ID!=0) {
            $revisions=$snippet->Versions()->map('ID', 'Created');
            
            $i=0;
            foreach($revisions as $id=>$date) {
                $response['data'][]=array(
                                        'id'=>$id,
                                        'date'=>($i==0 ? '{Current Revision}':$date)
                                    );
                $i++;
            }
        }else {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.SNIPPET_NOT_FOUND', '_Snippet not found');
        }
        
        return $response;
    }
public function getSnippetRevisions($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        //Ensure logged in
        if(!Permission::check('CODE_BANK_ACCESS')) {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.PERMISSION_DENINED', '_Permission Denied');
            
            return $response;
        }
        
        
        $snippet=Snippet::get()->byID($data->id);
        if(!empty($snippet) && $snippet!==false && $snippet->ID!=0) {
            $revisions=$snippet->Versions()->map('ID', 'Created');
            
            $i=0;
            foreach($revisions as $id=>$date) {
                $response['data'][]=array(
                                        'id'=>$id,
                                        'date'=>($i==0 ? '{Current Revision}':$date)
                                    );
                $i++;
            }
        }else {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.SNIPPET_NOT_FOUND', '_Snippet not found');
        }
        
        return $response;
    }
public function getSnippetRevisions ( $ data ) { $ response = CodeBank_ClientAPI :: responseBase ( ) ; //Ensure logged in if ( ! Permission :: check ( 'CODE_BANK_ACCESS' ) ) { $ response [ 'status' ] = 'EROR' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.PERMISSION_DENINED' , '_Permission Denied' ) ; return $ response ; } $ snippet = Snippet :: get ( ) -> byID ( $ data -> id ) ; if ( ! empty ( $ snippet ) && $ snippet !== false && $ snippet -> ID != 0 ) { $ revisions = $ snippet -> Versions ( ) -> map ( 'ID' , 'Created' ) ; $ i = 0 ; foreach ( $ revisions as $ id => $ date ) { $ response [ 'data' ] [ ] = array ( 'id' => $ id , 'date' => ( $ i == 0 ? '{Current Revision}' : $ date ) ) ; $ i ++ ; } } else { $ response [ 'status' ] = 'EROR' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.SNIPPET_NOT_FOUND' , '_Snippet not found' ) ; } return $ response ; }
Gets a revisions of the snippet
@param {stdClass} $data Data passed from ActionScript
@return {array} Standard response base
Gets a revisions of the snippet