While modifying redmine, I stuck on that part:
To hide the menu link "Activity" from a specific project.
My first try was that:
lib/redmine.rb - Line 239
menu.push :activity, { :controller => 'activities', :action => 'index' }, :if => Proc.new { Project.id==1 }
But I guess Project is undefined at the moment when this file is loaded.
Even though there is this nice plugin api. Which got this method: delete_menu_item
But how would I tell my plugin something like that:
if(Project.id == 1) then delete_menu_item(:project_menu, :activity) end
I guess both methods would work. But I can't get them working.
Some (maybe) useful information:
So I finally have my solution now:
menu.push :activity, { :controller => 'activities', :action => 'index' },
:if => Proc.new {|project| project.id==1 }
Thanks to Arnaud Martel for helping me with that.