src/Charcoal/Cms/Support/Traits/SocialNetworksAwareTrait.php
public function socialNetworks()
    {
        if ($this->socialNetworks) {
            return $this->socialNetworks;
        }

        $socials = json_decode($this->cmsConfig()['social_medias'], true);
        $configMeta = $this->configModel()->p('social_medias')->structureMetadata();

        foreach ($socials as $ident => $account) {
            $prefix = $configMeta->property($ident)['input_prefix'];
            $socials[$ident] = [
                'account' => $account,
                'prefix' => $prefix,
                'fullUrl' => $prefix.$account
            ];
        }

        $this->socialNetworks = $socials;

        return $this->socialNetworks;
    }
public function socialNetworks()
    {
        if ($this->socialNetworks) {
            return $this->socialNetworks;
        }

        $socials = json_decode($this->cmsConfig()['social_medias'], true);
        $configMeta = $this->configModel()->p('social_medias')->structureMetadata();

        foreach ($socials as $ident => $account) {
            $prefix = $configMeta->property($ident)['input_prefix'];
            $socials[$ident] = [
                'account' => $account,
                'prefix' => $prefix,
                'fullUrl' => $prefix.$account
            ];
        }

        $this->socialNetworks = $socials;

        return $this->socialNetworks;
    }
public function socialNetworks ( ) { if ( $ this -> socialNetworks ) { return $ this -> socialNetworks ; } $ socials = json_decode ( $ this -> cmsConfig ( ) [ 'social_medias' ] , true ) ; $ configMeta = $ this -> configModel ( ) -> p ( 'social_medias' ) -> structureMetadata ( ) ; foreach ( $ socials as $ ident => $ account ) { $ prefix = $ configMeta -> property ( $ ident ) [ 'input_prefix' ] ; $ socials [ $ ident ] = [ 'account' => $ account , 'prefix' => $ prefix , 'fullUrl' => $ prefix . $ account ] ; } $ this -> socialNetworks = $ socials ; return $ this -> socialNetworks ; }
Retrieve the websites's social presence.

@throws \Exception If the given context does not have access to config.
@return array
Retrieve the websites s social presence .