Commit 0c2e420aad5aafb1fd55da405af1e6533296ab49

Authored by Andrey Karpikov
1 parent 12eda134

check variables

@@ -124,7 +124,8 @@ module Kanjai @@ -124,7 +124,8 @@ module Kanjai
124 124
125 page_collection.each do |page| 125 page_collection.each do |page|
126 if page.children.length > 0 and next_level 126 if page.children.length > 0 and next_level
127 - subparts << item[:source] 127 + subparts << item[:source].to_s.gsub('###link###', page.menu_url(session[:scheme], lang = nil))
  128 + .gsub('###title###', page.lang_attributes(I18n.locale, :title))
128 129
129 self.menu_generator(session, domain, next_level[:children], subparts, nil, false, page) 130 self.menu_generator(session, domain, next_level[:children], subparts, nil, false, page)
130 else 131 else
@@ -153,7 +154,10 @@ module Kanjai @@ -153,7 +154,10 @@ module Kanjai
153 else 154 else
154 attributes = item[:attributes] 155 attributes = item[:attributes]
155 if current_page 156 if current_page
156 - p attributes 157 + attributes = replace_attributes_marker(attributes, {
  158 + '###link###' => current_page.menu_url(session[:scheme], lang = nil),
  159 + '###title###' => current_page.lang_attributes(I18n.locale, :title)
  160 + })
157 end 161 end
158 subparts.send(item[:name].to_s, attributes) do |next_subparts| 162 subparts.send(item[:name].to_s, attributes) do |next_subparts|
159 self.menu_generator(session, domain, item[:children], next_subparts, nil, start_from_current_page, current_page) 163 self.menu_generator(session, domain, item[:children], next_subparts, nil, start_from_current_page, current_page)
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.308" 2 + VERSION = "0.0.309"
3 end 3 end