Changeset 5832

Show
Ignore:
Timestamp:
07/11/08 10:26:27 (4 months ago)
Author:
uta
Message:

2008/07/11 sync

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • rubricks_core/trunk/app/models/rubricks_lib/character_set/chinese_character_set_convert.rb

    r4715 r5832  
    1111  # Change mail body to Chinese encoding. 
    1212  def convert_mail_body(str) 
    13     Iconv.conv('GB2312', 'UTF-8', str) 
     13    str 
    1414  end 
    1515 
    1616  # Change mail header to Chinese. 
    1717  def convert_mail_header(str) 
    18     Iconv.conv('GB2312', 'UTF-8', str) 
     18    str 
    1919  end 
    2020end 
  • rubricks_core/trunk/app/models/rubricks_menu_item.rb

    r5744 r5832  
    5151    def find_menu(controller, action, id) 
    5252      controller = controller.sub(%r|^/?|, '/') 
    53       rmi   = self.find(:first, :conditions => ['controller = ? and action = ? and url_id = ?', controller, action, id]) unless id.blank? 
     53      rmi = nil 
     54      unless id.blank? 
     55        rmi ||= self.find(:first, :conditions => ['controller = ? and action = ? and url_id = ?', controller, action, id]) 
     56        rmi ||= self.find(:first, :conditions => ['controller = ? and action = ? and url_id = ?', controller, 'main', id]) if action.blank? 
     57        rmi ||= self.find(:first, :conditions => ['controller = ? and action is null and url_id = ?', controller, id]) if action == 'main' 
     58      end 
    5459      rmi ||= self.find(:first, :conditions => ['controller = ? and action = ?', controller, action]) 
     60      rmi ||= self.find(:first, :conditions => ['controller = ? and action = ?', controller, 'main']) if action.blank? 
     61      rmi ||= self.find(:first, :conditions => ['controller = ? and action is null', controller]) if action == 'main' 
    5562      rmi ||= self.find(:first, :conditions => ['controller = ?', controller]) 
    5663      return rmi 
  • rubricks_core/trunk/app/models/rubricks_schedule_manager.rb

    r5816 r5832  
    1414    def change_schedule(schedule) 
    1515      adapter = find_adapter(schedule.adapter) 
    16       adapter.change(schedule) if adapter && installed?(adapter) 
     16      adapter.change(schedule) if executable?(adapter) 
    1717    end 
    1818 
    1919    def delete_schedule(adapter_id, schedule_id) 
    2020      adapter = find_adapter(adapter_id) 
    21       adapter.delete(schedule_id) if adapter && installed?(adapter) 
     21      adapter.delete(schedule_id) if executable?(adapter) 
    2222    end 
    2323 
     
    2525      result = [] 
    2626      @@adapters_attr.each do |a| 
    27         s_array = a.schedules(params) if a && installed?(a) 
     27        s_array = a.schedules(params) if executable?(a) 
    2828        (s_array || []).each do |s| 
    2929          begin 
     
    4545    end 
    4646 
     47    def executable?(adapter) 
     48      adapter && installed?(adapter) && has_permission?(adapter) 
     49    end 
     50 
     51    def has_permission?(adapter) 
     52      RubricksLib.permitted_component_function?(component_name(adapter), "access") 
     53    end 
     54 
    4755    def installed?(adapter) 
    48       RubricksComponent.exists?(["name = ?", adapter.name.underscore.split("/").first]) 
     56      RubricksComponent.exists?(["name = ?", component_name(adapter)]) 
     57    end 
     58 
     59    def component_name(adapter) 
     60      adapter.name.underscore.split("/").first 
    4961    end 
    5062  end 
  • rubricks_core/trunk/vendor/plugins/rails_protection/lib/custom_sanitizer_rules/tiny_mce.rb

    r5819 r5832  
    209209  :table => { 
    210210    :border         => /\A[0-9]+\Z/mn, 
    211     :cellpadding    => /\A[0-9]\Z/mn, 
    212     :cellspacing    => /\A[0-9]\Z/mn, 
     211    :cellpadding    => /\A[0-9]+\Z/mn, 
     212    :cellspacing    => /\A[0-9]+\Z/mn, 
    213213    :class          => /\A[-_a-zA-Z0-9]+\Z/mn, 
    214214    :height         => /\A([1-4]?[0-9]?[0-9]|([1-9]?[0-9]|100)%)\Z/mn, 
     
    220220      :'height'             => /\A([1-4]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 
    221221      :'width'              => /\A([1-6]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 
     222      :'margin-left'        => /\A([0-9]+px|auto)\Z/mn, 
     223      :'margin-right'       => /\A([0-9]+px|auto)\Z/mn, 
    222224    }, 
    223225    :summary        => /.+/mn, 
    224226    :width          => /\A([1-6]?[0-9]?[0-9]|([1-9]?[0-9]|100)%)\Z/mn, 
     227    :align          => /\Acenter|justy|left|right\Z/mn, 
    225228  }, 
    226229  :tbody => { 
     
    241244      :'width'              => /\A([1-6]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 
    242245      :'height'             => /\A([1-4]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 
     246      :'padding'            => /\A[0-9]+px\Z/mn, 
    243247    }, 
    244248    :valign         => /\Atop|middle|bottom\Z/mn, 
  • rubricks_core/trunk/vendor/plugins/rubricks/init.rb

    r5556 r5832  
    22require_dependency 'active_support_base' 
    33require_dependency 'action_controller_base' 
     4require_dependency 'action_mailer_tmail' 
    45require_dependency 'action_view_base' 
    56require_dependency 'active_record_base' 
  • rubricks_core/trunk/vendor/plugins/rubricks/lib/action_view_realtime_validator_helper.rb

    r5759 r5832  
    499499 
    500500      def kana_js(css_id, value) 
    501         msg = value.is_a?(Hash) ? value[:msg] : RubricksLib.hl('[_Common_Validate_Kana]') 
    502         return regexp_js(css_id, {:msg => msg, :value => '/' + RubricksLib.hl('[_Common_Kana_Format]') + '/'}) 
     501        allow_nil   = false 
     502        msg         = RubricksLib.hl('[_Common_Validate_Kana]') 
     503        if value.is_a?(Hash) 
     504          allow_nil = value[:allow_nil] 
     505          msg       = value[:msg] unless value[:msg].blank? 
     506        end 
     507        return regexp_js(css_id, {:allow_nil => allow_nil, :msg => msg, :value => '/' + RubricksLib.hl('[_Common_Kana_Format]') + '/'}) 
    503508      end 
    504509