module Spud::Cms::ApplicationHelper MENU_INDEX = {} def sp_snippet(name,snippets=nil) if name.blank? return '' end if !snippets.blank? snippet = snippets.select {|s| s.name == name} else snippet = SpudSnippet.where(:name => name).first end if !snippet.blank? return snippet.content_processed.html_safe else return nil end end def sp_list_pages(options = {}) pages = SpudPage.public.published_pages if Spud::Core.multisite_mode_enabled site_config = Spud::Core.site_config_for_host(request.host_with_port) pages = pages.site(site_config[:site_id]) if !site_config.blank? end start_page = nil max_depth = 0 active_class = "menu-active" if !options.blank? if options.has_key?(:exclude) pages = pages.where(["name NOT IN (?)",options[:exclude]]) end if options.has_key?(:start_page_id) start_page = options[:start_page_id] end if options.has_key?(:id) content = "