Пример #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
 /**
  * Lists the used translations into an HTML table for display
  *
  * @return string
  */
 public function listUsedStrings()
 {
     $r = null;
     if ($this->translatedStrings) {
         $r = '<table class="adminlist" id="cbtranslatedstrings"><tr class="sectiontableheader"><th>' . ($this->mode == 3 ? CBTxt::Th('Untranslated strings on this page') : CBTxt::Th('Translations on this page')) . ': ' . CBTxt::Th('Keys') . '</th><th>' . CBTxt::Th('Default string') . '</th><th>' . CBTxt::Th('Translated string') . '</th></tr>';
         $s = 0;
         foreach ($this->translatedStrings as $k => $v) {
             $columns = $this->generateHtmlColumns($k, $v);
             $r .= '<tr class="sectiontableentry' . (($s & 1) + 1) . ' row' . ($s++ & 1) . '">';
             foreach ($columns as $htmlColumn) {
                 $r .= '<td>' . $htmlColumn . '</td>';
             }
             $r .= '</tr>';
         }
         $r .= '</table>';
     }
     return $r;
 }
Пример #6
0
	/**
	 * render frontend overview panes
	 *
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showOverviewPanes( $user, $plugin ) {
		$overviewDesc			=	CBTxt::Th( $plugin->params->get( 'overview_desc', null ) );
		$authorized				=	cbgjClass::getAuthorization( null, null, $user );
		$categoryCount			=	count( cbgjData::getCategories( array( 'cat_access', 'mod_lvl1' ), array( 'parent', '=', 0 ) ) );

		$return					=	'<legend class="gjHeaderTitle">' . cbgjClass::getOverride( 'category', true ) . ' ' . cbgjClass::getOverride( 'overview' ) . '</legend>'
								.	'<div class="gjGrid row-fluid">'
								.		'<div class="gjGridLeft span9">'
								.			'<div class="gjGridLeftLogo span4">'
								.				'<img alt="' . htmlspecialchars( CBTxt::T( 'Logo' ) ) . '" src="' . $plugin->livePath . '/images/' . $plugin->params->get( 'overview_logo', 'default_overview.png' ) . '" class="gjLogoDefault img-polaroid" />'
								.			'</div>'
								.			'<div class="gjGridLeftInfo span8">'
								.				cbgjClass::getIntegrations( 'gj_onBeforeOverviewInfo', array( $user, $plugin ) )
								.				( $categoryCount ? '<div>' . cbgjClass::getOverride( 'category', true ) . ': ' . $categoryCount . '</div>' : null )
								.				cbgjClass::getIntegrations( 'gj_onAfterOverviewInfo', array( $user, $plugin ) )
								.			'</div>';

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

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

		$return					.=		'</div>'
								.		'<div class="gjGridRight span3">'
								.			cbgjClass::getIntegrations( 'gj_onBeforeOverviewMenu', array( $user, $plugin ), null, null )
								.			( cbgjClass::hasAccess( 'cat_create', $authorized ) ? '<div><i class="icon-plus"></i> <a href="' . cbgjClass::getPluginURL( array( 'categories', 'new' ) ) . '">' . CBTxt::Ph( 'New [category]', array( '[category]' => cbgjClass::getOverride( 'category' ) ) ) . '</a></div>' : null )
								.			( cbgjClass::hasAccess( 'usr_mod', $authorized ) && $categoryCount ? '<div><i class="icon-envelope"></i> <a href="' . cbgjClass::getPluginURL( array( 'overview', 'message' ) ) . '">' . CBTxt::Ph( 'Message [categories]', array( '[categories]' => cbgjClass::getOverride( 'category', true ) ) ) . '</a></div>' : null )
								.			( cbgjClass::hasAccess( 'usr_panel', $authorized ) ? '<div><i class="icon-home"></i> <a href="' . cbgjClass::getPluginURL( array( 'panel' ) ) . '">' . CBTxt::Ph( 'My [panel]', array( '[panel]' => cbgjClass::getOverride( 'panel' ) ) ) . '</a></div>' : null )
								.			cbgjClass::getIntegrations( 'gj_onAfterOverviewMenu', array( $user, $plugin ), null, null )
								.			( cbgjClass::hasAccess( 'gen_usr_notifications', $authorized ) ? '<div><i class="icon-info-sign"></i> <a href="' . cbgjClass::getPluginURL( array( 'notifications', 'show' ) ) . '">' . CBTxt::Th( 'Notifications' ) . '</a></div>' : null )
								.		'</div>'
								.	'</div>';

		return $return;
	}
Пример #7
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;
	}
Пример #8
0
    function edittab(&$row, $option, &$lists, $tabid, &$paramsEditorHtml)
    {
        global $_CB_framework, $task, $_CB_database, $_PLUGINS;
        _CBsecureAboveForm('edittab');
        outputCbTemplate(2);
        outputCbJs(2);
        initToolTip(2);
        $_CB_framework->outputCbJQuery('');
        global $_CB_Backend_Title;
        $_CB_Backend_Title = array(0 => array('cbicon-48-tabs', CBTxt::T('Community Builder Tab') . ": <small>" . ($row->tabid ? CBTxt::T('Edit') . ' [ ' . htmlspecialchars(getLangDefinition($row->title)) . ' ]' : CBTxt::T('New')) . '</small>'));
        if ($row->tabid && !$row->enabled) {
            echo '<div class="cbWarning">' . CBTxt::T('Tab is not published') . '</div>' . "\n";
        }
        $editorSave_description = $_CB_framework->saveCmsEditorJS('description');
        ob_start();
        ?>
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'showTab') {
		        <?php 
        echo $editorSave_description;
        ?>
				cbsubmitform( pressbutton );
				return;
			}
			var r = new RegExp("[^0-9A-Za-z]", "i");

			// do field validation
			if (jQuery.trim(form.title.value) == "") {
				alert('<?php 
        echo addslashes(CBTxt::T('You must provide a title.'));
        ?>
');
			} else {
		        <?php 
        echo $editorSave_description;
        ?>
				cbsubmitform( pressbutton );
			}
		}
<?php 
        $js = ob_get_contents();
        ob_end_clean();
        $_CB_framework->document->addHeadScriptDeclaration($js);
        ?>
	<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>

	<form action="<?php 
        echo $_CB_framework->backendUrl('index.php?option=com_comprofiler&task=saveTab');
        ?>
" method="POST" name="adminForm">
	<table cellspacing="0" cellpadding="0" width="100%">
	<tr valign="top">
		<td width="60%" valign="top">
			<table class="adminform">
			<tr>
				<th colspan="3">
				<?php 
        echo CBTxt::T('Tab Details');
        ?>
				</th>
			</tr>
			<tr>
				<td width="20%"><?php 
        echo CBTxt::T('Title');
        ?>
:</td>
				<td width="35%"><input type="text" name="title" class="inputbox" size="40" value="<?php 
        echo htmlspecialchars($row->title);
        ?>
" /></td>
				<td width="45%"><?php 
        echo CBTxt::T('Title as will appear on tab.');
        ?>
</td>
			</tr>
			<tr>
				<td colspan="3"><?php 
        echo CBTxt::T('Description: This description appears only on user edit, not on profile (For profile text, use delimiter fields)');
        ?>
:</td>
			</tr>
			<tr>
				<td colspan="3" align="left"><?php 
        echo $_CB_framework->displayCmsEditor('description', $row->description, 600, 200, 50, 10);
        // <textarea name="description" class="inputbox" cols="40" rows="10">< ?php echo htmlspecialchars( $row->description ); ? ></textarea>
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo CBTxt::T('Publish');
        ?>
:</td>
				<td><?php 
        echo $lists['enabled'];
        ?>
</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td><?php 
        echo CBTxt::T('Profile ordering');
        ?>
:</td>
				<td><?php 
        echo $lists['ordering'];
        ?>
</td>
				<td><?php 
        echo CBTxt::T('Tabs and fields on profile are ordered as follows:');
        ?>
<ol>
				    <li><?php 
        echo CBTxt::T('position of tab on user profile (top-down, left-right)');
        ?>
</li>
				    <li><?php 
        echo CBTxt::T('This ordering of tab on position of user profile');
        ?>
</li>
				    <li><?php 
        echo CBTxt::T('ordering of field within tab position of user profile.');
        ?>
</li></ol>
				</td>
			</tr>
			<tr>
				<td><?php 
        echo CBTxt::T('Registration ordering');
        ?>
<br /><?php 
        echo CBTxt::T('(default value: 10)');
        ?>
:</td>
				<td><?php 
        echo $lists['ordering_register'];
        ?>
</td>
				<td><?php 
        echo CBTxt::T('Tabs and fields on registration are ordered as follows:');
        ?>
<ol>
					<li><?php 
        echo CBTxt::T('This registration ordering of tab');
        ?>
</li>
				    <li><?php 
        echo CBTxt::T('position of tab on user profile (top-down, left-right)');
        ?>
</li>
				    <li><?php 
        echo CBTxt::T('ordering of tab on position of user profile');
        ?>
</li>
				    <li><?php 
        echo CBTxt::T('ordering of field within tab position of user profile.');
        ?>
</li></ol>
				</td>
			</tr>
			<tr>
				<td><?php 
        echo CBTxt::T('Position');
        ?>
:</td>
				<td><?php 
        echo $lists['position'];
        ?>
</td>
				<td><?php 
        echo CBTxt::T('Position on profile and ordering on registration.');
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo CBTxt::T('Display type');
        ?>
:</td>
				<td><?php 
        echo $lists['displaytype'];
        ?>
</td>
				<td><?php 
        echo CBTxt::T('In which way the content of this tab will be displayed on the profile.');
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo CBTxt::Th('View Access Level');
        ?>
:</td>
				<td><?php 
        echo $lists['viewaccesslevel'];
        ?>
</td>
				<td><?php 
        echo CBTxt::Th('Only users which are in groups assigned to this View Access Level will see this tab.') . ($lists['useraccessgroup'] ? ' (' . CBTxt::Th('New method working in all Joomla and Mambo versions') . ')' : '');
        ?>
</td>
			</tr>
			<?php 
        if ($lists['useraccessgroup']) {
            ?>
			<tr>
				<td><?php 
            echo CBTxt::Th('User Group to allow access to') . (checkJversion() >= 2 ? '<br /><em>(' . CBTxt::Th("Old deprecated method of Joomla 1.5, do not use here") . '. ' . CBTxt::Th('Keep setting "-- Everybody --" and Use View Access Level above instead') . ')</em>' : '');
            ?>
:</td>
				<td><?php 
            echo $lists['useraccessgroup'];
            ?>
</td>
				<td><?php 
            echo CBTxt::Ph('Old Joomla [VERSION] method', array('[VERSION]' => '1.0 and 1.5 and Mambo')) . ': ' . CBTxt::Th('This method is kept for backwards compatibility but will be removed at next major Community Builder version.') . '<br />' . CBTxt::Th('Use View Access Level above instead and set this Group setting to - "Everybody" -.') . ' ' . CBTxt::Th('All groups above that level will also have access to this tab.');
            ?>
				</td>
			</tr>
			<?php 
        }
        ?>
			</table>
		</td>
		<td width="40%">
			<table class="adminform">
			<tr>
				<th colspan="2">
				<?php 
        echo CBTxt::T('Parameters');
        ?>
				</th>
			</tr>
			<tr>
				<td>
				<?php 
        if ($row->tabid && $row->pluginid > 0) {
            $plugin = new moscomprofilerPlugin($_CB_database);
            $plugin->load((int) $row->pluginid);
            // fail if checked out not by 'me'
            if ($plugin->checked_out && $plugin->checked_out != $_CB_framework->myId()) {
                echo "<script type=\"text/javascript\">alert('" . addslashes(sprintf(CBTxt::T('The plugin %s is currently being edited by another administrator'), $plugin->name)) . "'); document.location.href='" . $_CB_framework->backendUrl("index.php?option={$option}") . "'</script>\n";
                exit(0);
            }
            // get params values
            if ($plugin->type !== "language" && $plugin->id) {
                $_PLUGINS->loadPluginGroup($plugin->type, array((int) $plugin->id), 0);
            }
            $element = $_PLUGINS->loadPluginXML('editTab', $row->pluginclass, $plugin->id);
            /*
            					$xmlfile = $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/' .$plugin->type . '/'.$plugin->folder . '/' . $plugin->element .'.xml';
            					// $params = new cbParameters( $row->params, $xmlfile );
            					cbimport('cb.xml.simplexml');
            					$xmlDoc = new CBSimpleXML();
            					if ( $xmlDoc->loadFile( $xmlfile ) ) {
            						$element =& $xmlDoc->document;
            					} else {
            						$element = null;
            					}
            */
            $pluginParams = new cbParamsBase($plugin->params);
            $params = new cbParamsEditorController($row->params, $element, $element, $plugin, $row->tabid);
            $params->setPluginParams($pluginParams);
            $options = array('option' => $option, 'task' => $task, 'pluginid' => $row->pluginid, 'tabid' => $row->tabid);
            $params->setOptions($options);
            echo $params->draw('params', 'tabs', 'tab', 'class', $row->pluginclass);
        } else {
            echo '<em>' . CBTxt::T('No Parameters') . '</em>';
        }
        if ($paramsEditorHtml) {
            foreach ($paramsEditorHtml as $paramsEditorHtmlBlock) {
                ?>
					<table class="adminform" cellspacing="0" cellpadding="0" width="100%">
						<tr>
							<th colspan="2">
								<?php 
                echo $paramsEditorHtmlBlock['title'];
                ?>
							</th>
						</tr>
						<tr>
							<td>
								<?php 
                echo $paramsEditorHtmlBlock['content'];
                ?>
							</td>
						</tr>
					</table>
<?php 
            }
        }
        ?>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
  <input type="hidden" name="tabid" value="<?php 
        echo $row->tabid;
        ?>
" />
  <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
  <input type="hidden" name="task" value="" />
  <?php 
        if (!$lists['useraccessgroup']) {
            ?>
  <input type="hidden" name="useraccessgroupid" value="-2" />
  <?php 
        }
        echo cbGetSpoofInputTag('tab');
        ?>
</form>
<?php 
    }
Пример #9
0
	/**
	 * render frontend panel panes
	 *
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return string
	 */
	static function showPanelPanes( $user, $plugin ) {
		$panelDesc				=	CBTxt::Th( $plugin->params->get( 'panel_desc', null ) );
		$panelCategoryDisplay	=	$plugin->params->get( 'panel_category_display', 1 );
		$panelGroupDisplay		=	$plugin->params->get( 'panel_group_display', 1 );
		$panelJoinedDisplay		=	$plugin->params->get( 'panel_joined_display', 1 );
		$panelInvitesDisplay	=	$plugin->params->get( 'panel_invites_display', 1 );
		$panelInvitedDisplay	=	$plugin->params->get( 'panel_invited_display', 1 );
		$authorized				=	cbgjClass::getAuthorization( null, null, $user );
		$ownedCategories		=	count( cbgjData::getCategories( null, array( 'user_id', '=', $user->id ) ) );

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

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

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

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

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

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

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

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

		return $return;
	}
Пример #10
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;
	}
    function ajaxResults($usernames, $emailSubject, $emailBody, $limitstart, $limit, $total, $errors)
    {
        global $_CB_framework;
        if ($errors == 0) {
            ?>
<h3><?php 
            echo sprintf(CBTxt::T('Sent email to %s of %s users'), min($total, $limitstart + $limit), $total);
            ?>
</h3>
<h4><?php 
            echo sprintf(CBTxt::T('Just sent %s emails to following users:'), min($limit, $total - $limitstart));
            ?>
</h4>
<div><?php 
            echo $usernames;
            ?>
</div>
<h3><?php 
        } else {
            ?>
<h3><?php 
            echo sprintf(CBTxt::T('Could not send email to %s of %s users out of %s emails to send'), $errors, min($total, $limitstart + $limit), $total);
            ?>
</h3>
<h4><?php 
            echo sprintf(CBTxt::T('Just sent %s emails to following users:'), min($limit, $total - $limitstart) - $errors);
            ?>
</h4>
<div><?php 
            echo $usernames;
            ?>
</div>
<h3><?php 
        }
        if ($total - ($limitstart + $limit) > 0) {
            echo sprintf(CBTxt::T('Still %s emails remaining to send.'), $total - ($limitstart + $limit));
        } else {
            if ($errors > 0) {
                echo sprintf(CBTxt::T('%s emails could not be sent due to a sending error.'), $errors);
            } elseif ($total == 1) {
                echo CBTxt::T('Your email has been sent.');
            } else {
                echo sprintf(CBTxt::T('All %s emails have been sent.'), $total);
            }
        }
        ?>
</h3>
<?php 
        if (!($total - ($limitstart + $limit) > 0)) {
            ?>
  <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
   <thead>
    <tr>
      <th colspan="2" width="100%" class="title"><?php 
            echo CBTxt::T('Email Sent');
            ?>
</th>
    </tr>
   </thead>
   <tbody>
    <tr>
      <td width="15%" class="captionCell"><?php 
            echo CBTxt::T('Email Subject');
            ?>
:</td>
      <td width="85%" class="fieldCell">
         <?php 
            echo htmlspecialchars($emailSubject);
            ?>
      </td>
    </tr>
    <tr>
      <td class="captionCell"><?php 
            echo CBTxt::T('Email Message');
            ?>
:</td>
      <td class="fieldCell">
         <?php 
            echo $emailBody;
            ?>
      </td>
    </tr>
   </tbody>
   <tfoot>
    <tr>
      <th align="center" colspan="2"></th>
    </tr>
   </tfoot>
  </table>

<h3><a href="<?php 
            echo $_CB_framework->backendUrl('index.php?option=com_comprofiler&task=showusers');
            ?>
"><?php 
            echo CBTxt::Th('Click here to go back to users management');
            ?>
</a></h3>

<?php 
        }
    }
Пример #12
0
	/**
	* @param string The name of the form element
	* @param string The value of the element
	* @param CBSimpleXMLElement  $node The xml element for the parameter
	* @param string The control name
	* @return string The html for the element
	*/
	function _form_spacer( $name, $value, &$node, $control_name ) {
		if ( $value ) {
			return '<strong id="' . $this->control_id( $control_name, $name ) . '">' . CBTxt::Th( $value ) . '</strong>';
		} else {
			return '<hr id="' . $this->control_id( $control_name, $name ) . '" />';
		}
	}
 static function loginForm($option, &$postvars, $regErrorMSG = null)
 {
     global $_CB_framework, $_CB_database, $_PLUGINS;
     $results = $_PLUGINS->trigger('onBeforeLoginFormDisplay', array(&$postvars, $regErrorMSG));
     if ($_PLUGINS->is_errors()) {
         echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
         exit;
     }
     outputCbTemplate(1);
     outputCbJs(1);
     initToolTip(1);
     $params = null;
     $login_module_file = $_CB_framework->getCfg('absolute_path') . '/modules/' . (checkJversion() > 0 ? 'mod_cblogin/' : '') . 'mod_cblogin.php';
     if (file_exists($login_module_file)) {
         define('_UE_LOGIN_FROM', 'loginform');
         $_CB_database->setQuery("SELECT params from #__modules WHERE module = 'mod_cblogin' ORDER BY ordering", 0, 1);
         $raw_params = $_CB_database->loadResult();
         $params = new cbParamsBase($raw_params);
         // needed for login module
         // $params of login module is needed for the include( $login_module_file ) below !!
         ob_start();
         include $login_module_file;
         $moduleContent = ob_get_contents();
         ob_end_clean();
     } else {
         $moduleContent = CBTxt::Th("Error: CB Login module not installed (required).");
     }
     if ($regErrorMSG) {
         echo "<div class='error'>" . $regErrorMSG . "</div>\n";
     }
     // output results of plugins event "onBeforeRegisterFormDisplay":
     if (is_array($results)) {
         echo implode('', $results);
     }
     echo '<div class="cbclearboth"><div id="cb_cb_comp_login"><div class="componentheading">' . _LOGIN_TITLE . '</div><div class="cb_comp_outer"><div class="cb_comp_inner">';
     echo $moduleContent;
     echo '</div></div></div></div>';
     echo "<div class=\"cbClr\"></div>";
 }
Пример #14
0
	/**
	* Generates the HTML to display the user edit tab
	* @param object tab reflecting the tab database entry
	* @param object mosUser reflecting the user being displayed
	* @param int 1 for front-end, 2 for back-end
	* @returns mixed : either string HTML for tab content, or false if ErrorMSG generated
	*/
	function getEditTab($tab,$user,$ui) {
        global $_CB_framework;
        
		//fix to hide edit tab from front-end!
		//if ($ui==1) return;
		
		// Get all relevant tab parameters - these settings are global and set by the admin
		$tabparams = $this->_pgGetTabParameters($user);
		//print_r($tabparams);
        $isModerator=isModerator($_CB_framework->myId());


		if ($ui==1 && $tabparams["pgallowuserenable"]!=1 && $tabparams["cbpgenable"]!=1 && !$isModerator) {
			return null;
		}
		
        $testfeature = 0; // test feature setting to allow backend running total edits set this to 1;
        
		$return		=	$this->_writeTabDescription( $tab, $user );

		$return .= "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n";
		
		// Short Greeting:
		$return .= "<tr>\n";
		$return .= "	<td class=\"titleCell\">" . CBTxt::Th("Short Greeting") . ":</td>\n";
		$return .= "	<td class=\"fieldCell\"><input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pgshortgreeting")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Short Greeting")) . "\" value=\"".cbUnHtmlspecialchars($user->cb_pgshortgreeting)."\" size=\"40\" />";
		$return .= getFieldIcons($ui, false, true, CBTxt::Th("Enter a short greeting for your gallery viewers"), CBTxt::Th("Short Greeting").":");
		$return .= "</td></tr>\n";

		$lists = array();

		// make the select list for the special gallery yes/no fields (normally 1=yes, 0=no)
		$yesno = array();
		$yesno[] = moscomprofilerHTML::makeOption( '_UE_YES', _CMN_YES );	// 1
		$yesno[] = moscomprofilerHTML::makeOption( '_UE_NO', _CMN_NO );	// 0

		// Enable Gallery:
        // logic is:    that backend can edit cb field but frontend can only edit if parameter is set to allow or if moderator is viewing
        //              
		if ($tabparams["pgallowuserenable"] || $ui==2 || $isModerator) { 
			$lists['_pg_EnableProfileGallery'] = moscomprofilerHTML::radioList( $yesno, $this->_getPGparamName("cb_pgenable"), 'class="inputbox" size="1" mosReq="0" mosLabel="' . htmlspecialchars(CBTxt::T("Enable Gallery")).'"', 'value', 'text', $user->cb_pgenable);
			$return .= "<tr>\n";
			$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Enable Gallery") . ":</td>\n";
			$return .= "  <td class=\"fieldCell\">".$lists['_pg_EnableProfileGallery'];
			$return .= getFieldIcons($ui, false, false, CBTxt::Th("Select Yes or No to turn-on or off the Gallery Tab"),CBTxt::Th("Enable Gallery") . ":");
			$return .= "</td>\n</tr>\n";
		}

		// Enable Autopublish Items:
		if ($tabparams["pgallowautopublishoverride"] || $ui==2 || $isModerator) {
			$lists['_pg_AutoPublish'] = moscomprofilerHTML::radioList( $yesno, $this->_getPGparamName("cb_pgautopublish"), 'class="inputbox" size="1" mosReq="0" mosLabel="' . htmlspecialchars(CBTxt::T("Autopublish items")).'"', 'value', 'text', $user->cb_pgautopublish);
			$return .= "<tr>\n";
			$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Autopublish items") . ":</td>\n";
			$return .= "  <td class=\"fieldCell\">";
			if ($tabparams["pgautopublish"]) {
				$return .= $lists['_pg_AutoPublish'];
			} else {
				$return .= ($tabparams["cbpgautopublish"] ? _CMN_YES : _CMN_NO);
			}
			$return .= getFieldIcons($ui, false, false, CBTxt::Th("Select Yes or No to autopublish or not newly uploaded gallery items"), CBTxt::Th("Autopublish items").":");
			$return .= "</td>\n</tr>\n";
		}

		// Auto-approve Items setting in backend or frontend for moderators:
		if ( ($ui == 2 && $tabparams["pgallowautoapproveoverride"]) || ($isModerator && $tabparams["pgallowautoapproveoverride"]) ) {
			$lists['_pg_AutoApprove'] = moscomprofilerHTML::radioList( $yesno, $this->_getPGparamName("cb_pgautoapprove"), 'class="inputbox" size="1" mosReq="0" mosLabel="' . htmlspecialchars(CBTxt::T("Automatically approve")) . '"', 'value', 'text', $user->cb_pgautoapprove);
			$return .= "<tr>\n";
			$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Automatically approve") . ":</td>\n";
			$return .= "  <td class=\"fieldCell\">". $lists['_pg_AutoApprove'];
			$return .= getFieldIcons($ui, false, false,CBTxt::Th("This value can be set by the admin to over-ride the gallery plugin backend default approval parameter"), CBTxt::Th("Automatically approve") . ":");
			$return .= "</td>\n</tr>\n";
		}
		// Storage Quota setting only in backend or frontend for moderators:
		if (isset($user->cb_pgtotalquotasize) && $user->cb_pgtotalquotasize) {
			$quota = $user->cb_pgtotalquotasize;
		} else {
			$quota = $tabparams["pgdefaultquota"];
		}
		$return .= "<tr>\n";
		$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Storage Quota (KB)") . ":</td>\n";
		$return .= "  <td class=\"fieldCell\">";
		if ($ui == 2 || $isModerator) {
			$return .= "<input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pgtotalquotasize")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Storage Quota (KB)")) . "\" value=\"".(isset($user->cb_pgtotalquotasize) ? $user->cb_pgtotalquotasize : null)."\" size=\"10\" />";
			$return .= " (" . CBTxt::Th("Default setting") . ": ".$tabparams["pgdefaultquota"].")";

		} else {
			$return .= $quota;
		}
		$return .= getFieldIcons($ui, false, false, CBTxt::Th("This value can be set by the admin to over-ride the gallery plugin backend default user quota"), CBTxt::Th("Storage Quota (KB)") . ":");
		$return .= "</td>\n</tr>\n";
		
		// Uploaded Items Quota setting only in backend or frontend for moderators:
		if (isset($user->cb_pgtotalquotaitems) && $user->cb_pgtotalquotaitems) {
			$quota = $user->cb_pgtotalquotaitems;
		} else {
			$quota = $tabparams["pgnumberofgalleryitems"];
		}
		$return .= "<tr>\n";
		$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Item Quota") . ":</td>\n";
		$return .= "  <td class=\"fieldCell\">";
		if ($ui == 2 || $isModerator) {
			$return .= "<input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pgtotalquotaitems")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Item Quota")) . "\" value=\"".(isset($user->cb_pgtotalquotaitems) ? $user->cb_pgtotalquotaitems : null)."\" size=\"10\" />";
			$return .= " (" . CBTxt::Th("Default setting").": ".$tabparams["pgnumberofgalleryitems"].")";

		} else {
			$return .= $quota;
		}
		$return .= getFieldIcons($ui, false, false, CBTxt::Th("The admin may use this to over-ride the default value of allowable items for each profile owner"), CBTxt::Th("Item Quota") . ":");
		$return .= "</td>\n</tr>\n";
		
		// Single Uploaded Item Maximum Size setting only in backend or frontend for moderators:
		if (isset($user->cb_pguploadsize) && $user->cb_pguploadsize) {
			$quota = $user->cb_pguploadsize;
		} else {
			$quota = $tabparams["pgmaxsize"];
		}
		$return .= "<tr>\n";
		$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Max single upload (KB)") . ":</td>\n";
		$return .= "  <td class=\"fieldCell\">";
		if ($ui == 2 || $isModerator) {
			$return .= "<input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pguploadsize")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Max single upload (KB)")) . "\" value=\"".(isset($user->cb_pguploadsize) ? $user->cb_pguploadsize : null)."\" size=\"10\" />";
			$return .= " (" . CBTxt::Th("Default setting") . ": ".$tabparams["pgmaxsize"].")";

		} else {
			$return .= $quota;
		}
		$return .= getFieldIcons($ui, false, false, CBTxt::Th("This value can be set by the admin to over-ride the gallery plugin backend default maximum single upload size"), CBTxt::Th("Max single upload (KB)") . ":");
		$return .= "</td>\n</tr>\n";
		
		// Current Item Count Usage (information field only):
		if (isset($user->cb_pgtotalitems) && $user->cb_pgtotalitems) {
			$quota = $user->cb_pgtotalitems;
		} else {
			$quota = "0";
		}
		$return .= "<tr>\n";
		$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Current Items") . ":</td>\n";
		$return .= "  <td class=\"fieldCell\">";
		
		if ($ui == 2 && $testfeature) {
			$return .= "<input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pgtotalitems")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Current Items")) . "\" value=\"".(isset($user->cb_pgtotalitems) ? $user->cb_pgtotalitems : 0)."\" size=\"10\" />";
		} else {
			$return .= $quota;
		}
		$return .= getFieldIcons($ui, false, false, CBTxt::Th("Keeps track of number of stored items"), CBTxt::Th("Current Items").":");
		$return .= "</td>\n</tr>\n";
		
		// Current Item Size Usage (information field only):
		if (isset($user->cb_pgtotalsize) && $user->cb_pgtotalsize) {
			$quota = $user->cb_pgtotalsize;
		} else {
			$quota = "0";
		}
		$return .= "<tr>\n";
		$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Current Storage") . ":</td>\n";
		$return .= "  <td class=\"fieldCell\">";
		if ($ui == 2 && $testfeature) {
			$return .= "<input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pgtotalsize")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Current Storage"))."\" value=\"".(isset($user->cb_pgtotalsize) ? $user->cb_pgtotalsize : 0)."\" size=\"10\" />";
		} else {
			$return .= $quota;
		}
		$return .= getFieldIcons($ui, false, false, CBTxt::Th("This field keeps track of the total size of all uploaded gallery items - like a quota usage field. Value is in bytes"), CBTxt::Th("Current Storage").":");
		$return .= "</td>\n</tr>\n";

		// Last Update (information field only):
		if (isset($user->cb_pglastupdate) && $user->cb_pglastupdate) {
			$quota = cbFormatDate($user->cb_pglastupdate);
		} else {
			$quota = _UE_NEVER;
		}
		$return .= "<tr>\n";
		$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Last Update") . ":</td>\n";
		$return .= "  <td class=\"fieldCell\">";
		if ($ui == 2 && $testfeature) {
			$return .= "<input class=\"inputbox\" type=\"text\" name=\"".$this->_getPGparamName("cb_pglastupdate")."\" mosReq=\"0\" mosLabel=\"" . htmlspecialchars(CBTxt::T("Last Update")) . "\" value=\"".(isset($user->cb_pglastupdate) ? $user->cb_pglastupdate : null)."\" size=\"10\" />";

		} else {
			$return .= $quota;
		}
		$return .= getFieldIcons($ui, false, false, CBTxt::Th("Date of last update to Gallery items in this profile"), CBTxt::Th("Last Update") . ":");
		$return .= "</td>\n</tr>\n";
		
		// Display Format:
		if ($tabparams["pgallowdisplayformatoverride"] || $ui ==2 || $isModerator) {
			$displayFormat = array();
			$displayFormat[] = moscomprofilerHTML::makeOption( '', ' ' );
			$displayFormat[] = moscomprofilerHTML::makeOption( 'DF1', CBTxt::T("Pictures gallery list format")  );
			$displayFormat[] = moscomprofilerHTML::makeOption( 'DF2', CBTxt::T("File list format") );
			$displayFormat[] = moscomprofilerHTML::makeOption( 'DF3', CBTxt::T("Picture gallery list lightbox format") );
			$lists['_pg_DisplayFormat'] = moscomprofilerHTML::selectList( $displayFormat, $this->_getPGparamName("cb_pgdisplayformat"), 'class="inputbox" size="1" mosReq="0" mosLabel="' . htmlspecialchars(CBTxt::T("Display Format")) . '"', 'value', 'text', $user->cb_pgdisplayformat );
			$return .= "<tr>\n";
			$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Display Format") . ":</td>\n";
			$return .= "  <td class=\"fieldCell\">". $lists['_pg_DisplayFormat'];
			$return .= getFieldIcons($ui, false, false, CBTxt::Th("Select Display Format to apply for gallery viewing."), CBTxt::Th("Display Format") . ":");
			$return .= "</td>\n</tr>\n";
		}
		
		// Access Mode:
		if ($tabparams["pgallowaccessmodeoverride"] || $ui ==2 || $isModerator) {
			$accessMode = array();
			$accessMode[] = moscomprofilerHTML::makeOption( '', ' ' );
			$accessMode[] = moscomprofilerHTML::makeOption( 'PUB', CBTxt::T("Allow Public Access")  );
			$accessMode[] = moscomprofilerHTML::makeOption( 'REG', CBTxt::T("Allow Registered Access") );
			$accessMode[] = moscomprofilerHTML::makeOption( 'CON', CBTxt::T("Allow Connections Access") );
			$accessMode[] = moscomprofilerHTML::makeOption( 'REG-S', CBTxt::T("Registered Stealth Access") );
			$accessMode[] = moscomprofilerHTML::makeOption( 'CON-S', CBTxt::T("Connections Stealth Access") );
			
			$lists['_pg_AccessMode'] = moscomprofilerHTML::selectList( $accessMode, $this->_getPGparamName("cb_pgaccessmode"), 'class="inputbox" size="1" mosReq="0" mosLabel="' . htmlspecialchars(CBTxt::T("Access Mode")) . '"', 'value', 'text', $user->cb_pgaccessmode );
			$return .= "<tr>\n";
			$return .= "  <td class=\"titleCell\">" . CBTxt::Th("Access Mode") . ":</td>\n";
			$return .= "  <td class=\"fieldCell\">". $lists['_pg_AccessMode'];
			$return .= getFieldIcons($ui, false, false, CBTxt::Th("Select desirable access mode: Public access, Registered users only, Connected users only, REG-S for Registered-stealth, CON-S for Connections-stealth"), CBTxt::Th("Access Mode") . ":");
			$return .= "</td>\n</tr>\n";
		}

		//$return .= "<tr>\n";
		//$return .= "  <td class=\"titleCell\">--- end ---</td>\n";
		//$return .= "  <td class=\"fieldCell\">--- end of programmed fields ! below are the standard cb fields: change fields to 0</td>\n";
		//$return .= "</tr>\n";
		$return .= "</table>\n";

		return $return;
	}
 /** Users View */
 static function _DEFAULT()
 {
     CBtoolmenuBar::startTable();
     if (CBuser::getMyInstance()->authoriseAction('core.create', 'com_users')) {
         CBtoolmenuBar::addNew();
     }
     if (CBuser::getMyInstance()->authoriseAction('core.edit', 'com_users')) {
         CBtoolmenuBar::editList();
     }
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::custom('emailusers', 'mail.png', 'mail.png', 'Mass Mail', false);
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::custom('resendconfirmationemails', 'mail.png', 'mail.png', 'Resend Confirmations', false);
     CBtoolmenuBar::spacer();
     if (CBuser::getMyInstance()->authoriseAction('core.delete', 'com_users')) {
         CBtoolmenuBar::deleteList();
         CBtoolmenuBar::spacer();
     }
     self::_PERMISSIONS('com_users', '<div class="cbbejeoptionsintro cbbejeoptionsintrocomusers">' . CBTxt::Th("These are the Joomla Users Manager Options: Some of these Preferences and all of the Permissions also apply to the Community Builder User Manager (except \"Access Component\" which applies only to the Joomla Users Manager. The \"Access Component\" permission for Community Builder is located in CB Configuration Options. To hide CB Users Manager to a group, simply disable all its permissions here):") . '</div>');
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::endTable();
 }
$cid = cbGetParam($_REQUEST, 'cid', array(0));
if (!is_array($cid)) {
    $cid = array((int) $cid);
}
global $_CB_Backend_Title, $_CB_Backend_task;
$_CB_Backend_Title = array();
$_CB_Backend_task = $task;
$oldignoreuserabort = ignore_user_abort(true);
$taskPart1 = strtok($task, '.');
$_CB_framework->document->_outputToHeadCollectionStart();
ob_start();
// remind step 2 if forgotten/failed:
$tgzFile = $_CB_framework->getCfg('absolute_path') . '/administrator/components/com_comprofiler/pluginsfiles.tgz';
if (file_exists($tgzFile)) {
    if (in_array($taskPart1, array('showusers', 'showconfig', 'showTab', 'showField', 'showLists', 'tools', 'showPlugins', ''))) {
        echo '<div class="cbWarning" style="color:red; font-size:140%; font-weight-bold;"> ' . sprintf(CBTxt::Th('Warning: file %s still exists. This is probably due to the fact that first installation step did not complete, or second installation step did not take place. If you are sure that first step has been performed, you need to execute second installation step before using CB. You can do this now by clicking here:'), $tgzFile) . ' <a href="' . $_CB_framework->backendUrl('index.php?option=com_comprofiler&task=finishinstallation') . '">' . CBTxt::Th('please click here to continue next and last installation step') . '</a>.</div>';
    }
}
function _CBloadController($name)
{
    global $_CB_framework, $ueConfig;
    require_once $_CB_framework->getCfg('absolute_path') . '/administrator/components/com_comprofiler/controller/controller.' . $name . '.php';
    $controllerClass = 'CBController_' . $name;
    return new $controllerClass($ueConfig);
}
function _CBloadView($name)
{
    global $_CB_framework, $ueConfig;
    require_once $_CB_framework->getCfg('absolute_path') . '/administrator/components/com_comprofiler/view/view.' . $name . '.php';
    $viewClass = 'CBView_' . $name;
    return new $viewClass($ueConfig);
Пример #17
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;
	}
	/**
	 * render backend menus
	 *
	 * @param array $input
	 * @param moscomprofilerUser  $user
	 * @param object $plugin
	 */
	static public function showMenus( $input, $user, $plugin ) {
		global $_CB_framework;

		HTML_cbgjAdmin::setTitle( CBTxt::T( 'Menus' ), 'cbicon-48-gjmenus' );

		$return	=	'<form action="' . $_CB_framework->backendUrl( 'index.php' ) . '" method="post" name="adminForm" enctype="multipart/form-data" id="adminForm" class="adminform">'
				.		'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
				.			'<thead>'
				.				'<tr>'
				.					'<th colspan="3">' . CBTxt::Th( 'General' ) . '</th>'
				.				'</tr>'
				.			'</thead>'
				.			'<tbody>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['plugin'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Plugin' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to CB GroupJive component plugin page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['overview'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Category Overview' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to category overview page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['panel'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'My Panel' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to user panel page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['notifications'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'General Notifications' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to general notifications page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['message'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Message Categories' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to general message page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['all_categories'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'All Categories' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to all categories page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['all_groups'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'All Groups' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to all groups page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['all_my_categories'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'All My Categories' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to users all categories page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['all_my_groups'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'All My Groups' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to users all groups page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['new_category'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'New Category' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to generic new category page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['new_group'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'New Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to genric new group page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['approve_category'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Category Approval' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to category approval page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['approve_group'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Group Approval' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to group approval page.' ) . '</td>'
				.				'</tr>'
				.				cbgjClass::getIntegrations( 'gj_onMenusIntegrationsGeneral', array( $user, $plugin ), null, null )
				.			'</tbody>'
				.			'<thead>'
				.				'<tr>'
				.					'<th colspan="3">' . CBTxt::Th( 'Categories' ) . '</th>'
				.				'</tr>'
				.			'</thead>'
				.			'<tbody>'
				.				'<tr>'
				.					'<th width="10%" style="text-align:center;">' . CBTxt::Th( 'Categories' ) . '</td>'
				.					'<td width="20%">' . $input['cats'] . '</td>'
				.					'<td>' . CBTxt::Th( 'Select categories to create the following menu links for.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['categories'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Category' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a categories page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['new_category_nested'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'New Nested Category' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a categories new nested category page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['new_category_group'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'New Category Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a categories new group page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['notifications_category'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Category Notifications' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a categories notifications page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['message_groups'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Message Groups' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a categories message page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['edit_category'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Edit Category' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to edit a category.' ) . '</td>'
				.				'</tr>'
				.				cbgjClass::getIntegrations( 'gj_onMenusIntegrationsCategories', array( $user, $plugin ), null, null )
				.			'</tbody>'
				.			'<thead>'
				.				'<tr>'
				.					'<th colspan="3">' . CBTxt::Th( 'Groups' ) . '</th>'
				.				'</tr>'
				.			'</thead>'
				.			'<tbody>'
				.				'<tr>'
				.					'<th width="10%" style="text-align:center;">' . CBTxt::Th( 'Groups' ) . '</td>'
				.					'<td width="20%">' . $input['grps'] . '</td>'
				.					'<td>' . CBTxt::Th( 'Select groups to create the following menu links for.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['groups'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a groups page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['new_group_nested'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'New Nested Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a groups new nested group page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['notifications_group'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Group Notifications' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a groups notifications page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['message_users'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Message Users' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to a groups message page.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['edit_group'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Edit Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to edit a group.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['join'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Join Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to join a group.' ) . '</td>'
				.				'</tr>'
				.				'<tr>'
				.					'<td width="10%" style="text-align:center;">' . $input['leave'] . '</td>'
				.					'<th width="20%">' . CBTxt::Th( 'Leave Group' ) . '</td>'
				.					'<td>' . CBTxt::Th( 'Create menu link to leave a group.' ) . '</td>'
				.				'</tr>'
				.				cbgjClass::getIntegrations( 'gj_onMenusIntegrationsGroups', array( $user, $plugin ), null, null )
				.			'</tbody>'
				.		'</table>'
				.		'<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="menus.save" />'
				.		cbGetSpoofInputTag( 'plugin' )
				.	'</form>';

		echo $return;
	}
Пример #19
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 showInvites( $rows, $pageNav, $displayed, $user, $plugin, $tabbed ) {
		global $_CB_framework;

		$invitesTabSearch			=	$plugin->params->get( 'invites_tab_search', 1 );
		$invitesTabPaging			=	$plugin->params->get( 'invites_tab_paging', 1 );
		$invitesTabLimitbox			=	$plugin->params->get( 'invites_tab_limitbox', 1 );

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

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

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

			foreach ( $rows as $row ) {
				$group				=	$row->getGroup();
				$category			=	$group->getCategory();

				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_onBeforeProfileGroupInviteMenu', array( $row, $group, $category, $displayed, $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_onAfterProfileGroupInviteMenu', array( $row, $group, $category, $displayed, $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">' . $group->getName( 0, true ) . '</div>'
									.				'<div class="gjContentBoxRow">' . $category->getName( 0, true ) . '</div>'
									.				'<div class="gjContentBoxRow">'
									.					cbgjClass::getIntegrations( 'gj_onBeforeProfileGroupInviteInfo', array( $row, $group, $category, $displayed, $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_onAfterProfileGroupInviteInfo', array( $row, $group, $category, $displayed, $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::Th( 'Menu' ) )
									.				'</div>';

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

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

			if ( $invitesTabSearch && $pageNav->searching ) {
				$return				.=				CBTxt::Th( 'No invite search results found.' );
			} else {
				if ( $displayed->id == $user->id ) {
					$return			.=				CBTxt::Th( 'You have no invites.' );
				} else {
					$return			.=				CBTxt::Th( 'This user has no invites.' );
				}
			}

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

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

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

		return $return;
	}
    /**
     * Writes a list of the defined modules
     * @param array An array of category objects
     */
    static function showPlugins(&$rows, &$pageNav, $option, &$lists, $search, $canAdmin, $canEdit, $canEditState)
    {
        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>' . ($canAdmin ? ' &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="cbToggleAll( this, ' . count($rows) . ', \'cb\' );"';
        ?>
 />
			</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%">
			<?php 
        if ($canEditState) {
            ?>
			<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>
			<?php 
        }
        ?>
			</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}");
            // View Access Level
            if ($row->access == 0) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } elseif ($row->access == 1) {
                $color_access = 'style="color: red;"';
                $task_access = 'accessspecial';
            } elseif ($row->access == 2) {
                $color_access = 'style="color: black;"';
                $task_access = 'accesspublic';
            } else {
                $color_access = 'style="color: blue;"';
                $task_access = 'accesspublic';
            }
            if ($canEditState) {
                $access = '	<a href="javascript: void(0);" onclick="return cbListItemTask( this, \'' . $task_access . '\', null, null, \'cb\', \'' . $i . '\' )" ' . $color_access . '>
				' . $row->groupname . '
				</a>';
            } else {
                $access = $row->groupname;
            }
            //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="cbIsChecked(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 = '<img src="' . $imgpath . $img . '" border="0" alt="' . htmlspecialchars($alt) . '" />';
                if ($canEditState) {
                    $published = '<a href="javascript: void(0);" onclick="return cbListItemTask( this, \'' . $task . '\', null, null, \'cb\', \'' . $i . '\' )" title="' . htmlspecialchars($action) . '">' . $published . '</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 htmlspecialchars($row->name);
                if (!$filesInstalled) {
                    echo "</span>";
                }
            } elseif ($canEdit) {
                ?>
					<a href="<?php 
                echo $link;
                ?>
">
					<?php 
                echo htmlspecialchars($row->name);
                ?>
					</a>
					<?php 
                echo implode('', $backendPluginMenus);
            } else {
                echo htmlspecialchars($row->name);
            }
            ?>
				</td>
				<td align="center">
				<?php 
            echo $installed;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $published;
            ?>
				</td>
				<td>
				<?php 
            if ($canEditState) {
                if (($i > 0 || $i + $pageNav->limitstart > 0) && $row->type == @$rows[$i - 1]->type) {
                    ?>
			         <a href="#reorder" onClick="return cbListItemTask( this, 'orderupPlugin', null, null, 'cb', '<?php 
                    echo $i;
                    ?>
' )">
			            <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 ($canEditState) {
                if (($i < $n - 1 || $i + $pageNav->limitstart < $pageNav->total - 1) && $row->type == @$rows[$i + 1]->type) {
                    ?>
			         <a href="#reorder" onClick="return cbListItemTask( this, 'orderdownPlugin', null, null, 'cb', '<?php 
                    echo $i;
                    ?>
' )">
			            <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" <?php 
            if (!$canEditState) {
                echo 'disabled="disabled"';
            }
            ?>
/>
				</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>

<?php 
        if ($canAdmin) {
            ?>

		<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>
<?php 
        } else {
            echo htmlspecialchars(CBTxt::T('Install New Plugin')) . ': ' . CBTxt::Th("Operation not allowed by the Permissions of your group(s).");
        }
        ?>
	</div>
		<?php 
    }
Пример #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
	/**
	 * Translates, prepares the HTML $htmlText with triggering CMS Content Plugins, replaces CB substitutions and extra HTML and non-HTML substitutions
	 * @see CBuser::replaceUserVars
	 *
	 * @param  string      $mainText
	 * @param  int         $user_id
	 * @param  boolean     $html
	 * @param  boolean     $translateMainText
	 * @param  boolean     $prepareHtmlContentPlugins
	 * @param  array|null  $extraHtmlStrings
	 * @param  array|null  $extraNonHtmlStrings
	 * @return string
	 */
	public static function replaceUserVars( $mainText, $user_id, $html, $translateMainText = true,
											$prepareHtmlContentPlugins = false,
											$extraHtmlStrings = null, $extraNonHtmlStrings = null )
	{
		if ( $translateMainText ) {
			$mainText		=	$html ? parent::Th( $mainText ) : parent::T( $mainText );
		}

		if ( $prepareHtmlContentPlugins ) {
			$mainText		=	Application::Cms()->prepareHtmlContentPlugins( $mainText );

			if ( ! $html ) {
				$mainText	=	strip_tags( $mainText );
			}
		}

		$cbUser				=	CBuser::getInstance( (int) $user_id );

		if ( ! $cbUser ) {
			$cbUser			=	CBuser::getInstance( null );
		}

		$mainText			=	$cbUser->replaceUserVars( $mainText, true, false, $extraNonHtmlStrings, false );

		if ( $extraHtmlStrings ) {
			foreach ( $extraHtmlStrings as $k => $v ) {
				$mainText	=	str_replace( "[$k]", $html ? $v : strip_tags( $v ), $mainText );
			}
		}

		return $mainText;
	}
 /**
  * Returns the activity update corresponding to the logged values
  *
  * @param  moscomprofilerFields       $field
  * @param  moscomprofilerActivity     $activity
  * @param  moscomprofilerUser         $user
  * @param  string  $output            NO 'htmledit' BUT: 'html', 'xml', 'json', 'php', 'csvheader', 'csv', 'rss', 'fieldslist'
  * @param  boolean $htmlspecialchars  TRUE: escape for display, FALSE: not escaped will display raw.
  * @return mixed
  */
 function _formatFieldActivityOutput(&$field, &$activity, &$user, $output, $htmlspecialchars = true)
 {
     $name = $field->name;
     /*
     		global $_CB_framework, $ueConfig;
     		$value		=	'<a href="' . $_CB_framework->userProfileUrl( $user->id ) . '">'
     					.	getNameFormat( $user->name, $user->username, $ueConfig['name_format'] )
     					.	'</a>'
     					.	' updated his '
     */
     $value = $this->_formatFieldOutput($field->name, $activity->new_value, $output, $htmlspecialchars);
     switch ($output) {
         case 'html':
         case 'rss':
         case 'htmledit':
             $title = $this->getFieldTitle($field, $user, $output, 'profile');
             if ($htmlspecialchars) {
                 return sprintf('%s %s %s', '<span class="titleCell">' . $title . '</span>', '<span class="cbIs">' . CBTxt::Th('is now') . '</span>', '<span class="fieldCell">' . htmlspecialchars($value) . '</span>');
             } else {
                 return sprintf(CBTxt::T('%s is now %s'), $title, $value);
                 //FIXME : LANGUAGE STRINGS FOR THIS !
             }
             break;
         case 'xml':
             return '<' . $name . '>' . htmlspecialchars($value) . '</' . $name . '>';
             // htmlspecialchars handled already by _formatFieldOutput
             break;
         case 'json':
             return "'" . $name . "' : '" . addslashes($value) . "'";
             break;
         case 'php':
             return array($name => $value);
             break;
         case 'csvheader':
         case 'fieldslist':
             return $name;
             break;
         case 'csv':
             return '"' . addslashes($value) . '"';
             break;
         default:
             trigger_error('_formatFieldActivityOutput called with ' . htmlspecialchars($output), E_USER_WARNING);
             return $value;
             break;
     }
 }
Пример #24
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;
	}
Пример #25
0
	private function showAutoEdit( $row, $input, $user, $plugin ) {
		global $_CB_framework;

		if ( $row->get( 'id' ) ) {
			$title		=	CBTxt::P( 'Auto: <small>Edit [[trigger]] ([id])</small>', array( '[trigger]' => htmlspecialchars( str_replace( ' ', '', $row->get( 'trigger' ) ) ), '[id]' => $row->get( 'id' ) ) );
		} else {
			$title		=	CBTxt::T( 'Auto: <small>New</small>' );
		}

		HTML_cbgjAdmin::setTitle( $title, 'cbicon-48-gjauto' );

		$return			=	'<form action="' . $_CB_framework->backendUrl( 'index.php' ) . '" method="post" name="adminForm" enctype="multipart/form-data" id="adminForm" class="adminform">'
						.		'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
						.			'<tbody>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Published' ) . '</th>'
						.					'<td width="40%">' . $input['published'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select publish status of auto. Unpublished auto action will not execute.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::T( 'Title' ) . '</th>'
						.					'<td width="40%">' . $input['title'] . '</td>'
						.					'<td>' . CBTxt::T( 'Optionally input title to display on auto list in replace of Triggers list.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::T( 'Description' ) . '</th>'
						.					'<td width="40%">' . $input['description'] . '</td>'
						.					'<td>' . CBTxt::T( 'Optionally input description to display on auto list on mouseover of Triggers list or Title.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Triggers' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['trigger'] . ' ' . $input['triggers'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Input comma separated list of triggers or select trigger to append (e.g. onAfterLogin).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'User' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['object'] . ' ' . $input['variable'] . ' ' . $input['variable_user'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select if user object should be automatically obtained from trigger variables, if manually selected variable should be used (e.g. function login( $var1, $var2, $var3 ) {...), if user executing the trigger, or if specified user id should be used. User variable determines substitution target (e.g. [username] will output the User username). Regardless of User selection you can substitute in other variables using [var1], [var2], [var3], etc.. (for arrays/objects use [var1_VARIABLE]; example: [var2_username]). In addition to trigger variables you can access $_GET and $_POST substitutions as post_VARIABLE and get_VARIABLE (e.g. get_task).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Access' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['access'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select access to auto; only groups selected will have access. Parent groups such as Public Front-end will NOT fire for Registered users; exact groups must be selected.' ) . '</td>'
						.				'</tr>'
						.				'<tr id="conditional">'
						.					'<th width="15%">' . CBTxt::Th( 'Conditional' ) . '</th>'
						.					'<td width="40%">'
						.						'<table class="adminlist" width="100%" cellspacing="0" cellpadding="4" border="0">'
						.							'<tbody>';

		for ( $i = 0, $n = $input['conditionals']; $i < $n; $i++ ) {
			$return		.=								'<tr>'
						.									'<td width="5%" style="text-align:center;"><div class="moveConditional ui-icon ui-icon-arrowthick-2-n-s" title="' . htmlspecialchars( CBTxt::T( 'Click and drag to move this conditional.' ) ) . '">#</div></td>'
						.									'<td width="30%" style="text-align:center;" class="conditionalField">' . $input["field$i"] . '</td>'
						.									'<td width="30%" style="text-align:center;" class="conditionalOperator">' . $input["operator$i"] . '</td>'
						.									'<td width="30%" style="text-align:center;" class="conditionalValue">' . $input["value$i"] . '</td>'
						.									'<td width="5%" style="text-align:center;">'
						.										'<div class="addConditional ui-icon ui-icon-plus" title="' . htmlspecialchars( CBTxt::T( 'Click to add new conditional.' ) ) . '">+</div>'
						.										'<div class="removeConditional ui-icon ui-icon-minus" title="' . htmlspecialchars( CBTxt::T( 'Click to remove this conditional.' ) ) . '">-</div>'
						.									'</td>'
						.								'</tr>';
		}

		$return			.=							'</tbody>'
						.						'</table>'
						.					'</td>'
						.					'<td>' . CBTxt::Th( 'Optionally input substitution supported conditional from one value to another. If condition is not met then auto will not be executed.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Auto' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['auto'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select type of auto. Auto determines what type of action is performed automatically.' ) . '</td>'
						.				'</tr>'
						.				'<tr id="list_groups">'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Groups' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['groups'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select groups to automatically join/leave.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Status' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['status'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select status of the user for the specified groups.' ) . '</td>'
						.				'</tr>'
						.				'<tr id="list_category">'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Category' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['category'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select category for the new group.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Category Parent' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['cat_parent'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select category parent of new category.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Category Name' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['cat_name'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Input substitution supported new category (e.g. [username]).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Category Description' ) . '</th>'
						.					'<td width="40%">' . $input['cat_description'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Optionally input substitution supported new category (e.g. [name]).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Category Types' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['types'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select categories available group types. Types determine the way a groups is joined (e.g. Invite requires new users to be invited to join a group).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Category Owner' ) . '</th>'
						.					'<td width="40%">' . $input['cat_owner'] . '</td>'
						.					'<td>' . CBTxt::T( 'Optionally input substitution supported category owner override. If left blank the user triggering the auto will be used.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Category Unique' ) . '</th>'
						.					'<td width="40%">' . $input['cat_unique'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select if category should be unique to the user. When checking if a category exists by name it will also check if exists by user id. If disabled only name is checked.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Group Parent' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['grp_parent'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select parent group of new group.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Group Name' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['grp_name'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Input substitution supported new group (e.g. [username]).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Group Description' ) . '</th>'
						.					'<td width="40%">' . $input['grp_description'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Optionally input substitution supported new group (e.g. [name]).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%"><div>' . CBTxt::Th( 'Group Type' ) . '</div><div><small>' . CBTxt::Th( '(required)' ) . '</small></div></th>'
						.					'<td width="40%">' . $input['type'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select group type. Type determines the way your group is joined (e.g. Invite requires new users to be invited to join your group).' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Group Owner' ) . '</th>'
						.					'<td width="40%">' . $input['grp_owner'] . '</td>'
						.					'<td>' . CBTxt::T( 'Optionally input substitution supported group owner override. If left blank the user triggering the auto will be used.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Group Unique' ) . '</th>'
						.					'<td width="40%">' . $input['grp_unique'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select if groups should be unique to the user. When checking if a group exists by name it will also check if exists by user id. If disabled only name is checked.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Auto Join' ) . '</th>'
						.					'<td width="40%">' . $input['grp_autojoin'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Select if group should be automatically joined if duplicate found.' ) . '</td>'
						.				'</tr>'
						.				'<tr>'
						.					'<th width="15%">' . CBTxt::Th( 'Exclude' ) . '</th>'
						.					'<td width="40%">' . $input['exclude'] . '</td>'
						.					'<td>' . CBTxt::Th( 'Optionally input comma separated list of user ids to be excluded from auto action (e.g. 62,39,21,8).' ) . '</td>'
						.				'</tr>'
						.			'</tbody>'
						.		'</table>'
						.		'<input type="hidden" id="id" name="id" value="' . (int) $row->get( 'id' ) . '" />'
						.		'<input type="hidden" id="ordering" name="order" value="' . (int) $row->get( 'ordering', 99999 ) . '" />'
						.		'<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="plugin.auto_save" />'
						.		cbGetSpoofInputTag( 'plugin' )
						.	'</form>';

		echo $return;
	}
Пример #26
0
	static function showConfig( &$ueConfig, &$lists, $option ) {
		global $_CB_framework;
	
		HTML_comprofiler::secureAboveForm('showConfig');
		outputCbTemplate(2);
		outputCbJs(2);
	
		global $_CB_Backend_Title;
		$_CB_Backend_Title	=	array( 0 => array( 'cbicon-48-settings', htmlspecialchars( "CB " . _UE_REG_CONFIGURATION_MANAGER ) ) );
		HTML_comprofiler::_overideWebFxLayout();

?>
<div style="width:95%;text-align:center;margin-bottom:15px;">
	<div style="width:88%;margin:auto;text-align:left;">
<?php update_checker(); ?>
	</div>
</div>
   <form action="<?php echo $_CB_framework->backendUrl( 'index.php' ); ?>" method="post" name="adminForm">
   <table cellspacing='0' cellpadding='4' border='0' width='100%'><tr><td width='100%'>
<?php
$tabs = new cbTabs( 0,2 );
?>
<?php

echo $tabs->startPane( "CB" );
echo $tabs->startTab("CB",_UE_GENERAL,"tab1");
?>

   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_NAME_STYLE ?></td>
         <td align="left" valign="top"><?php echo $lists['name_style']; ?></td>
         <td align="left" valign="top"><?php echo _UE_NAME_STYLE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_NAME_FORMAT ?></td>
         <td align="left" valign="top"><?php echo $lists['name_format']; ?></td>
         <td align="left" valign="top"><?php echo _UE_NAME_FORMAT_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_DATE_FORMAT ?></td>
         <td align="left" valign="top"><?php echo $lists['date_format']; ?></td>
         <td align="left" valign="top"><?php echo _UE_DATE_FORMAT_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_CALENDAR_TYPE ?></td>
         <td align="left" valign="top"><?php echo $lists['calendar_type']; ?></td>
         <td align="left" valign="top"><?php echo _UE_CALENDAR_TYPE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_EMAIL_DISPLAY ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_email_display']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_EMAIL_DISPLAY_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_EMAIL_REPLYTO ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_email_replyto']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_EMAIL_REPLYTO_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_EMAIL ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_email']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_EMAIL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_WEBSITE ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_website']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_WEBSITE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_ONLINESTATUS ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_onlinestatus']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_ONLINESTATUS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ICONS_DISPLAY ?></td>
         <td align="left" valign="top"><?php echo $lists['icons_display']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ICONS_DISPLAY_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_LOGIN_TYPE ?></td>
         <td align="left" valign="top"><?php echo $lists['login_type']; ?></td>
         <td align="left" valign="top"><?php echo _UE_LOGIN_TYPE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();
echo $tabs->startTab("CB",_UE_REGISTRATION,"tab2");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_CB_ALLOW ?></td>
         <td align="left" valign="top"><?php echo $lists['admin_allowcbregistration']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_CB_ALLOW_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_CB_EMAILPASS ?></td>
         <td align="left" valign="top"><?php echo $lists['emailpass']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_CB_EMAILPASS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_ADMIN_APPROVAL ?></td>
         <td align="left" valign="top"><?php echo $lists['admin_approval']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_ADMIN_APPROVAL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_CONFIRMATION ?></td>
         <td align="left" valign="top"><?php echo $lists['confirmation']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_CONFIRMATION_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_USERNAMECHECKER ?></td>
         <td align="left" valign="top"><?php echo $lists['reg_username_checker']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_USERNAMECHECKER_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_EMAILCHECKER ?></td>
         <td align="left" valign="top"><?php echo $lists['reg_email_checker']; ?></td>
         <td align="left" valign="top"><?php if ( ! function_exists( 'getmxrr' ) ) { echo _UE_REG_EMAILCHECKER_WARNING . ' --- '; } echo _UE_REG_EMAILCHECKER_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_UNIQUEEMAIL ?></td>
         <td align="left" valign="top"><?php echo $_CB_framework->getCfg( 'uniquemail') ? _UE_YES : _UE_NO; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_UNIQUEEMAIL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_SHOW_LOGIN_ON_PAGE ?></td>
         <td align="left" valign="top"><?php echo $lists['reg_show_login_on_page']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_SHOW_LOGIN_ON_PAGE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_EMAIL_NAME ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_reg_email_name" value="<?php echo htmlspecialchars(stripslashes($ueConfig['reg_email_name'])); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_EMAIL_NAME_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_EMAIL_FROM ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_reg_email_from" value="<?php echo htmlspecialchars($ueConfig['reg_email_from']); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_EMAIL_FROM_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_EMAIL_REPLYTO ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_reg_email_replyto" value="<?php echo htmlspecialchars($ueConfig['reg_email_replyto']); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_EMAIL_REPLYTO_DESC ?></td>
      </tr>
      <tr  align="left" valign="middle">
	 <td align="left" valign="top"></td>
	 <td align="left" valign="top" colspan="2"><?php echo _UE_REG_EMAIL_TAGS; ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_PEND_APPR_SUB ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_reg_pend_appr_sub" size="50" value="<?php echo htmlspecialchars(stripslashes($ueConfig['reg_pend_appr_sub'])); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_PEND_APPR_SUB_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_PEND_APPR_MSG ?></td>
         <td align="left" valign="top" colspan=2><textarea name="cfg_reg_pend_appr_msg" cols=50 rows=6><?php echo htmlspecialchars(stripslashes($ueConfig['reg_pend_appr_msg'])); ?></textarea></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_WELCOME_SUB ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_reg_welcome_sub" size="50" value="<?php echo htmlspecialchars(stripslashes($ueConfig['reg_welcome_sub'])); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_WELCOME_SUB_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_WELCOME_MSG ?></td>
         <td align="left" valign="top" colspan=2><textarea name="cfg_reg_welcome_msg" cols=50 rows=6><?php echo htmlspecialchars(stripslashes($ueConfig['reg_welcome_msg'])); ?></textarea></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_SHOW_ICONS_EXPLAIN ?></td>
         <td align="left" valign="top"><?php echo $lists['reg_show_icons_explain']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_SHOW_ICONS_EXPLAIN_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_INTRO_MSG ?></td>
         <td align="left" valign="top"><textarea name="cfg_reg_intro_msg" cols=50 rows=6><?php echo htmlspecialchars(stripslashes($ueConfig['reg_intro_msg'])); ?></textarea></td>
         <td align="left" valign="top"><?php echo _UE_REG_INTRO_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_CONCLUSION_MSG ?></td>
         <td align="left" valign="top"><textarea name="cfg_reg_conclusion_msg" cols=50 rows=6><?php echo htmlspecialchars(stripslashes($ueConfig['reg_conclusion_msg'])); ?></textarea></td>
         <td align="left" valign="top"><?php echo _UE_REG_CONCLUSION_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_TOC_MSG ?></td>
         <td align="left" valign="top"><?php echo $lists['reg_enable_toc']; ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_TOC_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_TOC_URL_MSG ?></td>
         <td align="left" valign="top"><input type="text" size="50" name="cfg_reg_toc_url" value="<?php echo htmlspecialchars($ueConfig['reg_toc_url']); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_TOC_URL_DESC ?></td>
      </tr>
     <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_FIRST_VISIT_URL_MSG ?></td>
         <td align="left" valign="top"><input type="text" size="50" name="cfg_reg_first_visit_url" value="<?php echo htmlspecialchars($ueConfig['reg_first_visit_url']); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_REG_FIRST_VISIT_URL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();
echo $tabs->startTab("CB",_UE_USERLIST,"tab3");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_NUM_PER_PAGE ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_num_per_page" value="<?php echo htmlspecialchars($ueConfig['num_per_page']); ?>" /></td>
         <td align="left" valign="top"><?php echo _UE_NUM_PER_PAGE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_PROFILELINK ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_profilelink']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_PROFILELINK_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();
echo $tabs->startTab("CB",_UE_USERPROFILE,"tab4");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_USERNAME ?></td>
         <td align="left" valign="top"><?php echo $lists['usernameedit']; ?></td>
         <td align="left" valign="top"><?php echo _UE_USERNAME_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ADMINREQUIREDFIELDS ?></td>
         <td align="left" valign="top"><?php echo $lists['adminrequiredfields']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ADMINREQUIREDFIELDS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOW_PROFILEVIEWBY ?></td>
         <td align="left" valign="top"><?php echo $lists['allow_profileviewbyGID']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOW_PROFILEVIEWBY_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_MINHITSINTV ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_minHitsInterval" value="<?php echo htmlspecialchars($ueConfig['minHitsInterval']);?>" /></td>
         <td align="left" valign="top"><?php echo _UE_MINHITSINTV_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_TEMPLATEDIR ?></td>
         <td align="left" valign="top"><?php echo $lists['templatedir']; ?></td>
         <td align="left" valign="top"><?php echo _UE_TEMPLATEDIR_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_PROFILE_2COLS ?></td>
         <td align="left" valign="top"><?php echo _UE_LEFT ?>: <input type="text" size="2" name="cfg_left2colsWidth" value="<?php echo htmlspecialchars($ueConfig['left2colsWidth']);?>" /> %&nbsp;&nbsp;&nbsp;&nbsp;<?php echo _UE_REG_PROFILE_2COLS_RIGHT_REST ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_PROFILE_2COLS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_PROFILE_3COLS ?></td>
         <td align="left" valign="top"><?php echo _UE_LEFT ?>: <input type="text" size="2" name="cfg_left3colsWidth" value="<?php echo htmlspecialchars($ueConfig['left3colsWidth']);?>" /> %&nbsp;&nbsp;&nbsp;&nbsp;
         							  <?php echo _UE_RIGHT ?>: <input type="text" size="2" name="cfg_right3colsWidth" value="<?php echo htmlspecialchars($ueConfig['right3colsWidth']);?>" /> %</td>
         <td align="left" valign="top"><?php echo _UE_REG_PROFILE_3COLS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_SHOWEMPTYTABS ?></td>
         <td align="left" valign="top"><?php echo $lists['showEmptyTabs']; ?></td>
         <td align="left" valign="top"><?php echo _UE_SHOWEMPTYTABS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_SHOWEMPTYFIELDS ?></td>
         <td align="left" valign="top"><?php echo $lists['showEmptyFields']; ?></td>
         <td align="left" valign="top"><?php echo _UE_SHOWEMPTYFIELDS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_EMPTYFIELDSTEXT ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_emptyFieldsText" value="<?php echo htmlspecialchars( isset( $ueConfig['emptyFieldsText'] ) ? $ueConfig['emptyFieldsText'] : '-' );?>" /></td>
         <td align="left" valign="top"><?php echo  _UE_EMPTYFIELDSTEXT_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_NESTTABS ?></td>
         <td align="left" valign="top"><?php echo $lists['nesttabs']; ?></td>
         <td align="left" valign="top"><?php echo _UE_NESTTABS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_XHTMLCOMPLY ?></td>
         <td align="left" valign="top"><?php echo $lists['xhtmlComply']; ?></td>
         <td align="left" valign="top"><?php echo _UE_XHTMLCOMPLY_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_FRONTENDUSERPARAMS ?></td>
         <td align="left" valign="top"><?php echo $lists['frontend_userparams']; ?></td>
         <td align="left" valign="top"><?php echo _UE_FRONTENDUSERPARAMS_DESC ?></td>
      </tr>
<?php
if ( isset( $ueConfig['frontend_userparams'] ) ) {
	if ( ( $ueConfig['frontend_userparams'] == 1 ) !== in_array( $_CB_framework->getCfg( "frontend_userparams" ), array( '1', null) ) ) {
//TBD in CB 1.3: move those in language strings:
?>
      <tr align="center" valign="middle">
         <td align="left" valign="top"> </td>
         <td align="left" valign="top"><div class="cbSmallWarning"><?php echo htmlspecialchars( CBTxt::T('WARNING: different from the CMS setting !') ); ?></div></td>
         <td align="left" valign="top"><?php echo htmlspecialchars( CBTxt::T('This may be ok, but this warning is just to make you aware of the difference.') ); ?></td>
      </tr>
<?php
	}
}
?>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo CBTxt::Th("Use new div or old table based views") ?></td>
         <td align="left" valign="top"><?php echo $lists['use_divs']; ?></td>
         <td align="left" valign="top"><?php echo CBTxt::Th("Choose table for compatibility with old templates and div for table-less output.") ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_FILTER_ALLOWED_TAGS ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_html_filter_allowed_tags" value="<?php echo htmlspecialchars($ueConfig['html_filter_allowed_tags']);?>" /></td>
         <td align="left" valign="top"><?php echo  _UE_REG_FILTER_ALLOWED_TAGS_DESC . '<br />' . $lists['_filteredbydefault']; ?></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();


$imgToolBox							=	new imgToolBox();
if ( $ueConfig['im_path'] ) {
	$imgToolBox->_IM_path			=	$ueConfig['im_path'];
}
if ( $ueConfig['netpbm_path'] ) {
	$imgToolBox->_NETPBM_path		=	$ueConfig['netpbm_path'];
}
$imageLibs							=	$imgToolBox->getImageLibs();

echo $tabs->startTab("CB",_UE_AVATARS,"tab5");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
	 <tr align="center" valign="middle">
		<td align="left" valign="top"><?php echo _UE_IMPATH;?></td>
		<td align="left" valign="top">
			<input type="text" name="cfg_im_path" value="<?php echo ($ueConfig['im_path'] == '') ? 'auto' : htmlspecialchars($ueConfig['im_path']);?>" size="40" >
		</td>
		<td align="left" valign="top">
			<?php echo _UE_IMPATH_DESC;?>
		</td>
	</tr>
	 <tr align="center" valign="middle">
		<td align="left" valign="top"><?php echo _UE_NETPBMPATH;?></td>
		<td align="left" valign="top">
			<input type="text" name="cfg_netpbm_path" value="<?php echo ($ueConfig['netpbm_path'] == '') ? 'auto' : htmlspecialchars($ueConfig['netpbm_path']);?>" size="40" >
		</td>
		<td align="left" valign="top">
			<?php echo _UE_NETPBMPATH_DESC;?>
		</td>
	</tr>
      <tr align="center" valign="middle">
	<td align="left" valign="top">
		<?php echo _UE_CONVERSIONTYPE;?>
	</td>
	<td align="left" valign="top">
	<?php echo $lists['conversiontype']; ?>
	</td>
	<td align="left" valign="top">
		<a href="http://www.imagemagick.org" target=_blank><?php echo htmlspecialchars( CBTxt::T('ImageMagick') ); ?></a>&nbsp;&nbsp;
			<?php if(array_key_exists('imagemagick',$imageLibs)) echo '<strong><font color="green">'._UE_AUTODET.' '.$imageLibs['imagemagick'].'</font></strong>'; else echo '<strong><font color="red">' . _UE_ERROR_NOTINSTALLED . '</font></strong>'; ?>
			<br />
		<a href="http://sourceforge.net/projects/netpbm" target=_blank><?php echo htmlspecialchars( CBTxt::T('NetPBM') ); ?></a>&nbsp;&nbsp;
			<?php if(array_key_exists('netpbm',$imageLibs)) echo '<strong><font color="green">'._UE_AUTODET.' '.$imageLibs['netpbm'].'</font></strong>'; else echo '<strong><font color="red">' . _UE_ERROR_NOTINSTALLED . '</font></strong>'; ?>
			<br />
		<?php echo htmlspecialchars( CBTxt::T('GD1 library') ); ?>
			<?php if(array_key_exists('gd1',$imageLibs['gd'])) echo '&nbsp;&nbsp;<strong><font color="green">'._UE_AUTODET.', '.$imageLibs['gd']['gd1'].'</font></strong>'; else echo '<strong><font color="red">' . _UE_ERROR_NOTINSTALLED . '</font></strong>'; ?>
			<br />
		<?php echo htmlspecialchars( CBTxt::T('GD2 library') ); ?>
			<?php if(array_key_exists('gd2',$imageLibs['gd'])) echo '&nbsp;&nbsp;<strong><font color="green">'._UE_AUTODET.', '.$imageLibs['gd']['gd2'].'</font></strong>'; else echo '<strong><font color="red">' . _UE_ERROR_NOTINSTALLED . '</font></strong>'; ?>

	</td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVATAR ?></td>
         <td align="left" valign="top"><?php echo $lists['allowAvatar']; ?></td>
         <td align="left" valign="top"><?php echo _UE_AVATAR_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVATARUPLOAD ?></td>
         <td align="left" valign="top"><?php echo $lists['allowAvatarUpload']; ?></td>
         <td align="left" valign="top"><?php echo _UE_AVATARUPLOAD_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALWAYSRESAMPLEUPLOADS ?></td>
         <td align="left" valign="top"><?php echo $lists['avatarResizeAlways']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALWAYSRESAMPLEUPLOADS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVATARGALLERY ?></td>
         <td align="left" valign="top"><?php echo $lists['allowAvatarGallery']; ?></td>
         <td align="left" valign="top"><?php echo _UE_AVATARGALLERY_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVHEIGHT ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_avatarHeight" value="<?php echo htmlspecialchars($ueConfig['avatarHeight']);?>" /></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVWIDTH ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_avatarWidth" value="<?php echo htmlspecialchars($ueConfig['avatarWidth']);?>" /></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVSIZE ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_avatarSize" value="<?php echo htmlspecialchars($ueConfig['avatarSize']);?>" /></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_TNHEIGHT ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_thumbHeight" value="<?php echo htmlspecialchars($ueConfig['thumbHeight']);?>" /></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_TNWIDTH ?></td>
         <td align="left" valign="top"><input type="text" name="cfg_thumbWidth" value="<?php echo htmlspecialchars($ueConfig['thumbWidth']);?>" /></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();
echo $tabs->startTab("CB",_UE_MODERATE,"tab6");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVATARUPLOADAPPROVALGROUP ?></td>
         <td align="left" valign="top"><?php echo $lists['imageApproverGid']; ?></td>
         <td align="left" valign="top"><?php echo _UE_AVATARUPLOADAPPROVALGROUP_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_MODERATORUSERAPPOVAL ?></td>
         <td align="left" valign="top"><?php echo $lists['allowModUserApproval']; ?></td>
         <td align="left" valign="top"><?php echo _UE_MODERATORUSERAPPOVAL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_MODERATOREMAIL ?></td>
         <td align="left" valign="top"><?php echo $lists['moderatorEmail']; ?></td>
         <td align="left" valign="top"><?php echo _UE_MODERATOREMAIL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOWUSERREPORTS ?></td>
         <td align="left" valign="top"><?php echo $lists['allowUserReports']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOWUSERREPORTS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AVATARUPLOADAPPROVAL ?></td>
         <td align="left" valign="top"><?php echo $lists['avatarUploadApproval']; ?></td>
         <td align="left" valign="top"><?php echo _UE_AVATARUPLOADAPPROVAL_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOWMODERATORSUSEREDIT ?></td>
         <td align="left" valign="top"><?php echo $lists['allowModeratorsUserEdit']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOWMODERATORSUSEREDIT_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOWUSERPROFILEBANNING ?></td>
         <td align="left" valign="top"><?php echo $lists['allowUserBanning']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOWUSERPROFILEBANNING_DESC ?></td>
      </tr>

      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();
echo $tabs->startTab("CB",_UE_CONNECTION,"tab7");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ALLOWCONNECTIONS ?></td>
         <td align="left" valign="top"><?php echo $lists['allowConnections']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ALLOWCONNECTIONS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_CONNECTIONDISPLAY ?></td>
         <td align="left" valign="top"><?php echo $lists['connectionDisplay']; ?></td>
         <td align="left" valign="top"><?php echo _UE_CONNECTIONDISPLAY_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_CONNECTIONPATH ?></td>
         <td align="left" valign="top"><?php echo $lists['connectionPath']; ?></td>
         <td align="left" valign="top"><?php echo _UE_CONNECTIONPATH_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_USEMUTUALCONNECTIONACCEPTANCE ?></td>
         <td align="left" valign="top"><?php echo $lists['useMutualConnections']; ?></td>
         <td align="left" valign="top"><?php echo _UE_USEMUTUALCONNECTIONACCEPTANCE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_CONNECTOINNOTIFYTYPE ?></td>
         <td align="left" valign="top"><?php echo $lists['conNotifyTypes']; ?></td>
         <td align="left" valign="top"><?php echo _UE_CONNECTOINNOTIFYTYPE_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_AUTOADDCONNECTIONS ?></td>
         <td align="left" valign="top"><?php echo $lists['autoAddConnections']; ?></td>
         <td align="left" valign="top"><?php echo _UE_AUTOADDCONNECTIONS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_CONNECTIONCATEGORIES ?></td>
         <td align="left" valign="top" ><textarea name="cfg_connection_categories" cols=25 rows=6><?php echo htmlspecialchars($ueConfig['connection_categories']); ?></textarea></td>
         <td align="left" valign="top"><?php echo _UE_CONNECTIONCATEGORIES_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>
<?php
echo $tabs->endTab();
echo $tabs->startTab("CB",_UE_INTEGRATION,"tab8");
?>
   <table cellpadding="4" cellspacing="0" border="0" width="95%" class="adminform">
      <tr align="center" valign="middle">
         <th width="20%">&nbsp;</th>
         <th width="20%"><?php echo _UE_CURRENT_SETTINGS ?></th>
         <th width="60%"><?php echo _UE_EXPLANATION ?></th>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo CBTxt::Th('Translations highlighting') ?></td>
         <td align="left" valign="top"><?php echo $lists['translations_debug']; ?></td>
         <td align="left" valign="top"><?php echo CBTxt::Th('Here you can highlight and debug your translations in various ways.') ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_ENABLESPOOFCHECK ?></td>
         <td align="left" valign="top"><?php echo $lists['enableSpoofCheck']; ?></td>
         <td align="left" valign="top"><?php echo _UE_ENABLESPOOFCHECK_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_NOVERSIONCHECK ?></td>
         <td align="left" valign="top"><?php echo $lists['noVersionCheck']; ?></td>
         <td align="left" valign="top"><?php echo _UE_NOVERSIONCHECK_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <td align="left" valign="top"><?php echo _UE_REG_FURTHER_SETTINGS ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_FURTHER_SETTINGS_MORE ?></td>
         <td align="left" valign="top"><?php echo _UE_REG_FURTHER_SETTINGS_DESC ?></td>
      </tr>
      <tr align="center" valign="middle">
         <th colspan="3">&nbsp;</th>
      </tr>
   </table>

<?php
echo $tabs->endTab();
echo $tabs->endPane();

?>
</td></tr></table>
   <input type="hidden" name="task" value="" />
   <input type="hidden" name="option" value="<?php echo $option; ?>" />
   <input type="hidden" name="cfg_version" value="<?php echo $ueConfig['version']; ?>" />
   <?php
	echo cbGetSpoofInputTag( 'config' );
	?>
</form>
<?php
		// flush();
		// ob_flush();
?>
<div style="align:center;">
   <p><?php echo _UE_BY;	// Note: the line below is not translated on purpose as it is part of the copyright notice subject to the GPL: ?>
      <a href="http://www.joomlapolis.com" target="_blank">Community Builder Team of Joomlapolis</a>
      <br />
      <font class="small"><?php echo _UE_VERSION ?>: <?php echo $ueConfig['version']; ?></font>
      <?php
		// update_checker();
?>
   </p>
</div>
<?php
	}
Пример #27
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;
	}
Пример #28
0
	/**
	 * render frontend invites list
	 *
	 * @param array $rows
	 * @param cbgjCategory $category
	 * @param cbgjGroup $group
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 * @return mixed
	 */
	static function showInvitesList( $rows, $category, $group, $user, $plugin ) {
		$group->setPathway( CBTxt::T( 'Invites List' ), true );

		$inviteBy			=	explode( '|*|', $plugin->params->get( 'group_invites_by', '1|*|2|*|3|*|4' ) );

		$return				=	'<div class="gjInvitesList">'
							.		'<form action="' . cbgjClass::getPluginURL( array( 'invites', 'send', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjForm" id="gjForm" class="gjForm">'
							.			'<legend class="gjEditTitle">' . cbgjClass::getOverride( 'user', true ) . '</legend>';

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

			foreach ( $rows as $row ) {
				$cbUser		=&	CBuser::getInstance( (int) $row->get( 'id' ) );

				if ( ! $cbUser ) {
					$cbUser	=&	CBuser::getInstance( null );
				}

				$recipient	=&	$cbUser->getUserData();

				if ( in_array( 1, $inviteBy ) ) {
					$invite	=	(int) $recipient->id;
				} elseif ( in_array( 4, $inviteBy ) ) {
					$invite	=	$recipient->email;
				} elseif ( in_array( 2, $inviteBy ) ) {
					$invite	=	$recipient->username;
				} elseif ( in_array( 3, $inviteBy ) ) {
					$invite	=	$recipient->name;
				}

				if ( ! $invite ) {
					$invite	=	(int) $row->get( 'id' );
				}

				$inviteUrl	=	"document.gjForm.invites_invite.value = '" . addslashes( $invite ) . "';"
							.	"document.gjForm.submit();";

				$return		.=				'<div class="gjContentBox mini-layout">'
							.					'<div class="gjContentBoxRow">' . $cbUser->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) . '</div>'
							.					'<div class="gjContentBoxRow">' . $cbUser->getField( 'avatar', null, 'html', 'none', 'list', 0, true ) . '</div>'
							.					'<div class="gjContentBoxRow">' . $cbUser->getField( 'onlinestatus', null, 'html', 'none', 'profile', 0, true  ) . '</div>'
							.					'<div class="gjContentBoxRow">'
							.						'<input type="button" value="' . htmlspecialchars( CBTxt::Th( 'Invite' ) ) . '" class="gjButton btn btn-success" onclick="' . $inviteUrl . '" />'
							.					'</div>'
							.				'</div>';
			}

			$return			.=			'</div>';
		} else {
			$return			.=			'<div class="gjContent">' . CBTxt::Ph( 'There are no [users] available to invite.', array( '[users]' => cbgjClass::getOverride( 'user', true ) ) ) . '</div>';
		}

		$return				.=			'<div class="gjButtonWrapper form-actions">'
							.				'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn" onclick="' . cbgjClass::getPluginURL( array( 'groups', 'show', (int) $category->get( 'id' ), (int) $group->get( 'id' ) ), CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '" />'
							.			'</div>'
							.			'<input type="hidden" name="invites_invite" id="invites_invite" value="" />'
							.			'<input type="hidden" name="invites_list" id="invites_list" value="1" />'
							.			cbGetSpoofInputTag( 'plugin' )
							.		'</form>'
							.	'</div>';

		echo $return;
	}
Пример #29
0
	/**
	 * Parse the string through CBTxt::Th.
	 * That is, for a particular string find the corresponding translation.
	 * Variable subsitution is performed for the $args parameter.
	 * @since 1.3
	 *
	 * @param string   $english  the string to translate
	 * @param array    $args     a strtr-formatted array of string substitutions
	 * @return string
	*/
	static function Ph( $english, $args = null ) {
		return CBTxt::_parseReplaceString( CBTxt::Th( $english ), $args );
	}
Пример #30
0
	/**
	 * prepare backend tools render
	 *
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	private function showTools( $user, $plugin ) {
		global $_CB_database, $_PLUGINS;

		$msgs								=	new stdClass();
		$msgs->errors						=	array();
		$msgs->warnings						=	array();
		$msgs->info							=	array();

		$_PLUGINS->trigger( 'gj_onBeforeTools', array( $msgs, $user, $plugin ) );

		if ( file_exists( $plugin->imgsAbs ) ) {
			if ( ! is_writable( $plugin->imgsAbs ) ) {
				$msgs->errors[]				=	CBTxt::P( ':: Images :: directory not writable - [img_path]', array( '[img_path]' => $plugin->imgsAbs ) );
			}
		}

		if ( file_exists( str_replace( '/' . $plugin->folder, '', $plugin->imgsAbs ) ) ) {
			if ( ! is_writable( str_replace( '/' . $plugin->folder, '', $plugin->imgsAbs ) ) ) {
				$msgs->errors[]				=	CBTxt::P( ':: Images :: directory not writable - [img_path]', array( '[img_path]' => str_replace( '/' . $plugin->folder, '', $plugin->imgsAbs ) ) );
			}
		}

		$categories							=	cbgjData::getCategories();

		$cat_types							=	array();
		$cat_published						=	array();
		$cat_name							=	array();
		$cat_user							=	array();
		$cat_notification					=	array();

		if ( $categories ) foreach ( $categories as $category ) {
			$category_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'categories', 'edit', (int) $category->get( 'id' ) ) ) . '">' . $category->get( 'id' ) . '</a>';

			if ( ! $category->get( 'types' ) ) {
				$cat_types[]				=	$category_url;
			}

			if ( ! $category->get( 'published' ) ) {
				$cat_published[]			=	$category_url;
			}

			if ( $category->get( 'name' ) == '' ) {
				$cat_name[]					=	$category_url;
			}

			if ( ! $category->get( 'user_id' ) ) {
				$cat_user[]					=	$category_url;
			} else {
				$notification				=	cbgjData::getNotifications( null, array( array( 'type', '=', 'category' ), array( 'item', '=', (int) $category->get( 'id' ) ), array( 'user_id', '=', (int) $category->get( 'user_id' ) ) ), null, null, false );

				if ( ( ! $notification->get( 'id' ) ) && cbgjClass::hasAccess( 'cat_usr_notifications', cbgjClass::getAuthorization( $category, null, $category->getOwner() ) ) ) {
					$cat_notification[]		=	$category_url;
				}
			}
		}

		if ( ! empty( $cat_types ) ) {
			$fix_url						=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'types' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
			$msgs->errors[]					=	CBTxt::P( ':: Category :: Missing types - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_types ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $cat_published ) ) {
			$fix_url						=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'published' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
			$msgs->info[]					=	CBTxt::P( ':: Category :: Not published - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_published ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $cat_name ) ) {
			$msgs->errors[]					=	CBTxt::P( ':: Category :: Missing name - [cat]', array( '[cat]' => implode( ', ', $cat_name ) ) );
		}

		if ( ! empty( $cat_user ) ) {
			$fix_url						=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'user_id' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
			$msgs->errors[]					=	CBTxt::P( ':: Category :: Missing owner - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_user ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $cat_notification ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'categories', 'notifications' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
			$msgs->errors[]				=	CBTxt::Ph( ':: Category :: Missing owner notifications - [cat] - [fixall]', array( '[cat]' => implode( ', ', $cat_notification ), '[fixall]' => $fix_url ) );
		}

		$groups								=	cbgjData::getGroups();

		$grp_cat_id							=	array();
		$grp_published						=	array();
		$grp_type							=	array();
		$grp_cat							=	array();
		$grp_name							=	array();
		$grp_user							=	array();
		$grp_owner							=	array();
		$grp_notification					=	array();

		if ( $groups ) foreach ( $groups as $group ) {
			$group_url						=	'<a href="' . cbgjClass::getPluginURL( array( 'groups', 'edit', (int) $group->get( 'id' ) ) ) . '">' . $group->get( 'id' ) . '</a>';

			if ( ! $group->get( 'published' ) ) {
				$grp_published[]			=	$group_url;
			}

			if ( ! $group->get( 'type' ) ) {
				$grp_type[]					=	$group_url;
			}

			if ( ! $group->get( 'category' ) ) {
				$grp_cat[]					=	$group_url;
			} else {
				if ( ! $group->getCategory()->get( 'id' ) ) {
					$grp_cat_id[]			=	$group_url;
				}
			}

			if ( $group->get( 'name' ) == '' ) {
				$grp_name[]					=	$group_url;
			}

			if ( ! $group->get( 'user_id' ) ) {
				$grp_user[]					=	$group_url;
			} else {
				if ( ! $group->getUser()->get( 'id' ) ) {
					$grp_owner[]			=	$group_url;
				} else {
					$notification			=	cbgjData::getNotifications( null, array( array( 'type', '=', 'group' ), array( 'item', '=', (int) $group->get( 'id' ) ), array( 'user_id', '=', (int) $group->get( 'user_id' ) ) ), null, null, false );

					if ( ( ! $notification->get( 'id' ) ) && cbgjClass::hasAccess( 'grp_usr_notifications', cbgjClass::getAuthorization( $group->getCategory(), $group, $group->getOwner() ) ) ) {
						$grp_notification[]	=	$group_url;
					}
				}
			}
		}

		if ( ! empty( $grp_cat_id ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Category does not exist in GroupJive - [grp]', array( '[grp]' => implode( ', ', $grp_cat_id ) ) );
		}

		if ( ! empty( $grp_published ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'groups', 'published' ) ) . '">' . CBTxt::Th( 'Fix All' ) . '</a>';
			$msgs->info[]				=	CBTxt::Ph( ':: Group :: Not published - [grp] - [fixall]', array( '[grp]' => implode( ', ', $grp_published ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $grp_type ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'groups', 'type' ) ) . '">' . CBTxt::Th( 'Fix All' ) . '</a>';
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Missing type - [grp] - [fixall]', array( '[grp]' => implode( ', ', $grp_type ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $grp_cat ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Missing category - [grp]', array( '[grp]' => implode( ', ', $grp_cat ) ) );
		}

		if ( ! empty( $grp_name ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Missing name - [grp]', array( '[grp]' => implode( ', ', $grp_name ) ) );
		}

		if ( ! empty( $grp_user ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'groups', 'gj_user' ) ) . '">' . CBTxt::Th( 'Fix All' ) . '</a>';
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Missing owner - [grp] - [fixall]', array( '[grp]' => implode( ', ', $grp_user ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $grp_owner ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'groups', 'owner' ) ) . '">' . CBTxt::Th( 'Fix All' ) . '</a>';
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Missing owner user - [grp] - [fixall]', array( '[grp]' => implode( ', ', $grp_owner ), '[fixall]' => $fix_url ) );
		}

		if ( ! empty( $grp_notification ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'groups', 'notifications' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
			$msgs->errors[]				=	CBTxt::Ph( ':: Group :: Missing owner notifications - [grp] - [fixall]', array( '[grp]' => implode( ', ', $grp_notification ), '[fixall]' => $fix_url ) );
		}

		$users							=	cbgjData::getUsers();

		$usr_grp						=	array();
		$usr_grp_id						=	array();
		$usr_user						=	array();
		$usr_notification				=	array();

		if ( $users ) foreach ( $users as $usr ) {
			$user_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'users', 'edit', (int) $usr->get( 'id' ) ) ) . '">' . $usr->get( 'id' ) . '</a>';

			if ( ! $usr->get( 'group' ) ) {
				$usr_grp_id[]			=	$user_url;
			} else {
				if ( ! $usr->getGroup()->get( 'id' ) ) {
					$usr_grp[]			=	$user_url;
				}
			}

			if ( ! $usr->get( 'user_id' ) ) {
				$usr_user[]				=	$user_url;
			} else {
				$notification			=	cbgjData::getNotifications( null, array( array( 'type', '=', 'group' ), array( 'item', '=', (int) $usr->get( 'group' ) ), array( 'user_id', '=', (int) $usr->get( 'user_id' ) ) ), null, null, false );

				if ( ( ! $notification->get( 'id' ) ) && ( $usr->get( 'status' ) > 0 ) && cbgjClass::hasAccess( 'grp_usr_notifications', cbgjClass::getAuthorization( $usr->getCategory(), $usr->getGroup(), $usr->getOwner() ) ) ) {
					$usr_notification[]	=	$user_url;
				}
			}
		}

		if ( ! empty( $usr_grp ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: User :: Group does not exist in GroupJive - [usr]', array( '[usr]' => implode( ', ', $usr_grp_id ) ) );
		}

		if ( ! empty( $usr_grp_id ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: User :: Missing group - [usr]', array( '[usr]' => implode( ', ', $usr_grp_id ) ) );
		}

		if ( ! empty( $usr_user ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: User :: Missing user - [usr]', array( '[usr]' => implode( ', ', $usr_user ) ) );
		}

		if ( ! empty( $usr_notification ) ) {
			$fix_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'fix', 'users', 'notifications' ) ) . '">' . CBTxt::T( 'Fix All' ) . '</a>';
			$msgs->errors[]				=	CBTxt::Ph( ':: User :: Missing notifications - [usr] - [fixall]', array( '[usr]' => implode( ', ', $usr_notification ), '[fixall]' => $fix_url ) );
		}

		$invites						=	cbgjData::getInvites();

		$inv_grp						=	array();
		$inv_grp_id						=	array();
		$inv_usr_id						=	array();
		$inv_user						=	array();

		if ( $invites ) foreach ( $invites as $invite ) {
			$invite_url					=	'<a href="' . cbgjClass::getPluginURL( array( 'invites' ) ) . '">' . $invite->get( 'id' ) . '</a>';

			if ( ! $invite->get( 'group' ) ) {
				$inv_grp_id[]			=	$invite_url;
			} else {
				if ( ! $invite->getGroup()->get( 'id' ) ) {
					$inv_grp[]			=	$invite_url;
				}
			}

			if ( ! $invite->get( 'user_id' ) ) {
				$inv_user[]				=	$invite_url;
			} else {
				if ( ! $invite->getUser()->get( 'id' ) ) {
					$inv_usr_id			=	$invite_url;
				}
			}
		}

		if ( ! empty( $inv_grp ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: Invite :: Group does not exist in GroupJive - [inv]', array( '[inv]' => implode( ', ', $inv_grp ) ) );
		}

		if ( ! empty( $inv_grp_id ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: Invite :: Missing group - [inv]', array( '[inv]' => implode( ', ', $inv_grp_id ) ) );
		}

		if ( ! empty( $inv_usr_id ) ) {
			$msgs->warnings[]			=	CBTxt::Ph( ':: Invite :: User does not exist in Group - [inv]', array( '[inv]' => implode( ', ', $inv_usr_id ) ) );
		}

		if ( ! empty( $inv_user ) ) {
			$msgs->errors[]				=	CBTxt::Ph( ':: Invite :: Missing user - [inv]', array( '[inv]' => implode( ', ', $inv_user ) ) );
		}

		$gj_categories					=	$_CB_database->getTableStatus( '#__gj_grcategory' );
		$gj_groups						=	$_CB_database->getTableStatus( '#__gj_groups' );
		$gj_users						=	$_CB_database->getTableStatus( '#__gj_users' );

		if ( $gj_categories || $gj_groups || $gj_users ) {
			$migrate_url				=	cbgjClass::getPluginURL( array( 'tools', 'migrate' ), CBTxt::Th( 'Are you sure you want to migrate your old GroupJive data?' ) );
			$migrate					=	'<a href="javascript: void(0);" onclick="' . $migrate_url . '">' . CBTxt::Th( 'Migrate' ) . '</a>';

			$delmigrate_url				=	cbgjClass::getPluginURL( array( 'tools', 'delmigrate' ), CBTxt::Th( 'Are you sure you want to delete your old GroupJive data?' ) );
			$delmigrate					=	'<a href="javascript: void(0);" onclick="' . $delmigrate_url . '">' . CBTxt::Th( 'Delete' ) . '</a>';

			$msgs->info[]				=	CBTxt::Ph( ':: GroupJive :: Previous release database found - [mig_url] | [del_url]', array( '[mig_url]' => $migrate, '[del_url]' => $delmigrate ) );
		}

		$_PLUGINS->trigger( 'gj_onAfterTools', array( $msgs, $user, $plugin ) );

		if ( empty( $msgs->errors ) ) {
			$msgs->errors[]				=	CBTxt::Th( 'No errors were found.' );
		}

		if ( empty( $msgs->warnings ) ) {
			$msgs->warnings[]			=	CBTxt::Th( 'No warnings were found.' );
		}

		if ( empty( $msgs->info ) ) {
			$msgs->info[]				=	CBTxt::Th( 'No info was found.' );
		}

		HTML_cbgjAdmin::showTools( $msgs, $user, $plugin );
	}