Creates a new instance of asset.
# File vendor/plugins/ubiquo_media/lib/ubiquo_media/connectors/i18n.rb, line 190
190: def uhook_create_asset visibility
191: asset = visibility.new(params[:asset])
192: asset.locale = current_locale
193: if params[:from] && asset.resource_file_name.blank?
194: asset.resource = visibility.find(params[:from]).resource
195: end
196: asset
197: end
destroys an asset instance. returns a boolean that means if the destroy was done.
# File vendor/plugins/ubiquo_media/lib/ubiquo_media/connectors/i18n.rb, line 200
200: def uhook_destroy_asset(asset)
201: destroyed = false
202: if params[:destroy_content]
203: destroyed = asset.destroy_content
204: else
205: destroyed = asset.destroy
206: end
207: destroyed
208: end
Performs any required action on asset when in edit
# File vendor/plugins/ubiquo_media/lib/ubiquo_media/connectors/i18n.rb, line 182
182: def uhook_edit_asset asset
183: unless asset.in_locale?(current_locale)
184: redirect_to(ubiquo_assets_path)
185: false
186: end
187: end
Returns a hash with extra filters to apply
# File vendor/plugins/ubiquo_media/lib/ubiquo_media/connectors/i18n.rb, line 166
166: def uhook_index_filters
167: {:locale => params[:filter_locale]}
168: end
Returns a subject that will have applied the index filters (e.g. a class, with maybe some scopes applied)
# File vendor/plugins/ubiquo_media/lib/ubiquo_media/connectors/i18n.rb, line 172
172: def uhook_index_search_subject
173: ::Asset.locale(current_locale, :all)
174: end
Disabled; run with $DEBUG to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.