code/control/KapostService.php
protected function getUsersBlogs($app_id) {
        if(SiteConfig::has_extension('SiteConfigSubsites')) {
            $response=array();
            
            //Disable subsite filter
            Subsite::disable_subsite_filter();
            
            $subsites=Subsite::get();
            foreach($subsites as $subsite) {
                $response[]=array(
                                'blogid'=>$subsite->ID,
                                'blogname'=>$subsite->Title
                            );
            }
            
            //Re-enable subsite filter
            Subsite::disable_subsite_filter(false);
            
            return $response;
        }
        
        
        $siteConfig=SiteConfig::current_site_config();
        return array(
                    array(
                        'blogid'=>$siteConfig->ID,
                        'blogname'=>$siteConfig->Title
                    )
                );
    }
protected function getUsersBlogs($app_id) {
        if(SiteConfig::has_extension('SiteConfigSubsites')) {
            $response=array();
            
            //Disable subsite filter
            Subsite::disable_subsite_filter();
            
            $subsites=Subsite::get();
            foreach($subsites as $subsite) {
                $response[]=array(
                                'blogid'=>$subsite->ID,
                                'blogname'=>$subsite->Title
                            );
            }
            
            //Re-enable subsite filter
            Subsite::disable_subsite_filter(false);
            
            return $response;
        }
        
        
        $siteConfig=SiteConfig::current_site_config();
        return array(
                    array(
                        'blogid'=>$siteConfig->ID,
                        'blogname'=>$siteConfig->Title
                    )
                );
    }
protected function getUsersBlogs ( $ app_id ) { if ( SiteConfig :: has_extension ( 'SiteConfigSubsites' ) ) { $ response = array ( ) ; //Disable subsite filter Subsite :: disable_subsite_filter ( ) ; $ subsites = Subsite :: get ( ) ; foreach ( $ subsites as $ subsite ) { $ response [ ] = array ( 'blogid' => $ subsite -> ID , 'blogname' => $ subsite -> Title ) ; } //Re-enable subsite filter Subsite :: disable_subsite_filter ( false ) ; return $ response ; } $ siteConfig = SiteConfig :: current_site_config ( ) ; return array ( array ( 'blogid' => $ siteConfig -> ID , 'blogname' => $ siteConfig -> Title ) ) ; }
Gets the site config or subsites for the current site
@return array Nested array of sites
Gets the site config or subsites for the current site