public function getSnippets() {
        $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;
        }
        
        
        $languages=SnippetLanguage::get();
        foreach($languages as $lang) {
            if($lang->Snippets()->Count()>0) {
                $snippets=$this->overviewList($lang->Snippets()->filter('FolderID', 0), 'Title', 'ID', 'LanguageID');
                
                $response['data'][]=array(
                                        'id'=>$lang->ID,
                                        'language'=>$lang->Name,
                                        'folders'=>$this->mapFolders($lang->Folders()),
                                        'snippets'=>$snippets
                                    );
            }
        }
        
        
        return $response;
    }
public function getSnippets() {
        $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;
        }
        
        
        $languages=SnippetLanguage::get();
        foreach($languages as $lang) {
            if($lang->Snippets()->Count()>0) {
                $snippets=$this->overviewList($lang->Snippets()->filter('FolderID', 0), 'Title', 'ID', 'LanguageID');
                
                $response['data'][]=array(
                                        'id'=>$lang->ID,
                                        'language'=>$lang->Name,
                                        'folders'=>$this->mapFolders($lang->Folders()),
                                        'snippets'=>$snippets
                                    );
            }
        }
        
        
        return $response;
    }
public function getSnippets ( ) { $ 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 ; } $ languages = SnippetLanguage :: get ( ) ; foreach ( $ languages as $ lang ) { if ( $ lang -> Snippets ( ) -> Count ( ) > 0 ) { $ snippets = $ this -> overviewList ( $ lang -> Snippets ( ) -> filter ( 'FolderID' , 0 ) , 'Title' , 'ID' , 'LanguageID' ) ; $ response [ 'data' ] [ ] = array ( 'id' => $ lang -> ID , 'language' => $ lang -> Name , 'folders' => $ this -> mapFolders ( $ lang -> Folders ( ) ) , 'snippets' => $ snippets ) ; } } return $ response ; }
Gets a list of snippets in an array of languages
@return {array} Standard response base
Gets a list of snippets in an array of languages