Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
- +--------------------------------------------------------------------+
- | 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 |
- +--------------------------------------------------------------------+
- *}
- <style>
- .hit {ldelim}padding-left:10px;{rdelim}
- .tree li {ldelim}padding-left:10px;{rdelim}
- #Tag .tree .collapsable .hit {ldelim}background:url('{$config->resourceBase}i/menu-expanded.png') no-repeat left 8px;padding-left: 9px;cursor:pointer{rdelim}
- #Tag .tree .expandable .hit {ldelim}background:url('{$config->resourceBase}i/menu-collapsed.png') no-repeat left 6px;padding-left: 9px;cursor:pointer{rdelim}
- #Tag #crm-tagListWrap .highlighted {ldelim}background-color:lightgrey;{rdelim}
- </style>
- {*crmScript ext=civicrm.jquery.plugins.jstree file=jquery.jstree.js*}
- <script type="text/javascript">
- (function($){ldelim}
- var entityID={$entityID};
- var entityTable='{$entityTable}';
- {literal}
- $(function() {
- $("#crm-tagListWrap input").removeAttr("disabled");
- //unobsctructive elements are there to provide the function to those not having javascript, no need for the others
- $(".unobstructive").hide();
- $("#crm-tagListWrap ul input:checked").each(function(){
- $(this).parents("li").children(".jstree-icon").addClass('highlighted');
- });
- //load js tree.
- $("#crm-tagListWrap").jstree({
- "plugins" : ["themes", "html_data"],
- "themes": {"url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/default/style.css'}
- });
- });
- })(cj);
- {/literal}
- </script>
- {if $title}
- <div class="crm-accordion-wrapper crm-tagGroup-accordion collapsed">
- <div class="crm-accordion-header">{$title}</div>
- <div class="crm-accordion-body" id="tagGroup">
- {/if}
- <table class="form-layout-compressed{if $context EQ 'profile'} crm-profile-tagsandgroups{/if}">
- <tr>
- {if $groupElementType eq 'crmasmSelect'}
- <td><span class="label">{if $title}{$form.group.label}{/if}</span>
- {$form.group.html}
- {literal}
- <script type="text/javascript">
- cj(function(){
- cj("select#group").crmasmSelect({
- respectParents: true
- });
- });
- </script>
- {/literal}
- </td>
- {/if}
- <td width="70%"><span class="label">{if $title}{$form.$key.label}{/if}</span>
- <div id="crm-tagListWrap">
- <ul class="tree">
- {foreach from=$tree item="node" key="id"}
- <li id="crm-tagRow{$id}">
- {if !$node.children}<input name="tag[{$id}]" id="tag_{$id}" type="checkbox" class="form-checkbox" value="1" {if $tagged[$id]}checked="checked"{/if}/>{/if}
- {if $node.children}<input name="tag[{$id}]" id="tag_{$id}" type="checkbox" class="form-checkbox" value="1" {if $tagged[$id]}checked="checked"{/if}/>{/if}
- {if $node.children} <span class="hit"></span> {/if} <label for="tag_{$id}">{$node.name}</label>
- {if $node.children}
- <ul>
- {foreach from=$node.children item="subnode" key="subid"}
- <li id="crm-tagRow{$subid}">
- <input id="tag_{$subid}" name="tag[{$subid}]" type="checkbox" class="form-checkbox" value="1" {if $tagged[$subid]}checked="checked"{/if}/>
- {if $subnode.children} <span class="hit"></span> {/if} <label for="tag_{$subid}">{$subnode.name}</label>
- {if $subnode.children}
- <ul>
- {foreach from=$subnode.children item="subsubnode" key="subsubid"}
- <li id="crm-tagRow{$subsubid}">
- <input id="tag_{$subsubid}" name="tag[{$subsubid}]" type="checkbox" class="form-checkbox" value="1" {if $tagged[$subsubid]}checked="checked"{/if}/>
- <label for="tag_{$subsubid}">{$subsubnode.name}</label>
- </li>
- {/foreach}
- </ul>
- {/if}
- </li>
- {/foreach}
- </ul>
- {/if}
- </li>
- {/foreach}
- </ul>
- </div>
- </td>
- </tr>
- {if !$type || $type eq 'tag'}
- <tr><td>{include file="CRM/common/Tag.tpl"}</td></tr>
- {/if}
- </table>
- {if $title}
- </div>
- </div><!-- /.crm-accordion-wrapper -->
- {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement