/**
	 * prepare backend categories render
	 *
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	private function showCategories( $user, $plugin ) {
		global $_CB_framework;

		$paging						=	new cbgjPaging( 'categories' );

		$limit						=	$paging->getlimit( 30 );
		$limitstart					=	$paging->getLimistart();
		$search						=	$paging->getFilter( 'search' );
		$parent						=	$paging->getFilter( 'parent' );
		$access						=	$paging->getFilter( 'access' );
		$state						=	$paging->getFilter( 'state' );
		$creator					=	$paging->getFilter( 'creator' );
		$id							=	$paging->getFilter( 'id' );
		$where						=	array();

		if ( isset( $search ) && ( $search != '' ) ) {
			$where[]				=	array( 'name', 'CONTAINS', $search );
		}

		if ( isset( $parent ) && ( $parent != '' ) ) {
			$where[]				=	array( 'parent', '=', (int) $parent );
		}

		if ( isset( $access ) && ( $access != '' ) ) {
			$where[]				=	array( 'access', '=', (int) $access );
		}

		if ( isset( $state ) && ( $state != '' ) ) {
			$where[]				=	array( 'published', '=', (int) $state );
		}

		if ( isset( $creator ) && ( $creator != '' ) ) {
			$where[]				=	array( 'b.id', '=', (int) $creator, array( 'b.username', 'CONTAINS', $creator ), array( 'b.name', 'CONTAINS', $creator ) );
		}

		if ( isset( $id ) && ( $id != '' ) ) {
			$where[]				=	array( 'id', '=', (int) $id );
		}

		$searching					=	( count( $where ) ? true : false );

		$total						=	count( cbgjData::getCategories( null, $where ) );

		if ( $total <= $limitstart ) {
			$limitstart				=	0;
		}

		$pageNav					=	$paging->getPageNav( $total, $limitstart, $limit );

		$rows						=	array_values( cbgjData::getCategories( null, $where, null, array( $pageNav->limitstart, $pageNav->limit ), true, ( $parent ? $parent : 0 ) ) );

		$input						=	array();

		$categories					=	cbgjClass::getCategoryOptions();

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

			$input['parent']		=	$paging->getInputSelect( 'adminForm', 'parent', $categories, $parent );
			$input['batch_parent']	=	moscomprofilerHTML::selectList( $categories, 'batch_parent', null, 'value', 'text', null, 1, false, false );
		} else {
			$input['parent']		=	'-';
			$input['batch_parent']	=	'-';
		}

		$listAccess					=	array();
		$listAccess[]				=	moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Access -' ) );
		$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']			=	$paging->getInputSelect( 'adminForm', 'access', $listAccess, $access );
		$input['batch_access']		=	moscomprofilerHTML::selectList( $listAccess, 'batch_access', null, 'value', 'text', null, 1, false, false );

		$listState					=	array();
		$listState[]				=	moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select State -' ) );
		$listState[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Published' ) );
		$listState[]				=	moscomprofilerHTML::makeOption( '0', CBTxt::T( 'Unpublished' ) );
		$input['state']				=	$paging->getInputSelect( 'adminForm', 'state', $listState, $state );

		$input['search']			=	$paging->getInputText( 'adminForm', 'search', $search, '30' );
		$input['creator']			=	$paging->getInputText( 'adminForm', 'creator', $creator, '15' );
		$input['batch_creator']		=	'<input type="text" id="batch_creator" name="batch_creator" size="6" />';
		$input['id']				=	$paging->getInputText( 'adminForm', 'id', $id, '6' );

		$pageNav->searching			=	$searching;

		HTML_cbgjAdmin::showCategories( $rows, $pageNav, $input, $user, $plugin );
	}