Ticket #35331

hide top menu item if all menus are hidden

Eröffnet am: 2015-07-19 17:04 Letztes Update: 2015-07-19 17:04

Auswertung:
Verantwortlicher:
(Keine)
Typ:
Status:
Offen
Komponente:
(Keine)
Meilenstein:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Keine
Datei:
Keine

Details

Index: init.rb

--- init.rb (revision 57) +++ init.rb (working copy) @@ -16,10 +16,13 @@

:partial => 'settings/info_settings')
menu(:top_menu, :redmine_info,
{ :controller => 'info', :action => 'index'},

- :if => Proc.new { User.current.logged? }) + :if => Proc.new { User.current.logged? && InfoCategory.show_top_menu? })

end

+ActionDispatch::Callbacks.to_prepare do + require_dependency 'info_category' +end

Redmine::MenuManager.map :redmine_info_menu do |menu|
InfoCategory.push_menu(menu, :permissions, :html => {:class => 'roles'})

Index: lib/info_category.rb

--- lib/info_category.rb (revision 57) +++ lib/info_category.rb (working copy) @@ -22,8 +22,7 @@

('label_' + sym.to_s).to_sym
end
end

- - +

def self.hide_map
map = {} InfoCategory.categories.each {|catsym|

@@ -32,6 +31,15 @@

map
end

+ def self.show_top_menu? + InfoCategory.categories.each {|catsym| + if (InfoCategory::is_shown?(catsym) or User.current.admin?) + return true + end + } + return false + end +

def self.push_menu(menu, catsym, opts = {})
url = {:controller => :info, :action => :show}

Ticket-Verlauf (1/1 Historien)

2015-07-19 17:04 Aktualisiert von: giray_pultar
  • New Ticket "hide top menu item if all menus are hidden" created

Dateianhangliste

Keine Anhänge

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden