public function addProfileButton($name, $options = null)
    {
        if (null === $options) {
            $options['label'] = ucfirst($name);
        } elseif (is_string($options)) {
            $options = array('label' => $options);
        }
        
        if (!isset($options['fetch_url'])) {
            $options['fetch_url'] = sprintf($this->fetchUrl, $name);
        }
        
        if (!isset($options['preview_url']) && $this->previewUrl) {
            $options['preview_url'] = sprintf($this->previewUrl, $options['label']);
        }
        
        if (!isset($options['icon'])) {
            $options['icon'] = $name;
        }

        $options['disable_capable']['description'] = sprintf(
            /*@translate*/ 'Allow users to attach their %s profile.',
            $options['label']
        );
        
        $this->add(
            array(
            'type' => 'Auth/SocialProfilesButton',
            'name' => $name,
            'options' => $options,
            )
        );
        return $this;
    }
public function addProfileButton($name, $options = null)
    {
        if (null === $options) {
            $options['label'] = ucfirst($name);
        } elseif (is_string($options)) {
            $options = array('label' => $options);
        }
        
        if (!isset($options['fetch_url'])) {
            $options['fetch_url'] = sprintf($this->fetchUrl, $name);
        }
        
        if (!isset($options['preview_url']) && $this->previewUrl) {
            $options['preview_url'] = sprintf($this->previewUrl, $options['label']);
        }
        
        if (!isset($options['icon'])) {
            $options['icon'] = $name;
        }

        $options['disable_capable']['description'] = sprintf(
            /*@translate*/ 'Allow users to attach their %s profile.',
            $options['label']
        );
        
        $this->add(
            array(
            'type' => 'Auth/SocialProfilesButton',
            'name' => $name,
            'options' => $options,
            )
        );
        return $this;
    }
public function addProfileButton ( $ name , $ options = null ) { if ( null === $ options ) { $ options [ 'label' ] = ucfirst ( $ name ) ; } elseif ( is_string ( $ options ) ) { $ options = array ( 'label' => $ options ) ; } if ( ! isset ( $ options [ 'fetch_url' ] ) ) { $ options [ 'fetch_url' ] = sprintf ( $ this -> fetchUrl , $ name ) ; } if ( ! isset ( $ options [ 'preview_url' ] ) && $ this -> previewUrl ) { $ options [ 'preview_url' ] = sprintf ( $ this -> previewUrl , $ options [ 'label' ] ) ; } if ( ! isset ( $ options [ 'icon' ] ) ) { $ options [ 'icon' ] = $ name ; } $ options [ 'disable_capable' ] [ 'description' ] = sprintf ( /*@translate*/ 'Allow users to attach their %s profile.' , $ options [ 'label' ] ) ; $ this -> add ( array ( 'type' => 'Auth/SocialProfilesButton' , 'name' => $ name , 'options' => $ options , ) ) ; return $ this ; }
Adds a profile button.

if <b>$options</b> is null, the <b>$name</b> will be used as label.
if <b>$options</b> is a string, this string will be used as label.
if <b>$options</b> is an array, it must provide a key 'label'.

@param string $name
@param null|string|array $options
@return self
Adds a profile button .