<{* $Revision: 1.10.2.1.2.7 $ *}>

<p>
<{$smarty.const._MI_XOONIPS_ACCOUNT_PANKUZU_MODERATOR}>
<{$smarty.const._MI_XOONIPS_ACCOUNT_PANKUZU_SEPARATOR}>
<{if $op eq "register" }>
<{$smarty.const._MD_XOONIPS_MODERATOR_PANKUZU_CREATE_NEW_GROUPS}>
<{else if $op eq "" or $op eq "update" or $op eq "edit"}>
<{$smarty.const._MD_XOONIPS_MODERATOR_PANKUZU_EDIT_GROUPS}>
<{if !empty( $gname )}>
<{$smarty.const._MI_XOONIPS_ACCOUNT_PANKUZU_SEPARATOR}>
<{$gname}>
<{/if}>
<{/if}>
</p>

<{if $op eq "" or $op eq "update" or $op eq "delete" }>
<table class="outer" cellspacing="1" cellpadding="4">
  <tr>
    <th><{$smarty.const._MD_XOONIPS_MODERATOR_GNAME}></th>
    <th><{$smarty.const._MD_XOONIPS_MODERATOR_GDESC}></th>
    <th><{$smarty.const._MD_XOONIPS_MODERATOR_OPERATION}></th>
  </tr>
<{foreach from=$groups item=grp}>
  <tr>
    <td class="head"><{$grp.gname}></td>
    <td class="<{cycle name="row1" values="even,odd"}>">
      <{$grp.gdesc}>
      <{if $grp.isLocked}>
        <br /><span style='color: red;'><{$grp.lockTypeString}></span>
      <{/if}>
    </td>
    <td class="<{cycle name="row2" values="even,odd"}>" style='white-space: nowrap;'>
      <{if $grp.isLocked}>
        &nbsp;
      <{else}>
        <a href="editgroups.php?op=edit&amp;gid=<{$grp.gid}>"><{$smarty.const._MD_XOONIPS_MODERATOR_EDIT}></a> /
        <a href='javascript:void(0);' onclick="return askAndDeleteGroup(<{$grp.gid}>)"><{$smarty.const._MD_XOONIPS_MODERATOR_DELETE}></a>
      <{/if}>
    </td>
  </tr>
<{/foreach}>
</table>
<br /><br />
<{/if}>

<{if $op eq "" or $op eq "register" or $op eq "update" or $op eq "edit" or $op eq "delete" }>
<form name="groupinfo" action="editgroups.php" onsubmit="return xoopsFormValidate_groupinfo();" method="post"<{$accept_charset}>>
<table class="outer" cellspacing="1" cellpadding="4">
 <tr>
  <th colspan="2">
<{if $op eq "edit"}>
<{$smarty.const._MD_XOONIPS_MODERATOR_EDIT_GROUP}>
<input type="hidden" name="op" value="update"/>
<input type="hidden" name="gid" value="<{$gid}>"/>
<{else}>
<{$smarty.const._MD_XOONIPS_MODERATOR_CREATE_GROUP}>
<input type="hidden" name="op" value="register"/>
<{/if}>
  </th>
 </tr>
 <tr>
  <td class="head"><{$smarty.const._MD_XOONIPS_MODERATOR_GNAME}></td>
  <td class="<{cycle name="oddeven" values="odd,even"}>"><input type="text" name="gname" size="50" value="<{$gname}>"/>
<{if !empty($gname_exists) && $gname_exists}>
  <br /><span style="color: red;"><{$smarty.const._MD_XOONIPS_GROUPNAME_ALREADY_EXISTS}></span>
<{/if}>
<{if !empty($gname_forbidden) && $gname_forbidden}>
  <br /><span style="color: red;"><{$smarty.const._MD_XOONIPS_GROUPNAME_FORBIDDEN}></span>
<{/if}>
 </td>
 </tr>
 <tr>
  <td class="head"><{$smarty.const._MD_XOONIPS_MODERATOR_GDESC}></td>
  <td class="<{cycle name="oddeven"}>"><textarea name="gdesc" rows="5" cols="50" style="width:400px;"><{$gdesc}></textarea></td>
 </tr>
 <tr>
  <td class="head"><{$smarty.const._MD_XOONIPS_MODERATOR_GROUP_ADMIN}></td>
  <td class="<{cycle name="oddeven"}>">
   <select name="gadmins[]" size="10" multiple="multiple">
    <{foreach from=$gadmins item=user}>
    <option value="<{$user.uid}>"<{if $user.isadmin eq 1}> selected="selected"<{/if}>><{$user.uname}></option>
    <{/foreach}>
   </select>
  </td>
 </tr>
 <tr>
  <td class="head"><{$smarty.const._MD_XOONIPS_MODERATOR_ITEM_NUMBER_LIMIT}></td>
  <td class="<{cycle name="oddeven"}>"><input type="text" name="item_number_limit" value="<{$item_number_limit}>"/></td>
 </tr>
 <tr>
  <td class="head"><{$smarty.const._MD_XOONIPS_MODERATOR_INDEX_NUMBER_LIMIT}></td>
  <td class="<{cycle name="oddeven"}>"><input type="text" name="index_number_limit" value="<{$index_number_limit}>"/></td>
 </tr>
 <tr>
  <td class="head"><{$smarty.const._MD_XOONIPS_MODERATOR_ITEM_STORAGE_LIMIT}></td>
  <td class="<{cycle name="oddeven"}>"><input type="text" name="item_storage_limit" value="<{$item_storage_limit}>"/></td>
 </tr>
 <tr>
  <td class="head" colspan="2">
   <input class="formButton" type="submit" name="submit" value="<{$smarty.const._US_SUBMIT}>"/>
  </td>
 </tr>
</table>
</form>
<br /><br />
<{/if}>

<form id='xoonips_delete_group_form' action='editgroups.php' method='post'>
<input type='hidden' name='gid' />
<input type='hidden' name='op' value='delete' />
</form>

<script type="text/javascript">
<!--//
function xoopsFormValidate_groupinfo() {
	myform = window.document.groupinfo;
	if ( myform.gname.value == "" ) { window.alert("<{$smarty.const._MD_XOONIPS_MODERATOR_ENTER_GROUP_NAME}>"); myform.gname.focus(); return false; }
	return true;
}
function askAndDeleteGroup(gid){
	if( !confirm('<{$smarty.const._MD_XOONIPS_MODERATOR_REALLY_DELETE}>')){
		return false;
	}
	var form = document.getElementById('xoonips_delete_group_form');
	form.gid.value=gid;
	return form.submit();
}
//--></script>
