From 292575bcae5580c16afb8ec73997ec8c194c2b47 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 14 Aug 2014 16:07:28 +0100 Subject: [PATCH] Simplify Tag.tpl code --- templates/CRM/Tag/Form/Tag.tpl | 30 +---------------------- templates/CRM/Tag/Form/Tagtree.tpl | 38 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 templates/CRM/Tag/Form/Tagtree.tpl diff --git a/templates/CRM/Tag/Form/Tag.tpl b/templates/CRM/Tag/Form/Tag.tpl index 834b586fc8..87a9830185 100644 --- a/templates/CRM/Tag/Form/Tag.tpl +++ b/templates/CRM/Tag/Form/Tag.tpl @@ -85,35 +85,7 @@

{if !$hideContext}{ts}Tags{/ts}{/if}

-
    - {foreach from=$tree item="node" key="id"} -
  • - {if ! $node.children}{/if} - {if $node.children}{/if} - {if $node.children} {/if} - {if $node.children} -
      - {foreach from=$node.children item="subnode" key="subid"} -
    • - - {if $subnode.children} {/if} - {if $subnode.children} -
        - {foreach from=$subnode.children item="subsubnode" key="subsubid"} -
      • - - -
      • - {/foreach} -
      - {/if} -
    • - {/foreach} -
    - {/if} -
  • - {/foreach} -
+ {include file="CRM/Tag/Form/Tagtree.tpl"}

{include file="CRM/common/Tagset.tpl"} diff --git a/templates/CRM/Tag/Form/Tagtree.tpl b/templates/CRM/Tag/Form/Tagtree.tpl new file mode 100644 index 0000000000..cbbf37aa06 --- /dev/null +++ b/templates/CRM/Tag/Form/Tagtree.tpl @@ -0,0 +1,38 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM version 4.5 | + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC (c) 2004-2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM. | + | | + | CiviCRM is free software; you can copy, modify, and distribute it | + | under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | + | | + | CiviCRM is distributed in the hope that it will be useful, but | + | WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License and the CiviCRM Licensing Exception along | + | with this program; if not, contact CiviCRM LLC | + | at info[AT]civicrm[DOT]org. If you have questions about the | + | GNU Affero General Public License or the licensing of CiviCRM, | + | see the CiviCRM license FAQ at http://civicrm.org/licensing | + +--------------------------------------------------------------------+ +*} +{* This tpl runs recursively to build each level of the tag tree *} + -- 2.25.1