Changeset 4612

Show
Ignore:
Timestamp:
09/25/07 17:46:09 (1 year ago)
Author:
uta
Message:

790

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • components/news/trunk/news/_install/component_info.rb

    r2894 r4612  
    66    @author         = 'Rubricks.org' 
    77    @license        = 'MIT' 
     8    @blocks         = [ 
     9      { 
     10        :title          => '[_News_Title_News]', 
     11        :controller     => '/news/news', 
     12        :action         => 'block', 
     13        :function       => 'access', 
     14        :description    => 'news block', 
     15        :widget         => { 
     16          :default_height   => '240', 
     17          :default_width    => '400', 
     18          :visible          => true 
     19        } 
     20      } 
     21    ] 
    822    @functions      = [ 
    923      { 
     
    3246      } 
    3347    ] 
    34     @blocks         = [ 
     48    @trails         = [ 
    3549      { 
    36         :title          => '[_News_Title_News]', 
    37         :controller     => '/news/news', 
    38         :action         => 'block', 
    39         :function       => 'access', 
    40         :description    => 'news block', 
    41         :widget         => { 
    42           :default_height   => '240', 
    43           :default_width    => '400', 
    44           :visible          => true 
    45         } 
    46       } 
     50        :record_type    => 'read', 
     51        :examples       => '[_News_Info_TrailRead]' 
     52      }, 
     53      { 
     54        :record_type    => 'update', 
     55        :examples       => '[_News_Info_TrailUpdate]' 
     56      }, 
    4757    ] 
    4858  end 
  • components/news/trunk/news/admin_controller.rb

    r4578 r4612  
    55  def main 
    66    @nc = News::NewsConfig.instance 
     7    rubricks_logger({:action_type => :detail, :data => @nc}) 
    78  end 
    89 
  • components/news/trunk/news/news_config.rb

    r4578 r4612  
    11class News::NewsConfig < ActiveRecord::Base 
     2  acts_as_record_trails     :trails_fields => {:approval => '[_News_Need_Approval_Posted_News]', :news_per_block => '[_News_News_Per_Block]', :news_per_page => '[_News_News_Per_Page]', :new_days => '[_News_New_Days]'}, :default_methods => [:approval, :news_per_block, :news_per_page, :new_days], :auto_logger => {:update => true} 
    23  validates_bool_of         :approval 
    34  validates_inclusion_of    :news_per_block, :in => 1..20 
  • components/news/trunk/news/news_controller.rb

    r4578 r4612  
    8080    end 
    8181    @pages, @news_items = paginate(:'news/news_item', :per_page => @nc.news_per_page, :conditions => ['approval = 1'], :order => 'publish_date DESC, id DESC') 
     82    rubricks_logger({:action_type => :list, :data => @news_items}) 
    8283  end 
    8384 
     
    111112      end 
    112113    end 
     114    rubricks_logger({:action_type => :detail, :data => @news}) 
    113115  end 
    114116 
     
    284286    if administrator? 
    285287      @pages, @news_items = paginate(:'news/news_item', :per_page => nc.news_per_page, :conditions => ['approval = ?', approval], :order => 'updated_on DESC, id DESC') 
     288      rubricks_logger({:action_type => :list, :data => @news_items}) 
    286289    else 
    287290      @pages, @news_items = paginate(:'news/news_item', :per_page => nc.news_per_page, :conditions => ['rubricks_user_id = ? and approval = ?', current_user.id, approval], :order => 'updated_on DESC, id DESC') 
     291      rubricks_logger({:action_type => :list, :data => @news_items}) 
    288292    end 
    289293  end 
  • components/news/trunk/news/news_item.rb

    r4578 r4612  
    11class News::NewsItem < ActiveRecord::Base 
    22  acts_as_approval 
     3  acts_as_record_trails         :trails_fields => {:title => '[_Common_Title]'}, :default_methods => [:title], :auto_logger => {:update => true} 
    34  acts_as_strippable            :article 
    45  acts_as_tiny_mce_attachable   :article