<?php  echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Add Registrants To Group'), false, false, false); ?>
<form method="post" action="<?php  echo $this->action('save_settings'); ?>">
<?php  echo Loader::helper('validation/token')->output('save_settings'); ?>
	<div class="ccm-pane-body">	
		<fieldset>
			<legend>
				<?php  echo t('When new users register, add them to group:'); ?>
			</legend>
			<div class="clearfix">
				<label><?php  echo t('Select Group')?></label>
				<div class="input">
					<div class="ccm-summary-selected-item">
						<?php  echo $form->hidden('gID',$gID)?>
						<strong><span id="groupName"><?php  echo $gName ?></span></strong>
						<div><a id="groupSelector" href="<?php  echo REL_DIR_FILES_TOOLS_REQUIRED?>/user_group_selector.php?mode=groups" dialog-title="<?php  echo t('Add Group')?>" dialog-modal="false"><?php  echo t('Select Group')?></a></div>
					</div>
				</div>
			</div>
		</fieldset>
		<p class="help-block"><?php  echo t('Note that this setting only applies to the front-end registration form -- users added via the dashboard will be placed into the group(s) chosen on the "Add User" page.'); ?></p>
	</div>
	<div class="ccm-pane-footer">
		<?php  echo $concrete_interface->submit(t('Save'),'Save','right', 'primary')?>
	</div>
</form>
<?php  echo Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper(false);?>
<script type="text/javascript">
$(function() {
	$('#groupSelector').dialog();
	ccm_triggerSelectGroup = function(gID, gName) {
		$('#gID').val(gID);
		$('#groupName').text(gName);
	};
});
</script>