{* $Id$ *} {section name=group loop=$groups} {permission name=edit_grouplimitedinfo type=group object=$groups[group].groupName} {if $prefs.useGroupHome eq 'y'} {/if} {/permission} {/section}
{tr}Name{/tr} {tr}Description{/tr} {tr}Actions{/tr}
{$groups[group].groupName|escape} {$groups[group].groupDesc|escape} {tr}{$groups[group].groupHome}{/tr} {actions} {strip} {if $groups[group].groupName neq 'Anonymous' and $groups[group].groupName neq 'Registered' and $groups[group].groupName neq 'Admins'} {icon name="edit" _menu_text='y' _menu_icon='y' alt="{tr}Edit{/tr}"} {/if} {/strip} {/actions}
{jq} $(".edit_group_a").click(function($ele){ var $dialog = $( "#modal_edit_group" ); $dialog.appendTo("body").modal({backdrop:"static"}); var id = $(this).data('id'); var name = $(this).data('name'); var desc = $(this).data('description'); $("#modal_edit_group input[name=name]").val(name); $("#modal_edit_group textarea[name=desc]").val(desc); $("#modal_edit_group input[name=id]").val(id); $("#modal_edit_group .modal-title").html('{tr}Edit{/tr} '+name); }); $("#edit_group_form").validate({ // Specify validation rules rules: { // The key name on the left side is the name attribute // of an input field. Validation rules are defined // on the right side name: "required", }, // Specify validation error messages messages: { name: "{tr}Name is required {/tr}", }, // Make sure the form is submitted to the destination defined // in the "action" attribute of the form when valid submitHandler: function(form) { $.ajax({ type: "POST", url: 'tiki-edit_groups.php', data: $(form).serialize(), // serializes the form's elements. success: function(data) { $( "#modal_edit_group" ).modal('hide'); location.reload(); }, error: function(data){ alert("{tr}Error saving group{/tr}"); } }); event.preventDefault(); } }); {/jq}