Frontend\Core\Engine\Footer::parse PHP Method

parse() public method

Parse the footer into the template
public parse ( )
    public function parse()
    {
        $footerLinks = (array) Navigation::getFooterLinks();
        $this->tpl->addGlobal('footerLinks', $footerLinks);
        $siteHTMLFooter = (string) $this->get('fork.settings')->get('Core', 'site_html_footer', null);
        $facebookAdminIds = $this->get('fork.settings')->get('Core', 'facebook_admin_ids', null);
        $facebookAppId = $this->get('fork.settings')->get('Core', 'facebook_app_id', null);
        // facebook admins given?
        if ($facebookAdminIds !== null || $facebookAppId !== null) {
            // add Facebook container
            $siteHTMLFooter .= $this->getFacebookHtml($facebookAppId);
        }
        // add Google sitelinks search box code if wanted.
        if ($this->get('fork.settings')->get('Search', 'use_sitelinks_search_box', true)) {
            $searchUrl = FrontendNavigation::getURLForBlock('Search');
            $url404 = FrontendNavigation::getURL(404);
            if ($searchUrl !== $url404) {
                $siteHTMLFooter .= $this->getSiteLinksCode($searchUrl);
            }
        }
        // assign site wide html
        $this->tpl->addGlobal('siteHTMLFooter', $siteHTMLFooter);
    }

Usage Example

Beispiel #1
0
 /**
  * Display the page
  */
 public function display()
 {
     // parse header
     $this->header->parse();
     // parse breadcrumb
     $this->breadcrumb->parse();
     // parse languages
     $this->parseLanguages();
     // parse footer
     $this->footer->parse();
     // assign the id so we can use it as an option
     $this->tpl->assign('isPage' . $this->pageId, true);
     $this->tpl->assign('isChildOfPage' . $this->record['parent_id'], true);
     // hide the cookiebar from within the code to prevent flickering
     $this->tpl->assign('cookieBarHide', !$this->get('fork.settings')->get('Core', 'show_cookie_bar', false) || CommonCookie::hasHiddenCookieBar());
     // the the positions to the template
     $this->parsePositions();
     // assign empty positions
     $unusedPositions = array_diff($this->record['template_data']['names'], array_keys($this->record['positions']));
     foreach ($unusedPositions as $position) {
         $this->tpl->assign('position' . \SpoonFilter::ucfirst($position), array());
     }
     // output
     return new Response($this->tpl->getContent($this->templatePath, false, true), $this->statusCode);
 }