2012-02-04 01:10:55 +00:00
|
|
|
module Locomotive
|
|
|
|
module ContentEntriesHelper
|
2012-01-31 00:50:09 +00:00
|
|
|
|
2012-02-04 01:10:55 +00:00
|
|
|
def options_for_belongs_to_custom_field(class_name)
|
|
|
|
content_type = Locomotive::ContentType.class_name_to_content_type(class_name, current_site)
|
2012-01-31 00:50:09 +00:00
|
|
|
|
2012-02-04 01:10:55 +00:00
|
|
|
if content_type
|
|
|
|
content_type.ordered_entries.map { |entry| [entry._label, entry._id] }
|
|
|
|
else
|
|
|
|
[] # unknown content type
|
|
|
|
end
|
2012-01-31 00:50:09 +00:00
|
|
|
end
|
|
|
|
|
2012-02-04 01:10:55 +00:00
|
|
|
end
|
|
|
|
end
|