{* $Id$ *} {title help="Categories" admpage="category"}{tr}Admin Categories{/tr}{/title}
{button href="tiki-browse_categories.php?parentId=$parentId" _type="link" _icon_name="view" _text="{tr}Browse Categories{/tr}" _title="{tr}Browse the category system{/tr}"} {button href="tiki-edit_categories.php" _type="link" _text="{tr}Organize Objects{/tr}" _icon_name="structure" _title="{tr}Organize Objects{/tr}"}
{tabset} {tab name='{tr}Categories{/tr}'} {$tree} {/tab} {if empty($categId)}{$editLabel = "{tr}Create category{/tr}"}{else}{$editLabel = "{tr}Edit category{/tr}"}{/if} {tab name=$editLabel} {if $categId > 0}

{tr}Edit this category:{/tr} {$categoryName|escape}

{button href="tiki-admin_categories.php?parentId=$parentId#editcreate" _text="{tr}Create New{/tr}" _title="{tr}Create New{/tr}"} {else}

{tr}Add new category{/tr}

{/if}
{ticket}
{if isset($role_groups) && count($role_groups) }
{foreach $role_groups as $role}
{$role.groupRoleName}:
{/foreach}
{/if} {if $tiki_p_admin_categories == 'y'}
{/if} {if $tiki_p_admin_categories == 'y' and $prefs.feature_templated_groups eq 'y'} {jq} $('input[type=checkbox][name=applyRoles]').change(function(ele){ if($('input[type=checkbox][name=applyRoles]:checked').length > 0){ $('#rolesToApply').parent().show("fast"); }else{ $('#rolesToApply').parent().hide("fast"); } }); $('input[type=checkbox][name=applyRoles]').ready(function(ele){ if($('input[type=checkbox][name=applyRoles]:checked').length > 0){ $('#rolesToApply').parent().show("fast"); }else{ $('#rolesToApply').parent().hide("fast"); } }); {/jq}
{if $parentId == 0} {jq} $('#tplGroupContainer').change(function(ele){ var v = $('#tplGroupContainer option:selected').val(); if(v > 0){ $('#patternGroupContainerDiv').show(); }else{ $('#patternGroupContainerDiv').hide(); } }); $('#tplGroupContainer').ready(function(ele){ var v = $('#tplGroupContainer option:selected').val(); if(v > 0){ $('#patternGroupContainerDiv').show(); }else{ $('#patternGroupContainerDiv').hide(); } }); {/jq}
{/if} {/if}
{/tab} {if not empty($parentId) and empty($categId)} {tab name="{tr}Objects in category{/tr}"}

{tr}Objects in category:{/tr} {$categ_name|escape}

{if $objects}
{/if}
{section name=ix loop=$objects} {sectionelse} {norecords _colspan=4} {/section}
{select_all checkbox_names='objects[]'}   {tr}Name{/tr} {tr}Type{/tr}
{icon name='remove'} {$objects[ix].name|truncate:80:"(...)":true|escape} {tr}{$objects[ix].type}{/tr}
{if not empty($objects)}
{ticket}
{/if}
{jq} $("#remove_object_form").unbind("submit").submit(function (e) { $.ajax($(this).attr('action'), { type: 'POST', dataType: 'json', data: $(e.currentTarget).serialize(), success: function (data) { location.href = location.href.replace(/#.*$/, ""); }, error: function (jqxhr) { $(form).showError(jqxhr); } }); return false; }); {/jq}
{pagination_links cant=$cant_objects step=$prefs.maxRecords offset=$offset}{/pagination_links} {/tab} {tab name="{tr}Moving objects{/tr}"}

{tr}Moving objects between categories{/tr}

{tr}Current category:{/tr} {$categ_name|escape}


{ticket}
{tr}Perform an action on all objects in the current category:{/tr}
{/tab} {tab name="{tr}Add objects{/tr}"}

{tr}Add objects to category:{/tr} {$categ_name|escape}

{if $prefs.feature_search eq 'y' and $prefs.unified_add_to_categ_search eq 'y'}
{ticket}
{jq} $("#add_object_form").unbind("submit").submit(function (e) { var form = this, formdata; // turn the list of objects into an parameter "array" $.each($("#add_object_selector").val().split("\n"), function (i, v) { $(form).append($("").val(v)); }); formdata = $(form).serialize(); $.ajax($(form).attr('action'), { type: 'POST', dataType: 'json', data: $(form).serialize(), success: function (data) { location.href = location.href.replace(/#.*$/, ""); }, error: function (jqxhr) { $(form).showError(jqxhr); } }); return false; }); $("#add_object_type").change(function () { $("#add_object_selector").object_selector_multi("setfilter", "type", $("#add_object_type").val()); }); {/jq} {else}{* feature_search=n (not unified search) *}
{pagination_links cant=$maximum step=$maxRecords offset=$offset}{/pagination_links}
{ticket}
{if $prefs.feature_wiki eq 'y' and $pages}
{/if} {if $prefs.feature_articles eq 'y' and $articles}
{/if} {if $prefs.feature_blogs eq 'y' and $blogs}
{/if} {if $prefs.feature_directory === 'y'&& $directories}
{/if} {if $prefs.feature_file_galleries eq 'y' and $file_galleries}
{/if} {if $prefs.feature_forums eq 'y' and $forums}
{/if} {if $prefs.feature_polls eq 'y' and $polls}
{/if} {if $prefs.feature_faqs eq 'y' and $faqs}
{/if} {if $prefs.feature_trackers eq 'y' and $trackers}
{/if} {if $prefs.feature_quizzes eq 'y' and $quizzes}
{/if}
{pagination_links cant=$maximum step=$maxRecords offset=$offset}{/pagination_links} {/if} {/tab} {/if}{* if not empty($parentId) and empty($categId) *} {if empty($categId)} {tab name="{tr}Batch upload{/tr}"}

{tr}Batch upload{/tr}

{ticket}
{tr}Sample file content{/tr}
{* can't indent 
 tag contents *}
category,description,parent
vegetable,Plants used as food,
potato,Root vegetable native to the Americas,vegetable
spinach,Spinach is a leafy green flowering plant,vegetable
{/tab} {/if} {* if empty($categId) *} {/tabset}