Return the attribute provider to provide attributes for the open links.

@see self::provideOpenLinkAttributes()

@param string $context

@return callable
180212
protected function getAttributeProvider($context)
    {

        $extendName = $this->getContextExtendName($context);

        if ($this->hasExtension($extendName)) {
            return $this->getExtension($extendName);
        }

        return function($file) {
            return [
                'href'  =>$file->url,
                'class'=>'inline',
                'onclick'=>"window.open($(this).attr('href'), 'imgViewer','width=600,height=400'); return false;"];
        };

    }
629489
public function getSelectedContextAttribute()
    {
        if (isset($this->context)) {
            return $this->context;
        }
        switch ($this->selected_context_type) {
            case 'Member':
                return $this->context = new MemberContext($this);
            default:
                abort(401, 'Context not selected.');
        }
    }
323464
public function get($attributeCode, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $getter = 'get'.ucfirst($attributeCode);
        if (method_exists($this, $getter)) {
            return $this->$getter($context);
        }

        if ($attribute->isCollection()) {
            return $this->getValuesData($attribute, $context);
        }

        return $this->getValueData($attribute, $context);
    }
956570
public function getRequestHandle(RequestContext $context)
    {
        $curlHandle = curl_init();

        $defaults = $this->getDefaultSettings($context);

        $defaults += $this->getCurlTimeoutSettings($context);

        $defaults += $this->getCurlSslSettings();

        $defaults += $this->getProxySettings($context);

        curl_setopt_array(
            $curlHandle, //@codeCoverageIgnore
            $context->getCurlOptions() + $defaults + $this->getRequestDataAndMethodOptions($context)
        );

        return $curlHandle;
    }
1197232
protected function getDefaultParametersFromContext($context = null)
    {
        if (count($this->defaultParameters['contexts'])) {
            //If context is not given, just take the default one
            if ($context === null) {
                $context = $this->defaultParameters['default']['context'];
            }

            //If context is in declared contexts, we use it
            if (array_key_exists($context, $this->defaultParameters['contexts'])) {
                return $this->defaultParameters['contexts'][$context];
            }
        }

        //else we return the default configuration
        return $this->defaultParameters['default'];
    }
823128
private function configureContext(Context $context)
    {
        foreach ($this->attributes as $key => $value) {
            $context->setAttribute($key, $value);
        }
        if (!empty($this->groups)) {
            $context->setGroups($this->groups);
        }

        if (($context instanceof SerializationContext) && $this->serializeNulls !== null) {
            $context->setSerializeNull($this->serializeNulls);
        }

        if ($this->enableMaxDepthChecks === true) {
            $context->enableMaxDepthChecks();
        }

        if ($this->version !== null) {
            $context->setVersion($this->version);
        }

        return $context;
    }
651655
public function toProvider(string $provider, string $context = '') : self
    {
        $this->untarget = null;
        $this->validate->toProvider($provider);
        $this->bound = (new DependencyFactory)->newProvider(new \ReflectionClass($provider), $context);
        $this->container->add($this);

        return $this;
    }
222204
public function getContext(TemplateContextInterface $context = null)
    {
        $context = new TemplateContext($context);
        $context->setData($this->getData());
        $context->setParameters($this->getParameters());

        return $context;
    }
358917
protected function getLabelValue(array $context = null)
    {
        $attributeAsLabel = $this->getFamily()->getAttributeAsLabel();
        if ($attributeAsLabel) {
            return (string) $this->getValueData($attributeAsLabel, $context);
        }

        return (string) $this->getIdentifier();
    }
434853
protected function _authorizeEdit($context)
    {
        $ret = parent::_authorizeEdit($context);

        if ($ret === false) {
            if ($this->_entity->isOwnable()) {
                $action = $this->_entity->component.':'.$this->_entity->getIdentifier()->name.':add';

                if ($this->_entity->owner->authorize('action', $action)) {
                    return true;
                }
            }
        }

        return $ret;
    }
608266
public function getProvider($accessTokenParams = [], $useCache = true)
    {
        if (!$useCache) {
            $this->provider->getAccessToken($this->type, $accessTokenParams);

            return $this->provider;
        }
        return $this->provider->setAccessToken($this->getToken($accessTokenParams));
    }
609912
public function getPluginNodesWithViewDefinitions(ContentContext $context)
    {
        $pluginNodes = [];
        foreach ($this->getPluginNodes($context) as $pluginNode) {
            /** @var NodeInterface $pluginNode */
            if ($this->getPluginViewDefinitionsByPluginNodeType($pluginNode->getNodeType()) !== []) {
                $pluginNodes[] = $pluginNode;
            }
        }
        return $pluginNodes;
    }
811477
protected function getAdapter($context) {
    return $this->context === $context || $context === NULL ? $this : new static($this->entityMeta, $context);
  }
766448
public function loadContext($context)
    {

        $ok = false;
        if (!empty($context->getRecordId())) {
            $sql = sprintf('SELECT context_pk, consumer_pk, lti_context_id, type, settings, created, updated ' .
                           "FROM {$this->dbTableNamePrefix}" . DataConnector::CONTEXT_TABLE_NAME . ' ' .
                           'WHERE (context_pk = %d)',
                           $context->getRecordId());
        } else {
            $sql = sprintf('SELECT context_pk, consumer_pk, lti_context_id, type, settings, created, updated ' .
                           "FROM {$this->dbTableNamePrefix}" . DataConnector::CONTEXT_TABLE_NAME . ' ' .
                           'WHERE (consumer_pk = %d) AND (lti_context_id = %s)',
                           $context->getConsumer()->getRecordId(), DataConnector::quoted($context->ltiContextId));
        }
        $rs_context = mysql_query($sql);
        if ($rs_context) {
            $row = mysql_fetch_object($rs_context);
            if ($row) {
                $context->setRecordId(intval($row->context_pk));
                $context->setConsumerId(intval($row->consumer_pk));
                $context->ltiContextId = $row->lti_context_id;
                $context->type = $row->type;
                $settings = unserialize($row->settings);
                if (!is_array($settings)) {
                    $settings = array();
                }
                $context->setSettings($settings);
                $context->created = strtotime($row->created);
                $context->updated = strtotime($row->updated);
                $ok = true;
            }
        }

        return $ok;

    }
752226
public function getSource(OperationContextInterface $context = null)
    {
        $sourceId = $this->getSourceId();
        if ($sourceId === null) {
            return null;
        }
        $context = $this->ensureContext($context);

        return $this->getSession()->getObject($sourceId, $context);
    }
1077284
protected function _actionBrowse($context)
    {
        if (!$context->query) {
            $context->query = $this->getRepository()->getQuery();
        }

        $query = $context->query;
        $query->order('open', 'DESC');

        if ($this->sort == 'priority') {
            $query->order('priority', 'DESC');
        }

        return parent::_actionBrowse($context);
    }
1129635
public static function getAuthorizationURL(ContextInterface $context)
	{
		$queryString = [
			'client_id' => $context->getClientId(),
			'client_secret' => $context->getClientSecret(),
			'redirect_uri' => $context->getRedirectUri(),
			'response_type' => 'code',
		];

		return SumUp::ENTRYPOINT . self::OAUTH_AUTHORIZATION . '?' . http_build_query($queryString);
	}