Frontend\Core\Engine\Navigation::getFooterLinks PHP Method

    public static function getFooterLinks()
    {
        // get the navigation
        $navigation = self::getNavigation();
        // init var
        $return = array();
        // validate
        if (!isset($navigation['footer'][0])) {
            return $return;
        }
        // loop links
        foreach ($navigation['footer'][0] as $id => $data) {
            // skip hidden pages
            if ($data['hidden']) {
                continue;
            }
            // build temp array
            $temp = array();
            $temp['id'] = $id;
            $temp['url'] = self::getURL($id);
            $temp['title'] = $data['title'];
            $temp['navigation_title'] = $data['navigation_title'];
            $temp['selected'] = (bool) in_array($id, self::$selectedPageIds);
            // add
            $return[] = $temp;
        }
        // return footer links
        return $return;
    }

Usage Example

Example #1
0
 /**
  * Parse the footer into the template
  */
 public function parse()
 {
     $footerLinks = (array) Navigation::getFooterLinks();
     $this->tpl->assign('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->assign('siteHTMLFooter', $siteHTMLFooter);
 }