module Optimacms module ApplicationHelper #include ActionView::Helpers::ApplicationHelper #include SimpleFilter::FormsHelper def method_missing(method, *args, &block) main_app.send(method, *args, &block) rescue NoMethodError super end def tinymce_editor_insert_block '
{{block:name:sub}}' end def eval_meta_string(s) eval('"'+s+'"') end def fix_quotes(s) s.gsub /"/, '\"' end def url_for(options = nil) #url_for # page processed by CMS if options.present? && options.kind_of?(Hash) && options[:controller]=='optimacms/pages' && options[:action]=='show' # get current page name page_name = options[:page_name] || controller.optimacms_pagedata.page.name if page_name.present? u = site_page_path(page_name, options) if u.present? return u end end end # return super(options) end def meta_tags(title=nil, keywords=nil, desc=nil) #s = 'news "11"' #s1 = s.gsub /"/, '\"' #s2 = eval('"'+s1+'"') title ||= eval_meta_string(fix_quotes(@optimacms_meta_title)) keywords ||= eval_meta_string(@optimacms_meta_keywords) desc ||= eval_meta_string(@optimacms_meta_description) return %(