/**
	 * finds and deletes a users invites, their place within groups, their groups, and their categories when deleted within CB
	 *
	 * @param  moscomprofilerUser $user
	 * @param  boolean            $deleted
	 */
	public function deleteUser( $user, $deleted ) {
		$invites		=	cbgjData::getInvites( null, array( 'user_id', '=', (int) $user->id, array( 'user', '=', (int) $user->id ) ) );

		if ( $invites ) foreach ( $invites as $invite ) {
			$invite->delete();
		}

		$usrs			=	cbgjData::getUsers( null, array( 'user_id', '=', (int) $user->id ) );

		if ( $usrs ) foreach ( $usrs as $usr ) {
			$usr->deleteAll();
		}

		$groups			=	cbgjData::getGroups( null, array( 'user_id', '=', (int) $user->id ) );

		if ( $groups ) foreach ( $groups as $group ) {
			$group->deleteAll();
		}

		$categories		=	cbgjData::getCategories( null, array( 'user_id', '=', (int) $user->id ) );

		if ( $categories ) foreach ( $categories as $category ) {
			$category->deleteAll();
		}

		$notifications	=	cbgjData::getNotifications( null, array( 'user_id', '=', (int) $user->id ) );

		if ( $notifications ) foreach ( $notifications as $notification ) {
			$notification->delete();
		}
	}
	public function getAutoEdit( $id, $user, $plugin, $message = null ) {
		global $_CB_framework;

		cbgjClass::getTemplate( 'cbgroupjiveauto_edit' );

		$row						=	cbgjAutoData::getAutos( null, array( 'id', '=', (int) $id ), null, null, false );
		$params						=	$row->getParams();

		$js							=	"function conditionalCalculate() {"
									.		"$( '#conditional table' ).each( function() {"
									.			"if ( $( this ).find( 'tbody tr' ).length > 1 ) {"
									.				"$( this ).find( '.moveConditional,.removeConditional' ).removeClass( 'gjautoHide' );"
									.				"$( this ).find( 'tbody' ).sortable( 'enable' );"
									.			"} else {"
									.				"$( this ).find( '.moveConditional,.removeConditional' ).addClass( 'gjautoHide' );"
									.				"$( this ).find( 'tbody' ).sortable( 'disable' );"
									.			"}"
									.			"$( this ).find( 'tbody tr' ).each( function( index ) {"
									.				"$( this ).find( '.conditionalField input' ).attr( 'id', 'fields__field' + index ).attr( 'name', 'fields[field' + index + ']' );"
									.				"$( this ).find( '.conditionalOperator select' ).attr( 'id', 'operators__operator' + index ).attr( 'name', 'operators[operator' + index + ']' );"
									.				"$( this ).find( '.conditionalValue input' ).attr( 'id', 'values__value' + index ).attr( 'name', 'values[value' + index + ']' );"
									.			"});"
									.		"});"
									.	"};"
									.	"$( '.addConditional' ).live( 'click', function() {"
									.		"var conditional = $( this ).parents( 'tr' ).first().clone();"
									.		"conditional.find( '.conditionalField input,.conditionalOperator select,.conditionalValue input' ).val( '' ).removeClass( 'gjautoHide' );"
									.		"conditional.appendTo( '#conditional table tbody' );"
									.		"conditionalCalculate();"
									.	"});"
									.	"$( '.removeConditional' ).live( 'click', function() {"
									.		"if ( $( '#conditional table tbody tr' ).length > 1 ) {"
									.			"$( this ).parents( 'tr' ).first().remove();"
									.		"}"
									.		"conditionalCalculate();"
									.	"});"
									.	"$( '.conditionalOperator select' ).live( 'change', function() {"
									.		"if ( ( $( this ).val() == 6 ) || ( $( this ).val() == 7 ) ) {"
									.			"$( this ).closest( 'tr' ).find( '.conditionalValue input' ).addClass( 'gjautoHide' );"
									.		"} else {"
									.			"$( this ).closest( 'tr' ).find( '.conditionalValue input' ).removeClass( 'gjautoHide' );"
									.		"}"
									.	"});"
									.	"$( '#conditional table tbody' ).sortable( { items: 'tr', containment: 'parent', animated: true, stop: conditionalCalculate, tolerance: 'pointer', handle: '.moveConditional', opacity: 0.5 } );"
									.	"conditionalCalculate();"
									.	"function validate() {"
									.		"if ( $( '#trigger' ).val() ) {"
									.			"$( '#object,#access__' ).closest( 'tr' ).removeClass( 'gjautoHide' );"
									.			"if ( $( '#object' ).val() == 1 ) {"
									.				"$( '#variable' ).removeClass( 'gjautoHide' );"
									.				"$( '#variable_user' ).addClass( 'gjautoHide' );"
									.			"} else if ( $( '#object' ).val() == 3 ) {"
									.				"$( '#variable' ).addClass( 'gjautoHide' );"
									.				"$( '#variable_user' ).removeClass( 'gjautoHide' );"
									.			"} else {"
									.				"$( '#variable,#variable_user' ).addClass( 'gjautoHide' );"
									.			"}"
									.			"if ( $( '#access__' ).val() ) {"
									.				"$( '#access__' ).closest( 'tr' ).nextAll( 'tr' ).removeClass( 'gjautoHide' );"
									.				"$( '#params__auto' ).closest( 'tr' ).nextAll( 'tr' ).addClass( 'gjautoHide' );"
									.				"if ( $( '#params__auto' ).val() == 1 ) {"
									.					"$( '#list_groups' ).removeClass( 'gjautoHide' );"
									.					"$( '#params__status' ).closest( 'tr' ).removeClass( 'gjautoHide' );"
									.				"} else if ( $( '#params__auto' ).val() == 2 ) {"
									.					"$( '#list_category' ).removeClass( 'gjautoHide' );"
									.					"if ( $( '#params__category' ).val() ) {"
									.						"$( '#list_category' ).closest( 'tr' ).nextAll( 'tr' ).removeClass( 'gjautoHide' );"
									.						"if ( $( '#params__category' ).val() != -1 ) {"
									.							"$( '#params__types__,#params__cat_parent,#params__cat_name,#params__cat_description,#params__cat_owner,#params__cat_unique' ).closest( 'tr' ).addClass( 'gjautoHide' );"
									.						"}"
									.						"if ( $( '#params__grp_unique' ).val() == 1 ) {"
									.							"$( '#params__grp_autojoin' ).closest( 'tr' ).addClass( 'gjautoHide' );"
									.						"}"
									.					"} else {"
									.						"$( '#list_category' ).closest( 'tr' ).nextAll( 'tr' ).addClass( 'gjautoHide' );"
									.					"}"
									.				"} else if ( $( '#params__auto' ).val() == 3 ) {"
									.					"$( '#list_category' ).closest( 'tr' ).nextAll( 'tr' ).removeClass( 'gjautoHide' );"
									.					"$( '#params__grp_parent,#params__grp_name,#params__grp_description,#params__grp_owner,#params__grp_unique,#params__grp_autojoin,#params__type' ).closest( 'tr' ).addClass( 'gjautoHide' );"
									.				"} else if ( $( '#params__auto' ).val() == 4 ) {"
									.					"$( '#list_groups' ).removeClass( 'gjautoHide' );"
									.				"}"
									.			"} else {"
									.				"$( '#access__' ).closest( 'tr' ).nextAll( 'tr' ).addClass( 'gjautoHide' );"
									.			"}"
									.		"} else {"
									.			"$( '#trigger' ).closest( 'tr' ).nextAll( 'tr' ).addClass( 'gjautoHide' );"
									.		"}"
									.	"};"
									.	"$( '#triggers' ).change( function() {"
									.		"if ( $( '#trigger' ).val() ) {"
									.			"value = $( '#trigger' ).val() + ',' + $( this ).val();"
									.		"} else {"
									.			"value = $( this ).val();"
									.		"}"
									.		"if ( value ) {"
									.			"$( '#trigger' ).attr( 'value', value ).focus();"
									.			"$( this ).attr( 'value', '' );"
									.		"}"
									.	"});"
									.	"$( '#adminForm :input' ).bind( 'change keyup focus', function() {"
									.		"validate();"
									.	"});"
									.	"validate();";

		$_CB_framework->outputCbJQuery( $js, 'ui-all' );

		$input						=	array();

		$input['published']			=	moscomprofilerHTML::yesnoSelectList( 'published', null, (int) cbgjClass::getCleanParam( true, 'published', $row->get( 'published', 0 ) ) );
		$input['title']				=	'<input type="text" id="title" name="title" value="' . htmlspecialchars( cbgjClass::getCleanParam( true, 'title', $row->get( 'title' ) ) ) . '" class="inputbox" size="40" />';
		$input['description']		=	'<textarea id="description" name="description" class="inputbox" cols="40" rows="3">' . htmlspecialchars( cbgjClass::getCleanParam( true, 'description', $row->get( 'description' ) ) ) . '</textarea>';

		$listTriggers				=	array();
		$listTriggers[]				=	moscomprofilerHTML::makeOption( '', CBTxt::T( '- Add Trigger -' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'Frontend' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeLoginFormDisplay', CBTxt::T( 'Before Login Form Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeFirstLogin', CBTxt::T( 'Before User First Login' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeLogin', CBTxt::T( 'Before User Login' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onLoginAuthentication', CBTxt::T( 'Login Authentication' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onDuringLogin', CBTxt::T( 'During Login' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onDoLoginNow', CBTxt::T( 'Do Login Now' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterLogin', CBTxt::T( 'After User Login' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeLogout', CBTxt::T( 'Before User Logout' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onDoLogoutNow', CBTxt::T( 'Do Logout Now' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterLogout', CBTxt::T( 'After User Logout' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserAvatarUpdate', CBTxt::T( 'Before Avatar Update' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserAvatarUpdate', CBTxt::T( 'After Avatar Update' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserProfileEditDisplay', CBTxt::T( 'After Profile Edit Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserUpdate', CBTxt::T( 'Before Profile Update' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserUpdate', CBTxt::T( 'After Profile Update' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserProfileRequest', CBTxt::T( 'Before Profile Request' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserProfileDisplay', CBTxt::T( 'Before Profile Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserProfileDisplay', CBTxt::T( 'After Profile Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeRegisterFormDisplay', CBTxt::T( 'Before Registration Form Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeRegisterForm', CBTxt::T( 'Before Registration Form' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onStartSaveUserRegistration', CBTxt::T( 'Start Save Registration' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserRegistration', CBTxt::T( 'Before Registration' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserRegistration', CBTxt::T( 'After Registration' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserRegistrationMailsSent', CBTxt::T( 'After Registration Mail Sent' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeAddConnection', CBTxt::T( 'Before Add Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterAddConnection', CBTxt::T( 'After Add Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeRemoveConnection', CBTxt::T( 'Before Remove Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterRemoveConnection', CBTxt::T( 'After Remove Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeDenyConnection', CBTxt::T( 'Before Deny Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterDenyConnection', CBTxt::T( 'After Deny Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeAcceptConnection', CBTxt::T( 'Before Accept Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterAcceptConnection', CBTxt::T( 'After Accept Connection' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onLostPassForm', CBTxt::T( 'Lost Password Form' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onStartNewPassword', CBTxt::T( 'Start New Password' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeNewPassword', CBTxt::T( 'Before New Password' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onNewPassword', CBTxt::T( 'New Password' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUsernameReminder', CBTxt::T( 'Before Username Reminder' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUsernameReminder', CBTxt::T( 'After Username Reminder' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeEmailUserForm', CBTxt::T( 'Before Email Form' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterEmailUserForm', CBTxt::T( 'After Email Form' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeEmailUser', CBTxt::T( 'Before Email User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeDisplayUsersList', CBTxt::T( 'Before Userlist Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'Backend' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUpdateUser', CBTxt::T( 'Before Profile Update' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUpdateUser', CBTxt::T( 'After Profile Update' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeNewUser', CBTxt::T( 'Before Registration' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterNewUser', CBTxt::T( 'After Registration' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeDeleteUser', CBTxt::T( 'Before Delete User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterDeleteUser', CBTxt::T( 'After Delete User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserBlocking', CBTxt::T( 'Before Blocking User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeSyncUser', CBTxt::T( 'Before Sync User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterSyncUser', CBTxt::T( 'After Sync User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserActive', CBTxt::T( 'Before User Active' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterCheckCbDb', CBTxt::T( 'After Check CB Database' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterCheckCbFieldsDb', CBTxt::T( 'After Check Fields Database' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeFixDb', CBTxt::T( 'Before Fix Database' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterFixDb', CBTxt::T( 'After Fix Database' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeFixFieldsDb', CBTxt::T( 'Before Fix Fields Database' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeBackendUsersListBuildQuery', CBTxt::T( 'Before Userlist Build Query' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterBackendUsersList', CBTxt::T( 'Before Userlist' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeBackendUsersEmailForm', CBTxt::T( 'Before Userlist Email Form' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeBackendUsersEmailStart', CBTxt::T( 'Before Userlist Email Start' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeBackendUserEmail', CBTxt::T( 'Before Userlist Email' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'Frontend & Backend' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserProfileEditDisplay', CBTxt::T( 'Before Profile Edit Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserConfirm', CBTxt::T( 'Before User Confirm' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserConfirm', CBTxt::T( 'After User Confirm' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUserApproval', CBTxt::T( 'Before User Approval' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUserApproval', CBTxt::T( 'After User Approval' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onPrepareMenus', CBTxt::T( 'Prepare Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterFieldsFetch', CBTxt::T( 'After Fields Fetch' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterTabsFetch', CBTxt::T( 'After Tabs Fetch' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterPrepareViewTabs', CBTxt::T( 'After Prepare Tabs View' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeEditATab', CBTxt::T( 'Before Tab Edit' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterEditATab', CBTxt::T( 'After Tab Edit' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onStartUsersList', CBTxt::T( 'Start Userlist' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterUsersListFieldsSql', CBTxt::T( 'After Userlist Fields SQL' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUsersListBuildQuery', CBTxt::T( 'Before Userlist Build Query' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onBeforeUsersListQuery', CBTxt::T( 'Before Userlist Query' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onInputFieldHtmlRender', CBTxt::T( 'Field HTML Render' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onFieldIcons', CBTxt::T( 'Field Icons' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onLogChange', CBTxt::T( 'Log Change' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterAuthorizeAction', CBTxt::T( 'After Authorize Action' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onAfterAuthorizeView', CBTxt::T( 'After Authorize View' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'CB GroupJive' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onPluginBE', CBTxt::T( 'Integration Backend' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeTools', CBTxt::T( 'Before Tools' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterTools', CBTxt::T( 'After Tools' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeNotification', CBTxt::T( 'Before Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterNotification', CBTxt::T( 'After Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeTemplate', CBTxt::T( 'Before Template' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterTemplate', CBTxt::T( 'After Template' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateCategory', CBTxt::T( 'Before Update Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCreateCategory', CBTxt::T( 'Before Create Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateCategory', CBTxt::T( 'After Update Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCreateCategory', CBTxt::T( 'After Create Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeDeleteCategory', CBTxt::T( 'Before Delete Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterDeleteCategory', CBTxt::T( 'After Delete Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateCategoryOrder', CBTxt::T( 'Before Update Category Order' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateCategoryOrder', CBTxt::T( 'After Update Category Order' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateCategoryState', CBTxt::T( 'Before Update Category State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateCategoryState', CBTxt::T( 'After Update Category State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateCategoryParams', CBTxt::T( 'Before Update Category Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateCategoryParams', CBTxt::T( 'After Update Category Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeSetCategoryParams', CBTxt::T( 'Before Set Category Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterSetCategoryParams', CBTxt::T( 'After Set Category Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateGroup', CBTxt::T( 'Before Update Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCreateGroup', CBTxt::T( 'Before Create Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateGroup', CBTxt::T( 'After Update Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCreateGroup', CBTxt::T( 'After Create Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeDeleteGroup', CBTxt::T( 'Before Delete Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterDeleteGroup', CBTxt::T( 'After Delete Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateGroupOrder', CBTxt::T( 'Before Update Group Order' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateGroupOrder', CBTxt::T( 'After Update Group Order' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateGroupState', CBTxt::T( 'Before Update Group State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateGroupState', CBTxt::T( 'After Update Group State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateGroupParams', CBTxt::T( 'Before Update Group Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateGroupParams', CBTxt::T( 'After Update Group Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeSetGroupParams', CBTxt::T( 'Before Set Group Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterSetGroupParams', CBTxt::T( 'After Set Group Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateUser', CBTxt::T( 'Before Update User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCreateUser', CBTxt::T( 'Before Create User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateUser', CBTxt::T( 'After Update User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCreateUser', CBTxt::T( 'After Create User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeDeleteUser', CBTxt::T( 'Before Delete User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterDeleteUser', CBTxt::T( 'After Delete User' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateUserStatus', CBTxt::T( 'Before Update User Status' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateUserStatus', CBTxt::T( 'After Update User Status' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateUserParams', CBTxt::T( 'Before Update User Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateUserParams', CBTxt::T( 'After Update User Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeSetUserParams', CBTxt::T( 'Before Set User Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterSetUserParams', CBTxt::T( 'After Set User Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateInvite', CBTxt::T( 'Before Update Invite' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCreateInvite', CBTxt::T( 'Before Create Invite' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateInvite', CBTxt::T( 'After Update Invite' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCreateInvite', CBTxt::T( 'After Create Invite' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeDeleteInvite', CBTxt::T( 'Before Delete Invite' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterDeleteInvite', CBTxt::T( 'After Delete Invite' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateNotification', CBTxt::T( 'Before Update Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCreateNotification', CBTxt::T( 'Before Create Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateNotification', CBTxt::T( 'After Update Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCreateNotification', CBTxt::T( 'After Create Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeDeleteNotification', CBTxt::T( 'Before Delete Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterDeleteNotification', CBTxt::T( 'After Delete Notification' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeUpdateNotificationParams', CBTxt::T( 'Before Update Notification Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterUpdateNotificationParams', CBTxt::T( 'After Update Notification Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeSetNotificationParams', CBTxt::T( 'Before Set Notification Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterSetNotificationParams', CBTxt::T( 'After Set Notification Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onPluginFE', CBTxt::T( 'Integration Frontend' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeMessageOverview', CBTxt::T( 'Before Message Overview' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterMessageOverview', CBTxt::T( 'After Message Overview' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeMessageCategory', CBTxt::T( 'Before Message Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterMessageCategory', CBTxt::T( 'After Message Category' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeJoinGroup', CBTxt::T( 'Before Join Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterJoinGroup', CBTxt::T( 'After Join Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeLeaveGroup', CBTxt::T( 'Before Leave Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterLeaveGroup', CBTxt::T( 'After Leave Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeMessageGroup', CBTxt::T( 'Before Message Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterMessageGroup', CBTxt::T( 'After Message Group' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onPluginBEToolbar', CBTxt::T( 'Integration Backend Toolbar' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateAuto', CBTxt::T( 'Before Update Auto' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeCreateAuto', CBTxt::T( 'Before Create Auto' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateAuto', CBTxt::T( 'After Update Auto' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterCreateAuto', CBTxt::T( 'After Create Auto' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeDeleteAuto', CBTxt::T( 'Before Delete Auto' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterDeleteAuto', CBTxt::T( 'After Delete Auto' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateAutoOrder', CBTxt::T( 'Before Update Auto Order' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateAutoOrder', CBTxt::T( 'After Update Auto Order' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateAutoParams', CBTxt::T( 'Before Update Auto Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateAutoParams', CBTxt::T( 'After Update Auto Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateAutoState', CBTxt::T( 'Before Update Auto State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateAutoState', CBTxt::T( 'After Update Auto State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeSetAutoFields', CBTxt::T( 'Before Set Auto Fields' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterSetAutoFields', CBTxt::T( 'After Set Auto Fields' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeSetAutoOperators', CBTxt::T( 'Before Set Auto Operators' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterSetAutoOperators', CBTxt::T( 'After Set Auto Operators' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeSetAutoValues', CBTxt::T( 'Before Set Auto Values' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterSetAutoValues', CBTxt::T( 'After Set Auto Values' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeSetAutoParams', CBTxt::T( 'Before Set Auto Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterSetAutoParams', CBTxt::T( 'After Set Auto Params' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateEvent', CBTxt::T( 'Before Update Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeCreateEvent', CBTxt::T( 'Before Create Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateEvent', CBTxt::T( 'After Update Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterCreateEvent', CBTxt::T( 'After Create Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeDeleteEvent', CBTxt::T( 'Before Delete Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterDeleteEvent', CBTxt::T( 'After Delete Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateEventState', CBTxt::T( 'Before Update Event State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateEventState', CBTxt::T( 'After Update Event State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateEventAttendance', CBTxt::T( 'Before Update Event Attendance' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateEventAttendance', CBTxt::T( 'After Update Event Attendance' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateFile', CBTxt::T( 'Before Update File' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeCreateFile', CBTxt::T( 'Before Create File' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateFile', CBTxt::T( 'After Update File' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterCreateFile', CBTxt::T( 'After Create File' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeDeleteFile', CBTxt::T( 'Before Delete File' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterDeleteFile', CBTxt::T( 'After Delete File' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateFileState', CBTxt::T( 'Before Update File State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateFileState', CBTxt::T( 'After Update File State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdatePhoto', CBTxt::T( 'Before Update Photo' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeCreatePhoto', CBTxt::T( 'Before Create Photo' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdatePhoto', CBTxt::T( 'After Update Photo' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterCreatePhoto', CBTxt::T( 'After Create Photo' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeDeletePhoto', CBTxt::T( 'Before Delete Photo' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterDeletePhoto', CBTxt::T( 'After Delete Photo' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdatePhotoState', CBTxt::T( 'Before Update Photo State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdatePhotoState', CBTxt::T( 'After Update Photo State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateVideo', CBTxt::T( 'Before Update Video' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeCreateVideo', CBTxt::T( 'Before Create Video' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateVideo', CBTxt::T( 'After Update Video' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterCreateVideo', CBTxt::T( 'After Create Video' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeDeleteVideo', CBTxt::T( 'Before Delete Video' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterDeleteVideo', CBTxt::T( 'After Delete Video' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateVideoState', CBTxt::T( 'Before Update Video State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateVideoState', CBTxt::T( 'After Update Video State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateWall', CBTxt::T( 'Before Update Wall' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeCreateWall', CBTxt::T( 'Before Create Wall' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateWall', CBTxt::T( 'After Update Wall' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterCreateWall', CBTxt::T( 'After Create Wall' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeDeleteWall', CBTxt::T( 'Before Delete Wall' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterDeleteWall', CBTxt::T( 'After Delete Wall' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onBeforeUpdateWallState', CBTxt::T( 'Before Update Wall State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gjint_onAfterUpdateWallState', CBTxt::T( 'After Update Wall State' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onMenuBE', CBTxt::T( 'Backend Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onCategoryEdit', CBTxt::T( 'Category Edit' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onGroupEdit', CBTxt::T( 'Group Edit' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onConfigIntegrations', CBTxt::T( 'Config Integrations' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onMenusIntegrationsGeneral', CBTxt::T( 'Menus Integrations General' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onMenusIntegrationsCategories', CBTxt::T( 'Menus Integrations Categories' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onMenusIntegrationsGroups', CBTxt::T( 'Menus Integrations Groups' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onMenusIntegrationsSave', CBTxt::T( 'Menus Integrations Save' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAuthorization', CBTxt::T( 'Authorization' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onCaptchaRender', CBTxt::T( 'Captcha Render' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onCaptchaValidate', CBTxt::T( 'Captcha Validate' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onToolbarBE', CBTxt::T( 'Backend Toolbar' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeOverviewCategoryMenu', CBTxt::T( 'Before Overview Category Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterOverviewCategoryMenu', CBTxt::T( 'After Overview Category Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeOverviewCategoryInfo', CBTxt::T( 'Before Overview Category Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterOverviewCategoryInfo', CBTxt::T( 'After Overview Category Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCategoryGroupMenu', CBTxt::T( 'Before Category Group Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCategoryGroupMenu', CBTxt::T( 'After Category Group Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCategoryGroupInfo', CBTxt::T( 'Before Category Group Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCategoryGroupInfo', CBTxt::T( 'After Category Group Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCategoryTab', CBTxt::T( 'Before Category Tab' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCategoryTab', CBTxt::T( 'After Category Tab' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCategoryInfo', CBTxt::T( 'Before Category Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCategoryInfo', CBTxt::T( 'After Category Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeCategoryMenu', CBTxt::T( 'Before Category Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterCategoryMenu', CBTxt::T( 'After Category Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupInviteInfo', CBTxt::T( 'Before Group Invite Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupInviteMenu', CBTxt::T( 'Before Group Invite Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupInviteMenu', CBTxt::T( 'After Group Invite Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupInviteInfo', CBTxt::T( 'After Group Invite Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupTab', CBTxt::T( 'Before Group Tab' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupTab', CBTxt::T( 'After Group Tab' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupInfo', CBTxt::T( 'Before Group Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupInfo', CBTxt::T( 'After Group Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupMenu', CBTxt::T( 'Before Group Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupMenu', CBTxt::T( 'After Group Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupUserMenu', CBTxt::T( 'Before Group User Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupUserMenu', CBTxt::T( 'After Group User Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeGroupUserInfo', CBTxt::T( 'Before Group User Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterGroupUserInfo', CBTxt::T( 'After Group User Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onGeneralNotifications', CBTxt::T( 'General Notifications' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onCategoryNotifications', CBTxt::T( 'Category Notifications' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onGroupNotifications', CBTxt::T( 'Group Notifications' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeOverviewInfo', CBTxt::T( 'Before Overview Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterOverviewInfo', CBTxt::T( 'After Overview Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeOverviewMenu', CBTxt::T( 'Before Overview Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterOverviewMenu', CBTxt::T( 'After Overview Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforePanelInfo', CBTxt::T( 'Before Panel Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterPanelInfo', CBTxt::T( 'After Panel Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforePanelMenu', CBTxt::T( 'Before Panel Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterPanelMenu', CBTxt::T( 'After Panel Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileTab', CBTxt::T( 'Before Profile Tab' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileTab', CBTxt::T( 'After Profile Tab' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileOverviewCategoryMenu', CBTxt::T( 'Before Profile Overview Category Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileOverviewCategoryMenu', CBTxt::T( 'After Profile Overview Category Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileOverviewCategoryInfo', CBTxt::T( 'Before Profile Overview Category Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileOverviewCategoryInfo', CBTxt::T( 'After Profile Overview Category Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileCategoryGroupMenu', CBTxt::T( 'Before Profile Category Group Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileCategoryGroupMenu', CBTxt::T( 'After Profile Category Group Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileCategoryGroupInfo', CBTxt::T( 'Before Profile Category Group Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileCategoryGroupInfo', CBTxt::T( 'After Profile Category Group Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileGroupInvitedMenu', CBTxt::T( 'Before Profile Group Invited Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileGroupInvitedMenu', CBTxt::T( 'After Profile Group Invited Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileGroupInvitedInfo', CBTxt::T( 'Before Profile Group Invited Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileGroupInvitedInfo', CBTxt::T( 'After Profile Group Invited Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileGroupInviteInfo', CBTxt::T( 'Before Profile Group Invite Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onBeforeProfileGroupInviteMenu', CBTxt::T( 'Before Profile Group Invite Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileGroupInviteMenu', CBTxt::T( 'After Profile Group Invite Menu' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'gj_onAfterProfileGroupInviteInfo', CBTxt::T( 'After Profile Group Invite Info' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'CB Paid Subscriptions' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterPlanRenewalSelected', CBTxt::T( 'After Plan Renewal Selected' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayEditBasketIntegration', CBTxt::T( 'Edit Basket Integration' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCbSubsAfterPaymentBasket', CBTxt::T( 'After Payment Basket' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeDrawSomething', CBTxt::T( 'Before Draw Something' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterDrawSomething', CBTxt::T( 'After Draw Something' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeDrawPlan', CBTxt::T( 'Before Draw Plan' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterDrawPlan', CBTxt::T( 'After Draw Plan' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterPlanSelected', CBTxt::T( 'After Plan Selected' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterPaymentStatusChange', CBTxt::T( 'After Payment Status Change' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterPaymentStatusUpdateEvent', CBTxt::T( 'After Payment Status Update Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeBackendPlanDisplay', CBTxt::T( 'Before Backend Plan Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeDisplayProductPeriodPrice', CBTxt::T( 'Before Display Product Period Price' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterDisplayProductPeriodPrice', CBTxt::T( 'After Display Product Period Price' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeComputeTotalizersPaymentBasketUpdated', CBTxt::T( 'Before Compute Totalizers Payment Basket Updated' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeStorePaymentBasketUpdated', CBTxt::T( 'Before Store Payment Basket Updated' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterPaymentBasketUpdated', CBTxt::T( 'After Payment Basket Updated' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayPaymentItemEvent', CBTxt::T( 'Payment Item Event' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeGetProductPrice', CBTxt::T( 'Before Get Product Price' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterGetProductPrice', CBTxt::T( 'After Get Product Price' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeDisplaySubscriptionPeriodPrice', CBTxt::T( 'Before Display Subscription Period Price' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterDisplaySubscriptionPeriodPrice', CBTxt::T( 'After Display Subscription Period Price' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayUserStateChange', CBTxt::T( 'User State Change' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeMailerEmailMessageSent', CBTxt::T( 'Before Mailer Email Message Sent' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeMailerPrivateMessageSent', CBTxt::T( 'Before Mailer Private Message Sent' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayAfterMailerMessageSent', CBTxt::T( 'After Mailer Message Sent' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'onCPayBeforeDrawSubscription', CBTxt::T( 'Before Draw Subscription' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'CB Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onBeforeMessageDisplay', CBTxt::T( 'Before Message Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onAfterMessageDisplay', CBTxt::T( 'After Message Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onBeforeItemDisplay', CBTxt::T( 'Before Item Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onAfterItemDisplay', CBTxt::T( 'After Item Display' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onBeforeUpdateActivity', CBTxt::T( 'Before Update Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onBeforeCreateActivity', CBTxt::T( 'Before Create Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onAfterUpdateActivity', CBTxt::T( 'After Update Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onAfterCreateActivity', CBTxt::T( 'After Create Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onBeforeDeleteActivity', CBTxt::T( 'Before Delete Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onAfterDeleteActivity', CBTxt::T( 'After Delete Activity' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onBeforeAccess', CBTxt::T( 'Before Access' ) );
		$listTriggers[]				=	moscomprofilerHTML::makeOption( 'activity_onAfterAccess', CBTxt::T( 'After Access' ) );
		$input['triggers']			=	moscomprofilerHTML::selectList( $listTriggers, 'triggers', null, 'value', 'text', null, 1, false, false );

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

		$listObject					=	array();
		$listObject[]				=	moscomprofilerHTML::makeOption( '0', CBTxt::T( 'Automatic' ) );
		$listObject[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Manually' ) );
		$listObject[]				=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'User' ) );
		$listObject[]				=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Specific' ) );
		$input['object']			=	moscomprofilerHTML::selectList( $listObject, 'object', null, 'value', 'text', (int) cbgjClass::getCleanParam( true, 'object', $row->get( 'object', 0 ) ), 1, false, false );

		$listVariable				=	array();
		$listVariable[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Variable 1' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'Variable 2' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Variable 3' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '4', CBTxt::T( 'Variable 4' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '5', CBTxt::T( 'Variable 5' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '6', CBTxt::T( 'Variable 6' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '7', CBTxt::T( 'Variable 7' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '8', CBTxt::T( 'Variable 8' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '9', CBTxt::T( 'Variable 9' ) );
		$listVariable[]				=	moscomprofilerHTML::makeOption( '10', CBTxt::T( 'Variable 10' ) );
		$input['variable']			=	moscomprofilerHTML::selectList( $listVariable, 'variable', null, 'value', 'text', (int) cbgjClass::getCleanParam( true, 'variable', $row->get( 'variable', 0 ) ), 1, false, false );

		$input['variable_user']		=	'******' . htmlspecialchars( cbgjClass::getCleanParam( true, 'variable', $row->get( 'variable' ) ) ) . '" class="inputbox" size="5" />';

		$listAccess					=	array();
		$listAccess[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'Custom ACL' ) );
		$listAccess[]				=	moscomprofilerHTML::makeOption( '-1', CBTxt::T( 'Everybody' ) );
		$listAccess[]				=	moscomprofilerHTML::makeOption( '-2', CBTxt::T( 'All Non-Registered Users' ) );
		$listAccess[]				=	moscomprofilerHTML::makeOption( '-3', CBTxt::T( 'All Registered Users' ) );
		$listAccess[]				=	moscomprofilerHTML::makeOption( '-4', CBTxt::T( 'All Non-Moderators' ) );
		$listAccess[]				=	moscomprofilerHTML::makeOption( '-5', CBTxt::T( 'All Moderators' ) );
		$listAccess[]				=	moscomprofilerHTML::makeOptGroup( CBTxt::T( 'CMS ACL' ) );
		$listAccess					=	array_merge( $listAccess, $_CB_framework->acl->get_group_children_tree( null, 'USERS', false ) );
		$input['access']			=	moscomprofilerHTML::selectList( $listAccess, 'access[]', 'size="6" multiple="multiple"', 'value', 'text', explode( '|*|', cbgjClass::getCleanParam( true, 'access', $row->get( 'access' ) ) ), 1, false, false );

		$listOperator				=	array();
		$listOperator[]				=	moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Operator -' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '0', CBTxt::T( 'Equal To' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Not Equal To' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'Greater Than' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Less Than' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '4', CBTxt::T( 'Greater Than or Equal To' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '5', CBTxt::T( 'Less Than or Equal To' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '6', CBTxt::T( 'Empty' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '7', CBTxt::T( 'Not Empty' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '8', CBTxt::T( 'Does Contain' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '9', CBTxt::T( 'Does Not Contain' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '10', CBTxt::T( 'Is REGEX' ) );
		$listOperator[]				=	moscomprofilerHTML::makeOption( '11', CBTxt::T( 'Is Not REGEX' ) );

		$conditionals				=	count( explode( "\n", $row->get( 'field' ) ) );

		for ( $i = 0, $n = ( $conditionals ? $conditionals : 1 ); $i < $n; $i++ ) {
			$operator				=	cbgjClass::getCleanParam( true, "operator$i", null, null, $row->get( 'operator' ) );

			$input["field$i"]		=	'<input type="text" id="fields__field' . $i . '" name="fields[field' . $i . ']" value="' . htmlspecialchars( cbgjClass::getHTMLCleanParam( true, "field$i", null, null, $row->get( 'field' ) ) ) . '" class="inputbox" size="25" />';
			$input["operator$i"]	=	moscomprofilerHTML::selectList( $listOperator, "operators[operator$i]", null, 'value', 'text', $operator, 1, false, false );
			$input["value$i"]		=	'<input type="text" id="values__' . $i . '" name="values[value' . $i . ']" value="' . htmlspecialchars( cbgjClass::getHTMLCleanParam( true, "value$i", null, null, $row->get( 'value' ) ) ) . '" class="inputbox' . ( in_array( $operator, array( 6, 7 ) ) ? ' gjautoHide' : null ) . '" size="25" />';
		}

		$input['conditionals']		=	( $conditionals ? $conditionals : 1 );

		$listAuto					=	array();
		$listAuto[]					=	moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Auto -' ) );
		$listAuto[]					=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Join Groups' ) );
		$listAuto[]					=	moscomprofilerHTML::makeOption( '4', CBTxt::T( 'Leave Groups' ) );
		$listAuto[]					=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'New Group' ) );
		$listAuto[]					=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'New Category' ) );
		$input['auto']				=	moscomprofilerHTML::selectList( $listAuto, 'params[auto]', null, 'value', 'text', $params->get( 'auto' ), 1, false, false );

		$listGroups					=	array();

		$categories					=	cbgjData::getCategories();

		if ( $categories ) foreach ( $categories as $cat ) {
			$groups					=	cbgjData::listArray( cbgjData::getGroups( null, array( 'category', '=', $cat->get( 'id' ) ) ) );

			if ( $groups ) {
				$listGroups[]		=	moscomprofilerHTML::makeOptGroup( $cat->get( 'name' ) );

				foreach ( $groups as $grp ) {
					$listGroups[]	=	moscomprofilerHTML::makeOption( $grp->value, $grp->text );
				}
			}
		}

		if ( $listGroups ) {
			$input['groups']		=	moscomprofilerHTML::selectList( $listGroups, 'params[groups][]', 'size="6" multiple="multiple"', 'value', 'text', explode( '|*|', $params->get( 'groups', '1|*|2|*|3' ) ), 1, false, false );

			array_unshift( $listGroups, moscomprofilerHTML::makeOption( '0', CBTxt::T( 'No Parent' ) ) );

			$input['grp_parent']	=	moscomprofilerHTML::selectList( $listGroups, 'params[grp_parent]', null, 'value', 'text', $params->get( 'grp_parent', 0 ), 1, false, false );
		} else {
			$input['groups']		=	CBTxt::T( 'No groups exist!' );
			$input['grp_parent']	=	CBTxt::T( 'No groups exist!' );
		}

		$listStatus					=	array();
		$listStatus[]				=	moscomprofilerHTML::makeOption( '-1', CBTxt::T( 'Banned' ) );
		$listStatus[]				=	moscomprofilerHTML::makeOption( '0', CBTxt::T( 'Inactive' ) );
		$listStatus[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Active' ) );
		$listStatus[]				=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'Moderator' ) );
		$listStatus[]				=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Admin' ) );
		$listStatus[]				=	moscomprofilerHTML::makeOption( '4', CBTxt::T( 'Owner' ) );
		$input['status']			=	moscomprofilerHTML::selectList( $listStatus, 'params[status]', null, 'value', 'text', $params->get( 'status', 1 ), 1, false, false );

		if ( $categories ) {
			$categories				=	cbgjData::listArray( $categories );
			$categoriesParents		=	$categories;

			array_unshift( $categories, moscomprofilerHTML::makeOption( '-1', CBTxt::T( 'New Category' ) ) );
			array_unshift( $categories, moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Category -' ) ) );

			$input['category']		=	moscomprofilerHTML::selectList( $categories, 'params[category]', null, 'value', 'text', $params->get( 'category' ), 1, false, false );

			array_unshift( $categoriesParents, moscomprofilerHTML::makeOption( '0', CBTxt::T( 'No Parent' ) ) );

			$input['cat_parent']	=	moscomprofilerHTML::selectList( $categoriesParents, 'params[cat_parent]', null, 'value', 'text', $params->get( 'cat_parent', 0 ), 1, false, false );
		} else {
			$input['category']		=	CBTxt::T( 'No categories exist!' );
			$input['cat_parent']	=	CBTxt::T( 'No categories exist!' );
		}

		$input['cat_name']			=	'<input type="text" id="params__cat_name" name="params[cat_name]" value="' . htmlspecialchars( $params->get( 'cat_name' ) ) . '" class="inputbox" size="40" />';
		$input['cat_description']	=	'<textarea id="params__cat_description" name="params[cat_description]" class="inputbox" cols="40" rows="5">' . htmlspecialchars( $params->get( 'cat_description' ) ) . '</textarea>';
		$input['cat_owner']			=	'<input type="text" id="params__cat_owner" name="params[cat_owner]" value="' . htmlspecialchars( $params->get( 'cat_owner' ) ) . '" class="inputbox" size="10" />';
		$input['cat_unique']		=	moscomprofilerHTML::yesnoSelectList( 'params[cat_unique]', null, $params->get( 'cat_unique', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );

		$listTypes					=	array();
		$listTypes[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Open' ) );
		$listTypes[]				=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'Approval' ) );
		$listTypes[]				=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Invite' ) );
		$input['types']				=	moscomprofilerHTML::selectList( $listTypes, 'params[types][]', 'size="4" multiple="multiple"', 'value', 'text', explode( '|*|', $params->get( 'types', '1|*|2|*|3' ) ), 1, false, false );

		$input['grp_name']			=	'<input type="text" id="params__grp_name" name="params[grp_name]" value="' . htmlspecialchars( $params->get( 'grp_name' ) ) . '" class="inputbox" size="40" />';
		$input['grp_description']	=	'<textarea id="params__grp_description" name="params[grp_description]" class="inputbox" cols="40" rows="5">' . htmlspecialchars( $params->get( 'grp_description' ) ) . '</textarea>';
		$input['grp_owner']			=	'<input type="text" id="params__grp_owner" name="params[grp_owner]" value="' . htmlspecialchars( $params->get( 'grp_owner' ) ) . '" class="inputbox" size="10" />';
		$input['grp_unique']		=	moscomprofilerHTML::yesnoSelectList( 'params[grp_unique]', null, $params->get( 'grp_unique', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
		$input['grp_autojoin']		=	moscomprofilerHTML::yesnoSelectList( 'params[grp_autojoin]', null, $params->get( 'grp_autojoin', 1 ), CBTxt::T( 'Enable' ), CBTxt::T( 'Disable' ) );
		$input['type']				=	moscomprofilerHTML::selectList( $listTypes, 'params[type]', null, 'value', 'text', $params->get( 'type', 1 ), 1, false, false );
		$input['exclude']			=	'<input type="text" id="exclude" name="exclude" value="' . htmlspecialchars( $params->get( 'exclude' ) ) . '" class="inputbox" size="20" />';

		cbgjClass::displayMessage( $message );

		if ( class_exists( 'HTML_cbgroupjiveautoEdit' ) ) {
			HTML_cbgroupjiveautoEdit::showAutoEdit( $row, $input, $user, $plugin );
		} else {
			$this->showAutoEdit( $row, $input, $user, $plugin );
		}
	}
	/**
	 * prepare frontend tab invited render
	 *
	 * @param  moscomprofilerUser $displayed
	 * @param  moscomprofilerUser $user
	 * @param  object             $plugin
	 * @param  boolean            $tabbed
	 * @return mixed
	 */
	public function getInvited( $displayed, $user, $plugin, $tabbed = true ) {
		cbgjClass::getTemplate( 'tab_invited' );

		$paging					=	new cbgjPaging( 'tab_invited' );

		$limit					=	$paging->getlimit( (int) $plugin->params->get( 'invited_tab_limit', 15 ) );
		$limitstart				=	$paging->getLimistart();
		$search					=	$paging->getFilter( 'search' );
		$where					=	array();

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

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

		$where[]				=	array( 'f.user', '=', (int) $displayed->id, array( 'f.email', '=', $displayed->email ) );
		$where[]				=	array( 'f.accepted', 'IN', array( '0000-00-00', '0000-00-00 00:00:00', '', null ) );

		switch( $plugin->params->get( 'invited_tab_orderby', 1 ) ) {
			case 2:
				$orderBy		=	array( 'ordering', 'DESC' );
				break;
			case 3:
				$orderBy		=	array( 'date', 'ASC' );
				break;
			case 4:
				$orderBy		=	array( 'date', 'DESC' );
				break;
			case 5:
				$orderBy		=	array( 'name', 'ASC' );
				break;
			case 6:
				$orderBy		=	array( 'name', 'DESC' );
				break;
			case 7:
				$orderBy		=	'user_count_asc';
				break;
			case 8:
				$orderBy		=	'user_count_desc';
				break;
			case 9:
				$orderBy		=	'nested_count_asc';
				break;
			case 10:
				$orderBy		=	'nested_count_desc';
				break;
			default:
				$orderBy		=	null;
				break;
		}

		$total					=	count( cbgjData::getGroups( array( array( 'grp_access', 'mod_lvl2' ), $user ), $where, $orderBy ) );

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

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

		$rows					=	cbgjData::getGroups( array( array( 'grp_access', 'mod_lvl2' ), $user ), $where, $orderBy, ( $plugin->params->get( 'invited_tab_paging', 1 ) ? array( $pageNav->limitstart, $pageNav->limit ) : null ) );

		$pageNav->search		=	$paging->getInputSearch( 'gjTabForm_invited', 'search', CBTxt::T( 'Search Invited...' ), $search );
		$pageNav->searching		=	$searching;
		$pageNav->limitbox		=	$paging->getLimitbox( $pageNav );
		$pageNav->pagelinks		=	$paging->getPagesLinks( $pageNav );

		return HTML_groupjiveTabInvited::showInvited( $rows, $pageNav, $displayed, $user, $plugin, $tabbed );
	}
	/**
	 * render frontend panel panes
	 *
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showPanelPanes( $user, $plugin ) {
		$panelDesc				=	CBTxt::Th( $plugin->params->get( 'panel_desc', null ) );
		$panelCategoryDisplay	=	$plugin->params->get( 'panel_category_display', 1 );
		$panelGroupDisplay		=	$plugin->params->get( 'panel_group_display', 1 );
		$panelJoinedDisplay		=	$plugin->params->get( 'panel_joined_display', 1 );
		$panelInvitesDisplay	=	$plugin->params->get( 'panel_invites_display', 1 );
		$panelInvitedDisplay	=	$plugin->params->get( 'panel_invited_display', 1 );
		$authorized				=	cbgjClass::getAuthorization( null, null, $user );
		$ownedCategories		=	count( cbgjData::getCategories( null, array( 'user_id', '=', $user->id ) ) );

		if ( $plugin->params->get( 'group_tab_joined', 0 ) ) {
			$access				=	array( 'user_id', '=', (int) $user->id, array( 'e.user_id', '=', (int) $user->id, 'e.status', '!IN', array( -1, 0, 4 ) ) );
		} else {
			$access				=	array( 'user_id', '=', (int) $user->id );
		}

		$ownedGroups			=	count( cbgjData::getGroups( null, $access ) );

		if ( $plugin->params->get( 'joined_tab_owned', 0 ) ) {
			$access				=	array( 'user_id', '=', (int) $user->id, array( 'e.user_id', '=', (int) $user->id, 'e.status', '!IN', array( -1, 0, 4 ) ) );
		} else {
			$access				=	array( 'e.user_id', '=', (int) $user->id, 'e.status', '!IN', array( -1, 0, 4 ) );
		}

		$joinedGroups			=	count( cbgjData::getGroups( null, $access ) );
		$ownedInvites			=	count( cbgjData::getInvites( null, array( 'user_id', '=', (int) $user->id ) ) );
		$invitedTo				=	count( cbgjData::getInvites( null, array( 'user', '=', (int) $user->id, array( 'email', '=', $user->email ) ) ) );

		$return					=	'<legend class="gjHeaderTitle">' . cbgjClass::getOverride( 'panel' ) . '</legend>'
								.	'<div class="gjGrid row-fluid">'
								.		'<div class="gjGridLeft span9">'
								.			'<div class="gjGridLeftLogo span4">'
								.				'<img alt="' . htmlspecialchars( CBTxt::Th( 'Logo' ) ) . '" src="' . $plugin->livePath . '/images/' . $plugin->params->get( 'panel_logo', 'default_panel.png' ) . '" class="gjLogoDefault img-polaroid" />'
								.			'</div>'
								.			'<div class="gjGridLeftInfo span8">'
								.				cbgjClass::getIntegrations( 'gj_onBeforePanelInfo', array( $user, $plugin ) )
								.				( $panelCategoryDisplay && $ownedCategories ? '<div>' . cbgjClass::getOverride( 'category', true ) . ': ' . $ownedCategories . '</div>' : null )
								.				( $panelGroupDisplay && $ownedGroups ? '<div>' . cbgjClass::getOverride( 'group', true ) . ': ' . $ownedGroups . '</div>' : null )
								.				( $panelJoinedDisplay && $joinedGroups ? '<div>' . CBTxt::Ph( 'Joined: [grp_joined_count]', array( '[grp_joined_count]' => $joinedGroups ) ) . '</div>' : null )
								.				( $panelInvitesDisplay && $ownedInvites ? '<div>' . CBTxt::Ph( 'Invites: [grp_invite_count]', array( '[grp_invite_count]' => $ownedInvites ) ) . '</div>' : null )
								.				( $panelInvitedDisplay && $invitedTo ? '<div>' . CBTxt::Ph( 'Invited: [grp_invited_count]', array( '[grp_invited_count]' => $invitedTo ) ) . '</div>' : null )
								.				cbgjClass::getIntegrations( 'gj_onAfterPanelInfo', array( $user, $plugin ) )
								.			'</div>';

		if ( $panelDesc ) {
			if ( $plugin->params->get( 'panel_desc_content', 0 ) ) {
				$panelDesc		=	cbgjClass::prepareContentPlugins( $panelDesc );
			}

			$return				.=			'<div class="gjGridLeftDesc span12 well well-small">' . $panelDesc . '</div>';
		}

		$return					.=		'</div>'
								.		'<div class="gjGridRight span3">'
								.			cbgjClass::getIntegrations( 'gj_onBeforePanelMenu', array( $user, $plugin ) )
								.			( $panelCategoryDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-home"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'categories' ) ) . '">' . CBTxt::Ph( 'My [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) . '</a></div>' : null )
								.			( $panelGroupDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-user"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'groups' ) ) . '">' . CBTxt::Ph( 'My [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</a></div>' : null )
								.			( $panelJoinedDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-user"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'joined' ) ) . '">' . CBTxt::Ph( 'Joined [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</a></div>' : null )
								.			( $panelInvitesDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-inbox"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'invites' ) ) . '">' . CBTxt::Th( 'My Invites' ) . '</a></div>' : null )
								.			( $panelInvitedDisplay && cbgjClass::hasAccess( 'usr_reg', $authorized ) ? '<div><i class="icon-inbox"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel', 'invited' ) ) . '">' . CBTxt::Th( 'Invited To' ) . '</a></div>' : null )
								.			cbgjClass::getIntegrations( 'gj_onAfterPanelMenu', array( $user, $plugin ) )
								.			( cbgjClass::hasAccess( 'gen_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show' ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
								.			'<div><i class="icon-share-alt"></i> <a href="' . cbgjClass::getPluginURL( array( 'overview' ) ) . '">' . CBTxt::Ph( 'Back to [overview]', array( '[overview]' => cbgjClass::getOverride( 'overview' ) ) ) . '</a></div>'
								.		'</div>'
								.	'</div>';

		return $return;
	}
			}
		} else {
			$return				.=				CBTxt::T( 'There are no files uploaded.' );
		}

		$return					.=			'</div>';
	} else {
		$return					.=			'<div>' . CBTxt::T( 'File integration not installed!' ) . '</div>';
	}
} elseif ( $mode == 16 ) {
	$where						=	$include_exclude;

	$where[]					=	array( 'f.user', '=', (int) $user->id, array( 'f.email', '=', $user->email ) );
	$where[]					=	array( 'f.accepted', 'IN', array( '0000-00-00', '0000-00-00 00:00:00', '', null ) );

	$rows						=	cbgjData::getGroups( array( array( 'grp_access', 'mod_lvl2' ), $user ), $where, null, $display );

	$return						.=			'<div class="gjInvitedTo' . $classLayout . '">';

	if ( $rows ) foreach ( $rows as $row ) {
		$authorized				=	cbgjClass::getAuthorization( $row, null, $user );

		$nestedCount			=	( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() );

		if ( $layout ) {
			$return				.=				'<div class="gjModuleContentBox mini-layout">'
								.					'<div class="gjModuleContentBoxRow">' . $row->getName( $nameLength, true ) . '</div>'
								.					'<div class="gjModuleContentBoxRow">' . $row->getLogo( true, true, true ) . '</div>'
								.					( $nestedCount ? '<div class="gjModuleContentBoxRow">' . cbgjClass::getOverride( 'group', $row->nestedCount() ) . '</div>' : null )
								.					( $row->userCount() ? '<div class="gjModuleContentBoxRow">' . cbgjClass::getOverride( 'user', $row->userCount() ) . '</div>' : null )
								.					'<div class="gjModuleContentBoxRow"><input type="button" value="' . htmlspecialchars( CBTxt::T( 'Join' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $row->get( 'category' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" /></div>'
Exemple #6
0
	public function getAccess( $trigger, $fbConfig, $params ) {
		if ( $trigger == 'getAllowedForumsRead' ) {
			$plugin					=	cbgjClass::getPlugin();
			$forum					=	$plugin->params->get( 'forum_id', null );

			if ( $forum ) {
				$forums				=	array();

				$categories			=	cbgjData::getCategories( array( 'forum_cat_access' ), array( 'params', 'REGEX', 'forum_id=[[:digit:]]+' ) );

				if ( $categories ) foreach ( $categories as $category ) {
					$catParams		=	$category->getParams();

					$forums[]		=	$catParams->get( 'forum_id', null );
				}

				$groups				=	cbgjData::getGroups( array( 'forum_grp_access' ), array( 'params', 'REGEX', 'forum_id=[[:digit:]]+' ) );

				if ( $groups ) foreach ( $groups as $group ) {
					$grpParams		=	$group->getParams();

					$forums[]		=	$grpParams->get( 'forum_id', null );
				}

				if ( ! empty( $forums ) ) {
					$forums[]		=	$forum;
					$existingAccess	=	explode( ',', $params[1] );
					$cleanAccess	=	array_diff( $forums, $existingAccess );
					$newAccess		=	array_merge( $existingAccess, $cleanAccess );

					cbArrayToInts( $newAccess );

					$params[1]		=	implode( ',', $newAccess );
				}
			}
		} elseif ( $trigger == 'checkSubscribers' ) {
			$plugin					=	cbgjClass::getPlugin();
			$forum					=	$plugin->params->get( 'forum_id', null );

			if ( $forum ) {
				$forumId			=	$params[0]->id;
				$users				=	$params[1];
				$ids				=	array();

				if ( $forumId && $users ) foreach ( $users as $user ) {
					$category		=	cbgjData::getCategories( array( array( 'forum_cat_access' ), $user ), array( 'params', 'REGEX', 'forum_id=[[:<:]]' . (int) $forumId . '[[:>:]]' ), null, null, false );

					if ( $category->get( 'id' ) ) {
						$ids[]		=	$user;
					}

					$group			=	cbgjData::getGroups( array( array( 'forum_grp_access' ), $user ), array( 'params', 'REGEX', 'forum_id=[[:<:]]' . (int) $forumId . '[[:>:]]' ), null, null, false );

					if ( $group->get( 'id' ) ) {
						$ids[]		=	$user;
					}
				}

				if ( ! empty( $ids ) ) {
					$existingAccess	=	$params[1];
					$cleanAccess	=	array_diff( $ids, $existingAccess );
					$newAccess		=	array_merge( $existingAccess, $cleanAccess );

					cbArrayToInts( $newAccess );

					$params[1]		=	array_values( array_unique( $newAccess ) );
				}
			}
		} elseif ( ( $trigger == 'onStart' ) && cbGetParam( $_REQUEST, 'catid', 0 ) ) {
			$plugin					=	cbgjClass::getPlugin();
			$backlink				=	$plugin->params->get( 'forum_backlink', 1 );
			$forum					=	$plugin->params->get( 'forum_id', null );

			if ( $backlink && $forum ) {
				cbgjClass::getTemplate( 'cbgroupjiveforums' );

				$catid				=	(int) cbGetParam( $_REQUEST, 'catid', 0 );

				if ( $forum == $catid ) {
					echo '<div id="cbGj"><div id="cbGjInner"><div class="gjTop gjTopCenter"><a href="' . cbgjClass::getPluginURL( array( 'overview' ) ) . '" role="button" class="gjButton btn"><i class="icon-share-alt"></i> ' . CBTxt::P( 'Back to [overview]', array( '[overview]' => cbgjClass::getOverride( 'overview' ) ) ) . '</a></div></div></div>';
				} else {
					$category		=	cbgjData::getCategories( array( 'cat_access', 'mod_lvl1' ), array( 'params', 'REGEX', 'forum_id=[[:<:]]' . (int) $catid . '[[:>:]]' ), null, null, false );

					if ( $category->get( 'id' ) ) {
						echo '<div id="cbGj"><div id="cbGjInner"><div class="gjTop gjTopCenter"><a href="' . $category->getUrl() . '" role="button" class="gjButton btn"><i class="icon-share-alt"></i> ' . CBTxt::P( 'Back to [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div></div></div>';
					} else {
						$group		=	cbgjData::getGroups( array( 'grp_access', 'mod_lvl2' ), array( 'params', 'REGEX', 'forum_id=[[:<:]]' . (int) $catid . '[[:>:]]' ), null, null, false );

						if ( $group->get( 'id' ) ) {
							echo '<div id="cbGj"><div id="cbGjInner"><div class="gjTop gjTopCenter"><a href="' . $group->getUrl() . '" role="button" class="gjButton btn"><i class="icon-share-alt"></i> ' . CBTxt::P( 'Back to [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div></div></div>';
						}
					}
				}
			}
		}
	}
	/**
	 * Called at each change of user subscription state due to a plan activation or deactivation
	 *
	 * @param  UserTable        $user
	 * @param  string           $status
	 * @param  int              $planId
	 * @param  int              $replacedPlanId
	 * @param  ParamsInterface  $integrationParams
	 * @param  string           $cause              'PaidSubscription' (first activation only), 'SubscriptionActivated' (renewals, cancellation reversals), 'SubscriptionDeactivated', 'Denied'
	 * @param  string           $reason             'N' new subscription, 'R' renewal, 'U'=update )
	 * @param  int              $now                Unix time
	 */
	public function onCPayUserStateChange( &$user, $status, /** @noinspection PhpUnusedParameterInspection */ $planId, /** @noinspection PhpUnusedParameterInspection */ $replacedPlanId, &$integrationParams, /** @noinspection PhpUnusedParameterInspection */ $cause, /** @noinspection PhpUnusedParameterInspection */ $reason, /** @noinspection PhpUnusedParameterInspection */ $now ) {
		global $_CB_framework;

		if ( ! is_object( $user ) ) {
			return;
		}

		$api											=	$_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/plugin/user/plug_cbgroupjive/cbgroupjive.class.php';

		if ( ! file_exists( $api ) ) {
			return;
		}

		/** @noinspection PhpIncludeInspection */
		require_once( $api );

		$gj_plugin										=	cbgjClass::getPlugin();
		$cbUser											=	CBuser::getInstance( $user->id );

		if ( ! $cbUser ) {
			$cbUser										=	$cbUser->getInstance( null );
		}

		for ( $i = 1; $i <= 5; $i++ ) {
			if ( $status == 'A' ) {
				if ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_type' . $i, null, null, $integrationParams ) == 3 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) ) {
					$parent								=	(int) cbgjClass::getCleanParam( true, 'cbgj_auto_cat_parent' . $i, '0', null, $integrationParams );
					$name								=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) );

					if ( cbgjClass::getCleanParam( true, 'cbgj_auto_unique' . $i, 1, null, $integrationParams ) ) {
						$where							=	array( array( 'user_id', '=', $user->id ), array( 'name', '=', $name ), array( 'parent', '=', $parent ) );
					} else {
						$where							=	array( array( 'name', '=', $name ), array( 'parent', '=', $parent ) );
					}

					$row								=	cbgjData::getCategories( null, null, $where, null, null, false );

					if ( ! $row->id ) {
						$category_editor				=	$gj_plugin->params->get( 'category_editor', 1 );
						$types							=	cbgjClass::getCleanParam( true, 'cbgj_auto_cat_types' . $i, '1|*|2|*|3', null, $integrationParams );

						$row->published					=	1;
						$row->parent					=	$parent;
						$row->user_id					=	(int) $user->id;
						$row->name						=	$name;

						if ( ( $category_editor == 2 ) || ( $category_editor == 3 ) ) {
							$row->description			=	$cbUser->replaceUserVars( cbgjClass::getHTMLCleanParam( true, 'cbgj_auto_desc' . $i, null, null, $integrationParams ) );
						} else {
							$row->description			=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_desc' . $i, null, null, $integrationParams ) );
						}

						$row->access					=	(int) $gj_plugin->params->get( 'category_access_default', -2 );
						$row->types						=	( $types ? $types : $gj_plugin->params->get( 'category_types_default', '1|*|2|*|3' ) );
						$row->create					=	(int) $gj_plugin->params->get( 'category_create_default', 1 );
						$row->create_access				=	(int) $gj_plugin->params->get( 'category_createaccess_default', -1 );
						$row->nested					=	(int) $gj_plugin->params->get( 'category_nested_default', 1 );
						$row->nested_access				=	(int) $gj_plugin->params->get( 'category_nestedaccess_default', -1 );
						$row->date						=	date( 'Y-m-d H:i:s' );
						$row->ordering					=	99999;

						$row->store();
					}
				} elseif ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_type' . $i, null, null, $integrationParams ) == 2 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat' . $i, null, null, $integrationParams ) && cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) ) {
					if ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat' . $i, null, null, $integrationParams ) == -1 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_name' . $i, null, null, $integrationParams ) ) {
						$parent							=	(int) cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_parent' . $i, '0', null, $integrationParams );
						$name							=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_name' . $i, null, null, $integrationParams ) );

						if ( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_unique' . $i, 1, null, $integrationParams ) ) {
							$where						=	array( array( 'user_id', '=', $user->id ), array( 'name', '=', $name ), array( 'parent', '=', $parent ) );
						} else {
							$where						=	array( array( 'name', '=', $name ), array( 'parent', '=', $parent ) );
						}

						$category						=	cbgjData::getCategories( null, null, $where, null, null, false );

						if ( ! $category->id ) {
							$category_editor			=	$gj_plugin->params->get( 'category_editor', 1 );
							$types						=	cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_types' . $i, '1|*|2|*|3', null, $integrationParams );

							$category->published		=	1;
							$category->parent			=	$parent;
							$category->user_id			=	(int) $user->id;
							$category->name				=	$name;

							if ( ( $category_editor == 2 ) || ( $category_editor == 3 ) ) {
								$category->description	=	$cbUser->replaceUserVars( cbgjClass::getHTMLCleanParam( true, 'cbgj_auto_grp_cat_desc' . $i, null, null, $integrationParams ) );
							} else {
								$category->description	=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_desc' . $i, null, null, $integrationParams ) );
							}

							$category->access			=	(int) $gj_plugin->params->get( 'category_access_default', -2 );
							$category->types			=	( $types ? $types : $gj_plugin->params->get( 'category_types_default', '1|*|2|*|3' ) );
							$category->create			=	(int) $gj_plugin->params->get( 'category_create_default', 1 );
							$category->create_access	=	(int) $gj_plugin->params->get( 'category_createaccess_default', -1 );
							$category->nested			=	(int) $gj_plugin->params->get( 'category_nested_default', 1 );
							$category->nested_access	=	(int) $gj_plugin->params->get( 'category_nestedaccess_default', -1 );
							$category->date				=	date( 'Y-m-d H:i:s' );
							$category->ordering			=	99999;

							$category->store();
						}
					} else {
						$category						=	cbgjData::getCategories( null, null, array( 'id', '=', cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat' . $i, null, null, $integrationParams ) ), null, null, false );
					}

					if ( $category->id ) {
						$parent							=	(int) cbgjClass::getCleanParam( true, 'cbgj_auto_grp_parent' . $i, '0', null, $integrationParams );
						$name							=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) );
						$join							=	false;

						if ( cbgjClass::getCleanParam( true, 'cbgj_auto_unique' . $i, 1, null, $integrationParams ) ) {
							$where						=	array( array( 'category', '=', $category->id ), array( 'user_id', '=', $user->id ), array( 'name', '=', $name ), array( 'parent', '=', $parent ) );
						} else {
							$where						=	array( array( 'category', '=', $category->id ), array( 'name', '=', $name ), array( 'parent', '=', $parent ) );

							if ( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_autojoin' . $i, 1, null, $integrationParams ) ) {
								$join					=	true;
							}
						}

						$row							=	cbgjData::getGroups( null, null, $where, null, null, false );

						if ( ! $row->id ) {
							$group_editor				=	$gj_plugin->params->get( 'group_editor', 1 );
							$type						=	cbgjClass::getCleanParam( true, 'cbgj_auto_grp_type' . $i, 1, null, $integrationParams );

							$row->published				=	1;
							$row->category				=	(int) $category->id;
							$row->parent				=	$parent;
							$row->user_id				=	(int) $user->id;
							$row->name					=	$name;

							if ( ( $group_editor == 2 ) || ( $group_editor == 3 ) ) {
								$row->description		=	$cbUser->replaceUserVars( cbgjClass::getHTMLCleanParam( true, 'cbgj_auto_desc' . $i, null, null, $integrationParams ) );
							} else {
								$row->description		=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_desc' . $i, null, null, $integrationParams ) );
							}

							$row->access				=	(int) $gj_plugin->params->get( 'group_access_default', -2 );
							$row->type					=	(int) ( $type ? $type : $gj_plugin->params->get( 'group_type_default', 1 ) );
							$row->nested				=	(int) $gj_plugin->params->get( 'group_nested_default', 1 );
							$row->nested_access			=	(int) $gj_plugin->params->get( 'group_nestedaccess_default', -1 );
							$row->date					=	date( 'Y-m-d H:i:s' );
							$row->ordering				=	1;

							if ( $row->store() ) {
								$row->storeOwner( $row->user_id );
							}
						} elseif ( $join ) {
							$usr						=	cbgjData::getUsers( null, null, array( array( 'group', '=', $row->id ), array( 'user_id', '=', $user->id ) ), null, null, false );

							if ( ! $usr->id ) {
								$usr->user_id			=	(int) $user->id;
								$usr->group				=	(int) $row->id;
								$usr->date				=	date( 'Y-m-d H:i:s' );
								$usr->status			=	(int) cbgjClass::getCleanParam( true, 'cbgj_auto_grp_usr_status' . $i, 1, null, $integrationParams );

								if ( $usr->store() ) {
									if ( $usr->status == 4 ) {
										$row->storeOwner( $usr->user_id );
									}
								}
							}
						}
					}
				} elseif ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_type' . $i, null, null, $integrationParams ) == 1 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_usr_groups' . $i, null, null, $integrationParams ) ) {
					$groups								=	cbgjClass::getCleanParam( true, 'cbgj_auto_usr_groups' . $i, null, null, $integrationParams );

					if ( $groups ) {
						$groups							=	explode( '|*|', $groups );

						cbArrayToInts( $groups );
					}

					if ( $groups ) foreach ( $groups as $group_id ) {
						$group							=	cbgjData::getGroups( null, null, array( 'id', '=', $group_id ), null, null, false );

						if ( $group->id ) {
							$row						=	cbgjData::getUsers( null, null, array( array( 'group', '=', $group->id ), array( 'user_id', '=', $user->id ) ), null, null, false );

							if ( ! $row->id ) {
								$row->user_id			=	(int) $user->id;
								$row->group				=	(int) $group->id;
								$row->date				=	date( 'Y-m-d H:i:s' );
								$row->status			=	(int) cbgjClass::getCleanParam( true, 'cbgj_auto_usr_status' . $i, 1, null, $integrationParams );

								if ( $row->store() ) {
									if ( $row->status == 4 ) {
										$group->storeOwner( $row->user_id);
									}
								}
							}
						}
					}
				}
			} elseif ( cbgjClass::getCleanParam( true, 'cbgj_auto_remove' . $i, null, null, $integrationParams ) ) {
				if ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_type' . $i, null, null, $integrationParams ) == 3 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) ) {
					$name								=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) );

					if ( cbgjClass::getCleanParam( true, 'cbgj_auto_unique' . $i, 1, null, $integrationParams ) ) {
						$where							=	array( array( 'user_id', '=', $user->id ), array( 'name', '=', $name ) );
					} else {
						$where							=	array( 'name', '=', $name );
					}

					$row								=	cbgjData::getCategories( null, null, $where, null, null, false );

					if ( $row->id ) {
						$row->deleteAll();
					}
				} elseif ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_type' . $i, null, null, $integrationParams ) == 2 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat' . $i, null, null, $integrationParams ) && cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) ) {
					$name								=	$cbUser->replaceUserVars( cbgjClass::getCleanParam( true, 'cbgj_auto_name' . $i, null, null, $integrationParams ) );

					if ( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat' . $i, null, null, $integrationParams ) == -1 ) {
						if ( cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat_unique' . $i, 1, null, $integrationParams ) ) {
							$where						=	array( array( 'user_id', '=', $user->id ), array( 'name', '=', $name ) );
						} else {
							$where						=	array( 'name', '=', $name );
						}
					} else {
						$category						=	cbgjData::getCategories( null, null, array( 'id', '=', cbgjClass::getCleanParam( true, 'cbgj_auto_grp_cat' . $i, null, null, $integrationParams ) ), null, null, false );

						if ( cbgjClass::getCleanParam( true, 'cbgj_auto_unique' . $i, 1, null, $integrationParams ) ) {
							$where						=	array( array( 'category', '=', $category->id ), array( 'user_id', '=', $user->id ), array( 'name', '=', $name ) );
						} else {
							$where						=	array( array( 'category', '=', $category->id ), array( 'name', '=', $name ) );
						}
					}

					$row								=	cbgjData::getGroups( null, null, $where, null, null, false );

					if ( $row->id ) {
						$row->deleteAll();
					}
				} elseif ( ( cbgjClass::getCleanParam( true, 'cbgj_auto_type' . $i, null, null, $integrationParams ) == 1 ) && cbgjClass::getCleanParam( true, 'cbgj_auto_usr_groups' . $i, null, null, $integrationParams ) ) {
					$groups								=	cbgjClass::getCleanParam( true, 'cbgj_auto_usr_groups' . $i, null, null, $integrationParams );

					if ( $groups ) {
						$groups							=	explode( '|*|', $groups );

						cbArrayToInts( $groups );
					}

					if ( $groups ) foreach ( $groups as $group_id ) {
						$group							=	cbgjData::getGroups( null, null, array( 'id', '=', $group_id ), null, null, false );

						if ( $group->id ) {
							$row						=	cbgjData::getUsers( null, null, array( array( 'group', '=', $group->id ), array( 'user_id', '=', $user->id ) ), null, null, false );

							if ( $row->id ) {
								$row->deleteAll();
							}
						}
					}
				}
			}
		}
	}
	/**
	 * prepare notification group
	 *
	 * @return cbgjGroup
	 */
	public function getGroup() {
		static $cache	=	array();

		if ( $this->get( 'type' ) != 'group' ) {
			$id			=	0;
		} else {
			$id			=	$this->get( 'item' );
		}

		if ( ! isset( $cache[$id] ) ) {
			$cache[$id]	=	cbgjData::getGroups( null, array( 'id', '=', (int) $id ), null, null, false );
		}

		return $cache[$id];
	}
	/**
	 * save menus
	 *
	 * @param string $id
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	private function saveMenus( $user, $plugin ) {
		$types								=	cbGetParam( $_POST, 'type', array() );
		$categories							=	cbGetParam( $_POST, 'cats', array() );
		$groups								=	cbGetParam( $_POST, 'grps', array() );

		if ( $categories ) {
			cbArrayToInts( $categories );
		}

		if ( $groups ) {
			cbArrayToInts( $groups );
		}

		if ( $types ) {
			foreach ( $types as $type ) {
				switch ( $type ) {
					case 'categories':
						if ( $categories ) {
							foreach ( $categories as $catid ) {
								$category	=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );

								if ( ! cbgjClass::setMenu( $category->getName(), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=show&cat=' . $category->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[category_name] menu failed to create!', array( '[category_name]' => $category->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'groups':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( $group->getName(), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=show&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[group_name] menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No groups specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'new-category-nested':
						if ( $categories ) {
							foreach ( $categories as $catid ) {
								$category	=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[category_name] New [category]', array( '[category_name]' => $category->getName(), '[category]' => cbgjClass::getOverride( 'category' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=new&cat=' . $category->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[category_name] new category menu failed to create!', array( '[category_name]' => $category->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'new-category-group':
						if ( $categories ) {
							foreach ( $categories as $catid ) {
								$category	=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[category_name] New [group]', array( '[category_name]' => $category->getName(), '[group]' => cbgjClass::getOverride( 'group' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=new&cat=' . $category->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[category_name] new group menu failed to create!', array( '[category_name]' => $category->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'new-group-nested':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[group_name] New [category]', array( '[group_name]' => $group->getName(), '[category]' => cbgjClass::getOverride( 'category' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=new&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[group_name] new category menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'approve-category':
						if ( ! cbgjClass::setMenu( CBTxt::P( '[category] Approval', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=approval', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Category approval menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'approve-group':
						if ( ! cbgjClass::setMenu( CBTxt::P( '[group] Approval', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=approval', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Group approval menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'new-category':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=new', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'New category menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'new-group':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=new', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'New group menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'all-categories':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'All [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=all', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'All categories menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'all-groups':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'All [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=all', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'All groups menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'all-my-categories':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'All [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=allmy', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'All categories menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'all-my-groups':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'All [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=allmy', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'All groups menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'edit-group':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( 'Edit [group_name]', array( '[group_name]' => $group->getName() ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=edit&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( 'Edit [group_name] menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No groups specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'join':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( 'Join [group_name]', array( '[group_name]' => $group->getName() ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=join&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( 'Join [group_name] menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No groups specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'leave':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( 'Leave [group_name]', array( '[group_name]' => $group->getName() ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=leave&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( 'Leave [group_name] menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No groups specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'message-groups':
						if ( $categories ) {
							foreach ( $categories as $catid ) {
								$category	=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[category_name] Message [groups]', array( '[category_name]' => $category->getName(), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=message&cat=' . $category->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[category_name] message groups menu failed to create!', array( '[category_name]' => $category->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'message-users':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[group_name] Message [users]', array( '[group_name]' => $group->getName(), '[users]' => cbgjClass::getOverride( 'user', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=groups&func=message&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[group_name] message users menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No groups specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'edit-category':
						if ( $categories ) {
							foreach ( $categories as $catid ) {
								$category	=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( 'Edit [category_name]', array( '[category_name]' => $category->getName() ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=categories&func=edit&cat=' . $category->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( 'Edit [category_name] menu failed to create!', array( '[category_name]' => $category->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'notifications-category':
						if ( $categories ) {
							foreach ( $categories as $catid ) {
								$category	=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[category_name] Notifications', array( '[category_name]' => $category->getName() ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=notifications&func=show&cat=' . $category->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[category_name] Notifications menu failed to create!', array( '[category_name]' => $category->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No categories specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'notifications-group':
						if ( $groups ) {
							foreach ( $groups as $grpid ) {
								$group		=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

								if ( ! cbgjClass::setMenu( CBTxt::P( '[group_name] Notifications', array( '[group_name]' => $group->getName() ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=notifications&func=show&cat=' . $group->get( 'category' ) . '&grp=' . $group->get( 'id' ), $plugin ) ) {
									cbgjClass::getPluginURL( array( 'menus' ), CBTxt::P( '[group_name] Notifications menu failed to create!', array( '[group_name]' => $group->getName() ) ), false, true, 'error' );
								}
							}
						} else {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No groups specified to create menus for.' ), false, true, 'error' );
						}
						break;
					case 'message':
						if ( ! cbgjClass::setMenu( CBTxt::P( 'Message [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=overview&func=message', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Message categories menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'notifications':
						if ( ! cbgjClass::setMenu( CBTxt::T( 'Notifications' ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=notifications&func=show', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Notifications menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'panel':
						if ( ! cbgjClass::setMenu( CBTxt::T( 'Panel' ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=panel', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Panel menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'overview':
						if ( ! cbgjClass::setMenu( CBTxt::P( '[categories] Overview', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element . '&action=overview', $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Overview menu failed to create!' ), false, true, 'error' );
						}
						break;
					case 'plugin':
						$general_title	=	CBTxt::T( $plugin->params->get( 'general_title', null ) );

						if ( ! cbgjClass::setMenu( ( $general_title ? $general_title : $plugin->name ), 'index.php?option=' . $plugin->option . '&task=pluginclass&plugin=' . $plugin->element, $plugin ) ) {
							cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Plugin menu failed to create!' ), false, true, 'error' );
						}
						break;
					default:
						cbgjClass::getIntegrations( 'gj_onMenusIntegrationsSave', array( $type, $categories, $groups, $user, $plugin ), null, 'raw' );
						break;
				}
			}

			cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'Menus created successfully!' ), false, true );
		} else {
			cbgjClass::getPluginURL( array( 'menus' ), CBTxt::T( 'No menus to create.' ), false, true, 'error' );
		}
	}