예제 #1
0
	/**
	 * render frontend group panes
	 *
	 * @param cbgjGroup $row
	 * @param cbgjCategory $category
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showGroupPanes( $row, $category, $user, $plugin ) {
		$authorized		=	cbgjClass::getAuthorization( $category, $row, $user );

		if ( $row->get( 'published' ) == 1 ) {
			$state		=	'<div><i class="icon-ban-circle"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'unpublish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '">' . CBTxt::Ph( 'Unpublish [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>';
		} else {
			$state		=	'<div><i class="icon-ok"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Publish [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>';
		}

		$groupAdmins	=	$row->getAdmins();
		$groupMods		=	$row->getModerators();

		$return			=	'<legend class="gjHeaderTitle">' . $row->getName() . '</legend>'
						.	'<div class="gjGrid row-fluid">'
						.		'<div class="gjGridLeft span9">'
						.			'<div class="gjGridLeftLogo span4">'
						.				$row->getLogo( true )
						.			'</div>'
						.			'<div class="gjGridLeftInfo span8">'
						.				cbgjClass::getIntegrations( 'gj_onBeforeGroupInfo', array( $row, $category, $user, $plugin ) )
						.				( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? '<div>' . cbgjClass::getOverride( 'group', true ) . ': ' . $row->nestedCount() . '</div>' : null )
						.				( $row->userCount() ? '<div>' . cbgjClass::getOverride( 'user', true ) . ': ' . $row->userCount() . '</div>' : null )
						.				( $row->get( 'user_id' ) ? '<div>' . cbgjClass::getOverride( 'owner' ) . ': ' . $row->getOwnerName( true ) . '</div>' : null )
						.				( ! empty( $groupMods ) ? '<div>' . cbgjClass::getOverride( 'moderator', true ) . ': ' . implode( ', ', $groupMods ) . '</div>' : null )
						.				( ! empty( $groupAdmins ) ? '<div>' . cbgjClass::getOverride( 'admin', true ) . ': ' . implode( ', ', $groupAdmins ) . '</div>' : null )
						.				'<div>' . CBTxt::Ph( 'Type: [grp_type]', array( '[grp_type]' => $row->getType() ) ) . '</div>'
						.				'<div>' . CBTxt::Ph( 'Access: [grp_access]', array( '[grp_access]' => $row->getAccess() ) ) . '</div>'
						.				'<div>' . cbgjClass::getOverride( 'category' ) . ': ' . $category->getName( 0, true ) . '</div>'
						.				( $row->get( 'parent' ) ? '<div>' . cbgjClass::getOverride( 'group' ) . ': ' . $row->getParent()->getName( 0, true ) . '</div>' : null )
						.				'<div>' . CBTxt::Ph( 'Created: [grp_date]', array( '[grp_date]' => cbFormatDate( $row->get( 'date' ), 1, false ) ) ) . '</div>'
						.				cbgjClass::getIntegrations( 'gj_onAfterGroupInfo', array( $row, $category, $user, $plugin ) )
						.			'</div>';

		if ( $row->get( 'description' ) ) {
			$return		.=			'<div class="gjGridLeftDesc span12 well well-small">'
						.				$row->getDescription()
						.			'</div>';
		}

		$return			.=		'</div>'
						.		'<div class="gjGridRight span3">'
						.			cbgjClass::getIntegrations( 'gj_onBeforeGroupMenu', array( $row, $category, $user, $plugin ), null, null )
						.			( cbgjClass::hasAccess( array( 'grp_join', 'grp_approved' ), $authorized, true ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . ( cbgjClass::hasAccess( 'grp_invited', $authorized ) ? CBTxt::Th( 'Accept Invite' ) : CBTxt::Ph( 'Join [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( array( 'grp_nested_create', 'grp_approved' ), $authorized, true ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'new', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( array( 'grp_leave', 'grp_approved' ), $authorized, true ) ? '<div><i class="icon-minus"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'leave', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to leave this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '">' . CBTxt::Ph( 'Leave [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ? '<div><i class="icon-pencil"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Edit [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'grp_message', $authorized ) && $row->userCount() ? '<div><i class="icon-envelope"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'message', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Message [users]', array( '[users]' => cbgjClass::getOverride( 'user', true ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ? $state : null )
						.			( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? '<div><i class="icon-remove"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'delete', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [group] and all its associated [users]?', array( '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ) ) . '">' . CBTxt::Ph( 'Delete [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
						.			cbgjClass::getIntegrations( 'gj_onAfterGroupMenu', array( $row, $category, $user, $plugin ), null, null )
						.			( cbgjClass::hasAccess( 'grp_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
						.			( $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . $row->getParent()->getUrl() . '">' . CBTxt::Ph( 'Back to [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
						.			( ! $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . $category->getUrl() . '">' . CBTxt::Ph( 'Back to [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
						.		'</div>'
						.	'</div>';

		return $return;
	}
예제 #2
0
	/**
	 * render frontend category panes
	 *
	 * @param cbgjCategory $row
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showCategoryPanes( $row, $user, $plugin ) {
		$authorized		=	cbgjClass::getAuthorization( $row, null, $user );

		if ( $row->get( 'published' ) == 1 ) {
			$state		=	'<div><i class="icon-ban-circle"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'unpublish', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [category]?', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) . '">' . CBTxt::Ph( 'Unpublish [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>';
		} else {
			$state		=	'<div><i class="icon-ok"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Publish [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>';
		}

		$return			=	'<legend class="gjHeaderTitle">' . $row->getName() . '</legend>'
						.	'<div class="gjGrid row-fluid">'
						.		'<div class="gjGridLeft span9">'
						.			'<div class="gjGridLeftLogo span4">'
						.				$row->getLogo( true )
						.			'</div>'
						.			'<div class="gjGridLeftInfo span8">'
						.				cbgjClass::getIntegrations( 'gj_onBeforeCategoryInfo', array( $row, $user, $plugin ) )
						.				( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? '<div>' . cbgjClass::getOverride( 'category', true ) . ': ' . $row->nestedCount() . '</div>' : null )
						.				( $row->groupCount() ? '<div>' . cbgjClass::getOverride( 'group', true ) . ': ' . $row->groupCount() . '</div>' : null )
						.				( $row->get( 'user_id' ) ? '<div>' . cbgjClass::getOverride( 'owner' ) . ': ' . $row->getOwnerName( true ) . '</div>' : null )
						.				'<div>' . CBTxt::Ph( 'Types: [cat_types]', array( '[cat_types]' => implode( ', ', $row->getTypes() ) ) ) . '</div>'
						.				'<div>' . CBTxt::Ph( 'Access: [cat_access]', array( '[cat_access]' => $row->getAccess() ) ) . '</div>'
						.				( $row->get( 'parent' ) ? '<div>' . cbgjClass::getOverride( 'category' ) . ': ' . $row->getParent()->getName( 0, true ) . '</div>' : null )
						.				'<div>' . CBTxt::Ph( 'Created: [cat_date]', array( '[cat_date]' => cbFormatDate( $row->get( 'date' ), 1, false ) ) ) . '</div>'
						.				cbgjClass::getIntegrations( 'gj_onAfterCategoryInfo', array( $row, $user, $plugin ) )
						.			'</div>';

		if ( $row->get( 'description' ) ) {
			$return		.=			'<div class="gjGridLeftDesc span12 well well-small">'
						.				$row->getDescription()
						.			'</div>';
		}

		$return			.=		'</div>'
						.		'<div class="gjGridRight span3">'
						.			cbgjClass::getIntegrations( 'gj_onBeforeCategoryMenu', array( $row, $user, $plugin ), null, null )
						.			( cbgjClass::hasAccess( 'cat_nested_create', $authorized ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'new', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'cat_grp_create', $authorized ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'groups', 'new', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><i class="icon-pencil"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Edit [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'cat_message', $authorized ) && $row->groupCount() ? '<div><i class="icon-envelope"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'message', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Ph( 'Message [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</a></div>' : null )
						.			( cbgjClass::hasAccess( 'cat_can_publish', $authorized ) ? $state : null )
						.			( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><i class="icon-remove"></i> <a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'delete', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [category] and all its associated [groups]?', array( '[category]' => cbgjClass::getOverride( 'category' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) ) . '">' . CBTxt::Ph( 'Delete [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
						.			cbgjClass::getIntegrations( 'gj_onAfterCategoryMenu', array( $row, $user, $plugin ), null, null )
						.			( cbgjClass::hasAccess( 'cat_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $row->get( 'id' ) ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
						.			( $row->get( 'parent' ) ? '<div><i class="icon-share-alt"></i> <a href="' . $row->getParent()->getUrl() . '">' . CBTxt::Ph( 'Back to [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
						.			( ! $row->get( 'parent' ) ? '<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>' : null )
						.		'</div>'
						.	'</div>';

		return $return;
	}
예제 #3
0
	/**
	 * render frontend category message
	 *
	 * @param cbgjCategory $row
	 * @param array $input
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	static function showCategoryMessage( $row, $input, $user, $plugin ) {
		$row->setPathway( CBTxt::P( 'Message [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), cbgjClass::getPluginURL( array( 'categories', 'message', (int) $row->get( 'id' ) ) ) );

		$return			=	'<div class="gjCategoryMessage">'
						.		'<form action="' . cbgjClass::getPluginURL( array( 'categories', 'send', (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm form-horizontal">'
						.			'<legend class="gjEditTitle">' . CBTxt::Ph( 'Message [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) . '</legend>'
						.			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Subject' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['subject']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Input [groups] message subject.', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>'
						.			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Body' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['body']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Input [groups] message body.', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';

		if ( $input['captcha'] !== false ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					'<div style="margin-bottom: 5px;">' . $input['captcha']['code'] . '</div>'
						.					'<div>' . $input['captcha']['input'] . '</div>'
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		}

		$return			.=			'<div class="gjButtonWrapper form-actions">'
						.				'<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Send Message' ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" />&nbsp;'
						.				'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-mini" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'show', (int) $row->get( 'id' ) ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '" />'
						.			'</div>'
						.			cbGetSpoofInputTag( 'plugin' )
						.		'</form>'
						.	'</div>';

		echo $return;
	}
예제 #4
0
	/**
	 * render frontend overview message
	 *
	 * @param array $input
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	static function showOverviewMessage( $input, $user, $plugin ) {
		global $_CB_framework;

		$generalTitle	=	$plugin->params->get( 'general_title', $plugin->name );
		$pageTitle		=	CBTxt::P( 'Message [category]', array( '[category]' => cbgjClass::getOverride( 'category', true ) ) );

		$_CB_framework->setPageTitle( htmlspecialchars( $pageTitle ) );

		if ( $generalTitle != '' ) {
			$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( $generalTitle ) ), cbgjClass::getPluginURL() );
		}

		$_CB_framework->appendPathWay( htmlspecialchars( cbgjClass::getOverride( 'category', true ) . ' ' . cbgjClass::getOverride( 'overview' ) ), cbgjClass::getPluginURL( array( 'overview' ) ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), cbgjClass::getPluginURL( array( 'overview', 'message' ) ) );

		$return			=	'<div class="gjOverviewMessage">'
						.		'<form action="' . cbgjClass::getPluginURL( array( 'overview', 'send' ) ) . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm form-horizontal">'
						.			'<legend class="gjEditTitle">' . $pageTitle . '</legend>'
						.			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Subject' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['subject']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Input [categories] message subject.', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>'
						.			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Body' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['body']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Input [categories] message body.', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>'
						.			'<div class="gjButtonWrapper form-actions">'
						.				'<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Send Message' ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" />&nbsp;'
						.				'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-mini" onclick="' . cbgjClass::getPluginURL( array( 'overview' ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '" />'
						.			'</div>'
						.			cbGetSpoofInputTag( 'plugin' )
						.		'</form>'
						.	'</div>';

		echo $return;
	}
예제 #5
0
 /**
  * Validator:
  * Validates $value for $field->required and other rules
  * Override
  *
  * @param  moscomprofilerFields  $field
  * @param  moscomprofilerUser    $user        RETURNED populated: touch only variables related to saving this field (also when not validating for showing re-edit)
  * @param  string                $columnName  Column to validate
  * @param  string                $value       (RETURNED:) Value to validate, Returned Modified if needed !
  * @param  array                 $postdata    Typically $_POST (but not necessarily), filtering required.
  * @param  string                $reason      'edit' for save profile edit, 'register' for registration, 'search' for searches
  * @return boolean                            True if validate, $this->_setErrorMSG if False
  */
 function validate(&$field, &$user, $columnName, &$value, &$postdata, $reason)
 {
     $validated = parent::validate($field, $user, $columnName, $value, $postdata, $reason);
     if ($validated && $value !== '' && $value !== null) {
         // empty values (e.g. non-mandatory) are treated in the parent validation.
         $pregExp = $this->_getRegexp($field);
         if ($pregExp) {
             $validated = preg_match($pregExp, $value);
             if (!$validated) {
                 $pregExpError = CBTxt::P($field->params->get('pregexperror', 'Not a valid input'), array('[FIELDNAME]' => $field->title));
                 // CBTxt::T('Not a valid input')
                 $this->_setValidationError($field, $user, $reason, $pregExpError);
             }
         }
     }
     return $validated;
 }
예제 #6
0
	/**
	 * Returns a field in specified format
	 *
	 * @param  moscomprofilerFields  $field
	 * @param  moscomprofilerUser    $user
	 * @param  string                $output  'html', 'xml', 'json', 'php', 'csvheader', 'csv', 'rss', 'fieldslist', 'htmledit'
	 * @param  string                $reason  'profile' for user profile view, 'edit' for profile edit, 'register' for registration, 'list' for user-lists
	 * @param  int                   $list_compare_types   IF reason == 'search' : 0 : simple 'is' search, 1 : advanced search with modes, 2 : simple 'any' search
	 * @return mixed                
	 */
	function getField( &$field, &$user, $output, $reason, $list_compare_types ) {
		global $_CB_framework;

		if ( ( $output == 'htmledit' ) && ( $reason != 'search' ) && defined( '_CB_VALIDATE_NEW' ) ) {
			if ( $field->params->get( 'fieldValidateInBrowser', 1 ) == 1 ) {
				$pregExp				=	$this->_getRegexp( $field );
				if ( $pregExp ) {
					$validationId		=	'cbvalidatefield_' . $field->name;
					$pregExpError		=	CBTxt::P( $field->params->get( 'pregexperror', 'Not a valid input' ), array( '[FIELDNAME]' => $field->title ) );				// CBTxt::T('Not a valid input')
					$_CB_framework->outputCbJQuery( 'jQuery.validator.addMethod("' . addslashes( $validationId ) . '", function(value, element) {'
					.	'	return this.optional(element) || ' . $pregExp . '.test(value);'
					.	'}, "' . addslashes( $pregExpError ) . '"); ');
	
					$value				=	$user->get( $field->name );
					return $this->_fieldEditToHtml( $field, $user, $reason, 'input', 'text', $value, '', null, true, array( $this->getMetaClass( $field, array( $validationId . ':true' ) ) ) );
				}
			}
		}
		return parent::getField( $field, $user, $output, $reason, $list_compare_types );
	}
function checkcbdb($dbId = 0)
{
    global $_CB_database, $_CB_framework, $ueConfig, $_PLUGINS;
    // Try extending time, as unziping/ftping took already quite some... :
    @set_time_limit(240);
    HTML_comprofiler::secureAboveForm('checkcbdb');
    outputCbTemplate(2);
    outputCbJs(2);
    global $_CB_Backend_Title;
    $_CB_Backend_Title = array(0 => array('cbicon-48-tools', CBTxt::T('CB Tools: Check database: Results')));
    $cbSpoofField = cbSpoofField();
    $cbSpoofString = cbSpoofString(null, 'cbtools');
    $version = $_CB_database->getVersion();
    $version = substr($version, 0, strpos($version, '-'));
    if ($dbId == 0) {
        echo "<div style='text-align:left;'><p>" . CBTxt::T('Checking Community Builder Database') . ":</p>";
        // 1. check comprofiler_field_values table for bad rows
        $sql = "SELECT fieldvalueid,fieldid FROM #__comprofiler_field_values WHERE fieldid=0";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in Community Builder comprofiler_field_values have bad fieldid values.'), count($bad_rows)) . "</font></p>";
            foreach ($bad_rows as $bad_row) {
                if ($bad_row->fieldvalueid == 0) {
                    echo "<p><font color=red>" . sprintf(CBTxt::T('ZERO fieldvalueid illegal: fieldvalueid=%s fieldid=0'), $bad_row->fieldvalueid) . "</font></p>";
                } else {
                    echo "<p><font color=red>fieldvalueid=" . $bad_row->fieldvalueid . " fieldid=0</font></p>";
                }
            }
            echo '<p><font color=red>' . CBTxt::T('This one can be fixed by <strong>first backing up database</strong>') . ' <a href="' . $_CB_framework->backendUrl("index.php?option=com_comprofiler&task=fixcbmiscdb&{$cbSpoofField}={$cbSpoofString}") . '"> ' . CBTxt::T('then by clicking here') . '</a>.</font></p>';
        } else {
            echo "<p><font color=green>" . CBTxt::T('All Community Builder comprofiler_field_values table fieldid rows all match existing fields.') . "</font></p>";
        }
        // 2.	check if comprofiler_field_values table has entries where corresponding fieldtype value in comprofiler_fields table
        //		does not allow values
        $sql = "SELECT v.fieldvalueid, v.fieldid, f.name, f.type FROM #__comprofiler_field_values as v, #__comprofiler_fields as f WHERE v.fieldid = f.fieldid AND f.type NOT IN ('checkbox','multicheckbox','select','multiselect','radio')";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in Community Builder comprofiler_field_values link back to fields of wrong fieldtype.'), count($bad_rows)) . "</font></p>";
            foreach ($bad_rows as $bad_row) {
                echo "<p><font color=red>fieldvalueid=" . $bad_row->fieldvalueid . " fieldtype=" . $bad_row->type . "</font></p>";
            }
            echo "<p><font color=red>" . CBTxt::T('This one can be fixed in SQL using a tool like phpMyAdmin.') . "</font></p>";
            // not done automatically since some fields might have field values ! echo '<p><font color=red>This one can be fixed by <strong>first backing up database</strong> then <a href="' . $_CB_framework->backendUrl( "index.php?option=com_comprofiler&task=fixcbmiscdb&$cbSpoofField=$cbSpoofString" ) . '">by clicking here</a>.</font></p>';
        } else {
            echo "<p><font color=green>" . CBTxt::T('All Community Builder comprofiler_field_values table rows link to correct fieldtype fields in comprofiler_field table.') . "</font></p>";
        }
        // 5.	check if all cb defined fields have corresponding comprofiler columns
        $sql = "SELECT * FROM #__comprofiler";
        $_CB_database->setQuery($sql, 0, 1);
        $all_comprofiler_fields_and_values = $_CB_database->loadAssoc();
        $all_comprofiler_fields = array();
        if ($all_comprofiler_fields_and_values === null) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (is_array($all_comprofiler_fields_and_values)) {
            while (false != (list($_cbfield) = each($all_comprofiler_fields_and_values))) {
                array_push($all_comprofiler_fields, $_cbfield);
            }
        }
        $sql = "SELECT * FROM #__comprofiler_fields WHERE `name` != 'NA' AND `table` = '#__comprofiler'";
        $_CB_database->setQuery($sql);
        $field_rows = $_CB_database->loadObjectList(null, 'moscomprofilerFields', array(&$_CB_database));
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } else {
            $html_output = array();
            $cb11 = true;
            foreach ($field_rows as $field_row) {
                if ($field_row->tablecolumns !== null) {
                    // CB 1.2 way:
                    if ($field_row->tablecolumns != '') {
                        $tableColumns = explode(',', $field_row->tablecolumns);
                        foreach ($tableColumns as $col) {
                            if (!in_array($col, $all_comprofiler_fields)) {
                                $html_output[] = "<p><font color=red>" . sprintf(CBTxt::T(' - Field %s - Column %s is missing from comprofiler table.'), $field_row->name, $col) . "</font></p>";
                            }
                        }
                    }
                    $cb11 = false;
                } else {
                    // cb 1.1 way
                    if (!in_array($field_row->name, $all_comprofiler_fields)) {
                        $html_output[] = "<p><font color=red>" . sprintf(CBTxt::T(' - Column %s is missing from comprofiler table.'), $field_row->name) . "</font></p>";
                    }
                }
            }
            if (count($html_output) > 0) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('There are %s column(s) missing in the comprofiler table, which are defined as fields (rows in comprofiler_fields):'), count($html_output)) . "</font></p>";
                echo implode('', $html_output);
                echo "<p><font color=red>" . CBTxt::T('This one can be fixed by deleting and recreating the field(s) using components / Community Builder / Field Management.') . '<br />' . CBTxt::T('Please additionally make sure that columns in comprofiler table <strong>are not also duplicated in users table</strong>.') . "</font></p>";
            } elseif ($cb11) {
                echo "<p><font color=red>" . CBTxt::T('All Community Builder fields from comprofiler_fields are present as columns in the comprofiler table, but comprofiler_fields table is not yet upgraded to CB 1.2 table structure. Just going to Community Builder Fields Management will fix this automatically.') . "</font></p>";
            } else {
                echo "<p><font color=green>" . CBTxt::T('All Community Builder fields from comprofiler_fields are present as columns in the comprofiler table.') . "</font></p>";
            }
        }
        // 9. Check if images/comprofiler is writable:
        $folder = 'images/comprofiler/';
        if ($ueConfig['allowAvatarUpload'] == 1) {
            echo "<p>Checking Community Builder folders:</p>";
            if (!is_writable($_CB_framework->getCfg('absolute_path') . '/' . $folder)) {
                echo '<font color="red">' . sprintf(CBTxt::T('Avatars and thumbnails folder: %s/%s is NOT writeable by the webserver.'), $_CB_framework->getCfg('absolute_path'), $folder) . ' </font>';
            } else {
                echo '<font color="green">' . CBTxt::T('Avatars and thumbnails folder is Writeable.') . '</font>';
            }
        }
        cbimport('cb.dbchecker');
        $dbChecker = new CBdbChecker($_CB_database);
        $result = $dbChecker->checkCBMandatoryDb(false);
        $dbName = CBTxt::T('Core CB mandatory basics');
        $messagesAfter = array();
        $messagesBefore = array();
        HTML_comprofiler::fixcbdbShowResults($dbChecker, false, false, $result, $messagesBefore, $messagesAfter, $dbName, $dbId);
        $dbChecker = new CBdbChecker($_CB_database);
        $result = $dbChecker->checkDatabase(false);
        $_PLUGINS->loadPluginGroup('user');
        $messagesAfter = $_PLUGINS->trigger('onAfterCheckCbDb', true);
        $dbName = CBTxt::T('Core CB');
        $messagesBefore = array();
        HTML_comprofiler::fixcbdbShowResults($dbChecker, false, false, $result, $messagesBefore, $messagesAfter, $dbName, $dbId);
        echo '</div>';
        // adapt published fields to global CB config (regarding name type)
        _cbAdaptNameFieldsPublished($ueConfig);
    } elseif ($dbId == 1) {
        // Check plugins db:
        $dbName = CBTxt::T('CB plugin');
        $messagesBefore = array();
        $messagesAfter = array();
        cbimport('cb.installer');
        $sql = 'SELECT `id`, `name` FROM `#__comprofiler_plugin` ORDER BY `ordering`';
        $_CB_database->setQuery($sql);
        $plugins = $_CB_database->loadObjectList();
        if (!$_CB_database->getErrorNum()) {
            $cbInstaller = new cbInstallerPlugin();
            foreach ($plugins as $plug) {
                $result = $cbInstaller->checkDatabase($plug->id, false);
                if (is_bool($result)) {
                    HTML_comprofiler::fixcbdbShowResults($cbInstaller, false, false, $result, $messagesBefore, $messagesAfter, $dbName . ' "' . $plug->name . '"', $dbId, false);
                } elseif (is_string($result)) {
                    echo '<div style="color:orange;">' . $dbName . ' "' . $plug->name . '"' . ': ' . $result . '</div>';
                } else {
                    echo '<div style="color:black;">' . sprintf(CBTxt::T('%s "%s": no database or no database description.'), $dbName, $plug->name) . '</div>';
                }
            }
        }
        $dbName = CBTxt::T('CB plugins');
        $null = null;
        HTML_comprofiler::fixcbdbShowResults($null, false, false, $result, array(), array(), $dbName, $dbId, true);
    } elseif ($dbId == 2) {
        echo "<div style='text-align:left;'><p>" . CBTxt::T('Checking Users Database') . ":</p>";
        // 3.	check if comprofiler table is in sync with users table
        $sql = "SELECT c.id FROM #__comprofiler c LEFT JOIN #__users u ON u.id = c.id WHERE u.id IS NULL";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in Community Builder comprofiler table without corresponding user table rows.'), count($bad_rows)) . "</font></p>";
            $badids = array();
            foreach ($bad_rows as $bad_row) {
                $badids[(int) $bad_row->id] = $bad_row->id;
            }
            echo "<p><font color=red>" . sprintf(CBTxt::T('Following comprofiler id: %s are missing in user table'), implode(', ', $badids)) . (isset($badids[0]) ? " " . CBtxt::T('This comprofiler entry with id 0 should be removed, as it\'s not allowed.') : "") . "</font></p>";
            echo "<p><font color=red>" . CBTxt::T('This one can be fixed using menu Components-&gt; Community Builder-&gt; tools and then click `Synchronize users`.') . "</font></p>";
        } else {
            echo "<p><font color=green>" . CBTxt::T('All Community Builder comprofiler table rows have links to user table.') . "</font></p>";
        }
        // 4.	check if users table is in sync with comprofiler table
        $sql = "SELECT u.id FROM #__users u LEFT JOIN #__comprofiler c ON c.id = u.id WHERE c.id IS NULL";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in users table without corresponding comprofiler table rows.'), count($bad_rows)) . "</font></p>";
            $badids = array();
            foreach ($bad_rows as $bad_row) {
                $badids[(int) $bad_row->id] = $bad_row->id;
            }
            echo "<p><font color=red>" . sprintf(CBTxt::T('users id: %s are missing in comprofiler table'), implode(', ', $badids)) . "</font></p>";
            echo "<p><font color=red>" . CBTxt::T('This one can be fixed using menu Components-&gt; Community Builder-&gt; tools and then click `Synchronize users`.') . "</font></p>";
        } else {
            echo "<p><font color=green>" . CBTxt::T('All users table rows have links to comprofiler table.') . "</font></p>";
        }
        // 6.	check if users table has id=0 in it
        $sql = "SELECT u.id FROM #__users u WHERE u.id = 0";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in users table with id=0.'), count($bad_rows)) . "</font></p>";
            foreach ($bad_rows as $bad_row) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('users id=%s is not allowed.'), $bad_row->id) . "</font></p>";
            }
            echo "<p><font color=red>" . CBTxt::T('This one can be fixed using menu Components-&gt; Community Builder-&gt; tools and then click `Synchronize users`.') . "</font></p>";
            // echo "<p><font color=red>" . CBTxt::T('This one can be fixed in SQL using a tool like phpMyAdmin.') . " <strong><u>" . CBTxt::T('You also need to check in SQL if id is autoincremented.') . "<u><strong></font></p>";
        } else {
            echo "<p><font color=green>" . CBTxt::T('users table has no zero id row.') . "</font></p>";
        }
        // 7.	check if comprofiler table has id=0 in it
        $sql = "SELECT c.id FROM #__comprofiler c WHERE c.id = 0";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in comprofiler table with id=0.'), count($bad_rows)) . "</font></p>";
            foreach ($bad_rows as $bad_row) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('comprofiler id=%s is not allowed.'), $bad_row->id) . "</font></p>";
            }
            echo "<p><font color=red>" . CBTxt::T('This one can be fixed using menu Components / Community Builder / Tools and then click "Synchronize users".') . "</font></p>";
        } else {
            echo "<p><font color=green>" . CBTxt::T('comprofiler table has no zero id row.') . "</font></p>";
        }
        // 8.	check if comprofiler table has user_id != id in it
        $sql = "SELECT c.id, c.user_id FROM #__comprofiler c WHERE c.id <> c.user_id";
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in comprofiler table with user_id <> id.'), count($bad_rows)) . "</font></p>";
            foreach ($bad_rows as $bad_row) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('comprofiler id=%s is different from user_id=%s.'), $bad_row->id, $bad_row->user_id) . "</font></p>";
            }
            echo "<p><font color=red>" . CBTxt::T('This one can be fixed using menu Components-&gt; Community Builder-&gt; tools and then click `Synchronize users`.') . "</font></p>";
        } else {
            echo "<p><font color=green>" . CBTxt::T('All rows in comprofiler table have user_id columns identical to id columns.') . "</font></p>";
        }
        // 10.	check if #__core_acl_aro table is in sync with users table	: A: user -> aro
        if (!cbStartOfStringMatch($version, '3.23')) {
            if (checkJversion() == 2) {
                $sql = "SELECT u.id FROM #__users u LEFT JOIN #__user_usergroup_map a ON a.user_id = CAST( u.id AS CHAR ) WHERE a.user_id IS NULL";
            } else {
                $sql = "SELECT u.id FROM #__users u LEFT JOIN #__core_acl_aro a ON a.section_value = 'users' AND a.value = CAST( u.id AS CHAR ) WHERE a.value IS NULL";
            }
        } else {
            if (checkJversion() == 2) {
                $sql = "SELECT u.id FROM #__users u LEFT JOIN #__user_usergroup_map a ON a.user_id = u.id WHERE a.user_id IS NULL";
            } else {
                $sql = "SELECT u.id FROM #__users u LEFT JOIN #__core_acl_aro a ON a.section_value = 'users' AND a.value = u.id WHERE a.value IS NULL";
            }
        }
        // SELECT u.id FROM jos_users u LEFT JOIN jos_core_acl_aro a ON a.section_value = 'users' AND a.value = CAST( u.id AS CHAR ) WHERE a.value IS NULL
        // INSERT INTO jos_core_acl_aro (section_value,value,order_value,name,hidden) SELECT 'users' AS section_value, u.id AS value, 0 AS order_value, u.name as name, 0 AS hidden FROM jos_users u LEFT JOIN jos_core_acl_aro a ON a.section_value = 'users' AND a.value = CAST( u.id AS CHAR ) WHERE a.value IS NULL;
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>";
            if (checkJversion() == 2) {
                echo sprintf(CBTxt::T('Warning: %s entries in the users table without corresponding user_usergroup_map table rows.'), count($bad_rows));
            } else {
                echo sprintf(CBTxt::T('Warning: %s entries in the users table without corresponding core_acl_aro table rows.'), count($bad_rows));
            }
            echo "</font></p>";
            $badids = array();
            foreach ($bad_rows as $bad_row) {
                $badids[(int) $bad_row->id] = $bad_row->id;
            }
            echo "<p><font color=red>";
            if (checkJversion() == 2) {
                echo sprintf(CBTxt::T('user id: %s are missing in user_usergroup_map table'), implode(', ', $badids));
            } else {
                echo sprintf(CBTxt::T('user id: %s are missing in core_acl_aro table'), implode(', ', $badids));
            }
            echo (isset($badids[0]) ? " " . CBTxt::T('This user entry with id 0 should be removed, as it\'s not allowed.') : "") . "</font></p>";
            echo '<p><font color=red>' . CBTxt::T('This one can be fixed by <strong>first backing up database</strong>') . ' <a href="' . $_CB_framework->backendUrl("index.php?option=com_comprofiler&task=fixacldb&{$cbSpoofField}={$cbSpoofString}") . '">' . CBTxt::T('then by clicking here') . '</a>.</font></p>';
        } else {
            echo "<p><font color=green>";
            if (checkJversion() == 2) {
                echo CBTxt::T('All users table rows have ACL entries in user_usergroup_map table.');
            } else {
                echo CBTxt::T('All users table rows have ACL entries in core_acl_aro table.');
            }
            echo "</font></p>";
        }
        // 11.	check if #__core_acl_aro table is in sync with users table	: B: aro -> user
        if (checkJversion() == 2) {
            $sql = "SELECT a.user_id AS id FROM #__user_usergroup_map a LEFT JOIN #__users u ON u.id = a.user_id WHERE u.id IS NULL";
        } elseif (checkJversion() == 1) {
            $sql = "SELECT a.value AS id, a.id AS aro_id FROM #__core_acl_aro a LEFT JOIN #__users u ON u.id = a.value WHERE a.section_value = 'users' AND u.id IS NULL";
        } else {
            $sql = "SELECT a.value AS id, a.aro_id FROM #__core_acl_aro a LEFT JOIN #__users u ON u.id = a.value WHERE a.section_value = 'users' AND u.id IS NULL";
            // SELECT a.value AS id, a.aro_id FROM jos_core_acl_aro a LEFT JOIN jos_users u ON u.id = a.value WHERE a.section_value = 'users' AND u.id IS NULL
            // DELETE a FROM jos_core_acl_aro AS a LEFT JOIN jos_users AS u ON u.id = a.value WHERE a.section_value = 'users' AND u.id IS NULL
        }
        $_CB_database->setQuery($sql);
        $bad_rows = $_CB_database->loadObjectList();
        if ($_CB_database->getErrorNum()) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
        } elseif (count($bad_rows) != 0) {
            echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in the core_acl_aro table without corresponding users table rows.'), count($bad_rows)) . "</font></p>";
            $badids = array();
            foreach ($bad_rows as $bad_row) {
                $badids[(int) $bad_row->id] = "user id=" . $bad_row->id . " (aro_id=" . $bad_row->aro_id . ")";
            }
            echo "<p><font color=red>" . CBTxt::P('Following entries of [tablename1] table are missing in [tablename2] table: [badids].', array('[tablename1]' => checkJversion() == 2 ? 'user_usergroup_map' : 'core_acl_aro', '[tablename2]' => 'users', '[badids]' => implode(', ', $badids))) . (isset($badids[0]) ? "<br /> " . CBTxt::T('This core_acl_aro entry with (user) value 0 should be removed, as it\'s not allowed.') : "") . ($bad_row->aro_id == 0 ? " " . CBtxt::T('This core_acl_aro entry with aro_id 0 should be removed, as it\'s not allowed.') : "") . "</font></p>";
            echo '<p><font color=red>' . CBTxt::T('This one can be fixed by <strong>first backing up database</strong>') . ' <a href="' . $_CB_framework->backendUrl("index.php?option=com_comprofiler&task=fixacldb&{$cbSpoofField}={$cbSpoofString}") . '">' . CBTxt::T('then by clicking here') . '</a>.</font></p>';
        } else {
            echo "<p><font color=green>" . CBTxt::P('All [tablename1] table rows have corresponding entries in [tablename2] table.', array('[tablename1]' => checkJversion() == 2 ? 'ACL user_usergroup_map' : 'ACL core_acl_aro', '[tablename2]' => 'users')) . "</font></p>";
        }
        // 12.	check if #__core_acl_groups_aro_map table is in sync with #__core_acl_aro table	A: aro -> groups
        if (checkJversion() <= 1) {
            if (checkJversion() == 1) {
                $sql = "SELECT a.value AS id, a.id AS aro_id FROM #__core_acl_aro a LEFT JOIN #__core_acl_groups_aro_map g ON g.aro_id = a.id WHERE g.aro_id IS NULL";
            } else {
                $sql = "SELECT a.value AS id, a.aro_id FROM #__core_acl_aro a LEFT JOIN #__core_acl_groups_aro_map g ON g.aro_id = a.aro_id WHERE g.aro_id IS NULL";
                // SELECT a.value AS id, a.aro_id FROM jos_core_acl_aro a LEFT JOIN jos_core_acl_groups_aro_map g ON g.aro_id = a.aro_id WHERE g.aro_id IS NULL
                // INSERT INTO jos_core_acl_groups_aro_map (aro_id,section_value,group_id) SELECT a.aro_id, '', 18 AS group_id FROM jos_core_acl_aro a LEFT JOIN jos_core_acl_groups_aro_map g ON g.aro_id = a.aro_id WHERE g.aro_id IS NULL
            }
            $_CB_database->setQuery($sql);
            $bad_rows = $_CB_database->loadObjectList();
            if ($_CB_database->getErrorNum()) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
            } elseif (count($bad_rows) != 0) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in the core_acl_aro table without corresponding core_acl_groups_aro_map table rows.'), count($bad_rows)) . "</font></p>";
                $badids = array();
                foreach ($bad_rows as $bad_row) {
                    $badids[(int) $bad_row->id] = "user id=" . $bad_row->id . " (aro_id=" . $bad_row->aro_id . ")";
                }
                echo "<p><font color=red>" . sprintf(CBTxt::T('Following entries of core_acl_aro table are missing in core_acl_groups_aro_map table: %s.'), implode(', ', $badids)) . (isset($badids[0]) ? "<br /> " . CBTxt::T('This core_acl_aro entry with (user) value 0 should be removed, as it\'s not allowed.') : "") . ($bad_row->aro_id == 0 ? " " . CBtxt::T('This core_acl_aro entry with aro_id 0 should be removed, as it\'s not allowed.') : "") . "</font></p>";
                echo '<p><font color=red>' . CBTxt::T('This one can be fixed by <strong>first backing up database</strong>') . ' <a href="' . $_CB_framework->backendUrl("index.php?option=com_comprofiler&task=fixacldb&{$cbSpoofField}={$cbSpoofString}") . '">' . CBTxt::T('then by clicking here') . '</a>.</font></p>';
            } else {
                echo "<p><font color=green>" . CBTxt::T('All core_acl_aro table rows have ACL entries in core_acl_groups_aro_map table.') . "</font></p>";
            }
        }
        // 13.	check if #__core_acl_groups_aro_map table is in sync with #__core_acl_aro table	B: groups -> aro
        if (checkJversion() <= 1) {
            if (checkJversion() == 1) {
                $sql = "SELECT g.aro_id AS id FROM #__core_acl_groups_aro_map g LEFT JOIN #__core_acl_aro a ON a.id = g.aro_id WHERE a.id IS NULL";
            } else {
                $sql = "SELECT g.aro_id AS id FROM #__core_acl_groups_aro_map g LEFT JOIN #__core_acl_aro a ON a.aro_id = g.aro_id WHERE a.aro_id IS NULL";
                // SELECT g.aro_id AS id FROM jos_core_acl_groups_aro_map g LEFT JOIN jos_core_acl_aro a ON a.aro_id = g.aro_id WHERE a.aro_id IS NULL
                // DELETE g FROM jos_core_acl_groups_aro_map g LEFT JOIN jos_core_acl_aro a ON a.aro_id = g.aro_id WHERE a.aro_id IS NULL
            }
            $_CB_database->setQuery($sql);
            $bad_rows = $_CB_database->loadObjectList();
            if ($_CB_database->getErrorNum()) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('ERROR: sql query: %s : returned error: %s'), htmlspecialchars($sql), stripslashes($_CB_database->getErrorMsg())) . "</font></p>";
            } elseif (count($bad_rows) != 0) {
                echo "<p><font color=red>" . sprintf(CBTxt::T('Warning: %s entries in the core_acl_groups_aro_map without corresponding core_acl_aro table table rows.'), count($bad_rows)) . "</font></p>";
                $badids = array();
                foreach ($bad_rows as $bad_row) {
                    $badids[(int) $bad_row->id] = $bad_row->id;
                }
                echo "<p><font color=red>" . sprintf(CBTxt::T('aro_id = %s are missing in core_acl_aro table table.'), implode(', ', $badids)) . (isset($badids[0]) ? " " . CBTxt::T('This entry with aro_id 0 should be removed, as it\'s not allowed.') : "") . "</font></p>";
                echo '<p><font color=red>' . CBTxt::T('This one can be fixed by <strong>first backing up database</strong>') . ' <a href="' . $_CB_framework->backendUrl("index.php?option=com_comprofiler&task=fixacldb&{$cbSpoofField}={$cbSpoofString}") . '">' . CBTxt::T('by clicking here') . '</a>.</font></p>';
            } else {
                echo "<p><font color=green>" . CBTxt::T('All core_acl_aro table rows have ACL entries in core_acl_groups_aro_map table.') . "</font></p>";
            }
        }
        $dbName = CBTxt::T('Users');
        echo '</div>';
    } elseif ($dbId == 3) {
        // adapt published fields to global CB config (regarding name type)
        _cbAdaptNameFieldsPublished($ueConfig);
        // Check fields db:
        cbimport('cb.dbchecker');
        $dbChecker = new CBdbChecker($_CB_database);
        $result = $dbChecker->checkAllCBfieldsDb(false);
        $dbName = CBTxt::T('CB fields data storage');
        $messagesBefore = array();
        $_PLUGINS->loadPluginGroup('user');
        $messagesAfter = $_PLUGINS->trigger('onAfterCheckCbFieldsDb', true);
        HTML_comprofiler::fixcbdbShowResults($dbChecker, false, false, $result, $messagesBefore, $messagesAfter, $dbName, $dbId);
        echo '</div>';
    }
    global $_CB_Backend_Title;
    $_CB_Backend_Title = array(0 => array('cbicon-48-tools', sprintf(CBTxt::T("CB Tools: Check %s database: Results"), $dbName)));
}
예제 #8
0
	/**
	 * render frontend all groups
	 *
	 * @param boolean $self
	 * @param object $rows
	 * @param object $pageNav
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return mixed
	 */
	static function showGroupAll( $self, $rows, $pageNav, $user, $plugin ) {
		global $_CB_framework, $_LANG;

		$generalTitle			=	$plugin->params->get( 'general_title', $plugin->name );

		$_CB_framework->setPageTitle( cbgjClass::getOverride( 'group', true ) );

		if ( $generalTitle != '' ) {
			$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( $generalTitle ) ), cbgjClass::getPluginURL() );
		}

		$_CB_framework->appendPathWay( cbgjClass::getOverride( 'group', true ), cbgjClass::getPluginURL( array( 'groups', ( $self ? 'allmy' : 'all' ) ) ) );

		$groupAllSearch			=	$plugin->params->get( 'group_all_search', 1 );
		$groupAllPaging			=	$plugin->params->get( 'group_all_paging', 1 );
		$groupAllLimitbox		=	$plugin->params->get( 'group_all_limitbox', 1 );
		$groupAllDescLimit		=	(int) $plugin->params->get( 'group_all_desc_limit', 150 );
		$groupApprove			=	$plugin->params->get( 'group_approve', 0 );
		$authorized				=	cbgjClass::getAuthorization( null, null, $user );
		$return					=	'<div class="gjGroupAll">';

		if ( cbgjClass::hasAccess( 'grp_create', $authorized ) ) {
			$return				.=		'<div class="gjTop gjTopCenter">'
								.			'<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new' ), true, true, false, null, true ) . '" />'
								.		'</div>';
		}

		$return					.=		'<form action="' . cbgjClass::getPluginURL( array( 'groups', ( $self ? 'allmy' : 'all' ) ) ) . '" method="post" name="gjForm" id="gjForm" class="gjForm">'
								.			( $groupAllSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );

		if ( $rows ) foreach ( $rows as $row ) {
			$category			=	$row->getCategory();
			$authorized			=	cbgjClass::getAuthorization( $category, $row, $user );

			if ( $row->get( 'published' ) == 1 ) {
				$state			=	'<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'unpublish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-ban-circle"></i> ' . CBTxt::Th( 'Unpublish' ) . '</a></div>';
			} else {
				$state			=	'<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-ok"></i> ' . CBTxt::Th( 'Publish' ) . '</a></div>';
			}

			$canApprove			=	( $groupApprove && ( $row->get( 'published' ) == -1 ) && cbgjClass::hasAccess( 'grp_can_publish', $authorized ) );

			$beforeMenu			=	cbgjClass::getIntegrations( 'gj_onBeforeCategoryGroupMenu', array( $row, $category, $user, $plugin ) );
			$afterMenu			=	cbgjClass::getIntegrations( 'gj_onAfterCategoryGroupMenu', array( $row, $category, $user, $plugin ) );

			$return				.=			'<div class="gjContent row-fluid">'
								.				'<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
								.				'<div class="gjContentBody mini-layout span10">'
								.					'<div class="gjContentBodyHeader row-fluid">'
								.						'<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ' - ' . $category->getName( 0, true ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'
								.						'<div class="gjContentBodyMenu span3">';

			if ( $canApprove ) {
				$return			.=							'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
			} else {
				if ( ( $row->get( 'published' ) == 0 ) || ( ( $row->get( 'published' ) == 1 ) && ( ! cbgjClass::hasAccess( 'grp_approved', $authorized ) ) ) ) {
					$return		.=							cbgjClass::getIcon( null, CBTxt::P( 'This [group] is currently unpublished.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), 'icon-eye-close' );
				}

				if ( cbgjClass::hasAccess( 'grp_join', $authorized ) ) {
					$return		.=							' <input type="button" value="' . htmlspecialchars( ( cbgjClass::hasAccess( 'grp_invited', $authorized ) ? CBTxt::T( 'Accept Invite' ) : CBTxt::T( 'Join' ) ) ) . '" class="gjButton gjButtonCancel btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
				}
			}

			if ( $beforeMenu || cbgjClass::hasAccess( array( 'grp_leave', 'mod_lvl2', 'mod_lvl3' ), $authorized ) || $afterMenu || ( ( ! $canApprove ) && cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ) || ( $canApprove && cbgjClass::hasAccess( 'grp_join', $authorized ) ) ) {
				$menuItems		=	$beforeMenu
								.	( $canApprove && cbgjClass::hasAccess( 'grp_join', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-plus"></i> ' . CBTxt::Th( 'Join' ) . '</a></div>' : null )
								.	( cbgjClass::hasAccess( 'grp_leave', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'leave', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to leave this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-minus"></i> ' . CBTxt::Th( 'Leave' ) . '</a></div>' : null )
								.	( cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
								.	( ( ! $canApprove ) && cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ? $state : null )
								.	( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'delete', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [group] and all its associated [users]?', array( '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
								.	$afterMenu;

				$return			.=							cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
			}

			$return				.=						'</div>'
								.					'</div>'
								.					'<div class="gjContentBodyInfo">' . ( $row->getDescription( $groupAllDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $groupAllDescLimit ) . '</div>' : null ) . '</div>'
								.					'<div class="gjContentDivider"></div>'
								.					'<div class="gjContentBodyFooter">'
								.						cbgjClass::getIntegrations( 'gj_onBeforeCategoryGroupInfo', array( $row, $category, $user, $plugin ), null, 'span' )
								.						( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'group', $row->nestedCount() ) . ' | ' : null )
								.						( $row->userCount() ? cbgjClass::getOverride( 'user', $row->userCount() ) . ' | ' : null )
								.						$row->getType()
								.						cbgjClass::getIntegrations( 'gj_onAfterCategoryGroupInfo', array( $row, $category, $user, $plugin ), null, 'span' )
								.					'</div>'
								.				'</div>'
								.			'</div>';
		} else {
			$return				.=			'<div class="gjContent">';

			if ( $groupAllSearch && $pageNav->searching ) {
				$return			.=				CBTxt::Ph( 'No [group] search results found.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) );
			} else {
				$return			.=				CBTxt::Ph( 'There are no [groups] available.', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
			}

			$return				.=			'</div>';
		}

		if ( $groupAllPaging ) {
			$return				.=			'<div class="gjPaging pagination pagination-centered">'
								.				( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
								.				( ! $groupAllLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
								.			'</div>';
		}

		$return					.=			cbGetSpoofInputTag( 'plugin' )
								.		'</form>'
								.	'</div>';

		echo $return;
	}
예제 #9
0
								.					( $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>'
								.				'</div>';
		} else {
			$return				.=				'<div class="gjModuleContent row-fluid">'
								.					'<div class="gjModuleContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
								.					'<div class="gjModuleContentBody span10">'
								.						'<div class="gjModuleContentBodyTitle">' . $row->getName( $nameLength, true ) . '</div>'
								.						'<div class="gjModuleContentBodyInfo">'
								.							( $nestedCount ? cbgjClass::getOverride( 'group', $row->nestedCount() ) : null )
								.							( $row->userCount() ? ( $nestedCount ? ' | ' : null ) . cbgjClass::getOverride( 'user', $row->userCount() ) : null )
								.						'</div>'
								.						'<div class="gjModuleContentBodyFooter"><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>'
								.					'</div>'
								.				'</div>'
								.				'<div class="gjModuleContentDivider"></div>';
		}
	} else {
		$return					.=				CBTxt::P( 'You are not invited to any [groups].', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
	}

	$return						.=			'</div>';
}

$return							.=		'</div>'
								.	'</div>';

echo $return;
?>
예제 #10
0
	/**
	 * 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' );
		}
	}
예제 #11
0
	/**
	 * render frontend category main
	 *
	 * @param cbgjCategory $row
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showCategoryMain( $row, $user, $plugin ) {
		global $_CB_framework;

		$componentClass			=	new CBplug_cbgroupjive();
		$authorized				=	cbgjClass::getAuthorization( $row, null, $user );

		$tabs					=	new cbTabs( 1, 1 );

		$newCategory			=	( $plugin->params->get( 'category_new_category', 0 ) && cbgjClass::hasAccess( 'cat_nested_create', $authorized ) );
		$newGroup				=	( $plugin->params->get( 'category_new_group', 0 ) && cbgjClass::hasAccess( 'cat_grp_create', $authorized ) );
		$hasNested				=	( $row->nestedCount() && cbgjClass::hasAccess( 'cat_approved', $authorized ) );
		$beforeTab				=	cbgjClass::getIntegrations( 'gj_onBeforeCategoryTab', array( $tabs, $row, $user, $plugin ), null, null );
		$afterTab				=	cbgjClass::getIntegrations( 'gj_onAfterCategoryTab', array( $tabs, $row, $user, $plugin ), null, null );

		$return					=	null;

		if ( ( $row->get( 'published' ) == -1 ) && $plugin->params->get( 'category_approve', 0 ) ) {
			$return				.=	'<div class="alert alert-error">' . CBTxt::P( 'This [category] is currently pending approval.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</div>';
		} elseif ( ( $row->get( 'published' ) == 0 ) || ( ( $row->get( 'published' ) == 1 ) && ( ! cbgjClass::hasAccess( 'cat_approved', $authorized ) ) ) ) {
			$return				.=	'<div class="alert alert-error">' . CBTxt::P( 'This [category] is currently unpublished.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</div>';
		}

		if ( $newCategory || $newGroup ) {
			$return				.=	'<div class="gjTop gjTopCenter">'
								.		'<div class="btn-group">'
								.			( $newCategory ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'new', (int) $row->get( 'id' ) ), true ) . '" />' : null )
								.			( $newGroup ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new', (int) $row->get( 'id' ) ), true ) . '" />' : null )
								.		'</div>'
								.	'</div>';
		}

		if ( $beforeTab || $afterTab || $hasNested ) {
			$return				.=	$tabs->startPane( 'getCategoryTabs' );

			if ( $hasNested && ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) ) {
				$return			.=		$tabs->startTab( null, cbgjClass::getOverride( 'category', true ), 'gjCategories' )
								.			'<div class="gjNestedCategories">'
								.				$componentClass->showNestedCategories( $row, $user, $plugin )
								.			'</div>'
								.		$tabs->endTab();
			}

			$return				.=		$beforeTab;

			if ( cbgjClass::hasAccess( 'cat_approved', $authorized ) ) {
				$return			.=		$tabs->startTab( null, cbgjClass::getOverride( 'group', true ), 'gjGroups' );
			}
		}

		if ( cbgjClass::hasAccess( 'cat_approved', $authorized ) ) {
			$return				.=			'<div class="gjCategoryGroups">'
								.				$componentClass->showCategoryGroups( $row, $user, $plugin )
								.			'</div>';
		}

		if ( $beforeTab || $afterTab || $hasNested ) {
			if ( cbgjClass::hasAccess( 'cat_approved', $authorized ) ) {
				$return			.=		$tabs->endTab();
			}

			$return				.=		$afterTab
								.	$tabs->endPane();
		}

		if ( isset( $_GET['tab'] ) ) {
			$tab				=	urldecode( stripslashes( cbGetParam( $_GET, 'tab' ) ) );
		} elseif ( isset( $_POST['tab'] ) ) {
			$tab				=	stripslashes( cbGetParam( $_POST, 'tab' ) );
		} else {
			$tab				=	null;
		}

		if ( $tab ) {
			$js					=	"$( '#getCategoryTabs .tab-row .tab a' ).each( function() {"
								.		"if ( $( this ).text().toLowerCase() == '" . addslashes( strtolower( $tab ) ) . "' ) {"
								.			"$( this ).parent( '.tab' ).trigger( 'click' );"
								.		"}"
								.	"});";

			$_CB_framework->outputCbJQuery( $js );
		}

		return $return;
	}
예제 #12
0
	/**
	 * render frontend overview main
	 *
	 * @param object $rows
	 * @param object $pageNav
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showOverviewMain( $rows, $pageNav, $user, $plugin ) {
		$authorized			=	cbgjClass::getAuthorization( null, null, $user );
		$overviewSearch		=	$plugin->params->get( 'overview_search', 1 );
		$overviewPaging		=	$plugin->params->get( 'overview_paging', 1 );
		$overviewLimitbox	=	$plugin->params->get( 'overview_limitbox', 1 );
		$categoryDescLimit	=	(int) $plugin->params->get( 'overview_cat_desc_limit', 150 );
		$categoryApprove	=	$plugin->params->get( 'category_approve', 0 );
		$newCategory		=	( $plugin->params->get( 'overview_new_category', 0 ) && cbgjClass::hasAccess( 'cat_create', $authorized ) );
		$newGroup			=	( $plugin->params->get( 'overview_new_group', 0 ) && cbgjClass::hasAccess( 'grp_create', $authorized ) );

		$return				=	null;

		if ( $newCategory || $newGroup ) {
			$return			.=	'<div class="gjTop gjTopCenter">'
							.		'<div class="btn-group">'
							.			( $newCategory ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'new' ), true ) . '" />' : null )
							.			( $newGroup ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new' ), true, true, false, null, true ) . '" />' : null )
							.		'</div>'
							.	'</div>';
		}

		$return				.=	'<form action="' . cbgjClass::getPluginURL( array( 'overview' ) ) . '" method="post" name="gjForm" id="gjForm" class="gjForm">'
							.		( $overviewSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );

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

			if ( $row->get( 'published' ) == 1 ) {
				$state		=	'<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'unpublish', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [category]?', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), true, false, null, true ) . '"><i class="icon-ban-circle"></i> ' . CBTxt::Th( 'Unpublish' ) . '</a></div>';
			} else {
				$state		=	'<div><a href="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-ok"></i> ' . CBTxt::Th( 'Publish' ) . '</a></div>';
			}

			$canApprove		=	( $categoryApprove && ( $row->get( 'published' ) == -1 ) && cbgjClass::hasAccess( 'cat_can_publish', $authorized ) );

			$beforeMenu		=	cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryMenu', array( $row, $user, $plugin ) );
			$afterMenu		=	cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryMenu', array( $row, $user, $plugin ) );

			$return			.=		'<div class="gjContent row-fluid">'
							.			'<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
							.			'<div class="gjContentBody mini-layout span10">'
							.				'<div class="gjContentBodyHeader row-fluid">'
							.					'<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . '</small></h5></div>'
							.					'<div class="gjContentBodyMenu span3">';

			if ( $canApprove ) {
				$return		.=						'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
			} else {
				if ( ( $row->get( 'published' ) == 0 ) || ( ( $row->get( 'published' ) == 1 ) && ( ! cbgjClass::hasAccess( 'cat_approved', $authorized ) ) ) ) {
					$return	.=						cbgjClass::getIcon( null, CBTxt::P( 'This [category] is currently unpublished.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), 'icon-eye-close' );
				}
			}

			if ( $beforeMenu || cbgjClass::hasAccess( array( 'mod_lvl1', 'cat_can_publish' ), $authorized ) || $afterMenu ) {
				$menuItems	=	$beforeMenu
							.	( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
							.	( ( ! $canApprove ) && cbgjClass::hasAccess( 'cat_can_publish', $authorized ) ? $state : null )
							.	( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'delete', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [category] and all its associated [groups]?', array( '[category]' => cbgjClass::getOverride( 'category' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
							.	$afterMenu;

				$return		.=						cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
			}

			$return			.=					'</div>'
							.				'</div>'
							.				'<div class="gjContentBodyInfo">' . ( $row->getDescription( $categoryDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $categoryDescLimit ) . '</div>' : null ) . '</div>'
							.				'<div class="gjContentDivider"></div>'
							.				'<div class="gjContentBodyFooter">'
							.					cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
							.					( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'category', $row->nestedCount() ) . ' | ' : null )
							.					( $row->groupCount() ? cbgjClass::getOverride( 'group', $row->groupCount() ) . ' | ' : null )
							.					implode( ', ', $row->getTypes() )
							.					cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
							.				'</div>'
							.			'</div>'
							.		'</div>';
		} else {
			$return			.=		'<div class="gjContent">';

			if ( $overviewSearch && $pageNav->searching ) {
				$return		.=			CBTxt::Ph( 'No [category] search results found.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) );
			} else {
				$return		.=			CBTxt::Ph( 'There are no [categories] available.', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) );
			}

			$return			.=		'</div>';
		}

		if ( $overviewPaging ) {
			$return			.=		'<div class="gjPaging pagination pagination-centered">'
							.			( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
							.			( ! $overviewLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
							.		'</div>';
		}

		$return				.=		cbGetSpoofInputTag( 'plugin' )
							.	'</form>';

		return $return;
	}
예제 #13
0
	/**
	 * render frontend invites
	 *
	 * @param object $rows
	 * @param object $pageNav
	 * @param cbgjCategory $category
	 * @param cbgjGroup $group
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showInvites( $rows, $pageNav, $category, $group, $user, $plugin ) {
		global $_CB_framework;

		$groupInvitesSearch			=	( $plugin->params->get( 'group_invites_search', 1 ) && ( $pageNav->searching || $pageNav->total ) );
		$groupInvitesPaging			=	$plugin->params->get( 'group_invites_paging', 1 );
		$groupInvitesLimitbox		=	$plugin->params->get( 'group_invites_limitbox', 1 );
		$authorized					=	cbgjClass::getAuthorization( $category, $group, $user );
		$groupInvitesToggle			=	( $plugin->params->get( 'group_toggle', 3 ) > 1 );
		$data						=	cbgjClass::parseParams( $_POST );

		if ( $plugin->params->get( 'group_invites_list', 0 ) ) {
			$connections			=	cbgjClass::getConnectionsList( $user );

			if ( $connections ) {
				$js					=	"$( '#invites_conn' ).change( function() {"
									.		"$( '#invites_invite' ).attr( 'value', $( this ).val() ).focus().keyup();"
									.		"$( this ).attr( 'value', '' );"
									.	"});";

				$_CB_framework->outputCbJQuery( $js );

				array_unshift( $connections, moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Connection -' ) ) );

				$usersList			=	moscomprofilerHTML::selectList( $connections, 'invites_conn', null, 'value', 'text', null, 0, false, false );
			}
		}

		if ( $plugin->params->get( 'group_invites_captcha', 0 ) && ( ! cbgjClass::hasAccess( 'usr_mod', $authorized ) ) ) {
			$captcha				=	cbgjCaptcha::render();
		} else {
			$captcha				=	false;
		}

		$return						=	'<form action="' . cbgjClass::getPluginURL( array( 'invites', 'send', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ) ) . '" method="post" name="gjForm_invite" id="gjForm_invite" class="gjForm gjToggle form-horizontal">'
									.		'<div class="gjEditContentInput control-group">'
									.			'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Invite' ) . '</label>'
									.			'<div class="gjEditContentInputField controls">'
									.				'<input type="text" size="35" class="input-large required" value="' . htmlspecialchars( $data->get( 'invites_invite', null ) ) . '" name="invites_invite" id="invites_invite" />'
									.				'<span class="gjEditContentInputIcon help-inline">'
									.					cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
									.					cbgjClass::getIcon( CBTxt::P( 'Invite by [invite_types].', array( '[invite_types]' => implode( ', ', cbgjInvite::inviteBy() ) ) ) )
									.				'</span>'
									.			'</div>'
									.		'</div>';

		if ( isset( $usersList ) ) {
			$return					.=		'<div class="gjEditContentInput control-group">'
									.			'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Connection' ) . '</label>'
									.			'<div class="gjEditContentInputField controls">'
									.				$usersList
									.				'<span class="gjEditContentInputIcon help-inline">'
									.					cbgjClass::getIcon( CBTxt::T( 'Pre-fill invite with a connection.' ) )
									.				'</span>'
									.			'</div>'
									.		'</div>';
		}

		if ( $captcha !== false ) {
			$return					.=		'<div class="gjEditContentInput control-group">'
									.			'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
									.			'<div class="gjEditContentInputField controls">'
									.				'<div style="margin-bottom: 5px;">' . $captcha['code'] . '</div>'
									.				'<div>' . $captcha['input'] . '</div>'
									.				'<span class="gjEditContentInputIcon help-inline">'
									.					cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
									.				'</span>'
									.			'</div>'
									.		'</div>';
		}

		$return						.=		'<div class="gjButtonWrapper form-actions">'
									.			'<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Send Invite' ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" />&nbsp;'
									.			( $groupInvitesToggle ? '<a href="#gjInviteToggle" role="button" class="gjButton gjButtonCancel btn btn-mini gjToggleCollapse">' . CBTxt::Th( 'Cancel' ) . '</a>' : null )
									.		'</div>'
									.		cbGetSpoofInputTag( 'plugin' )
									.	'</form>'
									.	'<form action="' . $group->getUrl() . '" method="post" name="gjForm_invites" id="gjForm_invites" class="gjForm">';

		if ( $groupInvitesToggle || $groupInvitesSearch ) {
			$return					.=		'<div class="gjTop row-fluid">'
									.			'<div class="gjTop gjTopLeft span6">'
									.				( $groupInvitesToggle ? '<a href="#gjForm_invite" id="gjInviteToggle" role="button" class="gjButton btn gjToggleExpand">' . CBTxt::Th( 'New Invite' ) . '</a>' : null )
									.			'</div>'
									.			'<div class="gjTop gjTopRight span6">'
									.				( $groupInvitesSearch ? $pageNav->search : null )
									.			'</div>'
									.		'</div>';
		}

		if ( $rows ) {
			$return					.=		'<div class="gjContent">';

			foreach ( $rows as $row ) {
				if ( $row->get( 'user' ) ) {
					$userAvatar		=	$row->getInvitedAvatar( true );
					$userName		=	$row->getInvitedName( true );
					$userOnline		=	$row->getInvitedOnline();
				} else {
					$userAvatar		=	'<img src="' . selectTemplate() . 'images/avatar/tnnophoto_n.png" alt="' . htmlspecialchars( $row->get( 'email' ) ) . '" title="' . htmlspecialchars( $row->get( 'email' ) ) . '" />';
					$userName		=	'******' . htmlspecialchars( $row->get( 'email' ) ) . '">' . htmlspecialchars( $row->get( 'email' ) ) . '</a>';
					$userOnline		=	null;
				}

				$menuItems			=	cbgjClass::getIntegrations( 'gj_onBeforeGroupInviteMenu', array( $row, $group, $category, $user, $plugin ) )
									.	'<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'invites', 'delete', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::T( 'Are you sure you want to delete this invite?' ) ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>'
									.	cbgjClass::getIntegrations( 'gj_onAfterGroupInviteMenu', array( $row, $group, $category, $user, $plugin ) );

				$return				.=			'<div class="gjContentBox mini-layout">'
									.				'<div class="gjContentBoxRow">' . $userName . '</div>'
									.				'<div class="gjContentBoxRow">' . $userAvatar . '</div>'
									.				( $userOnline ? '<div class="gjContentBoxRow">' . $userOnline . '</div>' : null )
									.				'<div class="gjContentBoxRow">'
									.					cbgjClass::getIntegrations( 'gj_onBeforeGroupInviteInfo', array( $row, $group, $category, $user, $plugin ) )
									.					'<span title="' . cbFormatDate( $row->get( 'invited' ), 1, false ) . ( $row->isAccepted() ? ' - ' . cbFormatDate( $row->get( 'accepted' ), 1, false ) : null ) . '">' . $row->getStatus() . '</span>'
									.					cbgjClass::getIntegrations( 'gj_onAfterGroupInviteInfo', array( $row, $group, $category, $user, $plugin ) )
									.				'</div>';

				if ( ( ! $row->isAccepted() ) && ( $row->dateDifference() >= 5 ) ) {
					$return			.=				'<div class="gjContentBoxRow">'
									.					'<input type="button" value="' . htmlspecialchars( CBTxt::Th( 'Resend' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'invites', 'send', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), true ) . '" />'
									.				'</div>';
				}

				$return				.=				'<div class="gjContentBoxRow">'
									.					cbgjClass::getDropdown( $menuItems, CBTxt::T( 'Menu' ) )
									.				'</div>';

				$return				.=			'</div>';
			}

			$return					.=		'</div>';
		} else {
			$return					.=		'<div class="gjContent">';

			if ( $groupInvitesSearch && $pageNav->searching ) {
				$return				.=			CBTxt::Th( 'No invite search results found.' );
			} else {
				$return				.=			CBTxt::Th( 'There are no invites available.' );
			}

			$return					.=		'</div>';
		}

		if ( $groupInvitesPaging ) {
			$return					.=		'<div class="gjPaging pagination pagination-centered">'
									.			( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
									.			( ! $groupInvitesLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
									.		'</div>';
		}

		$return						.=		cbGetSpoofInputTag( 'plugin' )
									.	'</form>';

		return $return;
	}
예제 #14
0
	/**
	 * saves users notifications
	 *
	 * @param int $catid
	 * @param int $grpid
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @param boolean $silent
	 * @return boolean
	 */
	static public function saveNotifications( $catid, $grpid, $user, $plugin, $silent = true ) {
		$category						=	cbgjData::getCategories( null, array( 'id', '=', (int) $catid ), null, null, false );
		$group							=	cbgjData::getGroups( null, array( 'id', '=', (int) $grpid ), null, null, false );

		if ( ( ! $category->get( 'id' ) ) && $group->get( 'id' ) ) {
			$category					=	$group->getCategory();
		}

		$authorized						=	cbgjClass::getAuthorization( $category, $group, $user );

		if ( cbgjClass::hasAccess( 'usr_notifications', $authorized ) ) {
			$categoryApprove			=	$plugin->params->get( 'category_approve', 0 );
			$groupApprove				=	$plugin->params->get( 'group_approve', 0 );

			if ( cbgjClass::hasAccess( 'gen_usr_notifications', $authorized ) ) {
				$generalNotifications	=	cbgjData::getNotifications( null, array( array( 'type', '=', 'general' ), array( 'user_id', '=', (int) $user->id ) ), null, null, false );

				$generalNotifications->set( 'user_id', (int) $user->id );
				$generalNotifications->set( 'type', 'general' );
				$generalNotifications->set( 'item', 0 );

				if ( $generalNotifications->getError() || ( ! $generalNotifications->store() ) ) {
					if ( ! $silent ) {
						cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::P( 'General notifications failed to save! Error: [error]', array( '[error]' => $generalNotifications->getError() ) ), false, true, null, false, false, true );
					}

					return false;
				}

				$generalParams			=	$generalNotifications->getParams();
				$generalCleanParams		=	new cbParamsBase( null );

				$generalCleanParams->set( 'general_categorynew', ( (int) ( cbgjClass::hasAccess( 'usr_mod', $authorized ) ? cbgjClass::getCleanParam( true, 'general_categorynew', $generalParams->get( 'general_categorynew', $plugin->params->get( 'notifications_general_categorynew', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$generalCleanParams->set( 'general_categoryapprove', ( (int) ( cbgjClass::hasAccess( 'usr_mod', $authorized ) && $categoryApprove ? cbgjClass::getCleanParam( true, 'general_categoryapprove', $generalParams->get( 'general_categoryapprove', $plugin->params->get( 'notifications_general_categoryapprove', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$generalCleanParams->set( 'general_categoryupdate', ( (int) ( cbgjClass::hasAccess( 'usr_mod', $authorized ) ? cbgjClass::getCleanParam( true, 'general_categoryupdate', $generalParams->get( 'general_categoryupdate', $plugin->params->get( 'notifications_general_categoryupdate', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$generalCleanParams->set( 'general_categorydelete', ( (int) ( cbgjClass::hasAccess( 'usr_mod', $authorized ) ? cbgjClass::getCleanParam( true, 'general_categorydelete', $generalParams->get( 'general_categorydelete', $plugin->params->get( 'notifications_general_categorydelete', 0 ) ) ) : 0 ) ? 1 : 0 ) );

				if ( $generalNotifications->getError() || ( ! $generalNotifications->storeParams( $generalCleanParams ) ) ) {
					if ( ! $silent ) {
						cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::P( 'General notifications failed to save! Error: [error]', array( '[error]' => $generalNotifications->getError() ) ), false, true, null, false, false, true );
					}

					return false;
				}
			}

			if ( cbgjClass::hasAccess( 'cat_usr_notifications', $authorized ) ) {
				$categoryNotifications	=	cbgjData::getNotifications( null, array( array( 'type', '=', 'category' ), array( 'item', '=', (int) $catid ), array( 'user_id', '=', (int) $user->id ) ), null, null, false );

				$categoryNotifications->set( 'user_id', (int) $user->id );
				$categoryNotifications->set( 'type', 'category' );
				$categoryNotifications->set( 'item', (int) $category->get( 'id' ) );

				if ( $categoryNotifications->getError() || ( ! $categoryNotifications->store() ) ) {
					if ( ! $silent ) {
						cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::P( '[category] notifications failed to save! Error: [error]', array( '[category]' => cbgjClass::getOverride( 'category' ), '[error]' => $categoryNotifications->getError() ) ), false, true, null, false, false, true );
					}

					return false;
				}

				$categoryParams			=	$categoryNotifications->getParams();
				$categoryCleanParams	=	new cbParamsBase( null );

				$categoryCleanParams->set( 'category_nestednew', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'cat_nested' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'category_nestednew', $categoryParams->get( 'category_nestednew', $plugin->params->get( 'notifications_category_nestednew', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_nestedapprove', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'cat_nested' ), $authorized, true ) && $categoryApprove ? cbgjClass::getCleanParam( true, 'category_nestedapprove', $categoryParams->get( 'category_nestedapprove', $plugin->params->get( 'notifications_category_nestedapprove', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_nestedupdate', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'cat_nested' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'category_nestedupdate', $categoryParams->get( 'category_nestedupdate', $plugin->params->get( 'notifications_category_nestedupdate', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_nesteddelete', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'cat_nested' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'category_nesteddelete', $categoryParams->get( 'category_nesteddelete', $plugin->params->get( 'notifications_category_nesteddelete', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_groupnew', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'grp_create' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'category_groupnew', $categoryParams->get( 'category_groupnew', $plugin->params->get( 'notifications_category_groupnew', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_groupapprove', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'grp_create' ), $authorized, true ) && $groupApprove ? cbgjClass::getCleanParam( true, 'category_groupapprove', $categoryParams->get( 'category_groupapprove', $plugin->params->get( 'notifications_category_groupapprove', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_groupupdate', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'grp_create' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'category_groupupdate', $categoryParams->get( 'category_groupupdate', $plugin->params->get( 'notifications_category_groupupdate', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$categoryCleanParams->set( 'category_groupdelete', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl1', 'grp_create' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'category_groupdelete', $categoryParams->get( 'category_groupdelete', $plugin->params->get( 'notifications_category_groupdelete', 0 ) ) ) : 0 ) ? 1 : 0 ) );

				if ( $categoryNotifications->getError() || ( ! $categoryNotifications->storeParams( $categoryCleanParams ) ) ) {
					if ( ! $silent ) {
						cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::P( '[category] notifications failed to save! Error: [error]', array( '[category]' => cbgjClass::getOverride( 'category' ), '[error]' => $categoryNotifications->getError() ) ), false, true, null, false, false, true );
					}

					return false;
				}
			}

			if ( cbgjClass::hasAccess( 'grp_usr_notifications', $authorized ) ) {
				$groupNotifications		=	cbgjData::getNotifications( null, array( array( 'type', '=', 'group' ), array( 'item', '=', (int) $grpid ), array( 'user_id', '=', (int) $user->id ) ), null, null, false );

				$groupNotifications->set( 'user_id', (int) $user->id );
				$groupNotifications->set( 'type', 'group' );
				$groupNotifications->set( 'item', (int) $group->get( 'id' ) );

				if ( $groupNotifications->getError() || ( ! $groupNotifications->store() ) ) {
					if ( ! $silent ) {
						cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::P( '[group] notifications failed to save! Error: [error]', array( '[group]' => cbgjClass::getOverride( 'category' ), '[error]' => $groupNotifications->getError() ) ), false, true, null, false, false, true );
					}

					return false;
				}

				$groupParams			=	$groupNotifications->getParams();
				$groupCleanParams		=	new cbParamsBase( null );

				$groupCleanParams->set( 'group_nestednew', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl2', 'grp_nested' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'group_nestednew', $groupParams->get( 'group_nestednew', $plugin->params->get( 'notifications_group_nestednew', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_nestedapprove', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl2', 'grp_nested' ), $authorized, true ) && $groupApprove ? cbgjClass::getCleanParam( true, 'group_nestedapprove', $groupParams->get( 'group_nestedapprove', $plugin->params->get( 'notifications_group_nestedapprove', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_nestedupdate', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl2', 'grp_nested' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'group_nestedupdate', $groupParams->get( 'group_nestedupdate', $plugin->params->get( 'notifications_group_nestedupdate', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_nesteddelete', ( (int) ( cbgjClass::hasAccess( array( 'mod_lvl2', 'grp_nested' ), $authorized, true ) ? cbgjClass::getCleanParam( true, 'group_nesteddelete', $groupParams->get( 'group_nesteddelete', $plugin->params->get( 'notifications_group_nesteddelete', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_userjoin', ( (int) ( cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ? cbgjClass::getCleanParam( true, 'group_userjoin', $groupParams->get( 'group_userjoin', $plugin->params->get( 'notifications_group_userjoin', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_userleave', ( (int) ( cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ? cbgjClass::getCleanParam( true, 'group_userleave', $groupParams->get( 'group_userleave', $plugin->params->get( 'notifications_group_userleave', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_userinvite', ( (int) ( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? cbgjClass::getCleanParam( true, 'group_userinvite', $groupParams->get( 'group_userinvite', $plugin->params->get( 'notifications_group_userinvite', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_userapprove', ( (int) ( cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ? cbgjClass::getCleanParam( true, 'group_userapprove', $groupParams->get( 'group_userapprove', $plugin->params->get( 'notifications_group_userapprove', 0 ) ) ) : 0 ) ? 1 : 0 ) );
				$groupCleanParams->set( 'group_inviteaccept', ( (int) ( cbgjClass::hasAccess( 'grp_invite', $authorized ) ? cbgjClass::getCleanParam( true, 'group_inviteaccept', $groupParams->get( 'group_inviteaccept', $plugin->params->get( 'notifications_group_inviteaccept', 0 ) ) ) : 0 ) ? 1 : 0 ) );

				if ( $groupNotifications->getError() || ( ! $groupNotifications->storeParams( $groupCleanParams ) ) ) {
					if ( ! $silent ) {
						cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::P( '[group] notifications failed to save! Error: [error]', array( '[group]' => cbgjClass::getOverride( 'category' ), '[error]' => $groupNotifications->getError() ) ), false, true, null, false, false, true );
						return false;
					}

					return false;
				}
			}

			if ( ! $silent ) {
				cbgjClass::getPluginURL( array( 'notifications', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::T( 'Notifications saved successfully!' ), false, true, null, false, false, true );
			}

			return true;
		} else {
			if ( ! $silent ) {
				cbgjClass::getPluginURL( array( 'overview' ), CBTxt::T( 'Not authorized.' ), false, true, 'error' );
			}

			return false;
		}
	}
예제 #15
0
 public function install($parent)
 {
     global $_CB_framework, $_CB_adminpath, $ueConfig;
     // Ensure PHP version is adaquete for CB:
     if (version_compare(phpversion(), '5.3.3', '<')) {
         JFactory::getApplication()->enqueueMessage(sprintf('As stated in README and prerequisites, PHP Version %s, which is obsolete since before 2009-11-19 and insecure, is not compatible with %s: Please upgrade to PHP %s or greater (CB is also compatible with PHP 5.4 and 5.5) before installing Community Builder.', phpversion(), 'Community Builder', sprintf('at least version %s, recommended version %s', '5.3.1', '5.3.10')), 'error');
         JFactory::getApplication()->enqueueMessage(sprintf('Installation failed. In all cases, please require your hoster to upgrade your PHP version as soon as possible.'), 'error');
         return false;
     }
     // Initialize CB Appplication library (which has delayed config lazy loading):
     if (is_readable(JPATH_SITE . '/libraries/CBLib/CB/Application/CBApplication.php')) {
         /** @noinspection PhpIncludeInspection */
         include_once JPATH_SITE . '/libraries/CBLib/CB/Application/CBApplication.php';
         \CB\Application\CBApplication::init();
     } else {
         JFactory::getApplication()->enqueueMessage("Mandatory Community Builder lib_CBLib not installed!", 'error');
         return false;
     }
     // Determine path to CBs backend file structure:
     $_CB_adminpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler/';
     // Disable loading of config immediately after foundation include as the db may not exist yet:
     \CB\Application\CBConfig::setCbConfigReadyToLoad(false);
     // Check if CBLib can load:
     /** @noinspection PhpIncludeInspection */
     if (false === (include_once $_CB_adminpath . 'plugin.foundation.php')) {
         return false;
     }
     // Check if CBLib is up to date:
     if (version_compare(constant('CBLIB'), $ueConfig['version'], '<')) {
         JFactory::getApplication()->enqueueMessage(sprintf('Community Builder library lib_CBLib version %s is older than the Community Builder version %s tried to be installed.', constant('CBLIB'), $ueConfig['version']), 'error');
         return false;
     }
     // Set location to backend:
     $_CB_framework->cbset('_ui', 2);
     if ($_CB_framework->getCfg('debug')) {
         ini_set('display_errors', true);
         error_reporting(E_ALL);
     }
     // Load in CB API:
     cbimport('cb.tabs');
     cbimport('cb.adminfilesystem');
     cbimport('cb.dbchecker');
     // Define CB backend filesystem API:
     $adminFS = cbAdminFileSystem::getInstance();
     // Delete removed files on upgrade:
     $filesToDelete = array($_CB_adminpath . 'comprofileg.xml', $_CB_adminpath . 'comprofilej.xml', $_CB_adminpath . 'admin.comprofiler.php', $_CB_adminpath . 'ue_config_first.php');
     foreach ($filesToDelete as $deleteThisFile) {
         if ($adminFS->file_exists($deleteThisFile)) {
             $adminFS->unlink($deleteThisFile);
         }
     }
     $liveSite = $_CB_framework->getCfg('live_site');
     $return = '<div style="margin-bottom:10px;width:100%;text-align:center;"><img alt="' . htmlspecialchars(CBTxt::T('CB Logo')) . '" src="' . $liveSite . '/components/com_comprofiler/images/smcblogo.gif" /></div>' . '<div style="font-size:14px;margin-bottom:10px;">Copyright 2004-2015 Joomlapolis.com. ' . CBTxt::T('This component is released under the GNU/GPL version 2 License. All copyright statements must be kept. Derivate work must prominently duly acknowledge original work and include visible online links.') . '</div>';
     $cbDatabase = \CBLib\Application\Application::Database();
     // Core database fixes:
     $dbChecker = new \CB\Database\CBDatabaseChecker($cbDatabase);
     $result = $dbChecker->checkDatabase(true, false, null, null);
     if ($result == true) {
         // All ok, Nothing to alarm user here:
         // $return							.=	'<div style="font-size:18px;color:green;margin-bottom:10px;">' . CBTxt::T( 'Automatic database upgrade applied successfully.' ) . '</div>';
     } elseif (is_string($result)) {
         $return .= '<div style="font-size:18px;color:red;margin-bottom:10px;">' . $result . '</div>';
     } else {
         $errors = $dbChecker->getErrors(false);
         if ($errors) {
             $return .= '<div style="color:red;margin-bottom:10px;">' . '<div style="font-size:18px;font-weight:bold;padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid red;">' . CBTxt::T('Database fixing errors') . '</div>';
             foreach ($errors as $error) {
                 $return .= '<div style="margin-bottom:10px;">' . '<div style="font-size:14px;">' . $error[0] . '</div>';
                 if ($error[1]) {
                     $return .= '<div style="font-size:12px;text-indent:15px;">' . $error[1] . '</div>';
                 }
                 $return .= '</div>';
             }
             $return .= '</div>';
         }
     }
     if ($_CB_framework->getCfg('session_handler') != 'database') {
         $logs = $dbChecker->getLogs(false);
         if (count($logs) > 0) {
             $return .= '<div style="margin-bottom:10px;">' . '<div style="font-size:14px;margin-bottom:5px;">' . '<a href="javascript: void(0);" id="cbdetailsLinkShow" onclick="this.style.display=\'none\';document.getElementById(\'cbdetailsdbcheck\').style.display=\'block\';document.getElementById(\'cbdetailsLinkHide\').style.display=\'block\';return false;">' . CBTxt::T('Click to Show details') . '</a>' . '<a href="javascript: void(0);" id="cbdetailsLinkHide" onclick="this.style.display=\'none\';document.getElementById(\'cbdetailsdbcheck\').style.display=\'block\';document.getElementById(\'cbdetailsLinkShow\').style.display=\'block\';return false;" style="display:none;">' . CBTxt::T('Click to Hide details') . '</a>' . '</div>' . '<div id="cbdetailsdbcheck" style="dsiplay:none;color:green;">';
             foreach ($logs as $log) {
                 $return .= '<div style="margin-bottom:10px;">' . '<div style="font-size:14px;">' . $log[0] . '</div>';
                 if ($log[1]) {
                     $return .= '<div style="font-size:12px;text-indent:15px;">' . $log[1] . '</div>';
                 }
                 $return .= '</div>';
             }
             $return .= '</div>' . '</div>';
         }
     }
     // Fix old 1.x usergroups-based permissions to 2.x access-levels in lists and in tabs:
     $this->convertUserGroupsToViewAccessLevels(new \CB\Database\Table\TabTable(), 'CB Tab access');
     $this->convertUserGroupsToViewAccessLevels(new \CB\Database\Table\ListTable(), 'CB Users list access');
     // Synchronize users to CB:
     $query = 'INSERT IGNORE INTO ' . $cbDatabase->NameQuote('#__comprofiler') . "\n (" . $cbDatabase->NameQuote('id') . ', ' . $cbDatabase->NameQuote('user_id') . ')' . "\n SELECT " . $cbDatabase->NameQuote('id') . ', ' . $cbDatabase->NameQuote('id') . "\n FROM " . $cbDatabase->NameQuote('#__users');
     $cbDatabase->setQuery($query);
     if (!$cbDatabase->query()) {
         $cbSpoofField = cbSpoofField();
         $cbSpoofString = cbSpoofString(null, 'plugin');
         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('User synchronization failed. Please <a href="[url]" target="_blank">click here</a> to manually synchronize.', array('[url]' => $_CB_framework->backendUrl("index.php?option=com_comprofiler&view=syncUsers&{$cbSpoofField}={$cbSpoofString}"))) . '</div>';
     }
     // Fix images:
     $imagesPath = $_CB_framework->getCfg('absolute_path') . '/images';
     $cbImages = $imagesPath . '/comprofiler';
     $cbImagesGallery = $cbImages . '/gallery';
     $cbImagesCanvasGallery = $cbImages . '/gallery/canvas';
     if ($adminFS->isUsingStandardPHP() && !$adminFS->file_exists($cbImages) && !$adminFS->is_writable($_CB_framework->getCfg('absolute_path') . '/images/')) {
         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ is not writable.', array('[path]' => $imagesPath)) . '</div>';
     } else {
         if (!$adminFS->file_exists($cbImages)) {
             if ($adminFS->mkdir($cbImages)) {
                 // All ok, Nothing to alarm user here.
                 // $return						.=	'<div style="font-size:14px;color:green;margin-bottom:10px;">' . CBTxt::P( '[path]/ successfully added.', array( '[path]' => $cbImages ) ) . '</div>';
             } else {
                 $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ failed to create, please do so manually.', array('[path]' => $cbImages)) . '</div>';
             }
         }
         if (!$adminFS->file_exists($cbImagesGallery)) {
             if ($adminFS->mkdir($cbImagesGallery)) {
                 // All ok, Nothing to alarm user here:
                 // $return					.=	'<div style="font-size:14px;color:green;margin-bottom:10px;">' . CBTxt::P( '[path]/ successfully added.', array( '[path]' => $cbImagesGallery ) ) . '</div>';
             } else {
                 $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ failed to create, please do so manually.', array('[path]' => $cbImagesGallery)) . '</div>';
             }
         }
         if (!$adminFS->file_exists($cbImagesCanvasGallery)) {
             if ($adminFS->mkdir($cbImagesCanvasGallery)) {
                 // All ok, Nothing to alarm user here:
                 // $return					.=	'<div style="font-size:14px;color:green;margin-bottom:10px;">' . CBTxt::P( '[path]/ successfully added.', array( '[path]' => $cbImagesCanvasGallery ) ) . '</div>';
             } else {
                 $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ failed to create, please do so manually.', array('[path]' => $cbImagesCanvasGallery)) . '</div>';
             }
         }
         if ($adminFS->file_exists($cbImages)) {
             if (!is_writable($cbImages)) {
                 if (!$adminFS->chmod($cbImages, 0775)) {
                     if (!@chmod($cbImages, 0775)) {
                         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ failed to chmod to 775 please do so manually.', array('[path]' => $cbImages)) . '</div>';
                     }
                 }
             }
             if (!is_writable($cbImages)) {
                 $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ is not writable and failed to chmod to 775 please do so manually.', array('[path]' => $cbImages)) . '</div>';
             }
             if (!$adminFS->file_exists($cbImages . '/index.html')) {
                 $result = @copy($imagesPath . '/index.html', $cbImages . '/index.html');
                 if (!$result) {
                     $result = $adminFS->copy($imagesPath . '/index.html', $cbImages . '/index.html');
                 }
                 if (!$result) {
                     $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('index.html failed to be added to [path] please do so manually.', array('[path]' => $cbImages)) . '</div>';
                 }
             }
         }
         if ($adminFS->file_exists($cbImagesGallery)) {
             if (!is_writable($cbImagesGallery)) {
                 if (!$adminFS->chmod($cbImagesGallery, 0775)) {
                     if (!@chmod($cbImagesGallery, 0775)) {
                         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ failed to chmod to 775 please do so manually.', array('[path]' => $cbImagesGallery)) . '</div>';
                     }
                 }
             }
             if (!is_writable($cbImagesGallery)) {
                 $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ is not writable and failed to chmod to 775 please do so manually.', array('[path]' => $cbImagesGallery)) . '</div>';
             }
             $galleryPath = $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/images/gallery';
             $galleryDir = @opendir($galleryPath);
             $galleryFiles = array();
             while (true == ($file = @readdir($galleryDir))) {
                 if ($file != '.' && $file != '..') {
                     $galleryFiles[] = $file;
                 }
             }
             @closedir($galleryDir);
             foreach ($galleryFiles as $galleryFile) {
                 if (!(file_exists($cbImagesGallery . '/' . $galleryFile) && is_readable($cbImagesGallery . '/' . $galleryFile))) {
                     $result = @copy($galleryPath . '/' . $galleryFile, $cbImagesGallery . '/' . $galleryFile);
                     if (!$result) {
                         $result = $adminFS->copy($galleryPath . '/' . $galleryFile, $cbImagesGallery . '/' . $galleryFile);
                     }
                     if (!$result) {
                         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[file] failed to be added to the gallery please do so manually.', array('[file]' => $galleryFile)) . '</div>';
                     }
                 }
             }
             if (!$adminFS->file_exists($cbImagesGallery . '/index.html')) {
                 $result = @copy($imagesPath . '/index.html', $cbImagesGallery . '/index.html');
                 if (!$result) {
                     $result = $adminFS->copy($imagesPath . '/index.html', $cbImagesGallery . '/index.html');
                 }
                 if (!$result) {
                     $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('index.html failed to be added to [path] please do so manually.', array('[path]' => $cbImagesGallery)) . '</div>';
                 }
             }
         }
         if ($adminFS->file_exists($cbImagesCanvasGallery)) {
             if (!is_writable($cbImagesCanvasGallery)) {
                 if (!$adminFS->chmod($cbImagesCanvasGallery, 0775)) {
                     if (!@chmod($cbImagesCanvasGallery, 0775)) {
                         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ failed to chmod to 775 please do so manually.', array('[path]' => $cbImagesCanvasGallery)) . '</div>';
                     }
                 }
             }
             if (!is_writable($cbImagesCanvasGallery)) {
                 $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[path]/ is not writable and failed to chmod to 775 please do so manually.', array('[path]' => $cbImagesCanvasGallery)) . '</div>';
             }
             $galleryPath = $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/images/gallery/canvas';
             $galleryDir = @opendir($galleryPath);
             $galleryFiles = array();
             while (true == ($file = @readdir($galleryDir))) {
                 if ($file != '.' && $file != '..') {
                     $galleryFiles[] = $file;
                 }
             }
             @closedir($galleryDir);
             foreach ($galleryFiles as $galleryFile) {
                 if (!(file_exists($cbImagesCanvasGallery . '/' . $galleryFile) && is_readable($cbImagesCanvasGallery . '/' . $galleryFile))) {
                     $result = @copy($galleryPath . '/' . $galleryFile, $cbImagesCanvasGallery . '/' . $galleryFile);
                     if (!$result) {
                         $result = $adminFS->copy($galleryPath . '/' . $galleryFile, $cbImagesCanvasGallery . '/' . $galleryFile);
                     }
                     if (!$result) {
                         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('[file] failed to be added to the gallery please do so manually.', array('[file]' => $galleryFile)) . '</div>';
                     }
                 }
             }
             if (!$adminFS->file_exists($cbImagesCanvasGallery . '/index.html')) {
                 $result = @copy($imagesPath . '/index.html', $cbImagesCanvasGallery . '/index.html');
                 if (!$result) {
                     $result = $adminFS->copy($imagesPath . '/index.html', $cbImagesCanvasGallery . '/index.html');
                 }
                 if (!$result) {
                     $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('index.html failed to be added to [path] please do so manually.', array('[path]' => $cbImagesCanvasGallery)) . '</div>';
                 }
             }
         }
     }
     if (!($adminFS->file_exists($cbImages) && is_writable($cbImages) && $adminFS->file_exists($cbImagesGallery) && $adminFS->file_exists($cbImagesCanvasGallery))) {
         $return .= '<div style="margin-bottom:10px;">' . '<div style="font-size:14px;">' . CBTxt::T('Manually do the following:') . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::P('1. create [path]/ directory', array('[path]' => $cbImages)) . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::T('2. chmod it to 755 or if needed to 775') . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::P('3. create [path]/ directory', array('[path]' => $cbImagesGallery)) . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::T('4. chmod it to 755 or if needed to 775') . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::P('5. copy [from_path]/ and its contents to [to_path]/', array('[from_path]' => $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/images/gallery', '[to_path]' => $cbImagesGallery)) . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::P('6. create [path]/ directory', array('[path]' => $cbImagesCanvasGallery)) . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::T('7. chmod it to 755 or if needed to 775') . '</div>' . '<div style="font-size:12px;text-indent:15px;">' . CBTxt::P('8. copy [from_path]/ and its contents to [to_path]/', array('[from_path]' => $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/images/gallery/canvas', '[to_path]' => $cbImagesCanvasGallery)) . '</div>' . '</div>';
     }
     $pluginMessages = null;
     if (cbInstaller_install_plugins($pluginMessages)) {
         // All ok, Nothing to alarm user here-
         // $return							.=	'<div style="font-size:18px;color:green;margin-bottom:10px;">' . CBTxt::T( 'Core plugins installed successfully.' ) . '</div>';
     } else {
         $return .= '<div style="font-size:14px;color:red;margin-bottom:10px;">' . CBTxt::P('Core plugins installation failed. Please <a href="[url]" target="_blank">click here</a> to manually install.', array('[url]' => $_CB_framework->backendUrl('index.php?option=com_comprofiler&view=finishinstallation'))) . '</div>';
     }
     $return .= $pluginMessages . '<div style="color:green;font-size:18px;font-weight:bold;margin-top:15px;margin-bottom:15px;">' . CBTxt::P('Installation done.') . '</div>' . '<div style="color:green;font-size:18px;font-weight:bold;margin-top:15px;margin-bottom:15px;">' . CBTxt::P('Now is a great time to checkout the <a href="[help_url]" target="_blank">Getting Started</a> resources.', array('[help_url]' => 'http://www.joomlapolis.com/documentation/community-builder/getting-started?pk_campaign=in-cb&amp;pk_kwd=installedwelcomescreen')) . '</div>' . '<div style="margin-bottom:10px;">' . '<div style="font-size:12px;"><a href="http://www.joomlapolis.com/cb-solutions?pk_campaign=in-cb&amp;pk_kwd=installedwelcomescreen" target="_blank">' . CBTxt::T('Click here to see more CB Plugins (Languages, Fields, Tabs, Signup-Connect, Paid Memberships and over 30 more) by CB Team at joomlapolis.com') . '</a></div>' . '<div style="font-size:12px;"><a href="http://extensions.joomla.org/extensions/clients-a-communities/communities/210" target="_blank">' . CBTxt::T('Click here to see our CB listing on the Joomla! Extensions Directory (JED) and find third-party add-ons for your website.') . '</a></div>' . '<div style="font-size:12px;margin:10px 0 25px;">or &nbsp; <a href="index.php?option=com_comprofiler&view=showconfig" class="btn btn-primary">' . CBTxt::T('Start to Configure Community Builder') . '</a></div>' . '</div>';
     echo $return;
     // For display in packager:
     $_CB_framework->setUserState('com_comprofiler_install', $return);
     return true;
 }
	/**
	 * render backend config
	 *
	 * @param array  $input
	 * @param moscomprofilerUser  $user
	 * @param object $plugin
	 */
	static public function showConfig( $input, $user, $plugin ) {
		global $_CB_framework;

		HTML_cbgjAdmin::setTitle( CBTxt::T( 'Configuration' ), 'cbicon-48-gjconfig' );

		$tabs	=	new cbTabs( 1, 2 );

		$return	=	'<form action="' . $_CB_framework->backendUrl( 'index.php' ) . '" method="post" name="adminForm" enctype="multipart/form-data" id="adminForm" class="adminform">'
				.	$tabs->startPane( 'gjConfig' )
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjGeneral' )
				.			$tabs->startPane( 'gjGeneralTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Global' ) ), 'gjGeneralGlobal' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Title' ) . '</th>'
				.								'<td width="40%">' . $input['general_title'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally replace breadcrumb title from plugin name (CB GroupJive).' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Template' ) . '</th>'
				.								'<td width="40%">' . $input['general_template'] . '</td>'
				.								'<td>' . CBTxt::Ph( 'Select template to be used for all of GroupJive. If template is incomplete then missing files will be used from the default template. Template files can be located at the following location: [rel_path]/templates', array( '[rel_path]' => $plugin->relPath ) ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Class' ) . '</th>'
				.								'<td width="40%">' . $input['general_class'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally add a class suffix to surrounding DIV encasing all of GroupJive.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Item ID' ) . '</th>'
				.								'<td width="40%">' . $input['general_itemid'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally add an Item ID override.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Dynamic ID' ) . '</th>'
				.								'<td width="40%">' . $input['general_dynamicid'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally obtain Item ID for every URL. Please note this will perform a query for every URL in attempt to find its menu link.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Tooltips' ) . '</th>'
				.								'<td width="40%">' . $input['general_tooltips'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select method for tooltip display. Applies to frontend only.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Panes' ) . '</th>'
				.								'<td width="40%">' . $input['general_panes'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable usage of Panes. Please note this will remove ALL menu structures. Only use if another means of menu display is available.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Validation' ) . '</th>'
				.								'<td width="40%">' . $input['general_validate'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable usage of jQuery form validation. This will prevent users from submitting forms without the required inputs complete. Validation is always done after form submit regardless of this parameter.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Folder Permission' ) . '</th>'
				.								'<td width="40%">' . $input['general_dirperms'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally input folder permissions used for folder creation. Only configure if you are sure you know what you are doing.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'File Permission' ) . '</th>'
				.								'<td width="40%">' . $input['general_fileperms'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally input file permissions used for file creation. Only configure if you are sure you know what you are doing.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Word Filter' ) . '</th>'
				.								'<td width="40%">' . $input['general_wordfilter'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally input word filtering applied to all locations user text can be supplied. Separate a filter and its replacement with an equal (=) sign (e.g. idiot=genius). Separate multiple filters by a linebreak. Lanugage strings are supported. Leave replacement blank to simply remove the word (e.g. idiot=). Note only whole words will be replaced.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Logos' ) ), 'gjGeneralLogos' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Size' ) . '</th>'
				.								'<td width="40%">' . $input['logo_size'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input maximum file size for logos. If blank Community Builder avatar size will be used.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Width' ) . '</th>'
				.								'<td width="40%">' . $input['logo_width'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input maximum logo width. If blank Community Builder avatar width will be used.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Height' ) . '</th>'
				.								'<td width="40%">' . $input['logo_height'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input maximum logo height. If blank Community Builder avatar height will be used.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Thumbnail Width' ) . '</th>'
				.								'<td width="40%">' . $input['logo_thumbwidth'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input maximum logo thumbnail width. If blank Community Builder avatar thumbnail width will be used.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Thumbnail Height' ) . '</th>'
				.								'<td width="40%">' . $input['logo_thumbheight'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input maximum logo thumbnail height. If blank Community Builder avatar thumbnail height will be used.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Overrides' ) ), 'gjGeneralOverrides' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th colspan="3" style="text-align: center;">' . CBTxt::Th( 'Please note overrides may not function for all languages dependant on if the language uses variable nouns. Simply exclude the substitution (e.g. [category]) from your translation (e.g. "[category] Forums" => "Category Forums"). See documentation for further details on translating without Overrides as are completely optional within the translation.' ) . '</th>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Overview' ) . '</th>'
				.								'<td width="40%">' . $input['override_overview_s'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Singular string override for Overview.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Panel' ) . '</th>'
				.								'<td width="40%">' . $input['override_panel_s'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Singular string override for Panel.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Category' ) . '</th>'
				.								'<td width="40%">'
				.									'<div style="margin-bottom:5px;">' . CBTxt::P( 'Singular: [category]', array( '[category]' => $input['override_category_s'] ) ) . '</div>'
				.									'<div>' . CBTxt::Ph( 'Plural: [categories]', array( '[categories]' => $input['override_category_p'] ) ) . '</div>'
				.								'</td>'
				.								'<td>' . CBTxt::Th( 'Singular and Plural string override for category.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Group' ) . '</th>'
				.								'<td width="40%">'
				.									'<div style="margin-bottom:5px;">' . CBTxt::P( 'Singular: [group]', array( '[group]' => $input['override_group_s'] ) ) . '</div>'
				.									'<div>' . CBTxt::Ph( 'Plural: [groups]', array( '[groups]' => $input['override_group_p'] ) ) . '</div>'
				.								'</td>'
				.								'<td>' . CBTxt::Th( 'Singular and Plural string override for Group.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'User' ) . '</th>'
				.								'<td width="40%">'
				.									'<div style="margin-bottom:5px;">' . CBTxt::P( 'Singular: [user]', array( '[user]' => $input['override_user_s'] ) ) . '</div>'
				.									'<div>' . CBTxt::Ph( 'Plural: [users]', array( '[users]' => $input['override_user_p'] ) ) . '</div>'
				.								'</td>'
				.								'<td>' . CBTxt::Th( 'Singular and Plural string override for User.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Owner' ) . '</th>'
				.								'<td width="40%">' . $input['override_owner_s'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Singular string override for owner.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Moderator' ) . '</th>'
				.								'<td width="40%">'
				.									'<div style="margin-bottom:5px;">' . CBTxt::P( 'Singular: [mod]', array( '[mod]' => $input['override_mod_s'] ) ) . '</div>'
				.									'<div>' . CBTxt::Ph( 'Plural: [users]', array( '[users]' => $input['override_mod_p'] ) ) . '</div>'
				.								'</td>'
				.								'<td>' . CBTxt::Th( 'Singular and Plural string override for Moderator.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Admin' ) . '</th>'
				.								'<td width="40%">'
				.									'<div style="margin-bottom:5px;">' . CBTxt::P( 'Singular: [admin]', array( '[admin]' => $input['override_admin_s'] ) ) . '</div>'
				.									'<div>' . CBTxt::Ph( 'Plural: [admins]', array( '[admins]' => $input['override_admin_p'] ) ) . '</div>'
				.								'</td>'
				.								'<td>' . CBTxt::Th( 'Singular and Plural string override for Admin.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Notifications' ) ), 'gjNotifications' )
				.			$tabs->startPane( 'gjNotificationsTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Global' ) ), 'gjNotificationsGlobal' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Notifications' ) . '</th>'
				.								'<td width="40%">' . $input['general_notifications'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable sending and configuration of notifications. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Notify By' ) . '</th>'
				.								'<td width="40%">' . $input['general_notifyby'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select method for notifications. Notify By determines how users are contacted when a notification is sent.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'From Name' ) . '</th>'
				.								'<td width="40%">' . $input['notifications_from_name'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally input notification email name. This will override the users name sent with email.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'From Address' ) . '</th>'
				.								'<td width="40%">' . $input['notifications_from_address'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally input notification email address. This will override the users email address sent with email.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Description' ) . '</th>'
				.								'<td width="40%">' . $input['notifications_desc'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally add description to be shown above notifications display.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.								'<td width="40%">' . $input['notifications_desc_content'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on notifications description.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjNotificationsGeneral' )
				.					$tabs->startPane( 'gjNotificationsGeneralTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjNotificationsGeneralDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_desc_gen'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally add description to be shown above general notifications display.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_desc_gen_content'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on general notifications description.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Defaults' ) ), 'gjNotificationsGeneralDefaults' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Create Category' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_general_categorynew'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for general notification parameter "Create of new category".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Category Approval' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_general_categoryapprove'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for general notification parameter "New category requires approval".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Update Category' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_general_categoryupdate'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for general notification parameter "Update of existing category".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Delete Category' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_general_categorydelete'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for general notification parameter "Delete of existing category".' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Categories' ) ), 'gjNotificationsCategories' )
				.					$tabs->startPane( 'gjNotificationsCategoriesTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjNotificationsCategoriesDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_desc_cat'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally add description to be shown above categories notifications display.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_desc_cat_content'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on categories notifications description.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Defaults' ) ), 'gjNotificationsCategoriesDefaults' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Create Nested' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_nestednew'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "Create of new nested category".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Nested Approval' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_nestedapprove'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "New nested category requires approval".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Update Nested' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_nestedupdate'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "Update of existing nested category".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Delete Nested' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_nesteddelete'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "Delete of existing nested category".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Create Group' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_groupnew'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "Create of new group".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Group Approval' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_groupapprove'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "New group requires approval".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Update Group' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_groupupdate'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "Update of existing group".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Delete Group' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_category_groupdelete'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for category notification parameter "Delete of existing group".' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Groups' ) ), 'gjNotificationsGroups' )
				.					$tabs->startPane( 'gjNotificationsGroupsTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjNotificationsGroupsDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_desc_grp'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally add description to be shown above groups notifications display.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_desc_grp_content'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on groups notifications description.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Defaults' ) ), 'gjNotificationsGroupsDefaults' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Create Nested' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_nestednew'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "Create of new nested group".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Nested Approval' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_nestedapprove'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "New nested group requires approval".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Update Nested' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_nestedupdate'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "Update of existing nested group".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Delete Nested' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_nesteddelete'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "Delete of existing nested group".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'User Join' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_userjoin'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "Join of new user".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'User Leave' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_userleave'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "Leave of existing user".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Invite Sent' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_userinvite'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "Invite of new user".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'User Approval' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_userapprove'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "New user requires approval".' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Invite Accepted' ) . '</th>'
				.										'<td width="40%">' . $input['notifications_group_inviteaccept'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select default value for group notification parameter "My group invite requests accepted".' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Overview' ) ), 'gjOverview' )
				.			$tabs->startPane( 'gjOverviewTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjOverviewDisplay' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Logo' ) . '</th>'
				.								'<td width="40%">' . $input['overview_logo'] . '</td>'
				.								'<td>' . CBTxt::Ph( 'Select logo to be used on overview pane display. Logo images can be located at the following location: [rel_path]/images', array( '[rel_path]' => $plugin->relPath ) ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Description' ) . '</th>'
				.								'<td width="40%">' . $input['overview_desc'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally add description to be shown on overview pane display.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.								'<td width="40%">' . $input['overview_desc_content'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on overview description.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Category' ) . '</th>'
				.								'<td width="40%">' . $input['overview_new_category'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new category link on overview.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Group' ) . '</th>'
				.								'<td width="40%">' . $input['overview_new_group'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new group link on overview.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Messages' ) ), 'gjOverviewMessages' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Editor' ) . '</th>'
				.								'<td width="40%">' . $input['overview_message_editor'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select editor for overview messaging.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Categories' ) ), 'gjOverviewCategories' )
				.					$tabs->startPane( 'gjOverviewCategoriesTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjOverviewCategoriesDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['overview_cat_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of categories. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['overview_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjOverviewCategoriesPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['overview_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on categories overview.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['overview_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on categories overview. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['overview_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on categories overview. Page limit determines how many categories are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['overview_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on categories overview.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Panel' ) ), 'gjPanel' )
				.			$tabs->startPane( 'gjPanelTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjPanelGeneral' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Panel' ) . '</th>'
				.								'<td width="40%">' . $input['overview_panel'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display and usage of panel. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Logo' ) . '</th>'
				.								'<td width="40%">' . $input['panel_logo'] . '</td>'
				.								'<td>' . CBTxt::Ph( 'Select logo to be used on Panel pane display. Logo images can be located at the following location: [rel_path]/images', array( '[rel_path]' => $plugin->relPath ) ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Description' ) . '</th>'
				.								'<td width="40%">' . $input['panel_desc'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Optionally add description to be shown on panel pane display.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.								'<td width="40%">' . $input['panel_desc_content'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on panel description.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Category' ) . '</th>'
				.								'<td width="40%">' . $input['panel_new_category'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new category link on panel.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Group' ) . '</th>'
				.								'<td width="40%">' . $input['panel_new_group'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new group link on panel.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Categories' ) ), 'gjPanelCategories' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['panel_category_display'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of categories menu link on Panel.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Groups' ) ), 'gjPanelGroups' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['panel_group_display'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of groups menu link on Panel.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Joined' ) ), 'gjPanelJoined' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['panel_joined_display'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of Joined menu link on Panel.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Invites' ) ), 'gjPanelInvites' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['panel_invites_display'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of Invites menu link on Panel.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Invited' ) ), 'gjPanelInvited' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['panel_invited_display'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of Invited To menu link on Panel.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Categories' ) ), 'gjCategories' )
				.			$tabs->startPane( 'gjCategoriesTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjCategoriesGeneral' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Logo' ) . '</th>'
				.								'<td width="40%">' . $input['category_logo'] . '</td>'
				.								'<td>' . CBTxt::Ph( 'Select default logo for newly created categories or categories without a logo. Logo images can be located at the following location: [rel_path]/images', array( '[rel_path]' => $plugin->relPath ) ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Create' ) . '</th>'
				.								'<td width="40%">' . $input['category_create'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable the creation of categories. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Create Access' ) . '</th>'
				.								'<td width="40%">' . $input['category_create_access'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select category create access. Access determines who can create categories. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author). Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested' ) . '</th>'
				.								'<td width="40%">' . $input['category_nested'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable nested categories. Nested categories allow categories within categories. Moderatorsa are exempt from this configuration and can always create nested categories.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested Access' ) . '</th>'
				.								'<td width="40%">' . $input['category_nested_access'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select category nested access. Access determines who can create nested categories. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author). Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Approve' ) . '</th>'
				.								'<td width="40%">' . $input['category_approve'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable approval of newly created categories. Categories will require approval by a Moderator to be published. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Limit' ) . '</th>'
				.								'<td width="40%">' . $input['category_limit'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Set the number of categories a user is allowed to create. Total is based off published and unpublished categories. Leave blank or 0 for unlimited. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Captcha' ) . '</th>'
				.								'<td width="40%">' . $input['category_captcha'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable usage of Captcha on new category creation. Requires latest CB Captcha or integrated Captcha to be installed and published. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Category' ) . '</th>'
				.								'<td width="40%">' . $input['category_new_category'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new nested category link on categories.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Group' ) . '</th>'
				.								'<td width="40%">' . $input['category_new_group'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new group link on categories.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Hide Empty' ) . '</th>'
				.								'<td width="40%">' . $input['category_hide_empty'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of categories with no groups for all displays. Note users with permission to create groups or nested categories will see the category. Group count check only includes a categories direct groups and does not check for nested category groups.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Description' ) ), 'gjCategoriesDescription' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Editor' ) . '</th>'
				.								'<td width="40%">' . $input['category_editor'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select editor for category description.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Input Limit' ) . '</th>'
				.								'<td width="40%">' . $input['category_desc_inputlimit'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input category description character count limit. If left blank or zero no limit will be applied. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.								'<td width="40%">' . $input['category_desc_content'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on category description.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Messages' ) ), 'gjCategoriesMessages' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['category_message'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable messaging of a categories groups. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Editor' ) . '</th>'
				.								'<td width="40%">' . $input['category_message_editor'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select editor for category messaging.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Captcha' ) . '</th>'
				.								'<td width="40%">' . $input['category_message_captcha'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable usage of Captcha on category messaging. Requires latest CB Captcha or integrated Captcha to be installed and published. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Nested' ) ), 'gjCategoriesNested' )
				.					$tabs->startPane( 'gjCategoriesNestedTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjCategoriesNestedDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['category_nested_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of categories. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['category_nested_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjCategoriesNestedPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['category_nested_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on categories.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['category_nested_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on categories. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['category_nested_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on categories. Page limit determines how many categories are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['category_nested_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'All' ) ), 'gjCategoriesAll' )
				.					$tabs->startPane( 'gjCategoriesAllTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjCategoriesAllDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['category_all_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of categories. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['category_all_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjCategoriesAllPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['category_all_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on categories.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['category_all_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on categories. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['category_all_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on categories. Page limit determines how many categories are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['category_all_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Approval' ) ), 'gjCategoriesApproval' )
				.					$tabs->startPane( 'gjCategoriesApprovalTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjCategoriesApprovalDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['category_approval_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of categories. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['category_approval_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjCategoriesApprovalPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['category_approval_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on categories.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['category_approval_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on categories. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['category_approval_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on categories. Page limit determines how many categories are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['category_approval_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Groups' ) ), 'gjCategoriesGroups' )
				.					$tabs->startPane( 'gjCategoriesGroupsTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjCategoriesGroupsDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['category_groups_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['category_groups_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjCategoriesGroupsPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['category_groups_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on groups.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['category_groups_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on groups. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['category_groups_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on groups. Page limit determines how many groups are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['category_groups_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Defaults' ) ), 'gjCategoriesDefaults' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Types' ) . '</th>'
				.								'<td width="40%">' . $input['category_types_default'] . ' ' . $input['category_types_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for category parameter "Types". Additionally select the display of the "Types" category parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Access' ) . '</th>'
				.								'<td width="40%">' . $input['category_access_default'] . ' ' . $input['category_access_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for category parameter "Access". Additionally select the display of the "Access" category parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Create' ) . '</th>'
				.								'<td width="40%">' . $input['category_create_default'] . ' ' . $input['category_create_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for category parameter "Create". Additionally select the display of the "Create" category parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Create Access' ) . '</th>'
				.								'<td width="40%">' . $input['category_createaccess_default'] . ' ' . $input['category_createaccess_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for category parameter "Create Access". Additionally select the display of the "Create Access" category parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested' ) . '</th>'
				.								'<td width="40%">' . $input['category_nested_default'] . ' ' . $input['category_nested_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for category parameter "Nested". Additionally select the display of the "Nested" category parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested Access' ) . '</th>'
				.								'<td width="40%">' . $input['category_nestedaccess_default'] . ' ' . $input['category_nestedaccess_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for category parameter "Nested Access". Additionally select the display of the "Nested Access" category parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Groups' ) ), 'gjGroups' )
				.			$tabs->startPane( 'gjGroupsTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjGroupsGeneral' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Logo' ) . '</th>'
				.								'<td width="40%">' . $input['group_logo'] . '</td>'
				.								'<td>' . CBTxt::Ph( 'Select default logo for newly created groups or groups without a logo. Logo images can be located at the following location: [rel_path]/images', array( '[rel_path]' => $plugin->relPath ) ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Create' ) . '</th>'
				.								'<td width="40%">' . $input['group_create'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable the creation of groups. Moderators and category owners are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Create Access' ) . '</th>'
				.								'<td width="40%">' . $input['group_create_access'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select group create access. Access determines who can create groups. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author). Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested' ) . '</th>'
				.								'<td width="40%">' . $input['group_nested'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable nested groups. Nested groups allow groups within groups. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested Access' ) . '</th>'
				.								'<td width="40%">' . $input['group_nested_access'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select group nested access. Access determines who can create nested groups. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author). Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Approve' ) . '</th>'
				.								'<td width="40%">' . $input['group_approve'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable approval of newly created groups. Groups will require approval by category owner or a moderator to be published. Moderators and category owners are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Leave' ) . '</th>'
				.								'<td width="40%">' . $input['group_leave'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable users leaving groups. Moderators and category owners are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Limit' ) . '</th>'
				.								'<td width="40%">' . $input['group_limit'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Set the number of groups a user is allowed to create. Total is based off published and unpublished groups. Leave blank or 0 for unlimited. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Toggle' ) . '</th>'
				.								'<td width="40%">' . $input['group_toggle'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select if group tabs new content display is toggled or always shown.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Captcha' ) . '</th>'
				.								'<td width="40%">' . $input['group_captcha'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable usage of captcha on new group creation. Requires latest CB Captcha or integrated captcha to be installed and published. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Group' ) . '</th>'
				.								'<td width="40%">' . $input['group_new_group'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new nested group link on groups.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Description' ) ), 'gjGroupsDescription' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Editor' ) . '</th>'
				.								'<td width="40%">' . $input['group_editor'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select editor for group description.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Input Limit' ) . '</th>'
				.								'<td width="40%">' . $input['group_desc_inputlimit'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Input group description character count limit. If left blank or zero no limit will be applied. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Content Plugins' ) . '</th>'
				.								'<td width="40%">' . $input['group_desc_content'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable processing of content plugins on group description.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Messages' ) ), 'gjGroupsMessages' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.								'<td width="40%">' . $input['group_message'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable messaging of a groups users. Moderators and category owners are exempt from this configuration and can always message.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Access' ) . '</th>'
				.								'<td width="40%">' . $input['group_message_perm'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select group message access. Message access determines what type of users can message group users (e.g. Users signify only those a member of the group can message). The users above the selected will also have permission. Moderators and category owners are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Editor' ) . '</th>'
				.								'<td width="40%">' . $input['group_message_editor'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select editor for Group messaging.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Captcha' ) . '</th>'
				.								'<td width="40%">' . $input['group_message_captcha'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable usage of Captcha on Group messaging. Requires latest CB Captcha or integrated Captcha to be installed and published. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Nested' ) ), 'gjGroupsNested' )
				.					$tabs->startPane( 'gjGroupsNestedTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjGroupsNestedDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['group_nested_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['group_nested_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjGroupsNestedPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_nested_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on groups.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_nested_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on groups. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_nested_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on groups. Page limit determines how many groups are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_nested_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'All' ) ), 'gjGroupsAll' )
				.					$tabs->startPane( 'gjGroupsAllTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjGroupsAllDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['group_all_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['group_all_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjGroupsAllPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_all_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on groups.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_all_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on groups. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_all_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on groups. Page limit determines how many groups are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_all_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Approval' ) ), 'gjGroupsApproval' )
				.					$tabs->startPane( 'gjGroupsApprovalTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Display' ) ), 'gjGroupsApprovalDisplay' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['group_approval_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['group_approval_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjGroupsApprovalPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_approval_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on groups.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_approval_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on groups. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_approval_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on groups. Page limit determines how many groups are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_approval_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Users' ) ), 'gjGroupsUsers' )
				.					$tabs->startPane( 'gjGroupsUsersTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjGroupsUsersPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_users_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on users.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_users_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on users. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_users_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on users. Page limit determines how many users are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_users_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on users.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Approval' ) ), 'gjGroupsUsersApproval' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_users_approval_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on users.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_users_approval_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on users. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_users_approval_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on users. Page limit determines how many users are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_users_approval_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on users.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Invites' ) ), 'gjGroupsInvites' )
				.					$tabs->startPane( 'gjGroupsInvitesTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjGroupsInvitesGeneral' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_display'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable display of invites tab on groups.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Invite By' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_by'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select how users may invite others to join groups. At least one method is required to be provided.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Captcha' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_captcha'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of Captcha on Invites tab. Requires latest CB Captcha or integrated Captcha to be installed and published. Moderators are exempt from this configuration.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Connections' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_list'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of connections dropdown list. This will allow quickly selecting a connected user to invite.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Auto Accept' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_accept'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enabled or disable auto accept of group invites on registration.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjGroupsInvitesPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on invites group tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_invites_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on invites group tab. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_invites_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on invites group tab. Page limit determines how many invites are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_invites_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on invites group tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Defaults' ) ), 'gjGroupsDefaults' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Type' ) . '</th>'
				.								'<td width="40%">' . $input['group_type_default'] . ' ' . $input['group_type_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for group parameter "Type". Additionally select the display of the "Type" group parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Group Access' ) . '</th>'
				.								'<td width="40%">' . $input['group_access_default'] . ' ' . $input['group_access_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for group parameter "Group Access". Additionally select the display of the "Group Access" group parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Invite Access' ) . '</th>'
				.								'<td width="40%">' . $input['group_invite_default'] . ' ' . $input['group_invite_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for group parameter "Invite Access". Additionally select the display of the "Invite Access" group parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Users Public' ) . '</th>'
				.								'<td width="40%">' . $input['group_users_default'] . ' ' . $input['group_users_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for group parameter "Users Public". Additionally select the display of the "Users Public" group parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested' ) . '</th>'
				.								'<td width="40%">' . $input['group_nested_default'] . ' ' . $input['group_nested_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for group parameter "Nested". Additionally select the display of the "Nested" group parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'Nested Access' ) . '</th>'
				.								'<td width="40%">' . $input['group_nestedaccess_default'] . ' ' . $input['group_nestedaccess_config'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Select default value for group parameter "Nested Access". Additionally select the display of the "Nested Access" group parameter. Moderators are exempt from this configuration.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Tabs' ) ), 'gjTabs' )
				.			$tabs->startPane( 'gjTabsTabs' )
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjTabsGeneral' )
				.					'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.						'<tbody>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Category' ) . '</th>'
				.								'<td width="40%">' . $input['tab_new_category'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new category link on profile tab.' ) . '</td>'
				.							'</tr>'
				.							'<tr>'
				.								'<th width="15%">' . CBTxt::Th( 'New Group' ) . '</th>'
				.								'<td width="40%">' . $input['tab_new_group'] . '</td>'
				.								'<td>' . CBTxt::Th( 'Enable or disable display of quick new group link on profile tab.' ) . '</td>'
				.							'</tr>'
				.						'</tbody>'
				.					'</table>'
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Categories' ) ), 'gjTabsCategories' )
				.					$tabs->startPane( 'gjTabsCategoriesTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjTabsCategoriesGeneral' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.										'<td width="40%">' . $input['category_tab_display'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable display of categories profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['category_tab_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of categories. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['category_tab_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of categories.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjTabsCategoriesPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['category_tab_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on categories profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['category_tab_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on categories profile tab. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['category_tab_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on categories profile tab. Page limit determines how many categories are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['category_tab_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on categories profile tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Groups' ) ), 'gjTabsGroups' )
				.					$tabs->startPane( 'gjTabsGroupsTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjTabsGroupsGeneral' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.										'<td width="40%">' . $input['group_tab_display'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable display of groups profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Joined' ) . '</th>'
				.										'<td width="40%">' . $input['group_tab_joined'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable inclusion of Joined groups in addition to Owned groups on groups profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['group_tab_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['group_tab_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjTabsGroupsPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['group_tab_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on groups profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['group_tab_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on groups profile tab. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['group_tab_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on groups profile tab. Page limit determines how many groups are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['group_tab_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on groups profile tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Joined' ) ), 'gjTabsJoined' )
				.					$tabs->startPane( 'gjTabsJoinedTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjTabsJoinedGeneral' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.										'<td width="40%">' . $input['joined_tab_display'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable display of Joined profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Owned' ) . '</th>'
				.										'<td width="40%">' . $input['joined_tab_owned'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable inclusion of Owned groups in addition to Joined groups on Joined profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['joined_tab_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['joined_tab_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjTabsJoinedPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['joined_tab_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on joined profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['joined_tab_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on joined profile tab. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['joined_tab_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on joined profile tab. Page limit determines how many groups are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['joined_tab_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on joined profile tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Invites' ) ), 'gjTabsInvites' )
				.					$tabs->startPane( 'gjTabsInvitesTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjTabsInvitesGeneral' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.										'<td width="40%">' . $input['invites_tab_display'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable display of Invites profile tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjTabsInvitesPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['invites_tab_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on invites profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['invites_tab_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on invites profile tab. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['invites_tab_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on invites profile tab. Page limit determines how many invites are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['invites_tab_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on invites profile tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.				$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Invited' ) ), 'gjTabsInvited' )
				.					$tabs->startPane( 'gjTabsInvitedTabs' )
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'General' ) ), 'gjTabsInvitedGeneral' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Display' ) . '</th>'
				.										'<td width="40%">' . $input['invited_tab_display'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable display of Invited To profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Description Length' ) . '</th>'
				.										'<td width="40%">' . $input['invited_tab_desc_limit'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Optionally input maxiumum description length of groups. Leave blank or 0 for no limit.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Order By' ) . '</th>'
				.										'<td width="40%">' . $input['invited_tab_orderby'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Select ordering of groups.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.						$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Paging' ) ), 'gjTabsInvitedPaging' )
				.							'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.								'<tbody>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Paging' ) . '</th>'
				.										'<td width="40%">' . $input['invited_tab_paging'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of paging on invited to profile tab.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limitbox' ) . '</th>'
				.										'<td width="50%">' . $input['invited_tab_limitbox'] . '</td>'
				.										'<td>' . CBTxt::T( 'Enable or disable usage of page limit on invited to profile tab. Requires Paging to be Enabled.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::T( 'Page Limit' ) . '</th>'
				.										'<td width="50%">' . $input['invited_tab_limit'] . '</td>'
				.										'<td>' . CBTxt::T( 'Input default page limit on invited to profile tab. Page limit determines how many invites are displayed per page.' ) . '</td>'
				.									'</tr>'
				.									'<tr>'
				.										'<th width="15%">' . CBTxt::Th( 'Search' ) . '</th>'
				.										'<td width="40%">' . $input['invited_tab_search'] . '</td>'
				.										'<td>' . CBTxt::Th( 'Enable or disable usage of searching on invited to profile tab.' ) . '</td>'
				.									'</tr>'
				.								'</tbody>'
				.							'</table>'
				.						$tabs->endTab()
				.					$tabs->endPane()
				.				$tabs->endTab()
				.			$tabs->endPane()
				.		$tabs->endTab()
				.		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Integrations' ) ), 'gjIntegrations' )
				.			$tabs->startPane( 'gjIntegrationsTabs' )
				.				cbgjClass::getIntegrations( 'gj_onConfigIntegrations', array( $tabs, $user, $plugin ), CBTxt::Th( 'There are no integrations available.' ), null )
				.			$tabs->endPane()
				.		$tabs->endTab()
				.	$tabs->endPane()
				.	'<input type="hidden" id="option" name="option" value="' . htmlspecialchars( $plugin->option ) . '" />'
				.	'<input type="hidden" id="task" name="task" value="editPlugin" />'
				.	'<input type="hidden" id="cid" name="cid" value="' . (int) $plugin->id . '" />'
				.	'<input type="hidden" id="action" name="action" value="config.save" />'
				.	cbGetSpoofInputTag( 'plugin' )
				.	'</form>';

		echo $return;
	}
예제 #17
0
	/**
	 * render frontend tab invites
	 *
	 * @param object $rows
	 * @param object $pageNav
	 * @param moscomprofilerUser $displayed
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @param boolean $tabbed
	 * @return mixed
	 */
	static function showInvited( $rows, $pageNav, $displayed, $user, $plugin, $tabbed ) {
		global $_CB_framework;

		$invitedTabSearch		=	$plugin->params->get( 'invited_tab_search', 1 );
		$invitedTabPaging		=	$plugin->params->get( 'invited_tab_paging', 1 );
		$invitedTabLimitbox		=	$plugin->params->get( 'invited_tab_limitbox', 1 );
		$invitedTabDescLimit	=	(int) $plugin->params->get( 'invited_tab_desc_limit', 150 );

		if ( ! $tabbed ) {
			$formUrl			=	cbgjClass::getPluginURL( array( 'panel', 'invited' ) );
		} else {
			$formUrl			=	$_CB_framework->userProfileUrl( $displayed->id, true, $plugin->tab->tabid );
		}

		$return					=	'<div class="gjTabInvited">'
								.		'<form action="' . $formUrl . '" method="post" name="gjTabForm_invited" id="gjTabForm_invited" class="gjForm">'
								.			( $invitedTabSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );

		if ( $rows ) foreach ( $rows as $row ) {
			$category			=	$row->getCategory();
			$authorized			=	cbgjClass::getAuthorization( $category, $row, $user );

			if ( $row->get( 'published' ) == 1 ) {
				$state			=	'<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'unpublish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to unpublish this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-ban-circle"></i> ' . CBTxt::Th( 'Unpublish' ) . '</a></div>';
			} else {
				$state			=	'<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'publish', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-ok"></i> ' . CBTxt::Th( 'Publish' ) . '</a></div>';
			}

			$beforeMenu			=	cbgjClass::getIntegrations( 'gj_onBeforeProfileGroupInvitedMenu', array( $row, $category, $displayed, $user, $plugin ) );
			$afterMenu			=	cbgjClass::getIntegrations( 'gj_onAfterProfileGroupInvitedMenu', array( $row, $category, $displayed, $user, $plugin ) );

			$return				.=			'<div class="gjContent row-fluid">'
								.				'<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
								.				'<div class="gjContentBody mini-layout span10">'
								.					'<div class="gjContentBodyHeader row-fluid">'
								.						'<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ' - ' . $category->getName( 0, true ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'
								.						'<div class="gjContentBodyMenu span3">';

			if ( cbgjClass::hasAccess( 'grp_join', $authorized ) ) {
				$return			.=							'<input type="button" value="' . htmlspecialchars( ( cbgjClass::hasAccess( 'grp_invited', $authorized ) ? CBTxt::T( 'Accept Invite' ) : CBTxt::T( 'Join' ) ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'join', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
			}

			if ( $beforeMenu || cbgjClass::hasAccess( array( 'grp_leave', 'mod_lvl2', 'mod_lvl3', 'grp_can_publish' ), $authorized ) || $afterMenu ) {
				$menuItems		=	$beforeMenu
								.	( cbgjClass::hasAccess( 'grp_leave', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'leave', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to leave this [group]?', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ), true, false, null, true ) . '"><i class="icon-minus"></i> ' . CBTxt::Th( 'Leave' ) . '</a></div>' : null )
								.	( cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
								.	( cbgjClass::hasAccess( 'grp_can_publish', $authorized ) ? $state : null )
								.	( cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'delete', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [group] and all its associated [users]?', array( '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
								.	$afterMenu;

				$return			.=							cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
			}

			$return				.=						'</div>'
								.					'</div>'
								.					'<div class="gjContentBodyInfo">' . ( $row->getDescription( $invitedTabDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $invitedTabDescLimit ) . '</div>' : null ) . '</div>'
								.					'<div class="gjContentDivider"></div>'
								.					'<div class="gjContentBodyFooter">'
								.						cbgjClass::getIntegrations( 'gj_onBeforeProfileGroupInvitedInfo', array( $row, $category, $displayed, $user, $plugin ), null, 'span' )
								.						( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'group', $row->nestedCount() ) . ' | ' : null )
								.						( $row->userCount() ? cbgjClass::getOverride( 'user', $row->userCount() ) . ' | ' : null )
								.						$row->getType()
								.						cbgjClass::getIntegrations( 'gj_onAfterProfileGroupInvitedInfo', array( $row, $category, $displayed, $user, $plugin ), null, 'span' )
								.					'</div>'
								.				'</div>'
								.			'</div>';
		} else {
			$return				.=			'<div class="gjContent">';

			if ( $invitedTabSearch && $pageNav->searching ) {
				$return			.=				CBTxt::Th( 'No invite search results found.' );
			} else {
				if ( $displayed->id == $user->id ) {
					$return		.=				CBTxt::Ph( 'You are not invited to any [groups].', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
				} else {
					$return		.=				CBTxt::Ph( 'This user is not invited to any [groups].', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) );
				}
			}

			$return				.=			'</div>';
		}

		if ( $invitedTabPaging ) {
			$return				.=			'<div class="gjPaging pagination pagination-centered">'
								.				( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
								.				( ! $invitedTabLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
								.			'</div>';
		}

		$return					.=			cbGetSpoofInputTag( 'plugin' )
								.		'</form>'
								.	'</div>';

		return $return;
	}
예제 #18
0
	/**
	* Writes a list of the defined modules
	* @param array An array of category objects
	*/
	static function showPlugins( &$rows, &$pageNav, $option, &$lists, $search ) {
		global $_CB_framework, $_PLUGINS;

		HTML_comprofiler::secureAboveForm('showPlugins');

		outputCbTemplate( 2 );
		outputCbJs( 2 );
	    initToolTip( 2 );

		global $_CB_Backend_Title;
		$_CB_Backend_Title	=	array( 0 => array( 'cbicon-48-plugins', htmlspecialchars( CBTxt::T('CB Plugin Manager') )
											 . ' <small><small> &nbsp;&nbsp;&nbsp;&nbsp; <a href="#getplugins">' . htmlspecialchars( CBTxt::T('Get Plugins') ) . '</a></small></small>'
											 . ' &nbsp;&nbsp;&nbsp;'
											 . ' <small><small> &nbsp;&nbsp;&nbsp;&nbsp; <a href="#install">' . htmlspecialchars( CBTxt::T('Install Plugin') ) . '</a></small></small>' ) );
											 
		HTML_comprofiler::_saveOrderJs( 'savepluginorder' );
		ob_start();
	?>
		function submitbutton3(pressbutton) {
			var form = document.adminForm_dir;

			// do field validation
			if (form.userfile.value == ""){
				alert('<?php echo addslashes( CBTxt::T('Please select a directory') ); ?>');
			} else {
				form.submit();
			}
		}
<?php
		$js			=	ob_get_contents();
		ob_end_clean();
		$_CB_framework->document->addHeadScriptDeclaration( $js );
?>
		<form action="<?php echo $_CB_framework->backendUrl( 'index.php' ); ?>" method="post" name="adminForm">

		<table class="adminheading" style="width:100%">
		<tr>
			<td style="width:80%">
			<?php echo htmlspecialchars( CBTxt::T('Filter') ); ?>: <input type="text" name="search" value="<?php echo htmlspecialchars( $search );?>" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td align="right">
			<?php echo $lists['type'];?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<thead>
		  <tr>
			<th width="20"><?php echo htmlspecialchars( CBTxt::T('#') ); ?></th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" <?php echo 'onclick="checkAll(' . count( $rows ) . ');"';?> />
			</th>
			<th class="title">
			<?php echo htmlspecialchars( CBTxt::T('Plugin Name') ); ?>
			</th>
			<th nowrap="nowrap" width="5%">
	  		<?php echo htmlspecialchars( CBTxt::T('Installed') ); ?>
			</th>
			<th nowrap="nowrap" width="5%">
	  		<?php echo htmlspecialchars( CBTxt::T('Published') ); ?>
			</th>
			<th colspan="2" nowrap="nowrap" width="5%">
			<?php echo htmlspecialchars( CBTxt::T('Reorder') ); ?>
			</th>
			<th width="2%">
			<?php echo htmlspecialchars( CBTxt::T('Order') ); ?>
			</th>
			<th width="4%">
			<a href="javascript: cbsaveorder( <?php echo count( $rows )-1; ?> )"><img src="../components/com_comprofiler/plugin/templates/luna/images/mini-icons/icon-16-filesave.png" border="0" width="16" height="16" alt="<?php echo htmlspecialchars( CBTxt::T('Save Order') ); ?>" /></a>
			</th>
			<th nowrap="nowrap" align="left" width="10%">
			<?php echo htmlspecialchars( CBTxt::T('Access') ); ?>
			</th>
			<th nowrap="nowrap" align="left" width="10%">
			<?php echo htmlspecialchars( CBTxt::T('Type') ); ?>
			</th>
			<th nowrap="nowrap" align="left" width="10%">
			<?php echo htmlspecialchars( CBTxt::T('Directory') ); ?>
			</th>
		  </tr>
		</thead>
		<tbody>
		<?php
		$k = 0;
		for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row 	= &$rows[$i];

			$xmlfile			=	$_PLUGINS->getPluginXmlPath( $row );
			$filesInstalled		=	file_exists($xmlfile);

			$link = $_CB_framework->backendUrl( "index.php?option=com_comprofiler&task=editPlugin&cid=$row->id" );

			//Access
			if ( !$row->access ) {
				$color_access = 'style="color: green;"';
				$task_access = 'accessregistered';
			} else if ( $row->access == 1 ) {
				$color_access = 'style="color: red;"';
				$task_access = 'accessspecial';
			} else {
				$color_access = 'style="color: black;"';
				$task_access = 'accesspublic';
			}

			$access = '	<a href="javascript: void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task_access .'\')" '. $color_access .'>
			'. $row->groupname .'
			</a>';

			//Checked Out
			if ( $filesInstalled && $row->checked_out ) {
				$hover = '';
				$date 				= cbFormatDate( $row->checked_out_time );
				$checked_out_text 	= '<table>';
				$checked_out_text 	.= '<tr><td>'. addslashes($row->editor) .'</td></tr>';
				$checked_out_text 	.= '<tr><td>'. $date .'</td></tr>';
				$checked_out_text 	.= '</table>';
				$hover = 'onMouseOver="return overlib(\''. htmlspecialchars( $checked_out_text ) .'\', CAPTION, \'Checked Out\', BELOW, RIGHT);" onMouseOut="return nd();"';

				if ( checkJversion() == 2 ) {
					$checked_img	 = 'templates/hathor/images/admin/checked_out.png';
				} else {
					$checked_img	 = 'images/checked_out.png';
				}

				$checked	 		= '<img src="'. $checked_img .'" '. $hover .'/>';
			} else {
				$checked = '<input type="checkbox" id="cb'.$i.'" name="cid[]" value="'.$row->id.'" onclick="isChecked(this.checked);" />';
			}

			$imgpath='../components/com_comprofiler/images/';
			//Installedg
			$instImg 	= $filesInstalled ? 'tick.png' : 'publish_x.png';
			$instAlt 	= htmlspecialchars( $filesInstalled ? CBTxt::T('Installed') : CBTxt::T('Plugin Files missing') );
			$installed  = '<img src="' . $imgpath . $instImg .'" border="0" alt="'. $instAlt .'"  title="'. $instAlt .'" />';

			//Published
			$img 	= $row->published ? 'publish_g.png' : 'publish_x.png';
			$task 	= $row->published ? 'unpublishPlugin' : 'publishPlugin';
			$alt 	= $row->published ? CBTxt::T('Published') : CBTxt::T('Unpublished');
			$action	= $row->published ? CBTxt::T('Unpublish Item') : CBTxt::T('Publish item');
			if ( ( $row->type == "language" ) && $row->published ) {
				$published = '<img src="' . $imgpath . 'publish_g.png" border="0" alt="' . htmlspecialchars( CBTxt::T('Published') ) . '" title="' . htmlspecialchars( CBTxt::T('language plugins cannot be unpublished, only uninstalled') ) . '" />';
			} elseif ( ( $row->id == 1 ) && $row->published ) {
				$published = '<img src="' . $imgpath . 'publish_g.png" border="0" alt="' . htmlspecialchars( CBTxt::T('Published') ) . '" title="' . htmlspecialchars( CBTxt::T('CB core plugin cannot be unpublished') ) . '" />';
			} else {
				$published = '<a href="javascript: void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task .'\')" title="'. htmlspecialchars( $action ) .'">
			<img src="'. $imgpath . $img .'" border="0" alt="'. htmlspecialchars( $alt ) .'" />
			</a>';
			}

			//Backend plugin menu:
			$backendPluginMenus = array();
			if ( isset( $row->backend_menu ) && $row->backend_menu ) {
				$backend = explode( ",", $row->backend_menu );
				foreach ( $backend as $backendAction ) {
					$backendActionParts = explode( ":", $backendAction );
					$backendActionLink = $_CB_framework->backendUrl( "index.php?option=com_comprofiler&task=pluginmenu&pluginid=$row->id&menu=$backendActionParts[1]" );
					$backendPluginMenus[] = '&nbsp; [<a href="' . $backendActionLink . '">' . $backendActionParts[0] . '</a>] ';
				}
			}

			?>
			<tr class="<?php echo "row$k"; ?>">
				<td align="right"><?php echo $i + 1 + $pageNav->limitstart ?></td>
				<td>
				<?php echo $checked; ?>
				</td>
				<td>
				<?php
				if ( ($row->checked_out && ( $row->checked_out != $_CB_framework->myId() )) || !$filesInstalled ) {
					if ( ! $filesInstalled ) {
						echo '<span title="' . $instAlt , '">';
					}
					echo $row->name;
					if ( ! $filesInstalled ) {
						echo "</span>";
					}
				} else {
					?>
					<a href="<?php echo $link; ?>">
					<?php echo htmlspecialchars( $row->name ); ?>
					</a>
					<?php
					echo implode( '', $backendPluginMenus );
				}
				?>
				</td>
				<td align="center">
				<?php echo $installed;?>
				</td>
				<td align="center">
				<?php echo $published;?>
				</td>
				<td>
				<?php    if (($i > 0 || ($i+$pageNav->limitstart > 0)) && $row->type == @$rows[$i-1]->type) { ?>
			         <a href="#reorder" onClick="return listItemTask('cb<?php echo $i;?>','orderupPlugin')">
			            <img src="../components/com_comprofiler/plugin/templates/luna/images/mini-icons/icon-12-uparrow.png" width="12" height="12" border="0" alt="<?php echo htmlspecialchars( CBTxt::T('Move Up') ); ?>" />
			         </a>
				<?php    } ?>
			      </td>
			      <td>
				<?php    if (($i < $n-1 || $i+$pageNav->limitstart < $pageNav->total-1) && $row->type == @$rows[$i+1]->type) { ?>
			         <a href="#reorder" onClick="return listItemTask('cb<?php echo $i;?>','orderdownPlugin')">
			            <img src="../components/com_comprofiler/plugin/templates/luna/images/mini-icons/icon-12-downarrow.png" width="12" height="12" border="0" alt="<?php echo htmlspecialchars( CBTxt::T('Move Down') ); ?>" />
			         </a>
				<?php    } ?>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
				</td>
				<td align="left">
				<?php echo $access;?>
				</td>
				<td align="left" nowrap="nowrap">
				<?php echo $row->type;?>
				</td>
				<td align="left" nowrap="nowrap">
				<?php
			if ( ! $filesInstalled ) {
				echo '<span style="text-decoration:line-through" title="' . $instAlt , '">';
			}
			echo $row->element;
			if ( ! $filesInstalled ) {
				echo "</span>";
			}
				?>
				</td>
			</tr>
			<?php
			$k = 1 - $k;
		}
		?>
	</tbody>
	<tfoot>
     <tr>
      <th align="center" colspan="12"> <?php echo $pageNav->getListFooter(); ?></th>
     </tr>
    </tfoot>
  </table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="showPlugins" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<?php
	echo cbGetSpoofInputTag( 'plugin' );
		?>
</form>


	<div style="clear:both; margin:20px 0px;">
		<table class="adminheading">
		<tr>
			<th class="install">
				<a name="getplugins"><?php echo htmlspecialchars( CBTxt::T('Get Plugins') ); ?></a>
			</th>
		</tr>
		<tr>
			<td align="left" style="padding-bottom:10px;">
				<a href="http://www.joomlapolis.com/cb-solutions" target="_blank"><?php echo htmlspecialchars( CBTxt::T('Click here to see more CB Plugins (Languages, Fields, Tabs, Signup-Connect, Paid Memberships and over 30 more) by CB Team at joomlapolis.com') ); ?></a>
			</td>
		</tr>
		<tr>
			<td align="left" style="padding-bottom:10px;">
				<a href="http://www.joomlapolis.com/cb-solutions/directory" target="_blank"><?php echo htmlspecialchars( CBTxt::T('Click here to see CB Directory listing hundreds of CB extensions at joomlapolis.com') ); ?></a>
			</td>
		</tr>
		<tr>
			<td align="left" style="padding-bottom:10px;">
				<a href="http://extensions.joomla.org/extensions/clients-a-communities/communities/210" target="_blank"><?php echo htmlspecialchars( CBTxt::T('Click here to Check our CB listing on JED and find more third-party free add-ons for your website') ); ?></a>
			</td>
		</tr>
		</table>
	</div>



	<div style="clear:both;">
		<table class="adminheading">
		<tr>
			<th class="install">
			<a name="install"><?php echo htmlspecialchars( CBTxt::T('Install New Plugin') ); ?></a>
			</th>
		</tr>
		</table>

		<form enctype="multipart/form-data" action="<?php echo $_CB_framework->backendUrl( 'index.php' ); ?>" method="post" name="filename">
		<table class="adminform">
		<tr>
			<th>
			<?php echo htmlspecialchars( CBTxt::T('Upload Package File') ); ?>
			</th>
		</tr>
		<tr>
			<td align="left">
			<?php echo htmlspecialchars( CBTxt::T('Package File:') ); ?>
			<input class="text_area" name="userfile" type="file" size="70"/>
			<input class="button" type="submit" value="<?php echo htmlspecialchars( CBTxt::T('Upload File & Install') ); ?>" />
			<?php echo CBTxt::P( 'Maximum upload size: <strong>[filesize]</strong> <em>(upload_max_filesize setting in file [php.ini] )</em>',
							 array( '[filesize]' => ini_get( 'upload_max_filesize' ),
							 		'[php.ini]' => ( is_callable( 'php_ini_loaded_file' ) && php_ini_loaded_file() ? htmlspecialchars( php_ini_loaded_file() ) : 'php.ini' ) ) ); ?>
			</td>
		</tr>
		</table>

		<input type="hidden" name="task" value="installPluginUpload"/>
		<input type="hidden" name="option" value="com_comprofiler"/>
		<input type="hidden" name="client" value=""/>
		<?php
	echo cbGetSpoofInputTag( 'plugin' );
		?>
		</form>
		<br />

		<form enctype="multipart/form-data" action="<?php echo $_CB_framework->backendUrl( 'index.php' ); ?>" method="post" name="adminForm_dir">
		<table class="adminform">
		<tr>
			<th>
			<?php echo htmlspecialchars( CBTxt::T('Install from directory') ); ?>
			</th>
		</tr>
		<tr>
			<td align="left">
			<?php echo htmlspecialchars( CBTxt::T('Install directory') ); ?>:&nbsp;
			<input type="text" name="userfile" class="text_area" size="65" value=""/>&nbsp;
			<input type="button" class="button" value="<?php echo htmlspecialchars( CBTxt::T('Install') ); ?>" onclick="submitbutton3()" />
			</td>
		</tr>
		</table>

		<input type="hidden" name="task" value="installPluginDir" />
		<input type="hidden" name="option" value="com_comprofiler"/>
		<input type="hidden" name="client" value=""/>
		<?php
	echo cbGetSpoofInputTag( 'plugin' );
		?>
		</form>
		<br />

		<form enctype="multipart/form-data" action="<?php echo $_CB_framework->backendUrl( 'index.php' ); ?>" method="post" name="adminForm_URL">
		<table class="adminform">
		<tr>
			<th>
			<?php echo htmlspecialchars( CBTxt::T('Install package from web (http/https)') ); ?>
			</th>
		</tr>
		<tr>
			<td align="left">
			<?php echo htmlspecialchars( CBTxt::T('Installation package URL') ); ?>:&nbsp;
			<input type="text" name="userfile" class="text_area" size="65" value=""/>&nbsp;
			<input class="button" type="submit" value="<?php echo htmlspecialchars( CBTxt::T('Download Package & Install') ); ?>" />
			</td>
		</tr>
		</table>

		<input type="hidden" name="task" value="installPluginURL" />
		<input type="hidden" name="option" value="com_comprofiler"/>
		<input type="hidden" name="client" value=""/>
		<?php
	echo cbGetSpoofInputTag( 'plugin' );
		?>
		</form>
		<br />
		<table class="content">
		<?php
	if (!is_callable(array("JFile","write")) || ($_CB_framework->getCfg('ftp_enable') != 1)) {
			writableCell( 'components/com_comprofiler/plugin/user' );
			// writableCell( 'components/com_comprofiler/plugin/fieldtypes' );
			writableCell( 'components/com_comprofiler/plugin/templates' );
			writableCell( 'components/com_comprofiler/plugin/language' );
	}
		writableCell( 'media' );

		?>
		</table>
	</div>
		<?php
	}
예제 #19
0
	/**
	 * prepare frontend tab groups render
	 *
	 * @param  moscomprofilerUser $displayed
	 * @param  moscomprofilerUser $user
	 * @param  object             $plugin
	 * @param  boolean            $tabbed
	 * @return mixed
	 */
	public function getGroups( $displayed, $user, $plugin, $tabbed = true ) {
		cbgjClass::getTemplate( 'tab_groups' );

		$paging					=	new cbgjPaging( 'tab_groups' );

		$limit					=	$paging->getlimit( (int) $plugin->params->get( 'group_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 );

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

		switch( $plugin->params->get( 'group_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( 'group_tab_paging', 1 ) ? array( $pageNav->limitstart, $pageNav->limit ) : null ) );

		$pageNav->search		=	$paging->getInputSearch( 'gjTabForm_groups', 'search', CBTxt::P( 'Search [groups]...', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), $search );
		$pageNav->searching		=	$searching;
		$pageNav->limitbox		=	$paging->getLimitbox( $pageNav );
		$pageNav->pagelinks		=	$paging->getPagesLinks( $pageNav );

		return HTML_groupjiveTabGroups::showGroups( $rows, $pageNav, $displayed, $user, $plugin, $tabbed );
	}
예제 #20
0
	/**
	 * render frontend panel main
	 *
	 * @param string $function
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showPanelMain( $function, $user, $plugin ) {
		global $_CB_framework;

		$authorized				=	cbgjClass::getAuthorization( null, null, $user );
		$newCategory			=	( $plugin->params->get( 'panel_new_category', 1 ) && cbgjClass::hasAccess( 'cat_create', $authorized ) );
		$newGroup				=	( $plugin->params->get( 'panel_new_group', 1 ) && cbgjClass::hasAccess( 'grp_create', $authorized ) );

		$return					=	null;

		if ( $newCategory || $newGroup ) {
			$return				.=	'<div class="gjTop gjTopCenter">'
								.		'<div class="btn-group">'
								.			( $newCategory ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'new' ), true, true, false, null, true ) . '" />' : null )
								.			( $newGroup ? '<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new' ), true, true, false, null, true ) . '" />' : null )
								.		'</div>'
								.	'</div>';
		}

		switch ( $function ) {
			case 'categories':
			default:
				if ( $plugin->params->get( 'panel_category_display', 1 ) ) {
					$title		=	htmlspecialchars( CBTxt::P( 'My [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) );

					$_CB_framework->setPageTitle( $title );
					$_CB_framework->appendPathWay( $title, cbgjClass::getPluginURL( array( 'panel', 'categories' ) ) );

					$return		.=	cbgjTab::getCategories( $user, $user, $plugin, false );
					break;
				}
			case 'groups':
				if ( $plugin->params->get( 'panel_group_display', 1 ) ) {
					$title		=	htmlspecialchars( CBTxt::P( 'My [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) );

					$_CB_framework->setPageTitle( $title );
					$_CB_framework->appendPathWay( $title, cbgjClass::getPluginURL( array( 'panel', 'groups' ) ) );

					$return		.=	cbgjTab::getGroups( $user, $user, $plugin, false );
					break;
				}
			case 'joined':
				if ( $plugin->params->get( 'panel_joined_display', 1 ) ) {
					$title		=	htmlspecialchars( CBTxt::P( 'Joined [groups]', array( '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) );

					$_CB_framework->setPageTitle( $title );
					$_CB_framework->appendPathWay( $title, cbgjClass::getPluginURL( array( 'panel', 'joined' ) ) );

					$return		.=	cbgjTab::getJoined( $user, $user, $plugin, false );
					break;
				}
			case 'invites':
				if ( $plugin->params->get( 'panel_invites_display', 1 ) ) {
					$title		=	htmlspecialchars( CBTxt::T( 'My Invites' ) );

					$_CB_framework->setPageTitle( $title );
					$_CB_framework->appendPathWay( $title, cbgjClass::getPluginURL( array( 'panel', 'invites' ) ) );

					$return		.=	cbgjTab::getInvites( $user, $user, $plugin, false );
					break;
				}
			case 'invited':
				if ( $plugin->params->get( 'panel_invited_display', 1 ) ) {
					$title		=	htmlspecialchars( CBTxt::T( 'Invited To' ) );

					$_CB_framework->setPageTitle( $title );
					$_CB_framework->appendPathWay( $title, cbgjClass::getPluginURL( array( 'panel', 'invited' ) ) );

					$return		.=	cbgjTab::getInvited( $user, $user, $plugin, false );
					break;
				}
		}

		return $return;
	}
예제 #21
0
	/**
	 * render frontend users
	 *
	 * @param object $rows
	 * @param object $pageNav
	 * @param cbgjCategory $category
	 * @param cbgjGroup $group
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showUsers( $rows, $pageNav, $category, $group, $user, $plugin ) {
		$groupUsersSearch		=	$plugin->params->get( 'group_users_search', 1 );
		$groupUsersPaging		=	$plugin->params->get( 'group_users_paging', 1 );
		$groupUsersLimitbox		=	$plugin->params->get( 'group_users_limitbox', 1 );

		$return					=	'<form action="' . $group->getUrl() . '" method="post" name="gjForm_users" id="gjForm_users" class="gjUsers_form">'
								.		( $groupUsersSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );

		if ( $rows ) {
			$return				.=		'<div class="gjContent">';

			foreach ( $rows as $row ) {
				$authorized		=	cbgjClass::getAuthorization( $category, $group, $user, $row->getOwner() );
				$adminUrl		=	cbgjClass::getPluginURL( array( 'users', 'admin', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to set this [user] to [admin]?', array( '[user]' => cbgjClass::getOverride( 'user' ), '[admin]' => cbgjClass::getOverride( 'admin' ) ) ) );
				$modUrl			=	cbgjClass::getPluginURL( array( 'users', 'mod', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to set this [user] to [mod]?', array( '[user]' => cbgjClass::getOverride( 'user' ), '[mod]' => cbgjClass::getOverride( 'moderator' ) ) ) );
				$activeUrl		=	cbgjClass::getPluginURL( array( 'users', 'active', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to set this [user] as Active?', array( '[user]' => cbgjClass::getOverride( 'user' ) ) ) );
				$inactiveUrl	=	cbgjClass::getPluginURL( array( 'users', 'inactive', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to set this [user] as Inactive?', array( '[user]' => cbgjClass::getOverride( 'user' ) ) ) );
				$banUrl			=	cbgjClass::getPluginURL( array( 'users', 'ban', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to ban this [user]?', array( '[user]' => cbgjClass::getOverride( 'user' ) ) ) );
				$deleteUrl		=	cbgjClass::getPluginURL( array( 'users', 'delete', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [user]?', array( '[user]' => cbgjClass::getOverride( 'user' ) ) ) );

				if ( $row->get( 'status' ) == 0 ) {
					$typeClass	=	'gjUserTypePENDING';
					$type		=	CBTxt::Th( 'Pending' );
				} elseif ( $row->get( 'status' ) == -1 ) {
					$typeClass	=	'gjUserTypeBANNED';
					$type		=	CBTxt::Th( 'Banned' );
				} elseif ( $row->get( 'status' ) == 2 ) {
					$typeClass	=	'gjUserTypeMOD';
					$type		=	cbgjClass::getOverride( 'moderator' );
				} elseif ( $row->get( 'status' ) == 3 ) {
					$typeClass	=	'gjUserTypeADMIN';
					$type		=	cbgjClass::getOverride( 'admin' );
				} elseif ( $row->get( 'status' ) == 4 ) {
					$typeClass	=	'gjUserTypeOWNER';
					$type		=	cbgjClass::getOverride( 'owner' );
				} else {
					$typeClass	=	'gjUserTypeUSER';
					$type		=	cbgjClass::getOverride( 'user' );
				}

				if ( ( ! in_array( $row->get( 'status' ), array( -1, 4 ) ) ) && ( ( $row->get( 'status' ) != 3 ) || cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
					$ban		=	'<div><a href="javascript: void(0);" onclick="' . $banUrl . '"><i class="icon-lock"></i> ' . CBTxt::T( 'Ban' ) . '</a></div>';
				} elseif ( ( $row->get( 'status' ) == -1 ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
					$ban		=	'<div><a href="javascript: void(0);" onclick="' . $activeUrl . '"><i class="icon-ok"></i> ' . CBTxt::T( 'Unban' ) . '</a></div>';
				} else {
					$ban		=	null;
				}

				if ( ( $row->get( 'status' ) == 1 ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
					$promote	=	'<div><a href="javascript: void(0);" onclick="' . $modUrl . '"><i class="icon-thumbs-up"></i> ' . CBTxt::T( 'Promote' ) . '</a></div>';
				} elseif ( ( $row->get( 'status' ) == 2 ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) {
					$promote	=	'<div><a href="javascript: void(0);" onclick="' . $adminUrl . '"><i class="icon-thumbs-up"></i> ' . CBTxt::T( 'Promote' ) . '</a></div>';
				} else {
					$promote	=	null;
				}

				if ( ( $row->get( 'status' ) == 2 ) && cbgjClass::hasAccess( 'mod_lvl3', $authorized ) ) {
					$demote		=	'<div><a href="javascript: void(0);" onclick="' . $activeUrl . '"><i class="icon-thumbs-down"></i> ' . CBTxt::T( 'Demote' ) . '</a></div>';
				} elseif ( ( $row->get( 'status' ) == 3 ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) {
					$demote		=	'<div><a href="javascript: void(0);" onclick="' . $modUrl . '"><i class="icon-thumbs-down"></i> ' . CBTxt::T( 'Demote' ) . '</a></div>';
				} elseif ( ( $row->get( 'status' ) == 1 ) && cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ) {
					$demote		=	'<div><a href="javascript: void(0);" onclick="' . $inactiveUrl . '"><i class="icon-thumbs-down"></i> ' . CBTxt::T( 'Demote' ) . '</a></div>';
				} else {
					$demote		=	null;
				}

				if ( ( $row->get( 'status' ) != 4 ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) {
					$delete		=	'<div><a href="javascript: void(0);" onclick="' . $deleteUrl . '"><i class="icon-remove"></i> ' . CBTxt::T( 'Delete' ) . '</a></div>';
				} else {
					$delete		=	null;
				}

				$beforeMenu		=	cbgjClass::getIntegrations( 'gj_onBeforeGroupUserMenu', array( $row, $group, $category, $user, $plugin ) );
				$afterMenu		=	cbgjClass::getIntegrations( 'gj_onAfterGroupUserMenu', array( $row, $group, $category, $user, $plugin ) );

				$return			.=			'<div class="gjContentBox mini-layout">'
								.				'<div class="gjContentBoxRow">' . $row->getOwnerName( true ) . '</div>'
								.				'<div class="gjContentBoxRow">' . $row->getOwnerAvatar( true ) . '</div>'
								.				'<div class="gjContentBoxRow">' . $row->getOwnerOnline() . '</div>'
								.				'<div class="gjContentBoxRow">'
								.					cbgjClass::getIntegrations( 'gj_onBeforeGroupUserInfo', array( $row, $group, $category, $user, $plugin ) )
								.					'<span class="' . $typeClass . '" title="' . cbFormatDate( $row->get( 'date' ), 1, false ) . '">' . $type . '</span>'
								.					cbgjClass::getIntegrations( 'gj_onAfterGroupUserInfo', array( $row, $group, $category, $user, $plugin ) )
								.				'</div>';

				if ( ( $row->get( 'status' ) == 0 ) && cbgjClass::hasAccess( 'mod_lvl4', $authorized ) ) {
					$return		.=				'<div class="gjContentBoxRow">'
								.					'<input type="button" value="' . htmlspecialchars( CBTxt::Th( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'users', 'active', (int) $category->get( 'id' ), (int) $group->get( 'id' ), (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to set this [user] as Active?', array( '[user]' => cbgjClass::getOverride( 'user' ) ) ), true ) . '" />'
								.				'</div>';
				}

				if ( $beforeMenu || $ban || $delete || $promote || $demote || $afterMenu ) {
					$return		.=				'<div class="gjContentBoxRow">'
								.					cbgjClass::getDropdown( ( $beforeMenu . $ban . $delete . $promote . $demote . $afterMenu ), CBTxt::T( 'Menu' ) )
								.				'</div>';
				}

				$return			.=			'</div>';
			}

			$return				.=		'</div>';
		} else {
			$return				.=		'<div class="gjContent">';

			if ( $groupUsersSearch && $pageNav->searching ) {
				$return			.=			CBTxt::Ph( 'No [user] search results found.', array( '[user]' => cbgjClass::getOverride( 'user' ) ) );
			} else {
				$return			.=			CBTxt::Ph( 'There are no [users] available.', array( '[users]' => cbgjClass::getOverride( 'user', true ) ) );
			}

			$return				.=		'</div>';
		}

		if ( $groupUsersPaging ) {
			$return				.=		'<div class="gjPaging pagination pagination-centered">'
								.			( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
								.			( ! $groupUsersLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
								.		'</div>';
		}

		$return					.=		cbGetSpoofInputTag( 'plugin' )
								.	'</form>';

		return $return;
	}
예제 #22
0
	/**
	 * render frontend category edit
	 *
	 * @param cbgjCategory $row
	 * @param array $input
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	static function showCategoryEdit( $row, $input, $user, $plugin ) {
		$authorized		=	cbgjClass::getAuthorization( $row, null, $user );
		$pageTitle		=	CBTxt::P( ( $row->get( 'id' ) ? 'Edit [category]' : 'Create [category]' ), array( '[category]' => cbgjClass::getOverride( 'category' ) ) );

		$row->setPathway( $pageTitle, cbgjClass::getPluginURL( ( $row->get( 'id' ) ? array( 'categories', 'edit', (int) $row->get( 'id' ) ) : array( 'categories', 'new', (int) $row->get( 'parent' ) ) ) ) );

		$tabs			=	new cbTabs( 0, 1 );

		$onEdit			=	cbgjClass::getIntegrations( 'gj_onCategoryEdit', array( $tabs, $row, $user, $plugin ), null, null );

		$return			=	'<div class="gjCategoryEdit">'
						.		'<form action="' . cbgjClass::getPluginURL( array( 'categories', 'save', (int) $row->get( 'id' ) ), null, true, false, null, 'current' ) . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm form-horizontal">'
						.			'<legend class="gjEditTitle">' . $pageTitle . '</legend>';

		if ( cbgjClass::hasAccess( 'usr_mod', $authorized ) || $row->getParentAccess( array( 'mod_lvl1', $user ) ) ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Published' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['publish']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Select publish status of [category]. Unpublished [categories] will not be visible to the public as well as its [groups].', array( '[category]' => cbgjClass::getOverride( 'category' ), '[categories]' => cbgjClass::getOverride( 'category', true ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		}

		if ( cbgjClass::hasAccess( 'usr_mod', $authorized ) || ( $plugin->params->get( 'category_nested', 1 ) && ( ! $row->get( 'parent' ) ) ) ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Parent' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['parent']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Select parent [category]. Selecting parent [category] allows for nested [category] display.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		} elseif ( $row->get( 'parent' ) ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Parent' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$row->getParent()->getName()
						.					'<input type="hidden" id="parent" name="parent" value="' . (int) $row->get( 'parent' ) . '" />'
						.				'</div>'
						.			'</div>';
		}

		$return			.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Name' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['name']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Input [category] name. This is the name that will distinguish this [category] from others. Suggested to input something unique and intuitive.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>'
						.			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Description' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['description']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Input [category] description. Your [category] description should be short and to the point; describing what your [category] is all about.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';

		if ( $input['inputlimit'] !== false ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Input Limit' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['inputlimit']
						.				'</div>'
						.			'</div>';
		}

		$return			.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Logo' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					'<div style="margin-bottom: 10px;">' . $row->getLogo( true ) . '</div>'
						.					( $row->get( 'logo' ) ? '<div style="margin-bottom: 5px;">' . $input['del_logo'] . '</div>' : null )
						.					'<div>'
						.						$input['file']
						.						'<span class="gjEditContentInputIcon help-inline">'
						.							cbgjClass::getIcon( CBTxt::P( 'Select [category] logo. A logo should represent the focus of your [category]; please be respectful and tasteful when selecting a logo.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) )
						.						'</span>'
						.					'</div>'
						.				'</div>'
						.			'</div>';

		if ( $plugin->params->get( 'category_types_config', 1 ) || cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Types' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['types']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Select [categories] available [group] types. Types determine the way a [group] is joined (e.g. Invite requires new [users] to be invited to join a [group]).', array( '[categories]' => cbgjClass::getOverride( 'category', true ), '[group]' => cbgjClass::getOverride( 'group' ), '[users]' => cbgjClass::getOverride( 'user', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		}

		if ( $plugin->params->get( 'category_access_config', 1 ) || cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Access' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['access']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Select [category] access. Access determines who can effectively see your [category]. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author).', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		}

		if ( cbgjClass::hasAccess( 'grp_create', $authorized ) ) {
			if ( $plugin->params->get( 'category_create_config', 1 ) || cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
				$return	.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Create' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['create']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Enable or disable the creation of [groups] in this [category]. Moderators and [owner] are exempt from this configuration and can always create [groups].', array( '[category]' => cbgjClass::getOverride( 'category' ), '[owner]' => cbgjClass::getOverride( 'owner' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
			}

			if ( $plugin->params->get( 'category_createaccess_config', 1 ) || cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
				$return	.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Create Access' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['create_access']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Select [group] create access. Create access determines who can create [groups] in this [category]. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author). Moderators and [owner] are exempt from this configuration and can always create [groups].', array( '[category]' => cbgjClass::getOverride( 'category' ), '[owner]' => cbgjClass::getOverride( 'owner' ), '[group]' => cbgjClass::getOverride( 'group' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
			}
		}

		if ( cbgjClass::hasAccess( 'cat_nested', $authorized ) ) {
			if ( $plugin->params->get( 'category_nested_config', 1 ) || cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
				$return	.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Nested' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['nested']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Enable or disable the creation of [categories] in this [category]. Moderators and [owner] are exempt from this configuration and can always create [categories].', array( '[category]' => cbgjClass::getOverride( 'category' ), '[categories]' => cbgjClass::getOverride( 'category', true ), '[owner]' => cbgjClass::getOverride( 'owner' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
			}

			if ( $plugin->params->get( 'category_nestedaccess_config', 1 ) || cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
				$return	.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Nested Access' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['nested_access']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( CBTxt::P( 'Select [categories] create access. Create access determines who can create [categories] in this [category]. The group selected as well as those above it will have access (e.g. Registered will also be accessible to Author). Moderators and [owner] are exempt from this configuration and can always create [categories].', array( '[category]' => cbgjClass::getOverride( 'category' ), '[categories]' => cbgjClass::getOverride( 'category', true ), '[owner]' => cbgjClass::getOverride( 'owner' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
			}
		}

		if ( cbgjClass::hasAccess( 'usr_mod', $authorized ) ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . cbgjClass::getOverride( 'owner' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$input['owner']
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.						cbgjClass::getIcon( CBTxt::P( 'Input [category] [owner]. [category] [owner] determines the creator of the [category] specified as User ID.', array( '[category]' => cbgjClass::getOverride( 'category' ), '[owner]' => cbgjClass::getOverride( 'owner' ) ) ) )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		}

		if ( $onEdit ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Integrations' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					$tabs->startPane( 'gjIntegrationsTabs' )
						.						$onEdit
						.					$tabs->endPane()
						.				'</div>'
						.			'</div>';
		}

		if ( $input['captcha'] !== false ) {
			$return		.=			'<div class="gjEditContentInput control-group">'
						.				'<label class="gjEditContentInputTitle control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
						.				'<div class="gjEditContentInputField controls">'
						.					'<div style="margin-bottom: 5px;">' . $input['captcha']['code'] . '</div>'
						.					'<div>' . $input['captcha']['input'] . '</div>'
						.					'<span class="gjEditContentInputIcon help-inline">'
						.						cbgjClass::getIcon( null, CBTxt::T( 'Required' ), 'icon-star' )
						.					'</span>'
						.				'</div>'
						.			'</div>';
		}

		$return			.=			'<div class="gjButtonWrapper form-actions">'
						.				'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::P( 'Update [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) : CBTxt::P( 'Create [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" />&nbsp;'
						.				'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-mini" onclick="' . cbgjClass::getPluginURL( ( $row->get( 'id' ) ? array( 'categories', 'show', (int) $row->get( 'id' ) ) : ( $row->get( 'parent' ) ? array( 'categories', 'show', (int) $row->get( 'parent' ) ) : array( 'overview' ) ) ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ), true, false, null, false, false, true ) . '" />'
						.			'</div>'
						.			cbGetSpoofInputTag( 'plugin' )
						.		'</form>'
						.	'</div>';

		echo $return;
	}
예제 #23
0
	private function copyAuto( $ids, $user, $plugin ) {
		if ( ! empty( $ids ) ) {
			foreach ( $ids as $id ) {
				$row	=	cbgjAutoData::getAutos( null, array( 'id', '=', (int) $id ), null, null, false );

				$row->set( 'id', null );
				$row->set( 'published', 0 );

				if ( ! $row->store() ) {
					cbgjClass::getPluginURL( array( 'plugin', 'auto' ), CBTxt::P( 'Auto failed to copy! Error: [error]', array( '[error]' => $row->getError() ) ), false, true, 'error' );
				}
			}

			cbgjClass::getPluginURL( array( 'plugin', 'auto' ), CBTxt::T( 'Auto copied successfully!' ), false, true );
		}

		cbgjClass::getPluginURL( array( 'plugin', 'auto' ), CBTxt::T( 'Auto not found.' ), false, true, 'error' );
	}
예제 #24
0
	/**
	 * render frontend group main
	 *
	 * @param cbgjGroup $row
	 * @param cbgjCategory $category
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showGroupMain( $row, $category, $user, $plugin ) {
		global $_CB_framework;

		$componentClass			=	new CBplug_cbgroupjive();
		$authorized				=	cbgjClass::getAuthorization( $category, $row, $user );

		$tabs					=	new cbTabs( 1, 1 );

		$beforeTab				=	cbgjClass::getIntegrations( 'gj_onBeforeGroupTab', array( $tabs, $row, $category, $user, $plugin ), null, null );
		$afterTab				=	cbgjClass::getIntegrations( 'gj_onAfterGroupTab', array( $tabs, $row, $category, $user, $plugin ), null, null );

		$return					=	null;

		if ( ( $row->get( 'published' ) == -1 ) && $plugin->params->get( 'group_approve', 0 ) ) {
			$return				.=	'<div class="alert alert-error">' . CBTxt::P( 'This [group] is currently pending approval.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</div>';
		} elseif ( ( $row->get( 'published' ) == 0 ) || ( ( $row->get( 'published' ) == 1 ) && ( ! cbgjClass::hasAccess( 'grp_approved', $authorized ) ) ) ) {
			$return				.=	'<div class="alert alert-error">' . CBTxt::P( 'This [group] is currently unpublished.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</div>';
		} else {
			if ( $user->id ) {
				if ( ( $row->get( 'type' ) == 2 ) && cbgjClass::hasAccess( 'grp_usr_inactive', $authorized ) ) {
					$return		.=	'<div class="alert alert-error">' . CBTxt::P( '[group] join request awaiting approval.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) . '</div>';
				}
			}
		}

		if ( $plugin->params->get( 'group_new_group', 0 ) && cbgjClass::hasAccess( 'grp_nested_create', $authorized ) ) {
			$return				.=	'<div class="gjTop gjTopCenter">'
								.		'<div class="btn-group">'
								.			'<input type="button" value="' . htmlspecialchars( CBTxt::P( 'New [group]', array( '[group]' => cbgjClass::getOverride( 'group' ) ) ) ) . '" class="gjButton btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'new', (int) $category->get( 'id' ), (int) $row->get( 'id' ) ), true ) . '" />'
								.		'</div>'
								.	'</div>';
		}

		$return					.=	$tabs->startPane( 'gjGroupTabs' );

		$tabContent				=	false;

		if ( cbgjClass::hasAccess( 'grp_approved', $authorized ) && $row->nestedCount() && ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl2', $authorized ) ) || $row->get( 'nested' ) ) ) {
			$return				.=		$tabs->startTab( null, cbgjClass::getOverride( 'group', true ), 'gjGroups' )
								.			'<div class="gjNestedGroups">'
								.				$componentClass->showNestedGroups( $row, $category, $user, $plugin )
								.			'</div>'
								.		$tabs->endTab();

			$tabContent			=	true;
		}

		$return					.=		$beforeTab;

		if ( cbgjClass::hasAccess( 'grp_approved', $authorized ) && ( ( ( ! $row->get( 'users' ) ) && cbgjClass::hasAccess( 'mod_lvl5', $authorized ) ) || $row->users ) ) {
			$return				.=		$tabs->startTab( null, cbgjClass::getOverride( 'user', true ), 'gjUsers' )
								.			'<div class="gjUsers">'
								.				$componentClass->showUsers( $row, $category, $user, $plugin )
								.			'</div>'
								.		$tabs->endTab();

			$tabContent			=	true;
		}

		if ( cbgjClass::hasAccess( array( 'grp_approved', 'grp_invite' ), $authorized, true ) ) {
			$return				.=		$tabs->startTab( null, htmlspecialchars( CBTxt::T( 'Invites' ) ), 'gjInvites' )
								.			'<div class="gjInvites">'
								.				$componentClass->showInvites( $category, $row, $user, $plugin )
								.			'</div>'
								.		$tabs->endTab();

			$tabContent			=	true;
		}

		if ( ( ! $tabContent ) && ( ! $beforeTab ) && ( ! $afterTab ) ) {
			if ( $user->id ) {
				if ( cbgjClass::hasAccess( 'grp_approved', $authorized ) && ( ! ( $row->get( 'type' ) == 2 ) && cbgjClass::hasAccess( 'grp_usr_inactive', $authorized ) ) ) {
					$return		.=		'<div>'
								.			CBTxt::Ph( 'Please join the [group] to view its content.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) )
								.		'</div>';
				}
			} else {
				$return			.=		'<div>'
								.			CBTxt::Ph( 'Please login or register to view [group] content.', array( '[group]' => cbgjClass::getOverride( 'group' ) ) )
								.		'</div>';
			}
		}

		$return					.=		$afterTab
								.	$tabs->endPane();

		if ( isset( $_GET['tab'] ) ) {
			$tab				=	urldecode( stripslashes( cbGetParam( $_GET, 'tab' ) ) );
		} elseif ( isset( $_POST['tab'] ) ) {
			$tab				=	stripslashes( cbGetParam( $_POST, 'tab' ) );
		} else {
			$tab				=	null;
		}

		if ( $tab ) {
			$js					=	"$( '#gjGroupTabs .tab-row .tab a' ).each( function() {"
								.		"if ( $( this ).text().toLowerCase() == '" . addslashes( strtolower( $tab ) ) . "' ) {"
								.			"$( this ).parent( '.tab' ).trigger( 'click' );"
								.		"}"
								.	"});";

			$_CB_framework->outputCbJQuery( $js );
		}

		return $return;
	}
예제 #25
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>';
						}
					}
				}
			}
		}
	}
예제 #26
0
	/**
	 * render frontend categories approval
	 *
	 * @param object $rows
	 * @param object $pageNav
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	static function showCategoryApproval( $rows, $pageNav, $user, $plugin ) {
		global $_CB_framework;

		$generalTitle				=	$plugin->params->get( 'general_title', $plugin->name );

		$_CB_framework->setPageTitle( CBTxt::P( '[category] Approval', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) );

		if ( $generalTitle != '' ) {
			$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( $generalTitle ) ), cbgjClass::getPluginURL() );
		}

		$_CB_framework->appendPathWay( CBTxt::P( '[category] Approval', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ), cbgjClass::getPluginURL( array( 'categories', 'approval' ) ) );

		$categoryApprovalSearch		=	$plugin->params->get( 'category_approval_search', 1 );
		$categoryApprovalPaging		=	$plugin->params->get( 'category_approval_paging', 1 );
		$categoryApprovalLimitbox	=	$plugin->params->get( 'category_approval_limitbox', 1 );
		$categoryApprovalDescLimit	=	(int) $plugin->params->get( 'category_approval_desc_limit', 150 );

		$return						=	'<div class="gjCategoryApproval">'
									.		'<form action="' . cbgjClass::getPluginURL( array( 'categories', 'approval' ) ) . '" method="post" name="gjForm" id="gjForm" class="gjForm">'
									.			( $categoryApprovalSearch && ( $pageNav->searching || $pageNav->total ) ? '<div class="gjTop gjTopRight">' . $pageNav->search . '</div>' : null );

		if ( $rows ) foreach ( $rows as $row ) {
			$authorized				=	cbgjClass::getAuthorization( $row, null, $user );
			$beforeMenu				=	cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryMenu', array( $row, $user, $plugin ) );
			$afterMenu				=	cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryMenu', array( $row, $user, $plugin ) );

			$return					.=			'<div class="gjContent row-fluid">'
									.				'<div class="gjContentLogo span2">' . $row->getLogo( true, true, true ) . '</div>'
									.				'<div class="gjContentBody mini-layout span10">'
									.					'<div class="gjContentBodyHeader row-fluid">'
									.						'<div class="gjContentBodyTitle span9"><h5>' . $row->getName( 0, true ) . '<small> ' . cbFormatDate( $row->get( 'date' ), 1, false ) . ( $row->get( 'parent' ) ? ' - ' . $row->getParent()->getName( 0, true ) : null ) . '</small></h5></div>'
									.						'<div class="gjContentBodyMenu span3">';

			if ( cbgjClass::hasAccess( 'cat_can_publish', $authorized ) ) {
				$return				.=						'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Approve' ) ) . '" class="gjButton btn btn-mini btn-success" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'publish', (int) $row->get( 'id' ) ), true, true, false, null, true ) . '" />';
			}

			if ( $beforeMenu || cbgjClass::hasAccess( 'mod_lvl1', $authorized ) || $afterMenu ) {
				$menuItems			=	$beforeMenu
									.	( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $row->get( 'id' ) ), null, true, false, null, true ) . '"><i class="icon-pencil"></i> ' . CBTxt::Th( 'Edit' ) . '</a></div>' : null )
									.	( cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ? '<div><a href="javascript: void(0);" onclick="' . cbgjClass::getPluginURL( array( 'categories', 'delete', (int) $row->get( 'id' ) ), CBTxt::P( 'Are you sure you want to delete this [category] and all its associated [groups]?', array( '[category]' => cbgjClass::getOverride( 'category' ), '[groups]' => cbgjClass::getOverride( 'group', true ) ) ), true, false, null, true ) . '"><i class="icon-remove"></i> ' . CBTxt::Th( 'Delete' ) . '</a></div>' : null )
									.	$afterMenu;

				$return				.=							cbgjClass::getDropdown( $menuItems, CBTxt::Th( 'Menu' ) );
			}

			$return					.=						'</div>'
									.					'</div>'
									.					'<div class="gjContentBodyInfo">' . ( $row->getDescription( $categoryApprovalDescLimit ) ? '<div class="well well-small">' . $row->getDescription( $categoryApprovalDescLimit ) . '</div>' : null ) . '</div>'
									.					'<div class="gjContentDivider"></div>'
									.					'<div class="gjContentBodyFooter">'
									.						cbgjClass::getIntegrations( 'gj_onBeforeOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
									.						( ( ( ( ! $row->get( 'nested' ) ) && cbgjClass::hasAccess( 'mod_lvl1', $authorized ) ) || $row->get( 'nested' ) ) && $row->nestedCount() ? cbgjClass::getOverride( 'category', $row->nestedCount() ) . ' | ' : null )
									.						( $row->groupCount() ? cbgjClass::getOverride( 'group', $row->groupCount() ) . ' | ' : null )
									.						implode( ', ', $row->getTypes() )
									.						cbgjClass::getIntegrations( 'gj_onAfterOverviewCategoryInfo', array( $row, $user, $plugin ), null, 'span' )
									.					'</div>'
									.				'</div>'
									.			'</div>';
		} else {
			$return					.=			'<div class="gjContent">';

			if ( $categoryApprovalSearch && $pageNav->searching ) {
				$return				.=				CBTxt::Ph( 'No [category] search results found.', array( '[category]' => cbgjClass::getOverride( 'category' ) ) );
			} else {
				$return				.=				CBTxt::Ph( 'There are no [categories] pending approval.', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) );
			}

			$return					.=			'</div>';
		}

		if ( $categoryApprovalPaging ) {
			$return					.=			'<div class="gjPaging pagination pagination-centered">'
									.				( $pageNav->total > $pageNav->limit ? $pageNav->pagelinks : null )
									.				( ! $categoryApprovalLimitbox ? $pageNav->getLimitBox( false ) : ( $pageNav->total ? '<div class="gjPagingLimitbox">' . $pageNav->limitbox . '</div>' : null ) )
									.			'</div>';
		}

		$return						.=		'</form>'
									.	'</div>';

		echo $return;
	}