Perfect... The addition is aimed at 2.1.x but in the require section there is no check for the XenForo version. Why am I doing this? And now you will see
HTML:
<modification type="admin" template="addon_list" modification_key="activeinactive_addon_list" description="Add code to the addon list template" execution_order="10" enabled="1" action="preg_replace">
<find><![CDATA[#^.*$#s]]></find>
<replace><![CDATA[<xf:title>{{ phrase('add_ons') }}</xf:title>
<xf:css src="addon_list.less" />
<xf:pageaction>
<xf:button href="{{ link('add-ons/install-from-archive') }}" overlay="true" icon="add">
{{ phrase('install_upgrade_from_archive') }}
</xf:button>
<xf:if is="$disabled">
<xf:button href="{{ link('add-ons/mass-toggle', null, {'enable': 1}) }}" overlay="true" data-cache="0">
{{ phrase('enable') }}
</xf:button>
</xf:if>
<xf:button href="{{ link('add-ons/mass-toggle', null, {'enable': 0}) }}" overlay="true" data-cache="0">
{{ phrase('disable_all') }}
</xf:button>
</xf:pageaction>
<xf:if is="$hasProcessing">
<div class="blockMessage blockMessage--error blockMessage--iconic">
{{ phrase('addon_action_pending_warning') }}
</div>
</xf:if>
<xf:macro template="addon_list_macros" name="addon_list_filter" />
<xf:if is="$total">
<div class="addOnList">
<!--[XF:list_block:top]-->
<!-- THIS MACRO IS FOR THE UPGRADEABLE ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block_org"
arg-addOns="{$upgradeable}" arg-heading="{{ phrase('upgradeable_add_ons') }}" />
<!--[XF:list_block:below_upgradeable]-->
<!-- THIS MACRO IS FOR THE INSTALLABLE ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block_org"
arg-addOns="{$installable}" arg-heading="{{ phrase('installable_add_ons') }}" />
<!--[XF:list_block:below_installable]-->
<xf:if is="$xf.options.ozzmodzActiveInactiveOrder == 'active'">
<!-- THIS MACRO IS FOR THE ACTIVE ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block"
arg-addOns="{$installed}" arg-heading="{{ phrase('ozzmodz_activeinactive_active') }}" />
<!--[XF:list_block:below_active]-->
<!-- THIS MACRO IS FOR THE INACTIVE ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block_inactive"
arg-addOns="{$installed}" arg-heading="{{ phrase('ozzmodz_activeinactive_inactive') }}" />
<!--[XF:list_block:below_inactive]-->
<xf:else />
<!-- THIS MACRO IS FOR THE INACTIVE ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block_inactive"
arg-addOns="{$installed}" arg-heading="{{ phrase('ozzmodz_activeinactive_inactive') }}" />
<!--[XF:list_block:below_inactive]-->
<!-- THIS MACRO IS FOR THE ACTIVE ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block"
arg-addOns="{$installed}" arg-heading="{{ phrase('ozzmodz_activeinactive_active') }}" />
<!--[XF:list_block:below_active]-->
</xf:if>
<!-- THIS MACRO IS FOR THE LEGACY ADDONS -->
<xf:macro template="addon_list_macros" name="addon_list_block_org"
arg-addOns="{$legacy}"
arg-heading="{{ phrase('legacy_add_ons') }}"
arg-desc="{{ phrase('legacy_add_ons_desc') }}" />
<!--[XF:list_block:bottom]-->
</div>
<xf:else />
<div class="blockMessage">{{ phrase('no_add_ons_installed_or_available_to_be_installed') }}</div>
</xf:if>]]></replace>
</modification>
Stop, somewhere I already saw it. And for sure:
ozzy47 submitted a new resource: [OzzModz] Hide Member Card From Guests - Hide the member card from guests Another addon brought to you by: This is a simple addon that will hide the member card from guests. There are no settings for this addon. Read more about this resource...
xenforo.com
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: This simple addon will automatically check the edit silently and clear last edit history checkboxes...
xenforo.com
HTML:
<modification type="admin" template="addon_list_macros" modification_key="activeinactive_addon_list_macros" description="Add code to the addon list macros template" execution_order="10" enabled="1" action="preg_replace">
<find><![CDATA[#^.*$#s]]></find>
<replace><![CDATA[<xf:macro name="addon_list_filter">
<div class="block">
<div class="block-outer">
<xf:js src="xf/filter.js" min="1" />
<div class="block-outer-opposite quickFilter u-jsOnly"
data-xf-init="filter"
data-key="addOns"
data-search-target=".addOnList"
data-search-row=".addOnList-row"
data-search-row-group=".block"
data-search-limit=".js-filterSearchable"
data-no-results-format="<div class="blockMessage js-filterNoResults">%s</div>">
<div class="inputGroup inputGroup--inline inputGroup--joined">
<input type="text" class="input js-filterInput" placeholder="{{ phrase('filter...')|for_attr }}" />
<span class="inputGroup-text">
<xf:checkbox standalone="true">
<xf:option class="js-filterPrefix" label="{{ phrase('prefix') }}" />
</xf:checkbox>
</span>
<i class="inputGroup-text js-filterClear is-disabled" aria-hidden="true"></i>
</div>
</div>
</div>
</div>
</xf:macro>
<!-- THIS MACRO IS FOR THE UPGRADEABLE, INSTALLABLE AND LEGACY ADDONS -->
<xf:macro name="addon_list_block_org" arg-addOns="!" arg-heading="!" arg-desc="">
<xf:if is="$addOns is not empty">
<div class="block">
<div class="block-container">
<h3 class="block-header">
{$heading}
<xf:if is="$desc">
<span class="block-desc">
{$desc}
</span>
</xf:if>
</h3>
<ol class="block-body">
<xf:foreach loop="$addOns" value="$addOn">
<xf:macro name="addon_list_item_org" arg-addOn="{$addOn}" />
</xf:foreach>
</ol>
</div>
</div>
</xf:if>
</xf:macro>
<!-- THIS MACRO IS FOR THE ACTIVE ADDONS -->
<xf:macro name="addon_list_block" arg-addOns="!" arg-heading="!" arg-desc="">
<xf:if is="$addOns is not empty">
<div class="block">
<div class="block-container">
<h3 class="block-header">
{$heading}
<xf:if is="$desc">
<span class="block-desc">
{$desc}
</span>
</xf:if>
</h3>
<ol class="block-body">
<xf:foreach loop="$addOns" value="$addOn">
<xf:macro name="addon_list_item" arg-addOn="{$addOn}" />
</xf:foreach>
</ol>
</div>
</div>
</xf:if>
</xf:macro>
<!-- THIS MACRO IS FOR THE INACTIVE ADDONS -->
<xf:macro name="addon_list_block_inactive" arg-addOns="!" arg-heading="!" arg-desc="">
<xf:if is="$addOns is not empty">
<div class="block">
<div class="block-container">
<h3 class="block-header">
{$heading}
<xf:if is="$desc">
<span class="block-desc">
{$desc}
</span>
</xf:if>
</h3>
<ol class="block-body">
<xf:foreach loop="$addOns" value="$addOn">
<xf:macro name="addon_list_items" arg-addOn="{$addOn}" />
</xf:foreach>
</ol>
</div>
</div>
</xf:if>
</xf:macro>
<!-- THIS MACRO LIST IS FOR THE UPGRADEABLE, INSTALLABLE AND LEGACY ADDONS -->
<xf:macro name="addon_list_item_org" arg-addOn="!">
<xf:css src="addon_list.less" />
<li class="block-row block-row--separated addOnList-row{{ ($addOn.isInstalled() && !$addOn.active) ? ' is-disabled' : '' }}">
<div class="contentRow">
<xf:macro name="addon_list_item_icon" arg-addOn="{$addOn}" />
<div class="contentRow-main">
<xf:macro name="addon_list_item_menu" arg-addOn="{$addOn}" />
<h3 class="contentRow-header js-filterSearchable">
{$addOn.title} <span class="contentRow-muted">{$addOn.version_string}</span>
<xf:if is="$addOn.is_processing">
<span class="label label--error" data-xf-init="tooltip" title="{{ phrase('last_action:')|for_attr }} {{ $addOn.last_pending_action ?: phrase('n_a')|for_attr }}">{{ phrase('action_pending') }}</span>
</xf:if>
</h3>
<div class="contentRow-lesser js-filterSearchable{{ !$addOn.description ? ' no-description' : '' }}">
{{ $addOn.description ? snippet($addOn.description, 200)|nl2br : ' ' }}
</div>
<xf:macro name="addon_list_item_footer" arg-addOn="{$addOn}" />
</div>
</div>
</li>
</xf:macro>
<!-- THIS MACRO LIST IS FOR THE ACTIVE ADDONS -->
<xf:macro name="addon_list_item" arg-addOn="!">
<xf:css src="addon_list.less" />
<xf:if is="$addOn.active">
<li class="block-row block-row--separated addOnList-row{{ ($addOn.isInstalled() && !$addOn.active) ? ' is-disabled' : '' }}">
<div class="contentRow">
<xf:macro name="addon_list_item_icon" arg-addOn="{$addOn}" />
<div class="contentRow-main">
<xf:macro name="addon_list_item_menu" arg-addOn="{$addOn}" />
<h3 class="contentRow-header js-filterSearchable">
{$addOn.title} <span class="contentRow-muted">{$addOn.version_string}</span>
<xf:if is="$addOn.is_processing">
<span class="label label--error" data-xf-init="tooltip" title="{{ phrase('last_action:')|for_attr }} {{ $addOn.last_pending_action ?: phrase('n_a')|for_attr }}">{{ phrase('action_pending') }}</span>
</xf:if>
</h3>
<div class="contentRow-lesser js-filterSearchable{{ !$addOn.description ? ' no-description' : '' }}">
{{ $addOn.description ? snippet($addOn.description, 200)|nl2br : ' ' }}
</div>
<xf:macro name="addon_list_item_footer" arg-addOn="{$addOn}" />
</div>
</div>
</li>
</xf:if>
</xf:macro>
....
And all the same to the same topics, all the same problems and violation of standards.
Hmmm your modifications can replace:
Template: addon_list
Find:
#(<xf:if is=\"\$total\">).*(<\/xf:if>)#is
Replace:
HTML:
<xf:if is="$total">
<div class="addOnList">
<xf:macro template="addon_list_macros" name="addon_list_block" arg-upgradeable="{$upgradeable}" arg-installable="{$installable}" arg-installed="{$installed}" arg-legacy="{$legacy}" arg-disabled="{$disabled_addons}" arg-tab="{$tab}" />
</div>
</xf:if>
Template:
addon_list_macros
Find:
#(<xf:macro name=\"addon_list_block\"[^>]*>).*(<\/xf:macro>)#isU
Replace:
<xf:macro name="addon_list_block" arg-upgradeable="!" arg-installable="!" arg-installed="!" arg-legacy="!" arg-disabled="!" arg-tab="">
And include ur template or macro.
So why did I say about checking for the XF version? And everything is simple, because the installation in 1 click appeared in 2.1, and here comes the modification of the templates and the code for 2.1, in part 2.0 will not work. And users who use 2.0.x will receive an error when clicking on the link.
HTML:
<xf:pageaction>
<xf:button href="{{ link('add-ons/install-from-archive') }}" overlay="true" icon="add">
{{ phrase('install_upgrade_from_archive') }}
</xf:button>
<xf:if is="$disabled">
<xf:button href="{{ link('add-ons/mass-toggle', null, {'enable': 1}) }}" overlay="true" data-cache="0">
{{ phrase('enable') }}
</xf:button>
</xf:if>
<xf:button href="{{ link('add-ons/mass-toggle', null, {'enable': 0}) }}" overlay="true" data-cache="0">
{{ phrase('disable_all') }}
</xf:button>
</xf:pageaction>
What gives my example? It will give users the opportunity to use 2.0.x and 2.1.x without any problems on these versions of the engine or add the appropriate check and align templates and their modifications.