lib/spiderfw/widget/widget_plugin.rb in spiderfw-0.5.15 vs lib/spiderfw/widget/widget_plugin.rb in spiderfw-0.5.16
- old
+ new
@@ -3,14 +3,16 @@
module WidgetPlugin
def self.included(mod)
mod.extend(ModuleMethods)
mod.module_eval{ include Annotations }
+ Spider::ControllerMixins::Visual.define_format_annotations(mod)
+ mod.extend(Spider::ControllerMixins::Visual::OutputFormatMethods)
end
module ModuleMethods
-
+
def plugin_name
@plugin_name
end
def plugin_for(widget, plugin_name)
@@ -37,9 +39,21 @@
def get_assets
path = overrides_path
return open(path){ |f| Hpricot.XML(f) }.root.children_of_type('tpl:asset').map{ |el|
Spider::Template.parse_asset_element(el)
}
+ end
+
+ def controller_actions(*methods)
+ if (methods.length > 0)
+ @controller_actions ||= []
+ @controller_actions += methods
+ end
+ @controller_actions
+ end
+
+ def controller_action?(method)
+ @controller_actions && @controller_actions.include?(method)
end
end
end
\ No newline at end of file