link to more

This commit is contained in:
Fu Matthew authored and chris committed 2013-02-27 10:50:50 +08:00
1 parent 8a8bfcb8fb
commit 071e8a349c
12 files changed
+46 -27

No files matched your search

+15 -2
View File
@@ -28,7 +28,7 @@ module OrbitApp
end
class DataSheet
attr_reader :name,:key,:base_path,:module_label
attr_reader :name,:key,:base_path,:module_label,:data_count
def initialize(name, &block)
@name = name
@@ -36,6 +36,7 @@ module OrbitApp
@side_bar = nil
@front_end_app_pages = nil
@module_label = 'rulingcom.errors.init.module_app_noname'
@data_count = 1..3 # as default
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
setup_module_app
end
@@ -86,6 +87,10 @@ module OrbitApp
@front_end_app_pages.nil? ? [] : @front_end_app_pages.to_module_app_format
end
def get_data_count
@data_count
end
def get_widget_by_path(path)
if @widget_set
@widget_set.find_by_path(path)
@@ -94,6 +99,14 @@ module OrbitApp
end
end
def default_widget_setting
@widget_set.default_widget_setting
end
def widget_setting
@widget_set
end
def get_widgets
@widget_set.nil? ? {} : @widget_set.to_module_app_format
end
@@ -127,7 +140,7 @@ module OrbitApp
# @default_widget = widget_set.default_widget
end
%w{module_label category base_url version organization author intro update_info}.each do |field|
%w{data_count module_label category base_url version organization author intro update_info}.each do |field|
define_method(field){|var| instance_variable_set( "@" + field, var)}
end