{* $Id$ *} {title}{tr}Organizer{/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}"} {if $tiki_p_admin_categories eq 'y'} {button href="tiki-admin_categories.php?parentId=$parentId" _type="link" _icon_name="settings" _text="{tr}Admin Categories{/tr}" _title="{tr}Admin the Category System{/tr}"} {/if}
{remarksbox title="{tr}Move objects between categories{/tr}"}
  1. {tr}Click on the category name to display the list of objects in that category.{/tr}
  2. {tr}Select the objects to affect. Controls will appear in the category browser.{/tr}
  3. {tr}Use the plus and minus signs to add or remove the categories on selected objects.{/tr}
{/remarksbox}
{$tree}
{filter action="tiki-edit_categories.php" filter=$filter}{/filter}
{tr}Object list result{/tr}
{if $result && count($result)} {tr}Select objects to change categorization:{/tr}
    {foreach from=$result item=object} {object_link type=$object.object_type id=$object.object_id} {/foreach}
{if $result->hasMore()}

{tr}More results are available. Please refine the search criteria.{/tr}

{/if}

{tr}Select all{/tr} {tr}Unselect all{/tr}

{else} {tr}No results{/tr} {/if}
{jq} function perform_selection_action(action, row) { var objects = [], categId = $(row).find('a').data('categ'), clicked = action === 'categorize' ? '.categ-add' : '.categ-remove'; $('.object-list :checked').each(function () { objects.push($(this).val()); }); $('.control' + clicked, row).first().fadeTo(10, .20); $.ajax({ type: 'POST', url: $.service('category', action), dataType: 'json', data: { categId: categId, objects: objects, ticket: $(row).find('span.control:first').data('ticket') }, complete: function (data) { location.href = location.href.replace(/#.*$/, ""); } }); } $('.categ-add') .click(function () { perform_selection_action('categorize', $(this).closest('li')[0]); }) .addClass('ui-icon') .addClass('ui-icon-circle-plus'); $('.categ-remove') .click(function () { perform_selection_action('uncategorize', $(this).closest('li')[0]); }) .addClass('ui-icon') .addClass('ui-icon-circle-minus'); $('.control').hide(); $('.object-list :checkbox').change(function () { $('.control').toggle($('.object-list :checkbox:checked').length > 0); }); $('.object-list li:not(.available) :checkbox').attr('disabled', true); $('.select-all').click(function () { $('.object-list :unchecked').prop('checked', true).change(); return false; }); $('.unselect-all').click(function () { $('.object-list :checked').prop('checked', false).change(); return false; }); {/jq}