complete new parser for layout_part
This commit is contained in:
1 parent
278938a52d
commit
34d0b8fac1
5 files changed
+37
-7
No files matched your search
+21
-2
@@ -206,7 +206,27 @@ module Parser
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#=============
|
||||
def parse_layout_layout_part(layout)
|
||||
content = layout.content
|
||||
context = parser_layout_layout_part(layout)
|
||||
parser = Radius::Parser.new(context, :tag_prefix => 'r')
|
||||
parser.parse(content)
|
||||
end
|
||||
|
||||
def parser_layout_layout_part(layout )
|
||||
Radius::Context.new do |c|
|
||||
c.define_tag 'layout_part' do |tag|
|
||||
data={}
|
||||
data[:class_tag]=tag.attr['class'].to_s
|
||||
data[:id_tag]=tag.attr['id'].to_s
|
||||
data[:name_tag]=tag.attr['name'].to_s
|
||||
data[:editable_tag]=tag.attr['editable'].to_s
|
||||
layout.layout_parts.create(data)
|
||||
end
|
||||
end
|
||||
end
|
||||
#============
|
||||
def parse_content_update_code(page, page_content)
|
||||
context = parser_context_update_code(page, page_content)
|
||||
parser = Radius::Parser.new(context, :tag_prefix => 'r')
|
||||
@@ -279,7 +299,6 @@ module Parser
|
||||
def self.included(base)
|
||||
base.send :helper_method, :parse_page if base.respond_to? :helper_method
|
||||
base.send :helper_method, :parse_page_edit if base.respond_to? :helper_method
|
||||
base.send :helper_method, :parse_page_code if base.respond_to? :helper_method
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user