2014-06-27 08:58:18 +00:00
|
|
|
class BreadcrumbWidgetsController < ApplicationController
|
|
|
|
def widget
|
|
|
|
params = OrbitHelper.params
|
|
|
|
url = params["url"]
|
|
|
|
crumbs = url.split("/")
|
|
|
|
data = []
|
|
|
|
crumbs.each do |crumb|
|
|
|
|
if crumb == ""
|
|
|
|
p = Page.root
|
2020-11-19 07:09:32 +00:00
|
|
|
data << {"page_name" => p.name.gsub('<br>',''), "url" => "/?locale=#{locale.to_s}"}
|
2014-06-27 08:58:18 +00:00
|
|
|
else
|
|
|
|
p = Page.where(:page_id => crumb).first
|
2020-11-19 07:09:32 +00:00
|
|
|
data << {"page_name" => p.name.gsub('<br>',''), "url" => "/#{locale.to_s}" + p.url}
|
2014-06-27 08:58:18 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
{
|
|
|
|
"crumbs" => data
|
|
|
|
}
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|