Commit 66712e81bcb79ae1242701cfae6577919da0945e

Authored by Victor Costa
1 parent 0708b23e

display_content: set default content types to display

plugins/display_content/lib/display_content_block.rb
... ... @@ -24,7 +24,7 @@ class DisplayContentBlock < Block
24 24 {:value => 'title', :checked => true},
25 25 {:value => 'abstract', :checked => true}]
26 26 settings_items :display_folder_children, :type => :boolean, :default => true
27   - settings_items :types, :type => Array, :default => []
  27 + settings_items :types, :type => Array, :default => ['TextileArticle', 'TinyMceArticle', 'RawHTMLArticle']
28 28  
29 29 def self.description
30 30 _('Display your contents')
... ... @@ -56,7 +56,7 @@ class DisplayContentBlock < Block
56 56 end
57 57  
58 58 def available_content_types
59   - @available_content_types ||= [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed] + plugins.dispatch(:content_types)
  59 + @available_content_types ||= [TinyMceArticle, RawHTMLArticle, TextileArticle, UploadedFile, Event, Folder, Blog, Forum, Gallery, RssFeed] + plugins.dispatch(:content_types)
60 60 checked_types = types.map {|t| t.constantize}
61 61 checked_types + (@available_content_types - checked_types)
62 62 end
... ... @@ -119,7 +119,7 @@ class DisplayContentBlock < Block
119 119 nodes_conditions += ' OR articles.parent_id IN(:nodes) ' if !nodes.blank? && display_folder_children
120 120  
121 121  
122   - docs = owner.articles.find(:all, :conditions => ["articles.type IN(:types) #{nodes.blank? ? '' : nodes_conditions}", {:nodes => self.nodes, :types => (self.types.blank? ? VALID_CONTENT : self.types)}])
  122 + docs = owner.articles.find(:all, :conditions => ["articles.type IN(:types) #{nodes.blank? ? '' : nodes_conditions}", {:nodes => self.nodes, :types => self.types}])
123 123  
124 124 block_title(title) +
125 125 content_tag('ul', docs.map {|item|
... ...