Commit 66712e81bcb79ae1242701cfae6577919da0945e
1 parent
0708b23e
Exists in
master
and in
29 other branches
display_content: set default content types to display
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
plugins/display_content/lib/display_content_block.rb
@@ -24,7 +24,7 @@ class DisplayContentBlock < Block | @@ -24,7 +24,7 @@ class DisplayContentBlock < Block | ||
24 | {:value => 'title', :checked => true}, | 24 | {:value => 'title', :checked => true}, |
25 | {:value => 'abstract', :checked => true}] | 25 | {:value => 'abstract', :checked => true}] |
26 | settings_items :display_folder_children, :type => :boolean, :default => true | 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 | def self.description | 29 | def self.description |
30 | _('Display your contents') | 30 | _('Display your contents') |
@@ -56,7 +56,7 @@ class DisplayContentBlock < Block | @@ -56,7 +56,7 @@ class DisplayContentBlock < Block | ||
56 | end | 56 | end |
57 | 57 | ||
58 | def available_content_types | 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 | checked_types = types.map {|t| t.constantize} | 60 | checked_types = types.map {|t| t.constantize} |
61 | checked_types + (@available_content_types - checked_types) | 61 | checked_types + (@available_content_types - checked_types) |
62 | end | 62 | end |
@@ -119,7 +119,7 @@ class DisplayContentBlock < Block | @@ -119,7 +119,7 @@ class DisplayContentBlock < Block | ||
119 | nodes_conditions += ' OR articles.parent_id IN(:nodes) ' if !nodes.blank? && display_folder_children | 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 | block_title(title) + | 124 | block_title(title) + |
125 | content_tag('ul', docs.map {|item| | 125 | content_tag('ul', docs.map {|item| |