예제 #1
0
    /**
     * @param eZContentObjectTreeNode $node
     * @return array
     */
    public function getGTMTags()
    {
        $gtmVariables = parent::getGTMTags($this->applicationLocalized());
        
        $gtmVariables['sponsorName'] = '';
        $gtmVariables['sponsorPage'] = false;
        
        $sponsorName = $this->applicationLocalized()->attribute("sponsor");
        
        if ($sponsorName)
        {
            $gtmVariables['sponsorName'] = $sponsorName;
            $gtmVariables['sponsorPage'] = true;
        }

        return $gtmVariables;
    }
    /**
     * @return bool
     */
    public function htmlBuildListResult()
    {
        $this->resultHandler->parseRequestParams();

        $this->pushResult('cluster_identifier', ClusterTool::clusterIdentifier());
        $this->pushResult('class_identifiers' , $this->resultHandler->contentClassIdentifiers);
        $this->pushResult('is_logged_in'      , (bool)$this->user());
        $this->pushResult('tou_validated'     , ($this->user() && $this->user()->toUValidated()));
        $this->pushResult('num_found'         , 0);
        $this->pushResult('sort_list'         , $this->resultHandler->sortList);
        $this->pushResult('facets'            , $this->getFacetsAsArray());
        $this->pushResult('related_publishers', $this->getRelatedPublishers());


        $this->pushChannelResult();

        if ( $this->applicationObject && !empty($this->applicationObject->configurationContentService) )
            $this->pushResult('content_service_configuration', $this->applicationObject->configurationContentService);

        if( SolrSafeOperatorHelper::featureIsActive( 'GoogleAnalytics' ) )
        {
            $gtmVariables = parent::getGTMTags($this->applicationLocalized());

            if ($this->channel){
                $gtmVariables['sponsorName'] = '';
                $gtmVariables['sponsorPage'] = false;

                $sponsorName = $this->channel->attribute("sponsor");
                if ($sponsorName)
                {
                    $gtmVariables['sponsorName'] = $sponsorName;
                    $gtmVariables['sponsorPage'] = true;
                }
            }
            $this->pushResult( 'gtm_variables', $gtmVariables);
        }
        
        return true;
    }