Changeset 5832
- Timestamp:
- 07/11/08 10:26:27 (4 months ago)
- Files:
-
- rubricks_core/trunk/app/models/rubricks_lib/character_set/chinese_character_set_convert.rb (modified) (1 diff)
- rubricks_core/trunk/app/models/rubricks_menu_item.rb (modified) (1 diff)
- rubricks_core/trunk/app/models/rubricks_schedule_manager.rb (modified) (3 diffs)
- rubricks_core/trunk/vendor/plugins/rails_protection/lib/custom_sanitizer_rules/tiny_mce.rb (modified) (3 diffs)
- rubricks_core/trunk/vendor/plugins/rubricks/init.rb (modified) (1 diff)
- rubricks_core/trunk/vendor/plugins/rubricks/lib/action_mailer_tmail.rb (added)
- rubricks_core/trunk/vendor/plugins/rubricks/lib/action_view_realtime_validator_helper.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
rubricks_core/trunk/app/models/rubricks_lib/character_set/chinese_character_set_convert.rb
r4715 r5832 11 11 # Change mail body to Chinese encoding. 12 12 def convert_mail_body(str) 13 Iconv.conv('GB2312', 'UTF-8', str)13 str 14 14 end 15 15 16 16 # Change mail header to Chinese. 17 17 def convert_mail_header(str) 18 Iconv.conv('GB2312', 'UTF-8', str)18 str 19 19 end 20 20 end rubricks_core/trunk/app/models/rubricks_menu_item.rb
r5744 r5832 51 51 def find_menu(controller, action, id) 52 52 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 54 59 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' 55 62 rmi ||= self.find(:first, :conditions => ['controller = ?', controller]) 56 63 return rmi rubricks_core/trunk/app/models/rubricks_schedule_manager.rb
r5816 r5832 14 14 def change_schedule(schedule) 15 15 adapter = find_adapter(schedule.adapter) 16 adapter.change(schedule) if adapter && installed?(adapter)16 adapter.change(schedule) if executable?(adapter) 17 17 end 18 18 19 19 def delete_schedule(adapter_id, schedule_id) 20 20 adapter = find_adapter(adapter_id) 21 adapter.delete(schedule_id) if adapter && installed?(adapter)21 adapter.delete(schedule_id) if executable?(adapter) 22 22 end 23 23 … … 25 25 result = [] 26 26 @@adapters_attr.each do |a| 27 s_array = a.schedules(params) if a && installed?(a)27 s_array = a.schedules(params) if executable?(a) 28 28 (s_array || []).each do |s| 29 29 begin … … 45 45 end 46 46 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 47 55 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 49 61 end 50 62 end rubricks_core/trunk/vendor/plugins/rails_protection/lib/custom_sanitizer_rules/tiny_mce.rb
r5819 r5832 209 209 :table => { 210 210 :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, 213 213 :class => /\A[-_a-zA-Z0-9]+\Z/mn, 214 214 :height => /\A([1-4]?[0-9]?[0-9]|([1-9]?[0-9]|100)%)\Z/mn, … … 220 220 :'height' => /\A([1-4]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 221 221 :'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, 222 224 }, 223 225 :summary => /.+/mn, 224 226 :width => /\A([1-6]?[0-9]?[0-9]|([1-9]?[0-9]|100)%)\Z/mn, 227 :align => /\Acenter|justy|left|right\Z/mn, 225 228 }, 226 229 :tbody => { … … 241 244 :'width' => /\A([1-6]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 242 245 :'height' => /\A([1-4]?[0-9]?[0-9](px)?|([1-9]?[0-9]|100)%)\Z/mn, 246 :'padding' => /\A[0-9]+px\Z/mn, 243 247 }, 244 248 :valign => /\Atop|middle|bottom\Z/mn, rubricks_core/trunk/vendor/plugins/rubricks/init.rb
r5556 r5832 2 2 require_dependency 'active_support_base' 3 3 require_dependency 'action_controller_base' 4 require_dependency 'action_mailer_tmail' 4 5 require_dependency 'action_view_base' 5 6 require_dependency 'active_record_base' rubricks_core/trunk/vendor/plugins/rubricks/lib/action_view_realtime_validator_helper.rb
r5759 r5832 499 499 500 500 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]') + '/'}) 503 508 end 504 509
