Returns the main url of the given social network

@param string  $social

@return string
175136
public function getMainUrlFromName($social)
    {
        foreach ($this->getDefinitions() as $domain => $name) {

            if ($name == $social) {

                return $domain;
            }
        }
        return null;
    }
278908
public function getLogoFromUrl($domain)
    {
        $social = $this->getSocialNetworkFromDomain($domain);
        $socialNetworks = $this->getDefinitions();

        $filePattern = 'plugins/Morpheus/icons/dist/socials/%s.png';

        $socialDomains = array_keys($socialNetworks, $social);
        foreach ($socialDomains as $domain) {
            if (file_exists(PIWIK_INCLUDE_PATH . '/' . sprintf($filePattern, $domain))) {
                return sprintf($filePattern, $domain);
            }
        }

        return sprintf($filePattern, 'xx');
    }
1228905
public function url($name, array $parameters = [], $schemeRelative = false)
    {
        if ($name instanceof TreeNodeInterface) {
            return $this->router->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
        } elseif ($name instanceof ContentTreeContext) {
            return $this->router->generate($name->getNode(), $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
        } elseif ($name instanceof ElementStructureValue) {
            if ($name->getType() === 'link') {
                $link = $name->getValue();
                if ($link['type'] === 'internal' || $link['type'] === 'intrasiteroot') {
                    $tree = $this->contentTreeManager->findByTreeId($link['tid']);
                    if ($tree) {
                        $node = $tree->get($link['tid']);

                        return $this->router->generate($node, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
                    }
                } elseif ($link['type'] === 'external') {
                    return $link['url'];
                } elseif ($link['type'] === 'mailto') {
                    return 'mailto:'.$link['recipient'];
                }
            }
        } elseif (is_array($name) && isset($name['type']) && in_array($name['type'], array('internal', 'intrasiteroot', 'external', 'mailto'))) {
            $link = $name;
            if ($link['type'] === 'internal' || $link['type'] === 'intrasiteroot') {
                $tree = $this->contentTreeManager->findByTreeId($link['tid']);
                if ($tree) {
                    $node = $tree->get($link['tid']);

                    return $this->router->generate($node, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
                }
            } elseif ($link['type'] === 'external') {
                return $link['url'];
            } elseif ($link['type'] === 'mailto') {
                return 'mailto:'.$link['recipient'];
            }
        } elseif (strlen($name) && (is_int($name) || (int) $name)) {
            $tree = $this->contentTreeManager->findByTreeId((int) $name);
            if ($tree) {
                $node = $tree->get((int) $name);

                return $this->router->generate($node, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
            }
        } elseif (is_string($name)) {
            return $this->router->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
        }

        return '';
    }
128712
public function getUrl($includeQueryString = true)
    {
        $url = $this->getProtocol() . '://';
        $url .= $this->getHostname();

        $isAbnormalPort = ($this->isHttps() && $this->getPort() != 443) || (!$this->isHttps() && $this->getPort() != 80);

        if ($isAbnormalPort) {
            $url .= ':' . $this->getPort();
        }

        $url .= $this->getRequestUri($includeQueryString);
        return $url;
    }
669706
public function getUrl()
    {
        $url = self::BASE_FNS_URL . $this->getUrlPath();

        if ($this->getHttpMethod() === self::HTTP_METHOD_GET) {
            $url .= '?' . http_build_query($this->getPayload());
        }

        return $url;
    }
560626
public function getQueryUrl()
    {

        $uri = Zend_Gdata_Gapps::APPS_BASE_FEED_URI;
        $uri .= Zend_Gdata_Gapps::APPS_GROUP_PATH;
        $uri .= '/' . $this->_domain;
        if ($this->_groupId !== null) {
            $uri .= '/' . $this->_groupId;
        } else {
            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
            throw new Zend_Gdata_App_InvalidArgumentException(
                    'groupId must not be null');
        }

        $uri .= '/member';

        if ($this->_memberId !== null) {
            $uri .= '/' . $this->_memberId;
        }
        $uri .= $this->getQueryString();
        return $uri;
    }
79196
public function url() {
		$url = $this->client->endpoint() . $this->resource . '.json';
		if (in_array($this->method, ['GET', 'DELETE']) && $this->params !== null) {
			$url .= '?' . http_build_query($this->params);
		}
		return $url;
	}
1085708
protected function getWallGetRequestUrl( $limit = null ) {

        $query = http_build_query( [
            'owner_id'   => ArrayHelper::getValue( $this->serviceSettings, 'options.owner_id' ),
            'from_group' => ArrayHelper::getValue( $this->serviceSettings, 'options.from_group' ),
            'limit'      => $limit
        ] );

        return 'wall.get' . ( ! empty( $query ) ? "?" . $query : null );
    }
1314551
public function getCurrentShopUrl($admin = null)
    {
        if ($admin === null) {
            $admin = $this->isAdmin();
        }
        if ($admin) {
            if ($this->isSsl()) {
                $url = $this->getConfigParam('sAdminSSLURL');
                if (!$url) {
                    return $this->getSslShopUrl() . $this->getConfigParam('sAdminDir') . '/';
                }

                return $url;
            } else {
                return $this->getShopUrl() . $this->getConfigParam('sAdminDir') . '/';
            }
        } else {
            return $this->isSsl() ? $this->getSslShopUrl() : $this->getShopUrl();
        }
    }
263740
private function getEndPoint()
    {
        $url = $this->adapter->getResponse()->getUrl();
        $key = $this->adapter->getConfig('facebook[key]');

        if (empty($key)) {
            return;
        }

        if ($url->getDirectoryPosition(0) === 'events') {
            return  Url::create('https://graph.facebook.com/')
                        ->withAddedPath($url->getDirectoryPosition(1))
                        ->withQueryParameter('access_token', $key)
                        ->withQueryParameter('fields', $this->adapter->getConfig('facebook[events_fields]'));
        }

        if ($url->getDirectoryPosition(1) === 'videos') {
            return  Url::create('https://graph.facebook.com/')
                        ->withAddedPath($url->getDirectoryPosition(2))
                        ->withQueryParameter('access_token', $key)
                        ->withQueryParameter('fields', $this->adapter->getConfig('facebook[videos_fields]'));
        }
    }
435304
public function getEvidenceURL($urlSuffix = null)
    {
        if (is_null($urlSuffix)) {
            $urlSuffix = $this->evidence;
        }

        $url = $this->url.$this->prefix.'/'.$this->company;
        if (!empty($urlSuffix)) {
            $url .= (($urlSuffix[0] == '.') ? '' : '/').$urlSuffix;
        }
        return $url;
    }
28484
public function getRelativeLink()
    {
        $path = $this->getRelativePath();
        $url = explode('/', $path);
        $url = implode(
            '/',
            array_map(
                function ($a) {
                    return DocumentationHelper::clean_page_url($a);
                },
                $url
            )
        );

        $url = trim($url, '/') . '/';

        return $url;
    }
182832
protected function getPageUrl($linkUrl)
    {
        $linkParts = parse_url($linkUrl);

        // Remove left / (but only if not root page)
        if ($linkParts['path'] === '/') {
            // Link points to root page
            $ret = '/';
        } else {
            // Link points to another page, strip left /
            $ret = ltrim($linkParts['path'], '/');
        }

        // Add query
        if (!empty($linkParts['query'])) {
            $ret .= '?' . $linkParts['query'];
        }

        return $ret;
    }
970029
public function baseUrl($path = null)
    {
        $backendUri = $this->uri();
        $baseUrl = Request::getBaseUrl();

        if ($path === null) {
            return $baseUrl . '/' . $backendUri;
        }

        $path = RouterHelper::normalizeUrl($path);
        return $baseUrl . '/' . $backendUri . $path;
    }
789905
public function getSocialProviderByUserName(SocialProvider &$social_provider)
		{
			$form_data = array(
				'username' => $social_provider->getUsername(),
				'provider' => $social_provider->getProviderName()
			);
			$xml = $this->call('getsocialproviderbyusername', $form_data);
			$xml = $xml->Data;

			$social_provider
				->setProviderId((int)$xml->social_provider_id);
		}
715071
public function linkAccountCallback() {
    $sdk = $this->getSdk();

    if ($sdk instanceof RedirectResponse) {
      return $sdk;
    }

    $network_manager = $this->networkManager->createInstance('social_auth_twitter');
    $data_handler = $network_manager->getDataHandler();

    // Get the Twitter OAuth token from storage.
    if (!($oauth_token = $data_handler->get('oauth_token')) || !($oauth_token_secret = $data_handler->get('oauth_token_secret'))) {
      drupal_set_message($this->t('Twitter login failed. Token or Token Secret is not valid.'), 'error');
      return $this->redirect('entity.user.edit_form', [
        'user' => $this->currentUser()->id(),
      ]);
    }

    $this->authManager->setSdk($sdk);
    $this->authManager->setAccessToken([
      'oauth_token' => $oauth_token,
      'oauth_token_secret' => $oauth_token_secret,
    ]);

    // Get the permanent access token.
    $access_token = $sdk->oauth('oauth/access_token', [
      'oauth_verifier' => $this->request->get('oauth_verifier'),
    ]);

    $this->authManager->setAccessToken([
      'oauth_token' => $access_token['oauth_token'],
      'oauth_token_secret' => $access_token['oauth_token_secret'],
    ]);

    // Get user's profile from Twitter API.
    if (!($this->authManager->getProfile()) || !($account_id = $this->authManager->getAccountId())) {
      drupal_set_message($this->t('@network login failed, could not load @network profile. Contact site administrator.', [
        '@network' => $this->t('Twitter'),
      ]), 'error');
      return $this->redirect('entity.user.edit_form', [
        'user' => $this->currentUser()->id(),
      ]);
    }

    // Check whether any another user account already connected.
    $account = $this->entityTypeManager()
      ->getStorage('user')
      ->loadByProperties(['twitter_id' => $account_id]);
    $account = current($account);

    // Check whether another account was connected to this Twitter account.
    if ($account && (int) $account->id() !== (int) $this->currentUser()->id()) {
      drupal_set_message($this->t('Your @network account has already connected to another account on this site.', [
        '@network' => $this->t('Twitter'),
      ]), 'warning');
      return $this->redirect('entity.user.edit_form', [
        'user' => $this->currentUser()->id(),
      ]);
    }

    $account = User::load($this->currentUser()->id());
    $account->get('twitter_id')->setValue($account_id);
    $account->save();

    drupal_set_message($this->t('You are now able to log in with @network', [
      '@network' => $this->t('Twitter'),
    ]));
    return $this->redirect('entity.user.edit_form', [
      'user' => $account->id(),
    ]);
  }
487077
public function getSocialId(){
		$result = null;
		if(isset($this->userInfo[$this->socialFieldsMap['socialId']])) {
			$result = $this->userInfo[$this->socialFieldsMap['socialId']];
			}
		return $result;
		}