/**
	 * prepare backend group edit render
	 *
	 * @param int $id
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @param string $message
	 */
	private function showGroupEdit( $id, $user, $plugin, $message = null ) {
		global $_CB_framework;

		$groupEditor						=	$plugin->params->get( 'group_editor', 1 );

		$row								=	cbgjData::getGroups( null, array( 'id', '=', (int) $id ), null, null, false );
		$category							=	$row->getCategory();

		$input								=	array();

		$input['publish']					=	moscomprofilerHTML::yesnoSelectList( 'published', null, (int) cbgjClass::getCleanParam( true, 'published', $row->get( 'published', ( $plugin->params->get( 'group_approve', 0 ) ? 0 : 1 ) ) ) );

		$categories							=	cbgjClass::getCategoryOptions();

		if ( $categories ) {
			$input['category']				=	moscomprofilerHTML::selectList( $categories, 'category', null, 'value', 'text', (int) cbgjClass::getCleanParam( true, 'category', $row->get( 'category', $category->get( 'id' ) ) ), 1, false, false );
		} else {
			$input['category']				=	CBTxt::Th( 'There currently are no categories.' );
		}

		if ( $row->get( 'id' ) ) {
			$groups							=	cbgjClass::getGroupOptions( null, $category->get( 'id' ), 0, array( $row->get( 'id' ) ) );
		} else {
			$groups							=	cbgjClass::getGroupOptions( null, $category->get( 'id' ) );
		}

		if ( $groups ) {
			array_unshift( $groups, moscomprofilerHTML::makeOption( '0', CBTxt::T( 'No Parent' ) ) );

			$input['parent']				=	moscomprofilerHTML::selectList( $groups, 'parent', null, 'value', 'text', (int) cbgjClass::getCleanParam( true, 'parent', $row->get( 'parent', 0 ) ), 1, false, false );
		} else {
			if ( $category->get( 'id' ) ) {
				$input['parent']			=	CBTxt::Th( 'There currently are no groups.' );
			} else {
				$input['parent']			=	CBTxt::Th( 'Please save group with category before selecting parent group.' );
			}
		}

		$input['name']						=	'<input type="text" id="name" name="name" value="' . htmlspecialchars( cbgjClass::getCleanParam( true, 'name', $row->get( 'name' ) ) ) . '" class="inputbox required" size="40" />';

		if ( $groupEditor >= 2 ) {
			$description					=	cbgjClass::getHTMLCleanParam( true, 'description', $row->get( 'description' ) );
		} else {
			$description					=	cbgjClass::getCleanParam( true, 'description', $row->get( 'description' ) );
		}

		if ( $groupEditor == 3 ) {
			$input['description']			=	$_CB_framework->displayCmsEditor( 'description', $description, 400, 200, 40, 5 );
		} else {
			$input['description']			=	'<textarea id="description" name="description" class="inputbox" cols="40" rows="5">' . htmlspecialchars( $description ) . '</textarea>';
		}

		$input['file']						=	'<input type="file" id="logo" name="logo" class="inputbox" size="40" />';
		$input['del_logo']					=	'<input type="checkbox" id="del_logo" name="del_logo" class="inputbox" value="1" /> <label for="del_logo">' . CBTxt::T( 'Delete logo?' ) . '</label>';

		$listType							=	array();
		$listType[]							=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Open' ) );
		$listType[]							=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'Approval' ) );
		$listType[]							=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Invite' ) );
		$input['type']						=	moscomprofilerHTML::selectList( $listType, 'type', 'class="inputbox required"', 'value', 'text', (int) cbgjClass::getCleanParam( true, 'type', $row->get( 'type', $plugin->params->get( 'group_type_default', 1 ) ) ), 1, false, false );

		$listAccess							=	array();
		$listAccess[]						=	moscomprofilerHTML::makeOption( '-2', CBTxt::T( '- Everybody' ) );
		$listAccess[]						=	moscomprofilerHTML::makeOption( '-1', CBTxt::T( '- All Registered Users' ) );
		$listAccess							=	array_merge( $listAccess, $_CB_framework->acl->get_group_children_tree( null, 'USERS', false ) );
		$input['access']					=	moscomprofilerHTML::selectList( $listAccess, 'access', 'class="inputbox required"', 'value', 'text', (int) cbgjClass::getCleanParam( true, 'access', $row->get( 'access', $plugin->params->get( 'group_access_default', -2 ) ) ), 1, false, false );

		$listInvite							=	array();
		$listInvite[]						=	moscomprofilerHTML::makeOption( '0', CBTxt::T( 'Group Users' ) );
		$listInvite[]						=	moscomprofilerHTML::makeOption( '1', '.&nbsp;-&nbsp;' . CBTxt::T( 'Group Moderators' ) );
		$listInvite[]						=	moscomprofilerHTML::makeOption( '2', '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;' . CBTxt::T( 'Group Admins' ) );
		$listInvite[]						=	moscomprofilerHTML::makeOption( '3', '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;' . CBTxt::T( 'Group Owner' ) );
		$input['invite']					=	moscomprofilerHTML::selectList( $listInvite, 'invite', 'class="inputbox required"', 'value', 'text', (int) cbgjClass::getCleanParam( true, 'invite', $row->get( 'invite', $plugin->params->get( 'group_invite_default', 0 ) ) ), 1, false, false );

		$input['users']						=	moscomprofilerHTML::yesnoSelectList( 'users', null, (int) cbgjClass::getCleanParam( true, 'users', $row->get( 'users', $plugin->params->get( 'group_users_default', 1 ) ) ) );

		$input['nested']					=	moscomprofilerHTML::yesnoSelectList( 'nested', null, (int) cbgjClass::getCleanParam( true, 'nested', $row->get( 'nested', $plugin->params->get( 'group_nested_default', 1 ) ) ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
		$input['nested_access']				=	moscomprofilerHTML::selectList( $listInvite, 'nested_access', 'class="inputbox"', 'value', 'text', (int) cbgjClass::getCleanParam( true, 'nested_access', $row->get( 'nested_access', $plugin->params->get( 'group_nestedaccess_default', -1 ) ) ), 1, false, false );

		$input['owner']						=	'<input type="text" id="user_id" name="user_id" value="' . (int) cbgjClass::getCleanParam( true, 'user_id', $row->get( 'user_id', $user->id ) ) . '" class="inputbox required digits" size="6" />';

		cbgjClass::displayMessage( $message );

		HTML_cbgjAdmin::showGroupEdit( $row, $category, $input, $user, $plugin );
	}