if parts[first+1][0] == '$':
# This takes care of elements where the filename is a variable, e.g. {{ inc $file }}
- element += 'file:' + ldelim + parts[first+1].rstrip('}') + rdelim
+ element += ldelim + parts[first+1].rstrip('}') + rdelim
else:
# This takes care of elements where the filename is a path, e.g. {{ inc file.tpl }}
element += parts[first+1].rstrip('}')
filename = os.path.join(path,a_file)
ext = a_file.split('.')[-1]
if os.path.isfile(filename) and ext == 'tpl':
- with open(filename, 'r') as f:
- newfilename = os.path.join(outpath,a_file)
- with open(newfilename, 'w') as outf:
- print "Converting " + filename + " to " + newfilename
- convert(f, outf, php_tpl)
+ f = open(filename, 'r')
+ newfilename = os.path.join(outpath,a_file)
+ outf = open(newfilename, 'w')
+
+ print "Converting " + filename + " to " + newfilename
+ convert(f, outf, php_tpl)
+
+ outf.close()
+ f.close()
{{/if}}
{{if $item.comment_lastcollapsed}}</div>{{/if}}
- {{include file="file:{{$item.template}}"}}
+ {{include file="{{$item.template}}"}}
{{/foreach}}
{{$live_update}}
{{foreach $threads as $thread}}
-{{include file="file:{{$thread.template}}" item=$thread}}
+{{include file="{{$thread.template}}" item=$thread}}
{{/foreach}}
<div id="conversation-end"></div>
<div class="wall-item-outside-wrapper-end {{$item.indent}} {{$item.shiny}}" ></div>
</div>
{{foreach $item.children as $child}}
- {{include file="file:{{$child.template}}" item=$child}}
+ {{include file="{{$child.template}}" item=$child}}
{{/foreach}}
</div>
{{/if}}
{{if $item.comment_lastcollapsed}}</div>{{/if}}
- {{include file="file:{{$item.template}}"}}
+ {{include file="{{$item.template}}"}}
{{/foreach}}
<p id="register-realpeople">{{$realpeople}}</p>
<br />
-{{if $oidlabel }}
+{{if $oidlabel}}
<div id="register-openid-wrapper" >
- <label for="register-openid" id="label-register-openid" >{{$oidlabel}}</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="{{$openid}}" >
+ <label for="register-openid" id="label-register-openid" >{{$oidlabel}}</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="{{$openid}}" >
</div>
<div id="register-openid-end" ></div>
{{/if}}
{{$live_update}}
{{foreach $threads as $thread}}
-{{include file="file:{{$thread.template}}" item=$thread}}
+{{include file="{{$thread.template}}" item=$thread}}
{{/foreach}}
<div id="conversation-end"></div>
<!--<div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>-->
<!--</div>-->
{{foreach $item.children as $child}}
- {{include file="file:{{$child.template}}" item=$child}}
+ {{include file="{{$child.template}}" item=$child}}
{{/foreach}}
{{if $item.flatten}}
</div>
<div class="acl-list-item" rel="acl-template" style="display:none">
- <img data-src="{0}"><p>{1}</p>
<a href="#" class='acl-button-show'>{{$show}}</a>
<a href="#" class='acl-button-hide'>{{$hide}}</a>
</div>
<p id="register-realpeople">{{$realpeople}}</p>
<br />
-{{if $oidlabel }}
+{{if $oidlabel}}
<div id="register-openid-wrapper" >
- <label for="register-openid" id="label-register-openid" >{{$oidlabel}}</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="{{$openid}}" >
+ <label for="register-openid" id="label-register-openid" >{{$oidlabel}}</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="{{$openid}}" >
</div>
<div id="register-openid-end" ></div>
{{/if}}
{{$live_update}}
{{foreach $threads as $thread}}
-{{include file="file:{{$thread.template}}" item=$thread}}
+{{include file="{{$thread.template}}" item=$thread}}
{{/foreach}}
<div id="conversation-end"></div>
<!--<div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>-->
<!--</div>-->
{{foreach $item.children as $child}}
- {{include file="file:{{$child.template}}" item=$child}}
+ {{include file="{{$child.template}}" item=$child}}
{{/foreach}}
{{if $item.flatten}}
{{if $item.type == tag}}
{{include file="wall_item_tag.tpl"}}
{{else}}
- {{include file="file:{{$item.template}}"}}
+ {{include file="{{$item.template}}"}}
{{/if}}
{{/foreach}}
{{if $thread.type == tag}}
{{include file="wall_item_tag.tpl" item=$thread}}
{{else}}
- {{include file="file:{{$thread.template}}" item=$thread}}
+ {{include file="{{$thread.template}}" item=$thread}}
{{/if}}
</div>
{{if $child.type == tag}}
{{include file="wall_item_tag.tpl" item=$child}}
{{else}}
- {{include file="file:{{$item.template}}" item=$child}}
+ {{include file="{{$item.template}}" item=$child}}
{{/if}}
{{/foreach}}
<div class="wall-item-outside-wrapper-end {{$item.indent}} {{$item.shiny}}" ></div>
{{foreach $item.children as $child}}
- {{include file="file:{{$child.template}}" item=$child}}
+ {{include file="{{$child.template}}" item=$child}}
{{/foreach}}
{{if $item.flatten}}
<div class="wall-item-outside-wrapper-end {{$item.indent}} {{$item.shiny}}" ></div>
{{foreach $item.children as $child}}
- {{include file="file:{{$child.template}}" item=$child}}
+ {{include file="{{$child.template}}" item=$child}}
{{/foreach}}
{{if $item.flatten}}
{{if $thread.type == tag}}
{{include file="wall_item_tag.tpl" item=$thread}}
{{else}}
- {{include file="file:{{$thread.template}}" item=$thread}}
+ {{include file="{{$thread.template}}" item=$thread}}
{{/if}}
</div>
{{if $item.type == tag}}
{{include file="wall_item_tag.tpl" item=$child}}
{{else}}
- {{include file="file:{{$item.template}}" item=$child}}
+ {{include file="{{$item.template}}" item=$child}}
{{/if}}
{{/foreach}}