11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/nesta-contentfocus-extensions/menu.rb', line 11
def self.
return @full_menu if @full_menu
@full_menu =
if @full_menu.empty?
= Tempfile.new('menu')
categories = Page.find_all.map(&:categories).flatten.compact.uniq
categories.sort_by!(&:abspath)
categories.each do |category|
.write(category.abspath + "\n")
category.pages.each do |sub_category|
.write(Nesta::Menu::INDENT + sub_category.abspath + "\n")
end
end.flatten
.rewind
(@full_menu, , 0)
.close
.unlink
end
@full_menu
end
|