class FrontController < ApplicationController layout false def show_breadcrumb @ancestors = Page.find(params[:id]).ancestors_and_self @ancestors = nil if @ancestors.size == 1 end def show_banner @ad_banner = AdBanner.find(params[:id]) rescue nil end def show_footer @page = Page.find(:all, :conditions => {:name => /terms/i}) @name = @page.first.name @url = "/#{@name}" if !@site.enable_terms_of_use render :text => (@site.footer + "Terms of Use") else render :text => @site.footer end end def show_menu page = Page.find(params[:id]) rescue nil render :text => menu_level(Page.root, page, 1, page.design.layout.menu) if page end def show_site_sub_menu @page = Page.find(:all, :conditions => {:name => /sitemap/i}) @name = @page.first.name @url = "/#{@name}" if !@site.sitemap_menu_in_header render :text => (@site.sub_menu + "Sitemap") else render :text => @site.sub_menu end end def show_sitemap @items = get_homepage.children.excludes(sitemap_enabled: false) rescue [] end def show_page_sub_menu @menu_page = Page.find(params[:menu_page_id]) rescue nil @page_id = params[:page_id] end def show_inner_ad_image @ad_image = AdImage.find(params[:id]) rescue nil @ad_images = AdImage.all end def show_tag_cloud module_app = ModuleApp.find(params[:id]) rescue nil @tags = module_app.sorted_tags_for_cloud end def show_terms_of_use @site = Site.first rescue nil @terms = @site.terms_of_use end private def menu_level(page, current_page, current, menu) res = '' if page.visible_children.size > 0 res << "" end res end def menu_li(page, current_page, current, menu, i) res = "" end end