<script type="text/javascript" charset="utf-8">
jQuery.noConflict();
jQuery(function(){
	jQuery("#<{$dirname}>_admin_groupEditForm :button[rel^='prettyPopin']").prettyPopin({
		width : 400, /* false/integer */
		height: 400, /* false/integer */
		opacity: 0.5, /* value from 0 to 1 */
		animationSpeed: '0', /*
		slow/medium/fast/integer */
		close : false, /* true/false */
		followScroll: false, /* true/false */
        dirname : '<{$dirname}>',
		loader_path: '../images/loader.gif', /* path to your loading image */
		callback: function(id,value){
			var form=jQuery('#<{$dirname}>_admin_groupEditForm');
			form.attr('action','index.php?action=GroupEdit&groupid=<{$actionForm->get('groupid')}>&adminvalue=' + value);
			form.submit();
			return false;
		} /* callback called when closing the popin */
	});
});
function deleteIcon(){
	jQuery('#<{$dirname}>_icon').attr('style','display:none');
	jQuery('#<{$dirname}>_showThumbnail').attr('value',2);
}
</script>
<div class="adminnavi">
  <a href="./index.php"><{$smarty.const._MI_USER_NAME}></a>
  &raquo;&raquo; <a href="./index.php?action=GroupList"><{$smarty.const._AD_USER_LANG_GROUP_LIST}></a>
  &raquo;&raquo;
  <{if $actionForm->get('groupid') }>
    <span class="adminnaviTitle"><{$smarty.const._AD_USER_LANG_GROUP_EDIT}></span>
  <{else}>
    <span class="adminnaviTitle"><{$smarty.const._AD_USER_LANG_GROUP_NEW}></span>
  <{/if}>
</div>

<{if $actionForm->get('groupid') }>
  <h3 class="admintitle"><{$smarty.const._AD_USER_LANG_GROUP_EDIT}> (<{$actionForm->get('name')}>)</h3>
<{else}>
  <h3 class="admintitle"><{$smarty.const._AD_USER_LANG_GROUP_NEW}></h3>
<{/if}>

<{if $actionForm->hasError()}>
<div class="error">
  <ul>
    <{foreach item=message from=$actionForm->getErrorMessages()}>
      <li><{$message|xoops_escape}></li>
    <{/foreach}>
  </ul>
</div>
<{/if}>

<form id="<{$dirname}>_admin_groupEditForm" action="?action=GroupEdit" method="post" enctype="multipart/form-data">
  <{xoops_token form=$actionForm}>
  <{xoops_input type=hidden name=groupid value=$actionForm->get('groupid')}>
  <{xoops_input type=hidden name=warning value=$actionForm->get('warning')}>
  <input type="hidden" id="<{$dirname}>_showThumbnail" name="showThumbnail" value="<{$actionForm->get('showThumbnail')}>"/>
  <table class="outer">
    <tr>
      <th colspan="2">
      <{if $actionForm->get('groupid') }>
        <{$smarty.const._AD_USER_LANG_GROUP_EDIT}> (<{$actionForm->get('name')}>)
      <{else}>
        <{$smarty.const._AD_USER_LANG_GROUP_NEW}>
      <{/if}>
      </th>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_NAME}><span style="color: red;">*</span></td>
      <td class="<{cycle values="odd,even"}>">
        <{xoops_input type=text name=name value=$actionForm->get('name')}>
      </td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_DESC}></td>
      <td class="<{cycle values="odd,even"}>">
        <{xoops_dhtmltarea name=description value=$actionForm->get('description')}>
      </td>
    </tr>
    <{if $actionForm->get('group_type') eq ''}>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_ADMIN}><span style="color: red;">*</span></td>
      <td class="<{cycle values="odd,even"}>">
        <{foreach item=admin from=$actionForm->get('admins')}>
  	 	<div id="<{$dirname}>_uid<{$admin.uid}>">
  		<input type="hidden" name="uid[]" value="<{$admin.uid}>" />
    	<{$admin.name|xoops_escape}><{if $admin.name}>(<{/if}><{$admin.uname|xoops_escape}><{if $admin.name}>)<{/if}>
    	<a href="javascript:deleteUser(<{$admin.uid}>);">
   		<img src="../images/delete.gif" alt="<{$smarty.const._DELETE}>" title="<{$smarty.const._DELETE}>" />
       	</a><br />
       	</div>
        <{/foreach}>
  	    <input type="button" href="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/userselectsub.php?callbackid=1;1;1" rel="prettyPopin" value="<{$smarty.const._MD_USER_LANG_SEARCH}>"/> 
      </td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_ICON}><br /></td>
      <td class="<{cycle values="odd,even"}>">
        <input type="file" name="filepath" size="40"><br/>
        <div id="<{$dirname}>_icon">
        <{if $actionForm->get('showThumbnail') eq 1}>
          <img src="<{$xoops_url}>/modules/<{$dirname}>/image.php?group_id=<{$actionForm->get('groupid')}>&type=<{$actionForm->get('mime_type')}>"/>
	      <input type="button" value="<{$smarty.const._DELETE}>" onclick="deleteIcon()"/> 
        <{/if}>
        </div>
      </td>
    </tr>
    <{if $actionForm->get('groupid') }>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_PUBLIC}><br /></td>
      <td class="<{cycle values="odd,even"}>">
  	    <input type="radio" <{if $actionForm->get('is_public') eq 1}>checked<{/if}> name="is_public" value="1" <{if $actionForm->get('warning') ne ''}>disabled="disabled"<{/if}>/><{$smarty.const._AD_USER_LANG_ALL}>
  		<input type="radio" <{if $actionForm->get('is_public') eq 0}>checked<{/if}> name="is_public" value="0" <{if $actionForm->get('warning') ne ''}>disabled="disabled"<{/if}>/><{$smarty.const._AD_USER_LANG_GROUP_ONLY}>
  	    <{if $actionForm->get('warning') eq ''}><br/><{else}><span style="color: red;">&nbsp;&nbsp;&nbsp;<{$actionForm->get('warning')}></span><{/if}>
      </td>
    </tr>
    <{/if}>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_JOIN_REQUEST}><br /></td>
      <td class="<{cycle values="odd,even"}>">
  		<input type="radio" <{if $actionForm->get('can_join') eq 1}>checked<{/if}> name="can_join" value="1"/><{$smarty.const._AD_USER_LANG_PERMIT}>
  		<input type="radio" <{if $actionForm->get('can_join') eq 0}>checked<{/if}> name="can_join" value="0"/><{$smarty.const._AD_USER_LANG_NO_PERMIT}>  				
      </td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_HIDDEN}><br /></td>
      <td class="<{cycle values="odd,even"}>">
  	    <input type="radio" <{if $actionForm->get('is_hidden') eq 0}>checked<{/if}> name="is_hidden" value="0" <{if $actionForm->get('warning') eq ''}>onclick="hiddenClick('0')"<{else}>disabled="disabled"<{/if}>/><{$smarty.const._AD_USER_LANG_NO}> 	
 	    <input type="radio" <{if $actionForm->get('is_hidden') eq 1}>checked<{/if}> name="is_hidden" value="1" <{if $actionForm->get('warning') eq ''}>onclick="hiddenClick('1')"<{else}>disabled="disabled"<{/if}>/><{$smarty.const._AD_USER_LANG_YES}> 			 		
  	    <{if $actionForm->get('warning') ne ''}><span style="color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<{$actionForm->get('warning')}></span><{/if}>
      </td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_MEMBER_ACCEPT}><br /></td>
      <td class="<{cycle values="odd,even"}>">
   		<input type="radio" <{if $actionForm->get('member_accept') eq 1}>checked<{/if}> name="member_accept" value="1"/><{$smarty.const._AD_USER_LANG_AUTO}>
  		<input type="radio" <{if $actionForm->get('member_accept') eq 0}>checked<{/if}> name="member_accept" value="0"/><{$smarty.const._AD_USER_LANG_MANUAL}>
      </td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_GROUP_ITEM_ACCEPT}><br /></td>
      <td class="<{cycle values="odd,even"}>">
   	    <input type="radio" <{if $actionForm->get('item_accept') eq 1}>checked<{/if}> name="item_accept" value="1"/><{$smarty.const._AD_USER_LANG_AUTO}>
  		<input type="radio" <{if $actionForm->get('item_accept') eq 0}>checked<{/if}> name="item_accept" value="0"/><{$smarty.const._AD_USER_LANG_MANUAL}> 		 		
      </td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_ITEM_LIMIT}></td>
      <td class="<{cycle values="odd,even"}>">
        <input type="text" name="item_number_limit" size="50" value="<{$actionForm->get('item_number_limit')}>"/>
        <br /><{$smarty.const._MD_USER_LANG_LIMIT_DESC}></td>
        
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_INDEX_LIMIT}></td>
      <td class="<{cycle values="odd,even"}>">
        <input type="text" name="index_number_limit" size="50" value="<{$actionForm->get('index_number_limit')}>"/>
        <br /><{$smarty.const._MD_USER_LANG_LIMIT_DESC}></td>
    </tr>
    <tr>
      <td class="head"><{$smarty.const._AD_USER_LANG_ITEM_STORAGE_LIMIT}></td>
      <td class="<{cycle values="odd,even"}>">
        <input type="text" name="item_storage_limit" size="50" value="<{$actionForm->get('item_storage_limit')}>"/>
        <br /><{$smarty.const._MD_USER_LANG_LIMIT_DESC}></td>
    </tr> 
    <{/if}>
    <tr>
      <td colspan="2" class="foot">
        <input class="formButton" type="submit" value="<{$smarty.const._SUBMIT}>" />
        <input class="formButton" type="submit" value="<{$smarty.const._BACK}>" name="_form_control_cancel" />
      </td>
    </tr>
  </table>
</form>