Another addition and, as always, non-compliance with standards...
HTML:
<modification type="public" template="helper_action" modification_key="editsilently_helper_action" description="Add code to the helper_action template" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<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>]]></find>
<replace><![CDATA[<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.isMemberOf($xf.options.editsilently_groups)}}">
<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.isMemberOf($xf.options.editsilently_groups)}}" />
<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>]]></replace>
</modification>
Why is there no regular expression? For example:
Code:
/(<xf:if is="\$canEditSilently">.*?)/is
Yes, of course, there is not too much to look for, but with a regular expression it would be faster and spend less code to modify. Next
Code:
<xf:if is="{{$xf.options.editsilently_silent_checked && !$xf.options.editsilently_clear_checked && $xf.visitor.isMemberOf($xf.options.editsilently_groups)}}">
<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.isMemberOf($xf.options.editsilently_groups)}}" />
<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>
Why not connect your template or macro?
In addition to all this, the developers have created a smart system of rights. Which can be applied even in the section, but in our section it is placed in authorized groups - this is very bad. Settings do not have their prefix as well as phrases. In one of the additions, I did not pay attention. Yes, the standards say for tables, etc. it is not said about this. But if a phrase is entered into the engine like a conflict, it will be desirable to avoid this and also keep the prefix for settings, phrases, style settings and so on.