[OzzModz] Edit Silently And Clear Edit History Checked

[OzzModz] Edit Silently And Clear Edit History Checked 2.0.0

No permission to download

Ozzy47

Well-known member
ozzy47 submitted a new resource:

[OzzModz] Edit Silently And Clear Edit History Checked - Auto check the edit silently and clear last edit history checkboxes

Another addon brought to you by:
View attachment 202312

This simple addon will automatically check the edit silently and clear last edit history checkboxes.

There are three settings for the addon.

  • Edit silently checked. You can set the edit silently box to be automatically checked.
  • Clear last edit information checked. You can set the clear edit history box to be automatically checked.
  • Allowed user groups. You can select which usergroups...

Read more about this resource...
 
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?
Template modifications must be careful not to replace too much of a template. This might require the use of more complex methods such as a PHP callback or regular expression match.
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.
 
Thanks for reporting this. I will look into it and update if necessary.

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.
 
Last edited:
Hello,

Are those to be set on the plugin options? Because I didn't see more than two options in there.

Regards,
Zentral.

EDIT: Disregard that, I managed to find it. Great addon and exactly what we were looking for!
 
Last edited:
Back
Top Bottom