?>
	<input id="<?php 
echo $genid;
?>
hfPerms" type="hidden" value="<?php 
echo str_replace('"', "'", json_encode($permissions));
?>
"/>
	
	<input id="<?php 
echo $genid;
?>
hfPermsSend" name="permissions" type="hidden" value=""/>
<table><tr><td>
  <?php 
echo select_users_or_groups("", isset($projects) ? $projects : null, null, "workspace-chooser{$genid}");
?>
  </td><td style="padding-left:20px">
  <div id="<?php 
echo $genid;
?>
project_permissions" style="display:none">
  <div id="<?php 
echo $genid;
?>
project_name" style="font-weight:bold;font-size:120%;padding-bottom:15px"></div>
  <!-- a href="#" class="internalLink" onclick="og.ogPermApplyToSubworkspaces('<?php 
echo $genid;
?>
');return false;"><?php 
echo lang('apply to all subworkspaces');
	
	$member = array_var($permission_parameters, 'member');
	$allowed_object_types = array_var($permission_parameters, 'allowed_object_types');
	$allowed_object_types_json = array_var($permission_parameters, 'allowed_object_types_json');
	$permission_groups = array_var($permission_parameters, 'permission_groups');
	$member_permissions = array_var($permission_parameters, 'member_permissions');
?>

	<input id="<?php echo $genid ?>hfPerms" type="hidden" value="<?php echo str_replace('"',"'", json_encode($member_permissions));?>"/>
	<input id="<?php echo $genid ?>hfAllowedOT" type="hidden" value="<?php echo str_replace('"',"'", json_encode($allowed_object_types_json));?>"/>
	
	<input id="<?php echo $genid ?>hfPermsSend" name="permissions" type="hidden" value=""/>
	
	<table><tr><td>
	  <?php	
	  		echo select_users_or_groups("", null, $genid . "user_selector");
	  ?>
	</td><td style="padding-left:20px">
	  <div id="<?php echo $genid ?>member_permissions" style="display:none;">
	  	<div id="<?php echo $genid ?>pg_name" style="font-weight:bold;font-size:120%;padding-bottom:5px"></div>
	  		<table>
		  	<col align=left/><col align=center/>
		  	<tr style="border-bottom:1px solid #888;margin-bottom:5px">
		  	<td style="vertical-align:middle">
		  		<span class="perm_all_checkbox_container">
					<?php echo checkbox_field($genid . 'pAll', false, array('id' => $genid . 'pAll', 'onclick' => 'og.userPermissions.ogPermAllChecked("' . $genid . '", this.checked)')) ?>
					<label style="font-weight:bold" for="<?php echo $genid ?>pAll" class="checkbox"><?php echo lang('all') ?></label>   
		  		</span>
		  	</td>
		  	<td align=center style="padding:0 10px;width:100px;"><a href="#" class="internalLink radio-title-3" onclick="og.userPermissions.ogPermSetLevel('<?php echo $genid ?>', 3);return false;"><?php echo lang('read write and delete') ?></a></td>
		  	<td align=center style="padding:0 10px;width:100px;"><a href="#" class="internalLink radio-title-2" onclick="og.userPermissions.ogPermSetLevel('<?php echo $genid ?>', 2);return false;"><?php echo lang('read and write') ?></a></td>