]> source.dussan.org Git - redmine.git/commitdiff
check that block is defined before rendering it (my/page_layout)
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 5 Feb 2007 19:38:19 +0000 (19:38 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 5 Feb 2007 19:38:19 +0000 (19:38 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@244 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/my/page_layout.rhtml

index 4ad4c8e711b8857a244a59bcf844637f1b417611..6856ee51d9895a4403881addc03513e5968dbcb7 100644 (file)
@@ -55,19 +55,22 @@ function removeBlock(block) {
 <h2><%=l(:label_my_page)%></h2>\r
 \r
 <div id="list-top" class="block-receiver">\r
-       <% @blocks['top'].each do |b| %>\r
+       <% @blocks['top'].each do |b| \r
+          next unless MyController::BLOCKS.keys.include? b %>\r
        <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>\r
        <% end if @blocks['top'] %>\r
 </div>\r
 \r
 <div id="list-left" class="splitcontentleft block-receiver">\r
-       <% @blocks['left'].each do |b| %>\r
+       <% @blocks['left'].each do |b| \r
+          next unless MyController::BLOCKS.keys.include? b %>\r
        <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>\r
        <% end if @blocks['left'] %>\r
 </div>\r
 \r
 <div id="list-right" class="splitcontentright block-receiver">\r
-       <% @blocks['right'].each do |b| %>\r
+       <% @blocks['right'].each do |b| \r
+          next unless MyController::BLOCKS.keys.include? b %>\r
        <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>\r
        <% end if @blocks['right'] %>\r
 </div>\r