public function getLanguages() {
        $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();
        $response['data']=array();
        
        foreach($languages as $lang) {
            if($lang->Hidden && $lang->Snippets()->Count()==0) {
                continue;
            }
            
            $response['data'][]=array(
                        'language'=>$lang->Name,
                        'file_extension'=>$lang->FileExtension,
                        'shjs_code'=>$lang->HighlightCode,
                        'hidden'=>$lang->Hidden,
                        'id'=>$lang->ID
                    );
        }
        
        return $response;
    }
public function getLanguages() {
        $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();
        $response['data']=array();
        
        foreach($languages as $lang) {
            if($lang->Hidden && $lang->Snippets()->Count()==0) {
                continue;
            }
            
            $response['data'][]=array(
                        'language'=>$lang->Name,
                        'file_extension'=>$lang->FileExtension,
                        'shjs_code'=>$lang->HighlightCode,
                        'hidden'=>$lang->Hidden,
                        'id'=>$lang->ID
                    );
        }
        
        return $response;
    }
public function getLanguages ( ) { $ 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 ( ) ; $ response [ 'data' ] = array ( ) ; foreach ( $ languages as $ lang ) { if ( $ lang -> Hidden && $ lang -> Snippets ( ) -> Count ( ) == 0 ) { continue ; } $ response [ 'data' ] [ ] = array ( 'language' => $ lang -> Name , 'file_extension' => $ lang -> FileExtension , 'shjs_code' => $ lang -> HighlightCode , 'hidden' => $ lang -> Hidden , 'id' => $ lang -> ID ) ; } return $ response ; }
Gets the list of languages
@return {array} Standard response base
Gets the list of languages