XF 2.1 [Solved] Template Modification Help

Ozzy47

Well-known member
Okay, I have this set as a template modification for the helper_action template. I have it as a simple replacement.

FIND:
HTML:
<xf:macro name="edit_type" arg-canEditSilently="{{ false }}" arg-silentName="silent" arg-clearEditName="clear_edit" arg-silentEdit="{{ false }}" arg-clearEdit="{{ false }}">
    <xf:if is="$canEditSilently">
        <xf:checkbox>
            <xf:option name="{$silentName}" checked="{$silentEdit}"
                label="{{ phrase('edit_silently') }}"
                hint="{{ phrase('if_selected_no_last_edited_note_will_be_added_for_this_edit') }}">

                <xf:checkbox>
                    <xf:option name="{$clearEditName}" checked="{$clearEdit}"
                        label="{{ phrase('clear_last_edit_information') }}"
                        hint="{{ phrase('if_selected_any_existing_last_edited_note_will_be_removed') }}" />
                </xf:checkbox>
            </xf:option>
        </xf:checkbox>
    </xf:if>
</xf:macro>

REPLACE:
HTML:
<xf:macro name="edit_type" arg-canEditSilently="{{ false }}" arg-silentName="silent" arg-clearEditName="clear_edit" arg-silentEdit="{{ false }}" arg-clearEdit="{{ false }}">
    <xf:if is="$canEditSilently">
        <xf:if is="{{$xf.options.editsilently_silent_checked && !$xf.options.editsilently_clear_checked && $xf.visitor.hasPermission('forum', 'ozzmodzEditSilently') }}">
            <xf:checkbox>
                <xf:option name="{$silentName}" checked="checked"
                    label="{{ phrase('edit_silently') }}"
                    hint="{{ phrase('if_selected_no_last_edited_note_will_be_added_for_this_edit') }}">
                   
                    <xf:checkbox>
                        <xf:option name="{$clearEditName}" checked="{$clearEdit}"
                            label="{{ phrase('clear_last_edit_information') }}"
                            hint="{{ phrase('if_selected_any_existing_last_edited_note_will_be_removed') }}" />
                    </xf:checkbox>
                </xf:option>
            </xf:checkbox>
        <xf:elseif is="{{$xf.options.editsilently_silent_checked && $xf.options.editsilently_clear_checked && $xf.visitor.hasPermission('forum', 'ozzmodzEditSilently') }}" />      
            <xf:checkbox>
                <xf:option name="{$silentName}" checked="checked"
                    label="{{ phrase('edit_silently') }}"
                    hint="{{ phrase('if_selected_no_last_edited_note_will_be_added_for_this_edit') }}">
                   
                    <xf:checkbox>
                        <xf:option name="{$clearEditName}" checked="checked"
                            label="{{ phrase('clear_last_edit_information') }}"
                            hint="{{ phrase('if_selected_any_existing_last_edited_note_will_be_removed') }}" />
                    </xf:checkbox>
                </xf:option>
            </xf:checkbox>
        <xf:else />
            <xf:checkbox>
                <xf:option name="{$silentName}" checked="{$silentEdit}"
                    label="{{ phrase('edit_silently') }}"
                    hint="{{ phrase('if_selected_no_last_edited_note_will_be_added_for_this_edit') }}">
   
                    <xf:checkbox>
                        <xf:option name="{$clearEditName}" checked="{$clearEdit}"
                            label="{{ phrase('clear_last_edit_information') }}"
                            hint="{{ phrase('if_selected_any_existing_last_edited_note_will_be_removed') }}" />
                    </xf:checkbox>      
                </xf:option>
            </xf:checkbox>
        </xf:if>
    </xf:if>
</xf:macro>

Anyone have a better idea on how to accomplish what I am doing?
 
Nevermind, I got this solved by using a regular expression as suggested, just had to play with the replacement a bit.
 
Back
Top Bottom