# -*- encoding : utf-8 -*-
module Public::MenuItemsHelper
def menu_item_link(menu_item)
	link_to menu_item.name, menu_item_path(:url => menu_item.url), :class => ('active' if @menu_item and (@menu_item.id == menu_item.id or @menu_item.ancestors.include?(menu_item)))
end

def lien_bouton(nbr,slug)
	menu_item = MenuItem.find_by_slug( slug)
	if menu_item
		link_to "", menu_item_path(:url => menu_item.url) , :id => "button-"+nbr.to_s, :class => "digibutton", :"data-text" => menu_item.name
	end
 #   page = Page.find_by_permanent_slug("bouton"+nbr.to_s) || nil
#		if page
#			link_to "", permalink(page) , :id => "button-"+nbr.to_s, :class => "digibutton", :"data-text" => page.title
#		else
#		  link_to "", "" , :id => "button-"+nbr.to_s, :class => "digibutton", :"data-text" => ""
#		end
end

end
