[OzzModz] Separate Active/Inactive Addons [Deleted]

Ozzy47

Well-known member
ozzy47 submitted a new resource:

[OzzModz] Separate Active/Inactive Addons - Separate the active and inactive addons

Another addon brought to you by:
View attachment 202850

This simple addon will separate your active and inactive addons. This separates them on the ACP index and on the addon list page.

I created this because I found it annoying scrolling throught the addons and seeing the inactive ones cluttering up the list.

There are no settings for the addon. Just install it and forget it.

View attachment 202851

This addon is also available on my site...

Read more about this resource...
 
Suggestion for your addons in general @ozzy47 :

You should add a "support" tag to your addons, like this

202866

which redirects it to the addon's page on XF.


A feature suggestion to this addon:

Since you figured out how to seperate addons in the addons' list based on active and inactive.
Could you also seperate the addons alphabetically in the active list, if possible?
 
You should add a "support" tag to your addons, like this
Yeah, probably on the next update to the addon.

A feature suggestion to this addon:

Since you figured out how to seperate addons in the addons' list based on active and inactive.
Could you also seperate the addons alphabetically in the active list, if possible?
I thought about that, will look into the possibility at some time.
 
  • Like
Reactions: sbj
A great feature that I'd like to see is to completely remove addons. I have a couple disabled ones that I can only remove via FTP and I'd rather not mess with that; just click delete like in WordPress.
 
A great feature that I'd like to see is to completely remove addons. I have a couple disabled ones that I can only remove via FTP and I'd rather not mess with that; just click delete like in WordPress.

That is a bit beyond the scope of this addon, and I would rather not get into removing addons from someone's site.
 
  • Like
Reactions: frm
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:
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=&quot;blockMessage js-filterNoResults&quot;>%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 : '&nbsp;' }}
                    </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 : '&nbsp;' }}
                        </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.
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.
 
Thanks for reporting this. I will look into it and update if necessary.

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:
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=&quot;blockMessage js-filterNoResults&quot;>%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 : '&nbsp;' }}
                    </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 : '&nbsp;' }}
                        </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.
 
Top Bottom