Пример #1
0
 /**
  * @param  OrderedTable  $row
  * @param  string[]      $input
  * @param  UserTable     $user
  * @param  stdClass      $model
  * @param  PluginTable   $plugin
  */
 static function showBlogEdit($row, $input, $user, $model, $plugin)
 {
     global $_CB_framework, $_PLUGINS;
     cbValidator::loadValidation();
     $blogMode = $plugin->params->get('blog_mode', 1);
     $pageTitle = $row->get('id') ? CBTxt::T('Edit Blog') : CBTxt::T('Create Blog');
     $cbModerator = Application::User((int) $user->get('id'))->isGlobalModerator();
     $_CB_framework->setPageTitle($pageTitle);
     $_CB_framework->appendPathWay(htmlspecialchars(CBTxt::T('Blogs')), $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), true, 'cbblogsTab'));
     $_CB_framework->appendPathWay(htmlspecialchars($pageTitle), $_CB_framework->pluginClassUrl($plugin->element, true, $row->get('id') ? array('action' => 'blogs', 'func' => 'edit', 'id' => (int) $row->get('id')) : array('action' => 'blogs', 'func' => 'new')));
     initToolTip();
     $return = '<div class="blogEdit">' . '<form action="' . $_CB_framework->pluginClassUrl($plugin->element, true, array('action' => 'blogs', 'func' => 'save', 'id' => (int) $row->get('id'))) . '" method="post" enctype="multipart/form-data" name="blogForm" id="blogForm" class="cb_form blogForm form-auto cbValidation">' . ($pageTitle ? '<div class="blogsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null);
     if ($cbModerator || !$plugin->params->get('blog_approval', 0)) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="published" class="col-sm-3 control-label">' . CBTxt::Th('Published') . '</label>' . '<div class="cb_field col-sm-9">' . $input['published'] . getFieldIcons(1, 0, null, CBTxt::T('Select publish status of the blog. Unpublished blogs will not be visible to the public.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_category_config', 1) || $cbModerator) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="category" class="col-sm-3 control-label">' . CBTxt::Th('Category') . '</label>' . '<div class="cb_field col-sm-9">' . $input['category'] . getFieldIcons(1, 0, null, CBTxt::T('Select blog category. Select the category that best describes your blog.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_access_config', 1) || $cbModerator) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="access" class="col-sm-3 control-label">' . CBTxt::Th('Access') . '</label>' . '<div class="cb_field col-sm-9">' . $input['access'] . getFieldIcons(1, 0, null, CBTxt::T('Select access to blog; all groups above that level will also have access to the blog.')) . '</div>' . '</div>';
     }
     $return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="title" class="col-sm-3 control-label">' . CBTxt::Th('Title') . '</label>' . '<div class="cb_field col-sm-9">' . $input['title'] . getFieldIcons(1, 1, null, CBTxt::T('Input blog title. This is the title that will distinguish this blog from others. Suggested to input something unique and intuitive.')) . '</div>' . '</div>';
     if (in_array($blogMode, array(1, 2))) {
         $return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_intro" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Intro') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_intro'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog intro contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
     }
     if (in_array($blogMode, array(1, 3))) {
         $return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_full" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Full') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_full'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
     }
     if ($cbModerator) {
         $return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="user" class="col-sm-3 control-label">' . CBTxt::T('Owner') . '</label>' . '<div class="cb_field col-sm-9">' . $input['user'] . getFieldIcons(1, 1, null, CBTxt::T('Input owner of blog as single integer user_id.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_captcha', 0) && !$cbModerator) {
         $_PLUGINS->loadPluginGroup('user');
         $captcha = $_PLUGINS->trigger('onGetCaptchaHtmlElements', array(false));
         if (!empty($captcha)) {
             $captcha = $captcha[0];
             $return .= '<div class="form-group cb_form_line clearfix">' . '<label class="col-sm-3 control-label">' . CBTxt::Th('Captcha') . '</label>' . '<div class="cb_field col-sm-9">' . (isset($captcha[0]) ? $captcha[0] : null) . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<div class="cb_field col-sm-offset-3 col-sm-9">' . str_replace('inputbox', 'form-control', isset($captcha[1]) ? $captcha[1] : null) . getFieldIcons(1, 1, null) . '</div>' . '</div>';
         }
     }
     $return .= '<div class="form-group cb_form_line clearfix">' . '<div class="col-sm-offset-3 col-sm-9">' . '<input type="submit" value="' . htmlspecialchars($row->get('id') ? CBTxt::T('Update Blog') : CBTxt::T('Create Blog')) . '" class="blogsButton blogsButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;' . ' <input type="button" value="' . htmlspecialchars(CBTxt::T('Cancel')) . '" class="blogsButton blogsButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes(CBTxt::T('Are you sure you want to cancel? All unsaved data will be lost!')) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), false, 'cbblogsTab') . '\'; }" />' . '</div>' . '</div>' . cbGetSpoofInputTag('plugin') . '</form>' . '</div>';
     echo $return;
 }
Пример #2
0
	/**
	 * @param int             $userId
	 * @param UserTable       $user
	 * @param cbPluginHandler $plugin
	 */
	static public function showDisable( $userId, $user, $plugin )
	{
		global $_CB_framework;

		cbValidator::loadValidation();

		$profileUrl		=	$_CB_framework->userProfileUrl( $user->get( 'id' ) );
		$pageTitle		=	CBTxt::T( 'Disable My Account' );

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $profileUrl );

		initToolTip();

		$tooltip		=	cbTooltip( null, CBTxt::T( 'Optionally input a reason for disabling your account.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$return			=	'<div class="privacyDisableAccount">'
						.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'privacy', 'func' => 'disableuser', 'id' => (int) $userId ) ) . '" method="post" enctype="multipart/form-data" name="privacyForm" id="privacyForm" class="cb_form privacyForm form-auto cbValidation">'
						.			( $pageTitle ? '<div class="privacyTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
						.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
						.				'<label for="reason" class="col-sm-3 control-label">' . CBTxt::T( 'Reason' ) . '</label>'
						.				'<div class="cb_field col-sm-9">'
						.					'<textarea id="reason" name="reason" class="form-control" cols="40" rows="5"' . ( $tooltip ? ' ' . $tooltip : null ) . '></textarea>'
						.					getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input a reason for disabling your account.' ) )
						.				'</div>'
						.			'</div>'
						.			'<div class="form-group cb_form_line clearfix">'
						.				'<div class="col-sm-offset-3 col-sm-9">'
						.					'<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Disable Account' ) ) . '" class="privacyButton privacyButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;'
						.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="privacyButton privacyButtonCancel btn btn-default" onclick="location.href = \'' . $profileUrl . '\';" />'
						.				'</div>'
						.			'</div>'
						.			cbGetSpoofInputTag( 'plugin' )
						.		'</form>'
						.	'</div>';

		echo $return;
	}
Пример #3
0
 /**
  * Outputs legacy user edit display
  *
  * @deprecated 2.0
  *
  * @param UserTable  $user
  * @param string     $option
  * @param int        $newCBuser
  * @param array      $postdata
  */
 public function edituser($user, $option, $newCBuser, &$postdata)
 {
     global $_CB_framework, $_CB_Backend_Title, $_PLUGINS;
     $results = $_PLUGINS->trigger('onBeforeUserProfileEditDisplay', array(&$user, 2));
     if ($_PLUGINS->is_errors()) {
         cbRedirect($_CB_framework->backendViewUrl('showusers'), $_PLUGINS->getErrorMSG(), 'error');
     }
     _CBsecureAboveForm('edituser');
     cbimport('cb.validator');
     outputCbTemplate(2);
     initToolTip(2);
     outputCbJs(2);
     $tabs = new cbTabs($_CB_framework->getUi() == 2 && !isset($_REQUEST['tab']) ? 1 : 0, 2);
     // use cookies in backend to remember selected tab.
     $tabcontent = $tabs->getEditTabs($user, $postdata, 'htmledit', 'divs');
     $_CB_Backend_Title = array(0 => array('fa fa-user', $user->id ? CBTxt::T('COMMUNITY_BUILDER_EDIT_USER_USERNAME', 'Community Builder: Edit User [[username]]', array('[username]' => $user->username)) : CBTxt::T('Community Builder: New User')));
     cbValidator::loadValidation();
     if (is_array($results)) {
         echo implode('', $results);
     }
     $return = '<form action="' . $_CB_framework->backendUrl('index.php') . '" method="post" name="adminForm" id="cbcheckedadminForm" enctype="multipart/form-data" autocomplete="off" class="cb_form form-auto cbValidation">' . $tabcontent . '<input type="hidden" name="id" value="' . (int) $user->id . '" />' . '<input type="hidden" name="newCBuser" value="' . (int) $newCBuser . '" />' . '<input type="hidden" name="option" value="com_comprofiler" />' . '<input type="hidden" name="view" value="save" />' . cbGetSpoofInputTag('user') . '<div class="cbIconsBottom">' . getFieldIcons(2, true, true, '', '', true) . '</div>' . '</form>';
     echo $return;
 }
Пример #4
0
	/**
	 * render frontend group users
	 *
	 * @param CB\Plugin\GroupJive\Table\UserTable[] $rows
	 * @param cbPageNav                             $pageNav
	 * @param bool                                  $searching
	 * @param array                                 $input
	 * @param GroupTable                            $group
	 * @param UserTable                             $user
	 * @param CBplug_cbgroupjive                    $plugin
	 * @return string
	 */
	static function showUsers( $rows, $pageNav, $searching, $input, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		initToolTip();

		$isModerator					=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$isOwner						=	( $user->get( 'id' ) == $group->get( 'user_id' ) );
		$userStatus						=	CBGroupJive::getGroupStatus( $user, $group );
		$canSearch						=	( $plugin->params->get( 'groups_users_search', 0 ) && ( $searching || $pageNav->total ) );
		$return							=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayUsers', array( &$return, &$rows, $group, $user ) );

		$return							.=	'<div class="gjGroupUsers">'
										.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '" method="post" name="gjGroupUsersForm" id="gjGroupUsersForm" class="gjGroupUsersForm">';

		if ( $canSearch ) {
			$return						.=			'<div class="gjHeader gjGroupUsersHeader row">'
										.				'<div class="col-sm-offset-8 col-sm-4 text-right">'
										.					'<div class="input-group">'
										.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
										.						$input['search']
										.					'</div>'
										.				'</div>'
										.			'</div>';
		}

		$return							.=			'<div class="gjGroupUsersRows">';

		if ( $rows ) foreach ( $rows as $row ) {
			$canModerate				=	( ( $userStatus >= 2 ) && ( $userStatus > $row->get( 'status' ) ) && ( $user->get( 'id' ) != $row->get( 'user_id' ) ) );

			$counters					=	array();
			$content					=	null;
			$menu						=	array();

			$_PLUGINS->trigger( 'gj_onDisplayUser', array( &$row, &$counters, &$content, &$menu, $group, $user ) );

			$cbUser						=	CBuser::getInstance( (int) $row->get( 'user_id' ), false );

			switch ( (int) $row->get( 'status' ) ) {
				case -1:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-ban text-danger"></span> ';
					break;
				case 0:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-warning text-warning"></span> ';
					break;
				case 1:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-user"></span> ';
					break;
				case 2:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-gavel text-success"></span> ';
					break;
				case 3:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-gavel text-success"></span> ';
					break;
				case 4:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-star text-primary"></span> ';
					break;
				default:
					$icon				=	'<span class="gjGroupUserStatusIcon fa fa-question text-warning"></span> ';
					break;
			}

			$return						.=				'<div class="gjGroupUsersUser gjContainerBox img-thumbnail">'
										.					'<div class="gjContainerBoxHeader">'
										.						'<div class="gjContainerBoxCanvas text-left">'
										.							$cbUser->getField( 'canvas', null, 'html', 'none', 'profile', 0, true )
										.						'</div>'
										.						'<div class="gjContainerBoxLogo text-left">'
										.							$cbUser->getField( 'avatar', null, 'html', 'none', 'list', 0, true )
										.						'</div>'
										.					'</div>'
										.					'<div class="gjContainerBoxBody text-left">'
										.						'<div class="gjContainerBoxTitle">'
										.							$cbUser->getField( 'onlinestatus', null, 'html', 'none', 'list', 0, true, array( '_imgMode' => 1 ) )
										.							' <strong>' . $cbUser->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) . '</strong>'
										.						'</div>'
										.						'<div class="gjContainerBoxCounters text-muted small row">'
										.							( $isModerator || $isOwner || $canModerate || ( $row->get( 'status' ) != 1 ) ? '<div class="gjContainerBoxCounter col-sm-6">' . $icon . $row->status() . '</div>' : null )
										.							( $counters ? '<div class="gjContainerBoxCounter col-sm-6">' . implode( '</div><div class="gjContainerBoxCounter col-sm-6">', $counters ) . '</div>' : null )
										.						'</div>'
										.						( $content ? '<div class="gjContainerBoxContent">' . $content . '</div>' : null );

			if ( ( $isModerator || $isOwner || $canModerate ) && ( $row->get( 'status' ) == 0 ) && ( $group->get( 'type' ) == 2 ) ) {
				$return					.=						'<div class="gjContainerBoxButton text-right">'
										.							'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'users', 'func' => 'active', 'id' => (int) $row->get( 'id' ) ) ) . '\';" class="gjButton gjButtonApprove btn btn-xs btn-success">' . CBTxt::T( 'Approve' ) . '</button>'
										.						'</div>';
			}

			$return						.=					'</div>';

			if ( ( $row->get( 'status' ) != 4 ) && ( $isModerator || $isOwner || $canModerate || $menu ) ) {
				$menuItems				=	'<ul class="gjUserMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">';

				if ( $isModerator || $isOwner ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to promote this user to Owner?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'owner', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-thumbs-o-up"></span> ' . CBTxt::T( 'Promote to Owner' ) . '</a></li>';
				}

				if ( ( $row->get( 'status' ) <= 2 ) && ( $isModerator || $isOwner ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to promote this user to Admin?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'admin', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-thumbs-o-up"></span> ' . CBTxt::T( 'Promote to Admin' ) . '</a></li>';
				}

				if ( ( $row->get( 'status' ) <= 1 ) && ( $isModerator || $isOwner || ( $canModerate && ( $userStatus >= 3 ) ) ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to promote this user to Moderator?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'moderator', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-thumbs-o-up"></span> ' . CBTxt::T( 'Promote to Moderator' ) . '</a></li>';
				}

				if ( ( $row->get( 'status' ) <= 0 ) && ( $isModerator || $isOwner || ( $canModerate && ( $userStatus >= 2 ) ) ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'users', 'func' => 'active', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-thumbs-o-up"></span> ' . ( ( $row->get( 'status' ) == 0 ) && ( $group->get( 'type' ) == 2 ) ? CBTxt::T( 'Approve' ) : CBTxt::T( 'Promote to Active' ) ) . '</a></li>';
				}

				if ( ( $row->get( 'status' ) >= 3 ) && ( $isModerator || $isOwner ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to demote this user to Moderator?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'moderator', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-thumbs-o-down"></span> ' . CBTxt::T( 'Demote to Moderator' ) . '</a></li>';
				}

				if ( ( $row->get( 'status' ) >= 2 ) && ( $isModerator || $isOwner || ( $canModerate && ( $userStatus >= 3 ) ) ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to demote this user to Active?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'active', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-thumbs-o-down"></span> ' . CBTxt::T( 'Demote to Active' ) . '</a></li>';
				}

				if ( ( $row->get( 'status' ) >= 0 ) && ( $isModerator || $isOwner || ( $canModerate && ( $userStatus >= 2 ) ) ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to ban this User?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'ban', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-ban"></span> ' . CBTxt::T( 'Ban' ) . '</a></li>';
				}

				if ( $menu ) {
					$menuItems			.=		'<li class="gjUserMenuItems">' . implode( '</li><li class="gjGroupMenuItem">', $menu ) . '</li>';
				}

				if ( $isModerator || $isOwner || ( $canModerate && ( $userStatus >= 3 ) ) ) {
					$menuItems			.=		'<li class="gjUserMenuItems"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to delete this User?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'users', 'func' => 'delete', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-trash-o"></span> ' . ( ( $row->get( 'status' ) == 0 ) && ( $group->get( 'type' ) == 2 ) ? CBTxt::T( 'Reject' ) : CBTxt::T( 'Delete' ) ) . '</a></li>';
				}

				$menuItems				.=	'</ul>';

				$menuAttr				=	cbTooltip( 1, $menuItems, null, 'auto', null, null, null, 'class="btn btn-default btn-xs" data-cbtooltip-menu="true" data-cbtooltip-classes="qtip-nostyle"' );

				$return					.=					'<div class="gjContainerBoxMenu">'
										.						'<div class="gjUserMenu btn-group">'
										.							'<button type="button" ' . trim( $menuAttr ) . '><span class="fa fa-cog"></span> <span class="fa fa-caret-down"></span></button>'
										.						'</div>'
										.					'</div>';
			}

			$return						.=				'</div>';
		} else {
			if ( $searching ) {
				$return					.=				CBTxt::T( 'No group user search results found.' );
			} else {
				$return					.=				CBTxt::T( 'This group currently has no users.' );
			}
		}

		$return							.=			'</div>';

		if ( $plugin->params->get( 'groups_users_paging', 1 ) && ( $pageNav->total > $pageNav->limit ) ) {
			$return						.=			'<div class="gjGroupUsersPaging text-center">'
										.				$pageNav->getListLinks()
										.			'</div>';
		}

		$return							.=			$pageNav->getLimitBox( false )
										.		'</form>'
										.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayUsers', array( &$return, &$rows, $group, $user ) );

		return $return;
	}
Пример #5
0
	/**
	 * render frontend event edit
	 *
	 * @param EventTable               $row
	 * @param array                    $input
	 * @param GroupTable               $group
	 * @param UserTable                $user
	 * @param CBplug_cbgroupjiveevents $plugin
	 * @return string
	 */
	static function showEventEdit( $row, $input, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$pageTitle					=	( $row->get( 'id' ) ? CBTxt::T( 'Edit Event' ) : CBTxt::T( 'New Event' ) );

		$_CB_framework->setPageTitle( $pageTitle );

		cbValidator::loadValidation();
		initToolTip();

		$isModerator				=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$canModerate				=	( CBGroupJive::getGroupStatus( $user, $group ) >= 2 );
		$return						=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayEventEdit', array( &$return, &$row, &$input, $group, $user ) );

		$return						.=	'<div class="gjEventEdit">'
									.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'events', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjEventEditForm" id="gjEventEditForm" class="cb_form gjEventEditForm form-auto cbValidation">'
									.			( $pageTitle ? '<div class="gjEventEditTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null );

		if ( $isModerator || $canModerate || ( $row->get( 'id' ) && ( $row->get( 'published' ) != -1 ) ) || ( $group->params()->get( 'events', 1 ) != 2 ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="published" class="col-sm-3 control-label">' . CBTxt::T( 'Published' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['published']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Select publish state of this event. Unpublished events will not be visible to the public.' ) )
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="title" class="col-sm-3 control-label">' . CBTxt::T( 'Title' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['title']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the event title. This is the title that will distinguish this event from others. Suggested to input something to uniquely identify your event.' ) )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
									.				'<label for="event" class="col-sm-3 control-label">' . CBTxt::T( 'Event' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['event']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input a detailed description about this event.' ) )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="location" class="col-sm-3 control-label">' . CBTxt::T( 'Location' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['location']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the location for this event (e.g. My House, The Park, Restaurant Name, etc..).' ) )
									.				'</div>'
									.			'</div>';

		if ( $plugin->params->get( 'groups_events_address', 1 ) ) {
			$js						=	"$( '.gjButtonLocation' ).on( 'click', function() {"
									.		"if ( typeof navigator.geolocation == 'undefined' ) {"
									.			"return null;"
									.		"}"
									.		"var input = $( this ).siblings( 'input' );"
									.		"navigator.geolocation.getCurrentPosition( function( position ) {"
									.			"input.val( position.coords.latitude + ',' + position.coords.longitude );"
									.		"});"
									.	"});";

			$_CB_framework->outputCbJQuery( $js );

			$return					.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="address" class="col-sm-3 control-label">' . CBTxt::T( 'Address' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					'<span class="gjEventEditAddress">'
									.						$input['address']
									.						'<button type="button" class="gjButton gjButtonLocation btn btn-default"><span class="fa fa-map-marker"></span></button>'
									.					'</span>'
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally input the address for this event or click the map button to attempt to find your current location.' ) )
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="cbft_datetime cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="start" class="col-sm-3 control-label">' . CBTxt::T( 'Start Date' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['start']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Select the date and time this event starts.' ) )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_datetime cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="end" class="col-sm-3 control-label">' . CBTxt::T( 'End Date' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['end']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally select the end date and time for this event.' ) )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="limit" class="col-sm-3 control-label">' . CBTxt::T( 'Guest Limit' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['limit']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally input a guest limit for this event.' ) )
									.				'</div>'
									.			'</div>';

		if ( $isModerator ) {
			$return					.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['user_id']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the event owner id. Event owner determines the creator of the event specified as User ID.' ) )
									.				'</div>'
									.			'</div>';
		}

		if ( ( ! $isModerator ) && $plugin->params->get( 'groups_events_captcha', 0 ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha				=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha			=	$captcha[0];

				$return				.=			'<div class="form-group cb_form_line clearfix">'
									.				'<label class="col-sm-3 control-label">' . CBTxt::T( 'Captcha' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					( isset( $captcha[0] ) ? $captcha[0] : null )
									.				'</div>'
									.			'</div>'
									.			'<div class="form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
									.					getFieldIcons( null, 1, null )
									.				'</div>'
									.			'</div>';
			}
		}

		$return						.=			'<div class="form-group cb_form_line clearfix cbtwolines">'
									.				'<div class="col-sm-offset-3 col-sm-9">'
									.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Event' ) : CBTxt::T( 'Schedule Event' ) ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" ' . cbValidator::getSubmitBtnHtmlAttributes() . ' />'
									.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '\'; })" />'
									.				'</div>'
									.			'</div>'
									.			( ! $row->get( 'id' ) ? '<input type="hidden" id="group" name="group" value="' . (int) $group->get( 'id' ) . '" />' : null )
									.			cbGetSpoofInputTag( 'plugin' )
									.		'</form>'
									.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayEventEdit', array( &$return, $row, $input, $group, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #6
0
	function editfield( &$row, $lists, $fieldvalues, $option, $paramsEditorHtml ) {
		global $_CB_framework, $_CB_database;

		_CBsecureAboveForm('editfield');
		outputCbTemplate( 2 );
		outputCbJs( 2 );
		initToolTip( 2 );

		global $_CB_Backend_Title;
		$_CB_Backend_Title	=	array( 0 => array( 'cbicon-48-fields', CBTxt::T('Community Builder Field') . ': <small>' . ( $row->fieldid ? CBTxt::T('Edit') . ' [ ' . htmlspecialchars( getLangDefinition( $row->title ) ) . ' ] ' : CBTxt::T('New') ) . '</small>' ) );

		if ( $row->fieldid && ( ! $row->published ) ) {
			echo '<div class="cbWarning">' . CBTxt::T('Field is not published') . '</div>' . "\n";
		}
		if ( $row->pluginid ) {
			$plugin		=	new moscomprofilerPlugin( $_CB_database );
			if ( ! $plugin->load( (int) $row->pluginid ) ) {
				echo '<div class="cbWarning">' . CBTxt::T('Plugin is not installed') . '</div>' . "\n";
			} else {
				if ( ! $plugin->published ) {
					echo '<div class="cbWarning">' . CBTxt::T('Plugin is not published') . '</div>' . "\n";
				}
			}
		}

//		$_CB_framework->outputCbJQuery( "var cbTypeState = $('#type').val();	$('#type').change(function() { if ( cbTypeState != $('#type').val() ) submitbutton('reloadField') } ).change();" );
//		outputCbJs( 2 );
	if($row->fieldid > 0) {
		$_CB_framework->outputCbJQuery( 'document.adminForm.name.readOnly=true; document.adminForm.name.disabled=true; document.adminForm.type.disabled=true;');
	}
//		disableAll();
//		selType('".$row->type."');

	$editorSave_description		=	$_CB_framework->saveCmsEditorJS( 'description' );
	$editorSave_default			=	$_CB_framework->saveCmsEditorJS( 'default' );
		ob_start();
?>
   function submitbutton(pressbutton) {
     if ( (pressbutton == 'showField') || (pressbutton == 'reloadField') ) {
       document.adminForm.type.disabled=false;
       <?php echo $editorSave_description;
			if ( $row->type == 'editorta' ) {
				echo $editorSave_default;
			}
       ?>
       submitform(pressbutton);
       return;
     }
     var coll = document.adminForm;
     var errorMSG = '';
     var iserror=0;
     if (coll != null) {
       var elements = coll.elements;
       // loop through all input elements in form
       for (var i=0; i < elements.length; i++) {
         // check if element is mandatory; here mosReq=1
         if ( (typeof(elements.item(i).getAttribute('mosReq')) != "undefined") && (elements.item(i).getAttribute('mosReq') == 1) ) {
           if (elements.item(i).value == '') {
             //alert(elements.item(i).getAttribute('mosLabel') + ':' + elements.item(i).getAttribute('mosReq'));
             // add up all error messages
             errorMSG += elements.item(i).getAttribute('mosLabel') + ' : <?php echo _UE_REQUIRED_ERROR; ?>\n';
             // notify user by changing background color, in this case to red
             elements.item(i).style.backgroundColor = "red";
             iserror=1;
           }
         }
       }
     }
     if(iserror==1) {
       alert(errorMSG);
     } else {
       document.adminForm.type.disabled=false;
       <?php echo $editorSave_description;
			if ( $row->type == 'editorta' ) {
				echo $editorSave_default;
			}
       ?>
       submitform(pressbutton);
     }
   }
<?php
		$jsTop		=	ob_get_contents();
		ob_end_clean();
		$_CB_framework->document->addHeadScriptDeclaration( $jsTop );
		ob_start();
?>
	function insertRow() {
		// Create and insert rows and cells into the first body.
//		var i = $('#adminForm input[name=valueCount]').val( Number( $('#adminForm input[name=valueCount]').val() ) + 1 ).val();
//		$('#fieldValuesBody').append('<tr><td><input id=\"vNames'+i+'\" name=\"vNames[' + i + ']\" /></td></tr>');
		var i = $('#adminForm input[name=valueCount]').val( Number( $('#adminForm input[name=valueCount]').val() ) + 1 ).val();
		$('#fieldValuesList').append('<li><input id=\"vNames'+i+'\" name=\"vNames[]\" /></li>');
		$('#vNames'+i).hide().slideDown('medium').focus();
	}

	function disableAll() {
		$('#divValues,#divColsRows,#divWeb,#divText').hide().css('visibility','visible');
		$('#vNames0').attr('mosReq','0');
	}

	function selType(sType) {
		var elem;
		//alert(sType);
		disableAll();
		switch (sType) {
			case 'editorta':
			case 'textarea':
				$('#divText,#divColsRows').show();
				break;

			case 'emailaddress':
			case 'password':
			case 'text':
			case 'integer':
			case 'predefined':
				$('#divText').show();
				break;

			case 'select':
			case 'multiselect':
				$('#divValues').show();
				$('#vNames0').attr('mosReq','1');
				break;

			case 'radio':
			case 'multicheckbox':
				$('#divValues,#divColsRows').show();
				$('#vNames0').attr('mosReq','1');
				break;

			case 'webaddress':
				$('#divText,#divWeb').show();
				break;

			case 'delimiter':
			default:
		}
	}

  function prep4SQL(o){
	if(o.value!='') {
		var cbsqloldvalue, cbsqlnewvalue;
		o.value=o.value.replace('cb_','');
		cbsqloldvalue = o.value;
		o.value=o.value.replace(/[^a-zA-Z0-9]+/g,'');
		cbsqlnewvalue = o.value;
		o.value='cb_' + o.value;
		if (cbsqloldvalue != cbsqlnewvalue) {
			alert('<?php echo addslashes( CBTxt::T('Warning: SQL name of field has been changed to fit SQL constraints') ); ?>');
		}
	}
  }
  var cbTypeState = $('#type').val();	$('#type').change(function() { selType(this.options[this.selectedIndex].value); if ( cbTypeState != $('#type').val() ) submitbutton('reloadField') } ).change();
  $('#name').change(function() { if ( ! $('#name').attr('disabled') ) { prep4SQL(this); } } ).change();
  $('#insertrow').click(function() { insertRow(); } );
  $('#fieldValuesList').sortable( { items: 'li', containment: 'parent', animated: true, placeholder: 'fieldValuesList-selected' } );
//  $('#mainparams').sortable( { items: 'tr', containment: 'parent', animated: true } );
  /* $('#adminForm').submit(function() { return submitbutton(''); } );	*/
  disableAll();
  selType('<?php echo $row->type; ?>');
<?php
$jsContent	=	ob_get_contents();
ob_end_clean();

		$_CB_framework->outputCbJQuery( $jsContent, 'ui-all' );
?>
<form action="<?php echo $_CB_framework->backendUrl( 'index.php?option=com_comprofiler&task=saveField' ); ?>" method="POST" id="adminForm" name="adminForm">
<?php
		if ( $paramsEditorHtml ) {
?>
  <table cellspacing="0" cellpadding="0" width="100%">
   <tr valign="top">
    <td width="60%" valign="top">
<?php
		}
?>

	<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform" id="mainparams">
		<tr>
			<td width="20%"><?php echo CBTxt::T('Type'); ?>:</td>
			<td width="20%"><?php echo $lists['type']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Tab'); ?>:</td>
			<td width="20%"><?php echo $lists['tabs']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Name'); ?>:</td>
			<td align=left  width="20%"><input type="text" id="name" name="name" maxlength='64' mosReq="1" mosLabel="<?php echo htmlspecialchars( CBTxt::T('Name') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->name ); ?>" /></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Title'); ?>:</td>
			<td width="20%" align=left><input type="text" name="title" mosReq="1" mosLabel="<?php echo htmlspecialchars( CBTxt::T('Title') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->title ); ?>" /></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="3"><?php echo CBTxt::T('Description/"i" field-tip: text or HTML'); ?>:</td>
		</tr>
		<tr>
			<td colspan="3" align=left><?php echo $_CB_framework->displayCmsEditor( 'description', $row->description, 600 /* ( $row->type == 'delimiter' ? 600 : 286 ) */ , 200, 50, 7 );
			// <textarea name="description" cols="40" rows="6" maxlength='255' mosReq="0" mosLabel="Description" class="inputbox">< ?php echo htmlspecialchars( $row->description ); ? ></textarea>
			?></td>
		</tr>
<?php
		if ( $row->type != 'delimiter' ) { ?>

		<tr>
<?php		if ( $row->type == 'editorta' ) {	?>
			<td colspan="3"><?php echo CBTxt::T('Pre-filled default value at registration only'); ?>:</td>
		</tr>
		<tr>
			<td colspan="3"><?php
				echo $_CB_framework->displayCmsEditor( 'cb_default', $row->default, 600, 200, 50, 7 );
			?></td>
<?php
			} else {
				?>
			<td width="20%"><?php echo CBTxt::T('Pre-filled default value at registration only'); ?>:</td>
			<td width="20%">
				<input type="text" name="cb_default" mosLabel="<?php echo htmlspecialchars( CBTxt::T('Default value') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->default ); ?>" />
			</td>
			<td>&nbsp;</td><?php
			}
			?>
		</tr>
<?php
		}
?>

		<tr>
			<td width="20%"><?php echo CBTxt::T('Required'); ?>?:</td>
			<td width="20%"><?php echo $lists['required']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Show on Profile'); ?>?:</td>
			<td width="20%"><?php echo $lists['profile']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Display field title in Profile'); ?>?:</td>
			<td width="20%"><?php echo $lists['displaytitle']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Searchable in users-lists'); ?>?:</td>
			<td width="20%"><?php echo $lists['searchable']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('User Read Only'); ?>?:</td>
			<td width="20%"><?php echo $lists['readonly']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Show at Registration'); ?>?:</td>
			<td width="20%"><?php echo $lists['registration']; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Published'); ?>:</td>
			<td width="20%"><?php echo ( $row->sys == 1 ? ( $row->published ? _UE_YES : _UE_NO ) . ' (' . CBTxt::T('System-fields cannot be published/unpublished here.') . ( in_array( $row->name, array( 'name', 'firstname', 'middlename', 'lastname' ) ) ? ' ' . CBTxt::T('Name-fields publishing depends on your setting in global CB config.') . ')' : ')' ) : $lists['published'] ); ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Size'); ?>:</td>
			<td width="20%"><input type="text" name="size" mosLabel="<?php echo htmlspecialchars( CBTxt::T('Size') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->size ); ?>" /></td>
			<td>&nbsp;</td>
		</tr>
	</table>
	<div id="page1"  class="pagetext">

	</div>
	<div id="divText"  class="pagetext">
		<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo CBTxt::T('Max Length'); ?>:</td>
			<td width="20%"><input type="text" name="maxlength" mosLabel="<?php echo htmlspecialchars( CBTxt::T('Max Length') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->maxlength ); ?>" /></td>
			<td>&nbsp;</td>
		</tr>
		</table>
	</div>
	<div id="divColsRows"  class="pagetext">
		<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo CBTxt::T('Cols'); ?>:</td>
			<td width="20%"><input type="text" name="cols" mosLabel="<?php echo htmlspecialchars( CBTxt::T('Cols') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->cols ); ?>" /></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="20%"><?php echo CBTxt::T('Rows'); ?>:</td>
			<td width="20%"><input type="text" name="rows"  mosLabel="<?php echo htmlspecialchars( CBTxt::T('Rows') ); ?>" class="inputbox" value="<?php echo htmlspecialchars( $row->rows ); ?>" /></td>
			<td>&nbsp;</td>
		</tr>
		</table>
	</div>
	<div id="divWeb"  class="pagetext">
		<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo CBTxt::T('Type'); ?>:</td>
			<td width="20%"><?php echo $lists['webaddresstypes']; ?></td>
			<td>&nbsp;</td>
		</tr>
		</table>
	</div>
	<div id="divValues" style="text-align:left;">
		<?php echo CBTxt::T('Use the table below to add new values.'); ?><br />
		<input type=button id="insertrow" value="<?php echo htmlspecialchars( CBTxt::T('Add a Value') ); ?>" />
		<table align="left" id="divFieldValues" cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform" >
		<thead>
		<tr>
			<th width="20%"><?php echo CBTxt::T('Name'); ?></th>
		</tr>
		</thead>
		<tbody id="fieldValuesBody">
		<tr>
			<td>
				<ul id="fieldValuesList">
	<?php
		//echo "count:".count( $fieldvalues );
		//print_r (array_values($fieldvalues));
		for ($i=0, $n=count( $fieldvalues ); $i < $n; $i++) {
			//print "count:".$i;
			$fieldvalue = $fieldvalues[$i];
			if ($i==0) $req =1;
			else $req = 0;
			echo "\n<li><input type='text' mosReq='$req'  mosLabel='" . htmlspecialchars( CBTxt::T('Value') ) . "' value=\"" . htmlspecialchars( $fieldvalue->fieldtitle ) . "\" name=\"vNames[]\" id=\"vNames".$i."\" /></li>\n";
		}
		if(count( $fieldvalues )< 1) {
			echo "\n<li><input type='text' mosReq='0'  mosLabel='" . htmlspecialchars( CBTxt::T('Value') ) . "' value='' name='vNames[]' /></li>\n";
			$i=0;
		}
	?>
				</ul>
			</td>
		</tr>
		</tbody>
	  </table>
	</div>
<?php
/*
		//echo "count:".count( $fieldvalues );
		//print_r (array_values($fieldvalues));
		for ($i=0, $n=count( $fieldvalues ); $i < $n; $i++) {
			//print "count:".$i;
			$fieldvalue = $fieldvalues[$i];
			if ($i==0) $req =1;
			else $req = 0;
			echo "<tr>\n<td width=\"20%\"><input type='text' mosReq='$req'  mosLabel='" . htmlspecialchars( CBTxt::T('Value') ) . "' value=\"" . htmlspecialchars( $fieldvalue->fieldtitle ) . "\" name=\"vNames[".$i."]\" id=\"vNames".$i."\" /></td></tr>\n";
		}
		if(count( $fieldvalues )< 1) {
			echo "<tr>\n<td width=\"20%\"><input type='text' mosReq='0'  mosLabel='" . htmlspecialchars( CBTxt::T('Value') ) . "' value='' name=vNames[0] /></td></tr>\n";
			$i=0;
		}
	?>
		</tbody>
		</table>
	</div>
<?php
*/
		if ( $paramsEditorHtml ) {
?>
    </td>
    <td width="40%" valign="top">
<?php
			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>
<?php
		}
?>
  <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
		<tr>
			<td colspan="3">&nbsp;</td>
		</tr>

  </table>
  <input type="hidden" name="valueCount" value=<?php echo $i; ?> />
  <input type="hidden" name="oldtabid" value="<?php echo htmlspecialchars( $row->tabid ); ?>" />
  <input type="hidden" name="fieldid" value="<?php echo (int) $row->fieldid; ?>" />
  <input type="hidden" name="ordering" value="<?php echo htmlspecialchars( $row->ordering ); ?>" />
  <input type="hidden" name="option" value="<?php echo $option; ?>" />
  <input type="hidden" name="task" value="" />
  <?php
	echo cbGetSpoofInputTag( 'field' );
  ?>
</form>
<?php
	}
Пример #7
0
	/**
	 * render frontend group edit
	 *
	 * @param GroupTable         $row
	 * @param array              $input
	 * @param CategoryTable      $category
	 * @param UserTable          $user
	 * @param CBplug_cbgroupjive $plugin
	 * @return string
	 */
	static function showGroupEdit( $row, $input, $category, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		cbValidator::loadValidation();
		initToolTip();

		$js							=	"$( '#canvas_method' ).on( 'change', function() {"
									.		"if ( $( this ).val() == 1 ) {"
									.			"$( '#gjCanvasUpload' ).removeClass( 'hidden' ).find( 'input' ).removeClass( 'cbValidationDisabled' );"
									.		"} else {"
									.			"$( '#gjCanvasUpload' ).addClass( 'hidden' ).find( 'input' ).addClass( 'cbValidationDisabled' ).val( '' );"
									.		"}"
									.	"}).change();"
									.	"$( '#logo_method' ).on( 'change', function() {"
									.		"if ( $( this ).val() == 1 ) {"
									.			"$( '#gjLogoUpload' ).removeClass( 'hidden' ).find( 'input' ).removeClass( 'cbValidationDisabled' );"
									.		"} else {"
									.			"$( '#gjLogoUpload' ).addClass( 'hidden' ).find( 'input' ).addClass( 'cbValidationDisabled' ).val( '' );"
									.		"}"
									.	"}).change();";

		$_CB_framework->outputCbJQuery( $js );

		$isModerator				=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$returnUrl					=	CBGroupJive::getReturn( true, true );
		$return						=	null;

		$integrations				=	$_PLUGINS->trigger( 'gj_onBeforeDisplayGroupEdit', array( &$return, &$row, &$input, $category, $user ) );

		if ( $row->get( 'id' ) ) {
			$pageTitle				=	CBTxt::T( 'Edit Group' );

			if ( ! $returnUrl ) {
				$returnUrl			=	$_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $row->get( 'id' ) ) );
			}
		} else {
			$pageTitle				=	CBTxt::T( 'New Group' );

			if ( ! $returnUrl ) {
				$returnUrl			=	$_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'categories', 'func' => 'show', 'id' => (int) $category->get( 'id' ) ) );
			}
		}

		$_CB_framework->setPageTitle( $pageTitle );

		$return						.=	'<div class="gjGroupEdit">'
									.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'save', 'id' => (int) $row->get( 'id' ), 'return' => CBGroupJive::getReturn( true ) ) ) . '" method="post" enctype="multipart/form-data" name="gjGroupEditForm" id="gjGroupEditForm" class="cb_form gjGroupEditForm form-auto cbValidation">'
									.			( $pageTitle ? '<div class="gjGroupEditTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null );

		if ( $isModerator || ( $row->get( 'id' ) && ( $row->get( 'published' ) != -1 ) ) || ( ! $plugin->params->get( 'groups_create_approval', 0 ) ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="published" class="col-sm-3 control-label">' . CBTxt::T( 'Published' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['published']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Select publish state of this group. Unpublished groups will not be visible to the public.' ) )
									.				'</div>'
									.			'</div>';
		}

		if ( $input['category'] ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="category" class="col-sm-3 control-label">' . CBTxt::T( 'Category' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['category']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Select the group category. This is the category a group will belong to and decide its navigation path.' ) )
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="type" class="col-sm-3 control-label">' . CBTxt::T( 'Type' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['type']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Select the group type. Type determines the way your group is joined (e.g. Invite requires new users to be invited to join your group).' ) )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="name" class="col-sm-3 control-label">' . CBTxt::T( 'Name' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['name']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the group name. This is the name that will distinguish this group from others. Suggested to input something unique and intuitive.' ) )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
									.				'<label for="description" class="col-sm-3 control-label">' . CBTxt::T( 'Description' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['description']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally input the group description. The group description should be short and to the point; describing what your group is all about.' ) )
									.				'</div>'
									.			'</div>';

		if ( $row->get( 'canvas' ) ) {
			$return					.=			'<div class="cbft_delimiter form-group cb_form_line clearfix">'
									.				'<label for="canvas_method" class="col-sm-3 control-label">' . CBTxt::T( 'Canvas' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$row->canvas()
									.				'</div>'
									.			'</div>'
									.			'<div id="gjCanvasMethod" class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					$input['canvas_method']
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div id="gjCanvasUpload" class="cbft_file cbtt_input form-group cb_form_line clearfix' . ( $row->get( 'canvas' ) ? ' hidden' : null ) . '">'
									.				( ! $row->get( 'canvas' ) ? '<label for="canvas" class="col-sm-3 control-label">' . CBTxt::T( 'Canvas' ) . '</label>' : null )
									.				'<div class="cb_field' . ( $row->get( 'canvas' ) ? ' col-sm-offset-3' : null ) . ' col-sm-9">'
									.					$input['canvas']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally select the group canvas. A canvas should represent the topic of your group; please be respectful and tasteful when selecting a canvas.' ) )
									.					'<div class="help-block">' . implode( ' ', $input['canvas_limits'] ) . '</div>'
									.				'</div>'
									.			'</div>';

		if ( $row->get( 'logo' ) ) {
			$return					.=			'<div class="cbft_delimiter form-group cb_form_line clearfix">'
									.				'<label for="logo_method" class="col-sm-3 control-label">' . CBTxt::T( 'Logo' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$row->logo()
									.				'</div>'
									.			'</div>'
									.			'<div id="gjLogoMethod" class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					$input['logo_method']
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div id="gjLogoUpload" class="cbft_file cbtt_input form-group cb_form_line clearfix' . ( $row->get( 'logo' ) ? ' hidden' : null ) . '">'
									.				( ! $row->get( 'logo' ) ? '<label for="logo" class="col-sm-3 control-label">' . CBTxt::T( 'Logo' ) . '</label>' : null )
									.				'<div class="cb_field' . ( $row->get( 'logo' ) ? ' col-sm-offset-3' : null ) . ' col-sm-9">'
									.					$input['logo']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally select the group logo. A logo should represent the topic of your group; please be respectful and tasteful when selecting a logo.' ) )
									.					'<div class="help-block">' . implode( ' ', $input['logo_limits'] ) . '</div>'
									.				'</div>'
									.			'</div>';

		if ( ( $row->get( 'type' ) != 3 ) && ( $isModerator || $plugin->params->get( 'groups_invites_display', 1 ) ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__invites" class="col-sm-3 control-label">' . CBTxt::T( 'Invites' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['invites']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally enable or disable usage of group invites. Group invites allow group users to invite other users to join the group. Group owner and group administrators are exempt from this configuration and can always invite users. Note existing invites will still be accessible.' ) )
									.				'</div>'
									.			'</div>';
		}

		if ( is_array( $integrations ) && $integrations ) {
			$return					.=			implode( '', $integrations );
		}

		if ( $isModerator ) {
			$return					.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['user_id']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the group owner id. Group owner determines the creator of the group specified as User ID.' ) )
									.				'</div>'
									.			'</div>';
		}

		if ( ( ! $isModerator ) && $plugin->params->get( 'groups_create_captcha', 0 ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha				=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha			=	$captcha[0];

				$return				.=			'<div class="form-group cb_form_line clearfix">'
									.				'<label class="col-sm-3 control-label">' . CBTxt::T( 'Captcha' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					( isset( $captcha[0] ) ? $captcha[0] : null )
									.				'</div>'
									.			'</div>'
									.			'<div class="form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
									.					getFieldIcons( null, 1, null )
									.				'</div>'
									.			'</div>';
			}
		}

		$return						.=			'<div class="form-group cb_form_line clearfix">'
									.				'<div class="col-sm-offset-3 col-sm-9">'
									.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Group' ) : CBTxt::T( 'Create Group' ) ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" ' . cbValidator::getSubmitBtnHtmlAttributes() . ' />'
									.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ).done( function() { window.location.href = \'' . $returnUrl . '\'; })" />'
									.				'</div>'
									.			'</div>'
									.			cbGetSpoofInputTag( 'plugin' )
									.		'</form>'
									.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayGroupEdit', array( &$return, $row, $input, $category, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #8
0
	/**
	 * render frontend video edit
	 *
	 * @param VideoTable              $row
	 * @param array                   $input
	 * @param GroupTable              $group
	 * @param UserTable               $user
	 * @param CBplug_cbgroupjivevideo $plugin
	 * @return string
	 */
	static function showVideoEdit( $row, $input, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$pageTitle					=	( $row->get( 'id' ) ? CBTxt::T( 'Edit Video' ) : CBTxt::T( 'New Video' ) );

		$_CB_framework->setPageTitle( $pageTitle );

		cbValidator::loadValidation();
		initToolTip();

		$isModerator				=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$canModerate				=	( CBGroupJive::getGroupStatus( $user, $group ) >= 2 );
		$return						=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayVideoEdit', array( &$return, &$row, &$input, $group, $user ) );

		$return						.=	'<div class="gjVideoEdit">'
									.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjVideoEditForm" id="gjVideoEditForm" class="cb_form gjVideoEditForm form-auto cbValidation">'
									.			( $pageTitle ? '<div class="gjVideoEditTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null );

		if ( $isModerator || $canModerate || ( $row->get( 'id' ) && ( $row->get( 'published' ) != -1 ) ) || ( $group->params()->get( 'video', 1 ) != 2 ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="published" class="col-sm-3 control-label">' . CBTxt::T( 'Published' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['published']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Select publish state of this video. Unpublished videos will not be visible to the public.' ) )
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="title" class="col-sm-3 control-label">' . CBTxt::T( 'Title' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['title']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally input a video title to display instead of url.' ) )
									.				'</div>'
									.			'</div>';

		if ( $row->get( 'id' ) && $row->exists() ) {
			$_CB_framework->outputCbJQuery( "$( '.gjVideoPlayer' ).mediaelementplayer();", 'media' );

			$return					.=			'<div class="cbft_delimiter form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					'<video width="640" height="360" style="width: 100%; height: 100%;" id="gjVideoPlayer' . (int) $row->get( 'id' ) . '" src="' . htmlspecialchars( $row->get( 'url' ) ) . '" type="' . htmlspecialchars( $row->mimeType() ) . '" controls="controls" preload="none" class="gjVideoPlayer"></video>'
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="url" class="col-sm-3 control-label">' . CBTxt::T( 'Video' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['url']
									.					getFieldIcons( null, ( ! $row->get( 'id' ) ? 1 : 0 ), null, CBTxt::T( 'Input the URL to the video to publish.' ) )
									.					( $input['url_limits'] ? '<div class="help-block">' . $input['url_limits'] . '</div>' : null )
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
									.				'<label for="caption" class="col-sm-3 control-label">' . CBTxt::T( 'Caption' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['caption']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally input a video caption.' ) )
									.				'</div>'
									.			'</div>';

		if ( $isModerator ) {
			$return					.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['user_id']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the video owner id. Video owner determines the creator of the video specified as User ID.' ) )
									.				'</div>'
									.			'</div>';
		}

		if ( ( ! $isModerator ) && $plugin->params->get( 'groups_video_captcha', 0 ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha				=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha			=	$captcha[0];

				$return				.=			'<div class="form-group cb_form_line clearfix">'
									.				'<label class="col-sm-3 control-label">' . CBTxt::T( 'Captcha' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					( isset( $captcha[0] ) ? $captcha[0] : null )
									.				'</div>'
									.			'</div>'
									.			'<div class="form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
									.					getFieldIcons( null, 1, null )
									.				'</div>'
									.			'</div>';
			}
		}

		$return						.=			'<div class="form-group cb_form_line clearfix cbtwolines">'
									.				'<div class="col-sm-offset-3 col-sm-9">'
									.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Video' ) : CBTxt::T( 'Publish Video' ) ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" ' . cbValidator::getSubmitBtnHtmlAttributes() . ' />'
									.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '\'; })" />'
									.				'</div>'
									.			'</div>'
									.			( ! $row->get( 'id' ) ? '<input type="hidden" id="group" name="group" value="' . (int) $group->get( 'id' ) . '" />' : null )
									.			cbGetSpoofInputTag( 'plugin' )
									.		'</form>'
									.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayVideoEdit', array( &$return, $row, $input, $group, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #9
0
	/**
	 * render frontend notifications
	 *
	 * @param NotificationTable  $row
	 * @param array              $input
	 * @param GroupTable         $group
	 * @param UserTable          $user
	 * @param CBplug_cbgroupjive $plugin
	 * @return string
	 */
	static function showNotifications( $row, $input, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$js							=	"$( '.gjToggleNotifications' ).on( 'change', function() {"
									.		"if ( $( this ).val() == 0 ) {"
									.			"$( '.gjNotificationsForm' ).find( 'select:not(.gjToggleNotifications)' ).val( 0 ).change();"
									.		"} else if ( $( this ).val() == 1 ) {"
									.			"$( '.gjNotificationsForm' ).find( 'select:not(.gjToggleNotifications)' ).val( 1 ).change();"
									.		"}"
									.		"$( this ).val( -1 );"
									.	"});";

		$_CB_framework->outputCbJQuery( $js );

		$pageTitle					=	CBTxt::T( 'Notifications' );

		$_CB_framework->setPageTitle( $pageTitle );

		cbValidator::loadValidation();
		initToolTip();

		$isModerator				=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$isOwner					=	( $user->get( 'id' ) == $group->get( 'user_id' ) );
		$status						=	CBGroupJive::getGroupStatus( $user, $group );
		$return						=	null;

		$integrations				=	$_PLUGINS->trigger( 'gj_onBeforeDisplayNotifications', array( &$return, &$row, &$input, $group, $user ) );

		$return						.=	'<div class="gjNotifications">'
									.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'notifications', 'func' => 'save', 'id' => (int) $group->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjNotificationsForm" id="gjNotificationsForm" class="cb_form gjNotificationsForm form-auto cbValidation">'
									.			( $pageTitle ? '<div class="gjNotificationsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
									.			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-12 text-right">'
									.					$input['toggle']
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__user_join" class="col-sm-9 control-label">' . CBTxt::T( 'Join of new user' ) . '</label>'
									.				'<div class="cb_field col-sm-3 text-right">'
									.					$input['user_join']
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__user_leave" class="col-sm-9 control-label">' . CBTxt::T( 'Leave of existing user' ) . '</label>'
									.				'<div class="cb_field col-sm-3 text-right">'
									.					$input['user_leave']
									.				'</div>'
									.			'</div>';

		if ( ( $isModerator || $isOwner || ( $status >= 2 ) ) && ( $group->get( 'type' ) == 2 ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__user_approve" class="col-sm-9 control-label">' . CBTxt::T( 'New user requires approval' ) . '</label>'
									.				'<div class="cb_field col-sm-3 text-right">'
									.					$input['user_approve']
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__user_cancel" class="col-sm-9 control-label">' . CBTxt::T( 'New user join request cancelled' ) . '</label>'
									.				'<div class="cb_field col-sm-3 text-right">'
									.					$input['user_cancel']
									.				'</div>'
									.			'</div>';
		}

		if ( ( $plugin->params->get( 'groups_invites_display', 1 ) || ( $group->get( 'type' ) == 3 ) ) && ( $group->params()->get( 'invites', 1 ) || ( $isModerator || $isOwner || ( $status >= 3 ) ) ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__invite_accept" class="col-sm-9 control-label">' . CBTxt::T( 'My group invite requests accepted' ) . '</label>'
									.				'<div class="cb_field col-sm-3 text-right">'
									.					$input['invite_accept']
									.				'</div>'
									.			'</div>'
									.			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="params__invite_reject" class="col-sm-9 control-label">' . CBTxt::T( 'My group invite requests rejected' ) . '</label>'
									.				'<div class="cb_field col-sm-3 text-right">'
									.					$input['invite_reject']
									.				'</div>'
									.			'</div>';
		}

		if ( is_array( $integrations ) && $integrations ) {
			$return					.=			implode( '', $integrations );
		}

		$return						.=			'<div class="form-group cb_form_line clearfix">'
									.				'<div class="col-sm-12 text-right">'
									.					'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '\'; })" />'
									.					' <input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Update Notifications' ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" ' . cbValidator::getSubmitBtnHtmlAttributes() . ' />'
									.				'</div>'
									.			'</div>'
									.			cbGetSpoofInputTag( 'plugin' )
									.		'</form>'
									.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayNotifications', array( &$return, $row, $input, $group, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #10
0
	/**
	 * render frontend group activity
	 *
	 * @param CB\Plugin\Activity\Table\ActivityTable $row
	 * @param string                                 $title
	 * @param string                                 $message
	 * @param CB\Plugin\Activity\Activity            $stream
	 * @param GroupTable                             $group
	 * @param cbgjPlugin                             $plugin
	 * @return string
	 */
	static function showActivity( $row, &$title, &$message, $stream, $group, $plugin )
	{
		global $_CB_framework;

		initToolTip();

		$message				=	null;

		switch( $row->get( 'subtype' ) ) {
			case 'group.join':
				$title			=	CBTxt::T( 'joined a group' );
				break;
			case 'group.leave':
				$title			=	CBTxt::T( 'left a group' );
				break;
			case 'group':
				$title			=	CBTxt::T( 'created a group' );
				break;
		}

		$user					=	CBuser::getMyUserDataInstance();
		$isModerator			=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$groupOwner				=	( $user->get( 'id' ) == $group->get( 'user_id' ) );
		$userStatus				=	CBGroupJive::getGroupStatus( $user, $group );

		$return					=	'<div class="gjActivity">'
								.		'<div class="gjGroupCanvas gjPageHeader border-default">'
								.			'<div class="gjPageHeaderCanvas">'
								.				'<div class="gjPageHeaderCanvasBackground">'
								.					$group->canvas()
								.				'</div>'
								.				'<div class="gjPageHeaderCanvasLogo">'
								.					$group->logo( false, true, true )
								.				'</div>';

		if ( $isModerator || $groupOwner || ( ( ! $groupOwner ) && ( ( $userStatus === null ) || ( $userStatus === 0 ) || ( $userStatus >= 1 ) ) ) ) {
			$return				.=				'<div class="gjPageHeaderCanvasButtons text-right">';

			if ( $isModerator && ( $group->get( 'published' ) == -1 ) && $plugin->params->get( 'groups_create_approval', 0 ) ) {
				$return			.=					' <span class="gjPageHeaderCanvasButton">'
								.						'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'publish', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\';" class="gjButton gjButtonApprove btn btn-xs btn-success">' . CBTxt::T( 'Approve' ) . '</button>'
								.					'</span>';
			} elseif ( ! $groupOwner ) {
				if ( $userStatus === null ) {
					$return		.=					' <span class="gjPageHeaderCanvasButton">'
								.						( $group->get( '_invite_id' ) ? '<button type="button" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to reject all invites to this Group?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'reject', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\'; })" class="gjButton gjButtonReject btn btn-xs btn-danger">' . CBTxt::T( 'Reject' ) . '</button> ' : null )
								.						'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'join', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\';" class="gjButton gjButtonJoin btn btn-xs btn-success">' . ( $group->get( '_invite_id' ) ? CBTxt::T( 'Accept Invite' ) : CBTxt::T( 'Join' ) ) . '</button>'
								.					'</span>';
				} elseif ( $userStatus === 0 ) {
					$return		.=					' <span class="gjPageHeaderCanvasButton">'
								.						'<button type="button" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel your pending join request to this Group?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'cancel', 'id' => (int) $group->get( 'id' ), 'return' => CBGroupJive::getReturn() ) ) . '\'; })" class="gjButton gjButtonCancel btn btn-xs btn-danger">' . CBTxt::T( 'Cancel' ) . '</button> '
								.						'<span class="gjButton gjButtonPending btn btn-xs btn-warning disabled">' . CBTxt::T( 'Pending Approval' ) . '</span>'
								.					'</span>';
				}
			}

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

		$return					.=			'</div>'
								.			'<div class="gjPageHeaderBar border-default">'
								.				'<div class="gjPageHeaderBarTitle text-primary">'
								.					'<strong><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '">' . htmlspecialchars( CBTxt::T( $group->get( 'name' ) ) ) . '</a></strong>'
								.				'</div>'
								.				'<div class="gjPageHeaderBarCounters text-muted small">';

		if ( $group->get( 'category' ) ) {
			$return				.=					'<span class="gjPageHeaderBarCounter"><span class="gjGroupCategoryIcon fa-before fa-folder">'
								.						' <a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'categories', 'func' => 'show', 'id' => (int) $group->get( 'category' ) ) ) . '">' . CBTxt::T( $group->category()->get( 'name' ) ) . '</a>'
								.					'</span></span>';
		}

		$return					.=					' <span class="gjPageHeaderBarCounter"><span class="gjGroupTypeIcon fa-before fa-globe"> ' . $group->type() . '</span></span>'
								.					' <span class="gjPageHeaderBarCounter"><span class="gjGroupUsersIcon fa-before fa-user"> ' . CBTxt::T( 'GROUP_USERS_COUNT', '%%COUNT%% User|%%COUNT%% Users', array( '%%COUNT%%' => (int) $group->get( '_users', 0 ) ) ) . '</span></span>'
								.				'</div>'
								.				( $group->get( 'description' ) ? ' <div class="gjPageHeaderBarDescription">' . cbTooltip( 1, CBTxt::T( $group->get( 'description' ) ), CBTxt::T( $group->get( 'name' ) ), 400, null, '<span class="fa fa-info-circle text-muted"></span>' ) . '</div>' : null )
								.			'</div>'
								.		'</div>'
								.	'</div>';

		return $return;
	}
function installPluginURL()
{
    global $_CB_framework;
    // Try extending time, as unziping/ftping took already quite some... :
    @set_time_limit(240);
    HTML_comprofiler::secureAboveForm('showPlugins');
    outputCbTemplate(2);
    outputCbJs(2);
    initToolTip(2);
    $option = "com_comprofiler";
    $task = "showPlugins";
    $client = 0;
    // echo "installPluginURL";
    $installer = new cbInstallerPlugin();
    // Check that the zlib is available
    if (!extension_loaded('zlib')) {
        HTML_comprofiler::showInstallMessage(CBTxt::T('The installer cannot continue before zlib is installed'), CBTxt::T('Installer - Error'), $installer->returnTo($option, $task, $client));
        exit;
    }
    $userfileURL = cbGetParam($_REQUEST, 'userfile', null);
    if (!$userfileURL) {
        HTML_comprofiler::showInstallMessage(CBTxt::T('No URL selected'), CBTxt::T('Upload new plugin - error'), $installer->returnTo($option, $task, $client));
        exit;
    }
    cbimport('cb.adminfilesystem');
    $adminFS =& cbAdminFileSystem::getInstance();
    if ($adminFS->isUsingStandardPHP()) {
        $baseDir = _cbPathName($_CB_framework->getCfg('tmp_path'));
    } else {
        $baseDir = $_CB_framework->getCfg('absolute_path') . '/tmp/';
    }
    $userfileName = $baseDir . 'comprofiler_temp.zip';
    $msg = '';
    //echo "step-uploadfile<br />";
    $resultdir = uploadFileURL($userfileURL, $userfileName, $msg);
    if ($resultdir !== false) {
        //echo "step-upload<br />";
        if (!$installer->upload($userfileName)) {
            HTML_comprofiler::showInstallMessage($installer->getError(), sprintf(CBTxt::T('Download %s - Upload Failed'), $userfileURL), $installer->returnTo($option, $task, $client));
        }
        //echo "step-install<br />";
        $ret = $installer->install();
        if ($ret) {
            HTML_comprofiler::showInstallMessage($installer->getError(), sprintf(CBTxt::T('Download %s'), $userfileURL) . ' - ' . ($ret ? CBTxt::T('Success') : CBTxt::T('Failed')), $installer->returnTo($option, $task, $client));
        }
        $installer->cleanupInstall($userfileName, $installer->unpackDir());
    } else {
        HTML_comprofiler::showInstallMessage($msg, sprintf(CBTxt::T('Download %s - Download Error'), $userfileURL), $installer->returnTo($option, $task, $client));
    }
}
Пример #12
0
	/**
	 * render frontend events
	 *
	 * @param EventTable[]     $rows
	 * @param cbPageNav        $pageNav
	 * @param bool             $searching
	 * @param array            $input
	 * @param array            $counters
	 * @param GroupTable       $group
	 * @param UserTable        $user
	 * @param cbgjEventsPlugin $plugin
	 * @return string
	 */
	static function showEvents( $rows, $pageNav, $searching, $input, &$counters, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$_CB_framework->outputCbJQuery( "$( '.gjGroupEventDescription .cbMoreLess' ).cbmoreless();", 'cbmoreless' );

		$counters[]							=	'<span class="gjGroupEventsIcon fa-before fa-calendar"> ' . CBTxt::T( 'GROUP_EVENTS_COUNT', '%%COUNT%% Event|%%COUNT%% Events', array( '%%COUNT%%' => (int) $pageNav->total ) ) . '</span>';

		initToolTip();

		$isModerator						=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$isOwner							=	( $user->get( 'id' ) == $group->get( 'user_id' ) );
		$userStatus							=	CBGroupJive::getGroupStatus( $user, $group );
		$canCreate							=	CBGroupJive::canCreateGroupContent( $user, $group, 'events' );
		$canSearch							=	( $plugin->params->get( 'groups_events_search', 1 ) && ( $searching || $pageNav->total ) );
		$showAddress						=	$plugin->params->get( 'groups_events_address', 1 );
		$return								=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayEvents', array( &$return, &$rows, $group, $user ) );

		$return								.=	'<div class="gjGroupEvents">'
											.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '" method="post" name="gjGroupEventsForm" id="gjGroupEventsForm" class="gjGroupEventsForm">';

		if ( $canCreate || $canSearch ) {
			$return							.=			'<div class="gjHeader gjGroupEventsHeader row">';

			if ( $canCreate ) {
				$return						.=				'<div class="' . ( ! $canSearch ? 'col-sm-12' : 'col-sm-8' ) . ' text-left">'
											.					'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'events', 'func' => 'new', 'group' => (int) $group->get( 'id' ) ) ) . '\';" class="gjButton gjButtonNewEvent btn btn-success"><span class="fa fa-plus-circle"></span> ' . CBTxt::T( 'New Event' ) . '</button>'
											.				'</div>';
			}

			if ( $canSearch ) {
				$return						.=				'<div class="' . ( ! $canCreate ? 'col-sm-offset-8 ' : null ) . 'col-sm-4 text-right">'
											.					'<div class="input-group">'
											.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
											.						$input['search']
											.					'</div>'
											.				'</div>';
			}

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

		$return								.=			'<div class="gjGroupEventsRows">';

		if ( $rows ) foreach ( $rows as $row ) {
			$rowOwner						=	( $user->get( 'id' ) == $row->get( 'user_id' ) );
			$address						=	htmlspecialchars( $row->get( 'location' ) );

			if ( $showAddress ) {
				if ( $row->get( 'address' ) ) {
					$mapUrl					=	CBTxt::T( 'GROUP_EVENT_ADDRESS_MAP_URL', 'https://www.google.com/maps/place/[address]', array( '[location]' => urlencode( $row->get( 'location' ) ), '[address]' => urlencode( $row->get( 'address' ) ) ) );
				} else {
					$mapUrl					=	CBTxt::T( 'GROUP_EVENT_LOCATION_MAP_URL', 'https://www.google.com/maps/search/[location]', array( '[location]' => urlencode( $row->get( 'location' ) ), '[address]' => urlencode( $row->get( 'address' ) ) ) );
				}

				if ( $mapUrl ) {
					$address				=	'<a href="' . htmlspecialchars( $mapUrl ) . '" target="_blank" rel="nofollow">' . $address . '</a>';
				}
			}

			$menu							=	array();

			$integrations					=	$_PLUGINS->trigger( 'gj_onDisplayEvent', array( &$row, &$menu, $group, $user ) );

			$canAttend						=	( ( ! $rowOwner ) && ( $row->status() != 1 ) && ( ! $row->get( '_attending' ) ) && ( $userStatus >= 1 ) && ( ( ! $row->get( 'limit' ) ) || ( $row->get( 'limit' ) && ( $row->get( '_guests' ) < $row->get( 'limit' ) ) ) ) );
			$canMenu						=	( $isModerator || $isOwner || $rowOwner || ( $userStatus >= 2 ) || ( ( ! $rowOwner ) && ( $row->status() != 1 ) && ( $userStatus >= 1 ) && $row->get( '_attending' ) ) || $menu );

			$return							.=				'<div class="gjGroupEventsRow row' . ( $row->status() == 1 ? ' gjGroupEventExpired' : ( $row->status() == 2 ? ' gjGroupEventActive' : null ) ) . '">'
											.					'<div class="gjGroupEventCalendar col-md-2 hidden-sm hidden-xs">'
											.						'<div class="panel panel-default text-center">'
											.							'<div class="gjGroupEventMonth panel-body">' . cbFormatDate( $row->get( 'start' ), true, false, 'M' ) . '</div>'
											.							'<div class="gjGroupEventDay panel-footer">' . cbFormatDate( $row->get( 'start' ), true, false, 'j' ) . '</div>'
											.						'</div>'
											.					'</div>'
											.					'<div class="gjGroupEventContainer col-md-10 col-sm-12 col-xs-12">'
											.						'<div class="panel ' . ( $row->status() == 1 ? 'panel-warning' : ( $row->status() == 2 ? 'panel-primary' : 'panel-default' ) ) . '">'
											.							'<div class="gjGroupEventHeader panel-heading">'
											.								'<div class="row">'
											.									'<div class="gjGroupEventTitle ' . ( $canAttend || $canMenu ? 'col-sm-8' : 'col-sm-12' ) . '">' . htmlspecialchars( $row->get( 'title' ) ) . '</div>';

			if ( $canAttend || $canMenu ) {
				$return						.=									'<div class="gjGroupEventMenu col-sm-4 text-right">';

				if ( $canAttend ) {
					$return					.=										'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'events', 'func' => 'attend', 'id' => (int) $row->get( 'id' ) ) ) . '\';" class="gjButton gjButtonAttend btn btn-xs btn-success">' . CBTxt::T( 'Attend' ) . '</button> ';
				}

				if ( $canMenu ) {
					$menuItems				=	'<ul class="gjEventMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">';

					if ( ( ! $rowOwner ) && ( $row->status() != 1 ) && ( $userStatus >= 1 ) && $row->get( '_attending' ) ) {
						$menuItems			.=		'<li class="gjEventMenuItem"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you do not want to attend this Event?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'events', 'func' => 'unattend', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-times-circle"></span> ' . CBTxt::T( 'Unattend' ) . '</a></li>';
					}

					if ( $isModerator || $isOwner || $rowOwner || ( $userStatus >= 2 ) ) {
						$menuItems			.=		'<li class="gjEventMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'events', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'Edit' ) . '</a></li>';

						if ( ( $row->get( 'published' ) == -1 ) && ( $group->params()->get( 'events', 1 ) == 2 ) ) {
							if ( $isModerator || $isOwner || ( $userStatus >= 2 ) ) {
								$menuItems	.=		'<li class="gjEventMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'events', 'func' => 'publish', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Approve' ) . '</a></li>';
							}
						} elseif ( $row->get( 'published' ) == 1 ) {
							$menuItems		.=		'<li class="gjEventMenuItem"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to unpublish this Event?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'events', 'func' => 'unpublish', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-times-circle"></span> ' . CBTxt::T( 'Unpublish' ) . '</a></li>';
						} else {
							$menuItems		.=		'<li class="gjEventMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'events', 'func' => 'publish', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Publish' ) . '</a></li>';
						}
					}

					if ( $menu ) {
						$menuItems			.=		'<li class="gjEventMenuItem">' . implode( '</li><li class="gjEventMenuItem">', $menu ) . '</li>';
					}

					if ( $isModerator || $isOwner || $rowOwner || ( $userStatus >= 2 ) ) {
						$menuItems			.=		'<li class="gjEventMenuItem"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to delete this Event?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'events', 'func' => 'delete', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-trash-o"></span> ' . CBTxt::T( 'Delete' ) . '</a></li>';
					}

					$menuItems				.=	'</ul>';

					$menuAttr				=	cbTooltip( 1, $menuItems, null, 'auto', null, null, null, 'class="btn btn-default btn-xs" data-cbtooltip-menu="true" data-cbtooltip-classes="qtip-nostyle"' );

					$return					.=										'<span class="gjEventMenu btn-group">'
											.											'<button type="button" ' . trim( $menuAttr ) . '><span class="fa fa-cog"></span> <span class="fa fa-caret-down"></span></button>'
											.										'</span>';
				}

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

			$return							.=								'</div>'
											.							'</div>'
											.							'<div class="gjGroupEventDetails panel-body small">';

			if ( $row->status() == 1 ) {
				$return						.=								'<div class="gjGroupEventNotice text-warning text-right">' . CBTxt::T( 'This event has ended.' ) . '</div>';
			} elseif ( $row->status() == 2 ) {
				if ( $row->get( 'end' ) ) {
					$return					.=								'<div class="gjGroupEventNotice text-primary text-right">' . CBTxt::T( 'GROUP_EVENT_ENDS_IN', 'This event is currently in progress and ends in [timeago].', array( '[timeago]' => cbFormatDate( $row->get( 'end' ), true, 'exacttimeago' ) ) ) . '</div>';
				} else {
					$return					.=								'<div class="gjGroupEventNotice text-primary text-right">' . CBTxt::T( 'This event is currently in progress.' ) . '</div>';
				}
			} else {
				$return						.=								'<div class="gjGroupEventNotice text-right">' . CBTxt::T( 'GROUP_EVENT_STARTS_IN', 'This event starts in [timeago].', array( '[timeago]' => cbFormatDate( $row->get( 'start' ), true, 'exacttimeago' ) ) ) . '</div>';
			}

			$return							.=								'<div class="gjGroupEventDate">'
											.									'<span class="gjGroupEventIcon fa fa-clock-o text-center"></span> ' . $row->date()
											.								'</div>'
											.								'<div class="gjGroupEventLocation">'
											.									'<span class="gjGroupEventIcon fa fa-map-marker text-center"></span> ' . $address
											.								'</div>'
											.								'<div class="gjGroupEventAttending row">'
											.									'<div class="gjGroupEventGuests col-sm-6">'
											.										'<span class="gjGroupEventIcon fa fa-users text-center"></span> '
											.										'<a href="' . htmlspecialchars( $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'events', 'func' => 'attending', 'id' => (int) $row->get( 'id' ) ) ) ) . '">'
											.											( $row->get( 'limit' ) ? CBTxt::T( 'GROUP_GUESTS_COUNT_LIMITED', '%%COUNT%% of [limit] Guest|%%COUNT%% of [limit] Guests', array( '%%COUNT%%' => (int) $row->get( '_guests', 0 ), '[limit]' => (int) $row->get( 'limit' ) ) ) : CBTxt::T( 'GROUP_GUESTS_COUNT', '%%COUNT%% Guest|%%COUNT%% Guests', array( '%%COUNT%%' => (int) $row->get( '_guests', 0 ) ) ) )
											.										'</a>'
											.									'</div>'
											.									'<div class="gjGroupEventHost col-sm-6 text-right">'
											.										CBuser::getInstance( (int) $row->get( 'user_id' ), false )->getField( 'formatname', null, 'html', 'none', 'list', 0, true )
											.									'</div>'
											.								'</div>'
											.							'</div>'
											.							'<div class="gjGroupEventDescription panel-footer">'
											.								'<div class="cbMoreLess">'
											.									'<div class="cbMoreLessContent">'
											.										( $plugin->params->get( 'groups_events_content_plugins', 0 ) ? Application::Cms()->prepareHtmlContentPlugins( $row->get( 'event' ) ) : $row->get( 'event' ) )
											.									'</div>'
											.									'<div class="cbMoreLessOpen fade-edge hidden">'
											.										'<a href="javascript: void(0);" class="cbMoreLessButton">' . CBTxt::T( 'See More' ) . '</a>'
											.									'</div>'
											.								'</div>'
											.							'</div>'
											.							( is_array( $integrations ) && $integrations ? '<div class="gjGroupEventFooter panel-footer">' . implode( '', $integrations ) . '</div>' : null )
											.						'</div>'
											.					'</div>'
											.				'</div>';
		} else {
			if ( $searching ) {
				$return						.=				CBTxt::T( 'No group event search results found.' );
			} else {
				$return						.=				CBTxt::T( 'This group currently has no events.' );
			}
		}

		$return								.=			'</div>';

		if ( $plugin->params->get( 'groups_events_paging', 1 ) && ( $pageNav->total > $pageNav->limit ) ) {
			$return							.=			'<div class="gjGroupEventsPaging text-center">'
											.				$pageNav->getListLinks()
											.			'</div>';
		}

		$return								.=			$pageNav->getLimitBox( false )
											.		'</form>'
											.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayEvents', array( &$return, $rows, $group, $user ) );

		return $return;
	}
Пример #13
0
	/**
	 * render frontend categories
	 *
	 * @param CategoryTable[]    $rows
	 * @param cbPageNav          $pageNav
	 * @param bool               $searching
	 * @param array              $input
	 * @param UserTable          $user
	 * @param CBplug_cbgroupjive $plugin
	 * @return string
	 */
	static function showCategories( $rows, $pageNav, $searching, $input, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$_CB_framework->setPageTitle( CBTxt::T( 'Categories' ) );

		initToolTip();

		$canCreateGroup					=	CBGroupJive::canCreateGroup( $user );
		$canSearch						=	( $plugin->params->get( 'categories_search', 1 ) && ( $searching || $pageNav->total ) );
		$return							=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayCategories', array( &$return, &$rows, $user ) );

		$return							.=	'<div class="gjCategories">'
										.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'categories', 'func' => 'all' ) ) . '" method="post" name="gjCategoriesForm" id="gjCategoriesForm" class="gjCategoriesForm">';

		if ( $canCreateGroup || $canSearch ) {
			$return						.=			'<div class="gjHeader gjCategoriesHeader row">';

			if ( $canCreateGroup ) {
				$return					.=				'<div class="' . ( ! $canSearch ? 'col-sm-12' : 'col-sm-8' ) . ' text-left">'
										.					'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'new', 'return' => CBGroupJive::getReturn() ) ) . '\';" class="gjButton gjButtonNewGroup btn btn-success"><span class="fa fa-plus-circle"></span> ' . CBTxt::T( 'New Group' ) . '</button>'
										.				'</div>';
			}

			if ( $canSearch ) {
				$return					.=				'<div class="' . ( ! $canCreateGroup ? 'col-sm-offset-8 ' : null ) . 'col-sm-4 text-right">'
										.					'<div class="input-group">'
										.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
										.						$input['search']
										.					'</div>'
										.				'</div>';
			}

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

		$return							.=			'<div class="gjCategoriesRows">';

		if ( $rows ) foreach ( $rows as $row ) {
			$counters					=	array();
			$content					=	null;

			$_PLUGINS->trigger( 'gj_onDisplayCategory', array( &$row, &$counters, &$content, $user ) );

			$return						.=				'<div class="gjCategoriesCategory gjContainerBox img-thumbnail">'
										.					'<div class="gjContainerBoxHeader">'
										.						'<div class="gjContainerBoxCanvas text-left">'
										.							$row->canvas( true, true )
										.						'</div>'
										.						'<div class="gjContainerBoxLogo text-center">'
										.							$row->logo( true, true, true )
										.						'</div>'
										.					'</div>'
										.					'<div class="gjContainerBoxBody text-left">'
										.						'<div class="gjContainerBoxTitle">'
										.							'<strong><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'categories', 'func' => 'show', 'id' => (int) $row->get( 'id' ) ) ) . '">' . CBTxt::T( $row->get( 'name' ) ) . '</a></strong>'
										.						'</div>'
										.						'<div class="gjContainerBoxCounters text-muted small row">'
										.							'<div class="gjContainerBoxCounter ' . ( $counters ? 'col-sm-6' : 'col-sm-12' ) . '"><span class="gjCategoryGroupsIcon fa-before fa-users"> ' . CBTxt::T( 'GROUPS_COUNT', '%%COUNT%% Group|%%COUNT%% Groups', array( '%%COUNT%%' => (int) $row->get( '_groups', 0 ) ) ) . '</span></div>'
										.							( $counters ? '<div class="gjContainerBoxCounter col-sm-6">' . implode( '</div><div class="gjContainerBoxCounter col-sm-6">', $counters ) . '</div>' : null )
										.						'</div>'
										.						( $content ? '<div class="gjContainerBoxContent">' . $content . '</div>' : null )
										.						( $row->get( 'description' ) ? '<div class="gjContainerBoxDescription">' . cbTooltip( 1, CBTxt::T( $row->get( 'description' ) ), CBTxt::T( $row->get( 'name' ) ), 400, null, '<span class="fa fa-info-circle text-muted"></span>' ) . '</div>' : null )
										.					'</div>'
										.				'</div>';
		} else {
			if ( $searching ) {
				$return					.=				CBTxt::T( 'No category search results found.' );
			} else {
				$return					.=				CBTxt::T( 'There are no categories available.' );
			}
		}

		$return							.=			'</div>';

		if ( $plugin->params->get( 'categories_paging', 1 ) && ( $pageNav->total > $pageNav->limit ) ) {
			$return						.=			'<div class="gjCategoriesPaging text-center">'
										.				$pageNav->getListLinks()
										.			'</div>';
		}

		$return							.=			$pageNav->getLimitBox( false )
										.		'</form>'
										.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayCategories', array( &$return, &$rows, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #14
0
	/**
	 * @param cbinvitesInviteTable $row
	 * @param array                $input
	 * @param UserTable            $user
	 * @param cbPluginHandler      $plugin
	 */
	static function showInviteEdit( $row, $input, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		cbValidator::loadValidation();

		$cbModerator		=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
		$pageTitle			=	( $row->get( 'to' ) ? CBTxt::T( 'Edit Invite' ) : CBTxt::T( 'Create Invite' ) );

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'Invites' ) ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbinvitesTab' ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'invites', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'invites', 'func' => 'new' ) ) ) );

		initToolTip();

		$return				=	'<div class="invitesEdit">'
							.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'invites', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="invitesForm" id="invitesForm" class="cb_form invitesForm form-auto cbValidation">'
							.			( $pageTitle ? '<div class="invitesTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="to" class="col-sm-3 control-label">' . CBTxt::T( 'To' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['to']
							.					getFieldIcons( 1, 1, null, ( $plugin->params->get( 'invite_multiple', 1 ) ? CBTxt::T( 'Input invite email to address. Separate multiple email addresses with a comma.' ) : CBTxt::T( 'Input invite email to address.' ) ) )
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="subject" class="col-sm-3 control-label">' . CBTxt::T( 'Subject' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['subject']
							.					getFieldIcons( 1, 0, null, CBTxt::T( 'Input invite email subject; if left blank a subject will be applied.' ) )
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="body" class="col-sm-3 control-label">' . CBTxt::T( 'Body' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['body']
							.					getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input private message to include with invite email.' ) )
							.				'</div>'
							.			'</div>';

		if ( $cbModerator ) {
			$return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['user_id']
							.					getFieldIcons( 1, 1, null, CBTxt::T( 'Input owner of invite as single integer user_id. This is the user who sent the invite.' ) )
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'User' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['user']
							.					getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input user of invite as single integer user_id. This is the user who accepted the invite.' ) )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'invite_captcha', 0 ) && ( ! $cbModerator ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha		=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha	=	$captcha[0];

				$return		.=			'<div class="form-group cb_form_line clearfix">'
							.				'<label class="col-sm-3 control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					( isset( $captcha[0] ) ? $captcha[0] : null )
							.				'</div>'
							.			'</div>'
							.			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
							.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
							.					getFieldIcons( 1, 1, null )
							.				'</div>'
							.			'</div>';
			}
		}

		$return				.=			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="col-sm-offset-3 col-sm-9">'
							.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Invite' ) : CBTxt::T( 'Send Invite' ) ) ) . '" class="invitesButton invitesButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;'
							.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="invitesButton invitesButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbinvitesTab' ) . '\'; }" />'
							.				'</div>'
							.			'</div>'
							.			cbGetSpoofInputTag( 'plugin' )
							.		'</form>'
							.	'</div>';

		echo $return;
	}
Пример #15
0
	/**
	 * @param cbinvitesInviteTable $row
	 * @param array                $input
	 * @param UserTable            $user
	 * @param cbPluginHandler      $plugin
	 */
	static function showProductEdit( $row, $input, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		cbValidator::loadValidation();

		$cbModerator		=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
		$pageTitle			=	( $row->get( 'id' ) ? CBTxt::T( 'MEDPR_EDIT_PRODUCT' ) : CBTxt::T( 'MEDPR_CREATE_PRODUCT' ) );

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'MEDPR_MEDICINE_PRODUCT' ) ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbinvitesTab' ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'medizd', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'medizd', 'func' => 'new' ) ) ) );

		initToolTip();

		$return				=	'<div class="medizdEdit">'
							.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'medizd', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="medizdForm" id="medizdForm" class="cb_form medizdForm form-auto cbValidation">'
							.			( $pageTitle ? '<div class="invitesTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="to" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_CODE' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['code']
							.					getFieldIcons( 1, 1, null)
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="subject" class="col-sm-3 control-label">' . CBTxt::T( 'Name' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['name']
							.					getFieldIcons( 1, 1, null)
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="body" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_DESCRIPTION' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['description']
							.					getFieldIcons( 1, 0, null )
							.				'</div>'
							.			'</div>';

		
			$return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Category' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['category']
							.					getFieldIcons( 1, 1, null)
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_MANUFACTURE' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['proizvoditel']
							.					getFieldIcons( 1, 0, null)
							.				'</div>'
							.			'</div>'
                                                        .   '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_COUNTRY' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['country']
							.					getFieldIcons( 1, 0, null)
							.				'</div>'
							.			'</div>'
                                                        .   '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_PRICE' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['price']
							.					getFieldIcons( 1, 0, null)
							.				'</div>'
							.			'</div>';
		

		

		$return				.=			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="col-sm-offset-3 col-sm-9">'
							.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'MEDPR_UPDATE_PRODUCT' ) : CBTxt::T( 'MEDPR_SAVE_PRODUCT' ) ) ) . '" class="invitesButton invitesButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;'
							.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="invitesButton invitesButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbmedizdFormTab' ) . '\'; }" />'
							.				'</div>'
							.			'</div>'
							.			cbGetSpoofInputTag( 'plugin' )
							.		'</form>'
							.	'</div>';

		echo $return;
	}
    static function manageConnections($connections, $actions, $total, &$connMgmtTabs, &$pagingParams, $perpage, $connecteds = null)
    {
        global $_CB_framework, $ueConfig, $_REQUEST;
        $Itemid = $_CB_framework->itemid();
        $ui = 1;
        outputCbTemplate($ui);
        initToolTip(1);
        ob_start();
        ?>
var tabPanemyCon;
function showCBTabPaneMy( sName ) {
	if (typeof tabPanemyCon != "undefined" ) {
		switch ( sName.toLowerCase() ) {
			case "<?php 
        echo strtolower(_UE_MANAGEACTIONS);
        ?>
":
			case "manageactions":
			case "0":
				tabPanemyCon.setSelectedIndex( 0 );
				break;
			case "<?php 
        echo strtolower(_UE_MANAGECONNECTIONS);
        ?>
":
			case "manageconnections":
			case "1":
				tabPanemyCon.setSelectedIndex( 1 );
				break;
			case "<?php 
        echo strtolower(_UE_CONNECTEDWITH);
        ?>
":
			case "connectedfrom":
			case "2":
				tabPanemyCon.setSelectedIndex( 2 );
				break;
		}
	}
}
<?php 
        $cbjavascript = ob_get_contents();
        ob_end_clean();
        $_CB_framework->outputCbJQuery($cbjavascript);
        ob_start();
        ?>
function confirmSubmit() {
	if (confirm("<?php 
        echo _UE_CONFIRMREMOVECONNECTION;
        ?>
"))
		return true ;
	else
		return false ;
}
<?php 
        $cbjavascript = ob_get_contents();
        ob_end_clean();
        $_CB_framework->document->addHeadScriptDeclaration($cbjavascript);
        $tabs = new cbTabs(0, $ui);
        $cTypes = explode("\n", $ueConfig['connection_categories']);
        $connectionTypes = array();
        foreach ($cTypes as $cType) {
            if (trim($cType) != null && trim($cType) != "") {
                $connectionTypes[] = moscomprofilerHTML::makeOption(trim($cType), getLangDefinition(trim($cType)));
            }
        }
        ?>
<div class="contentheading"><?php 
        echo _UE_MANAGECONNECTIONS;
        ?>
</div><br />
<br />
<?php 
        echo $tabs->startPane("myCon");
        // Tab 0: Manange Actions:
        echo $tabs->startTab("myCon", _UE_MANAGEACTIONS . " (" . count($actions) . ")", "action");
        if (!count($actions) > 0) {
            echo "\t\t<div class=\"tab_Description\">" . _UE_NOACTIONREQUIRED . "</div>\n";
        } else {
            echo '<form method="post" action="' . cbSef('index.php?option=com_comprofiler&amp;task=processConnectionActions' . ($Itemid ? "&amp;Itemid=" . (int) $Itemid : "")) . '">';
            echo "\t\t<div class=\"tab_Description\">" . _UE_CONNECT_ACTIONREQUIRED . "</div>\n";
            // echo "<div style=\"width:100%;text-align:right;\"><input type=\"submit\" class=\"inputbox\"  value=\""._UE_UPDATE."\" /></div>";
            echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"95%\">";
            echo "<tr>";
            echo "<td>";
            foreach ($actions as $action) {
                $conAvatar = null;
                $conAvatar = getFieldValue('image', $action->avatar, $action);
                $onlineIMG = $ueConfig['allow_onlinestatus'] == 1 ? getFieldValue('status', $action->isOnline, $action, null, 1) : "";
                $tipField = "<b>" . _UE_CONNECTIONREQUIREDON . "</b> : " . dateConverter($action->membersince, 'Y-m-d', $ueConfig['date_format']);
                if ($action->reason != null) {
                    $tipField .= "<br /><b>" . _UE_CONNECTIONMESSAGE . "</b> :<br />" . htmlspecialchars($action->reason, ENT_QUOTES);
                }
                $tipTitle = _UE_CONNECTIONREQUESTDETAIL;
                $htmltext = $conAvatar;
                $style = "style=\"padding:5px;\"";
                $tooltip = cbFieldTip($ui, $tipField, $tipTitle, '250', '', $htmltext, '', $style, '', false);
                echo "<div class=\"connectionBox\">";
                echo $onlineIMG . ' ' . getNameFormat($action->name, $action->username, $ueConfig['name_format']) . "<br />" . $tooltip . "<br /><img src=\"components/com_comprofiler/images/tick.png\" border=\"0\" alt=\"" . _UE_ACCEPTCONNECTION . "\" title=\"" . _UE_ACCEPTCONNECTION . "\" /><input type=\"radio\"  value=\"a\" checked=\"checked\" name=\"" . $action->id . "action\"/> <img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_DECLINECONNECTION . "\" title=\"" . _UE_DECLINECONNECTION . "\" /><input type=\"radio\" value=\"d\" name=\"" . $action->id . "action\"/><input type=\"hidden\" name=\"uid[]\" value=\"" . $action->id . "\" />";
                echo " </div>\n";
            }
            echo "</td>";
            echo "</tr>";
            echo "</table>";
            echo "<div style=\"width:100%;text-align:right;\"><input type=\"submit\" class=\"button\"  value=\"" . _UE_UPDATE . "\" /></div>";
            echo cbGetSpoofInputTag('manageConnections');
            echo "</form>";
        }
        echo $tabs->endTab();
        // Tab 1: Manange Connections:
        echo $tabs->startTab("myCon", _UE_MANAGECONNECTIONS, "connections");
        if (!count($connections) > 0) {
            echo "\t\t<div class=\"tab_Description\">" . _UE_NOCONNECTIONS . "</div>\n";
        } else {
            ?>
	<form action='<?php 
            echo cbSef('index.php?option=com_comprofiler&amp;task=saveConnections' . ($Itemid ? "&amp;Itemid=" . (int) $Itemid : ""));
            ?>
' method='post' name='userAdmin'>
	<div class="tab_Description"><?php 
            echo _UE_CONNECT_MANAGECONNECTIONS;
            ?>
</div>
	<table cellpadding="5" cellspacing="0" border="0" width="95%">
	  <thead><tr>
		<th style='text-align:center;'><?php 
            echo _UE_CONNECTION;
            ?>
</th>
		<th style='text-align:center;'><?php 
            echo _UE_CONNECTIONTYPE;
            ?>
</th>
		<th style='text-align:center;'><?php 
            echo _UE_CONNECTIONCOMMENT;
            ?>
</th>
	  </tr></thead>
	  <tbody>
<?php 
            $i = 1;
            foreach ($connections as $connection) {
                $k = explode('|*|', trim($connection->type));
                $list = array();
                $list['connectionType'] = moscomprofilerHTML::selectList($connectionTypes, $connection->id . 'connectiontype[]', 'class="inputbox" multiple="multiple" size="5"', 'value', 'text', $k, 0);
                $conAvatar = null;
                $conAvatar = getFieldValue('image', $connection->avatar, $connection);
                $emailIMG = getFieldValue('primaryemailaddress', $connection->email, $connection, null, 1);
                $pmIMG = getFieldValue('pm', $connection->username, $connection, null, 1);
                $onlineIMG = $ueConfig['allow_onlinestatus'] == 1 ? getFieldValue('status', $connection->isOnline, $connection, null, 1) : "";
                if ($connection->accepted == 1 && $connection->pending == 1) {
                    $actionIMG = "<img src=\"components/com_comprofiler/images/pending.png\" border=\"0\" alt=\"" . _UE_CONNECTIONPENDING . "\" title=\"" . _UE_CONNECTIONPENDING . "\" /> <a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=" . $connection->memberid . ($Itemid ? "&amp;Itemid=" . (int) $Itemid : "")) . "\" onclick=\"return confirmSubmit();\" ><img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_REMOVECONNECTION . "\" /></a>";
                } elseif ($connection->accepted == 1 && $connection->pending == 0) {
                    $actionIMG = "<a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=" . $connection->memberid . ($Itemid ? "&amp;Itemid=" . (int) $Itemid : "")) . "\" onclick=\"return confirmSubmit();\" ><img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_REMOVECONNECTION . "\" /></a>";
                } elseif ($connection->accepted == 0) {
                    $actionIMG = "<a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=acceptConnection&amp;connectionid=" . $connection->memberid . ($Itemid ? "&amp;Itemid=" . (int) $Itemid : "")) . "\"><img src=\"components/com_comprofiler/images/tick.png\" border=\"0\" alt=\"" . _UE_ACCEPTCONNECTION . "\" title=\"" . _UE_ACCEPTCONNECTION . "\" /></a> <a href=\"" . cbSef("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=" . $connection->memberid . ($Itemid ? "&amp;Itemid=" . (int) $Itemid : "")) . "\"><img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_DECLINECONNECTION . "\" /></a>";
                }
                $tipField = "<b>" . _UE_CONNECTEDSINCE . "</b> : " . dateConverter($connection->membersince, 'Y-m-d', $ueConfig['date_format']);
                if ($connection->type != null) {
                    $tipField .= "<br /><b>" . _UE_CONNECTIONTYPE . "</b> : " . getConnectionTypes($connection->type);
                }
                if ($connection->description != null) {
                    $tipField .= "<br /><b>" . _UE_CONNECTEDCOMMENT . "</b> : " . htmlspecialchars($connection->description);
                }
                $tipTitle = _UE_CONNECTEDDETAIL;
                $htmltext = $conAvatar;
                $style = "style=\"padding:5px;\"";
                $tooltip = cbFieldTip($ui, $tipField, $tipTitle, '200', '', $htmltext, '', $style, '', false);
                echo "\n<tr style='vertical-align:top;' class='sectiontableentry" . $i . "'>";
                echo "\n\t<td style='text-align:center;'>" . $onlineIMG . ' ' . getNameFormat($connection->name, $connection->username, $ueConfig['name_format']) . "<br />" . $tooltip . "<br />" . $actionIMG . " <a href=\"" . cbSef("index.php?option=com_comprofiler&amp;task=userProfile&amp;user="******"&amp;Itemid=" . (int) $Itemid : "")) . "\"><img src=\"components/com_comprofiler/images/profiles.gif\" border=\"0\" alt=\"" . _UE_VIEWPROFILE . "\" title=\"" . _UE_VIEWPROFILE . "\" /></a> " . $emailIMG . " " . $pmIMG . "</td>";
                echo "\n\t<td style='text-align:center;'>" . $list['connectionType'] . "</td>";
                echo "\n\t<td style='text-align:center;'><textarea cols=\"25\" class=\"inputbox\"  rows=\"5\" name=\"" . $connection->id . "description\">" . htmlspecialchars($connection->description) . "</textarea><input type=\"hidden\" name=\"uid[]\" value=\"" . $connection->id . "\" /></td>";
                echo "\n</tr>";
                $i = $i == 1 ? 2 : 1;
            }
            echo "</tbody>";
            echo "</table><br />";
            if ($perpage < $total) {
                echo "<div style='width:95%;text-align:center;'>" . $connMgmtTabs->_writePaging($pagingParams, 'connections_', $perpage, $total, 'manageConnections') . "</div>";
            }
            echo "<div style=\"width:100%;text-align:right;\"><input type=\"submit\" class=\"button\"  value=\"" . _UE_UPDATE . "\" /></div>";
            echo cbGetSpoofInputTag('manageConnections');
            echo "</form>";
        }
        echo $tabs->endTab();
        // Tab 2: Users connected with me:
        if ($ueConfig['autoAddConnections'] == 0) {
            echo $tabs->startTab('myCon', _UE_CONNECTEDWITH, 'connected');
            if (!count($connecteds) > 0) {
                echo _UE_NOCONNECTEDWITH;
            } else {
                // tooltip params:
                $width = '200';
                $icon = '';
                $href = '';
                echo '<table cellpadding="5" cellspacing="0" border="0" width="95%">';
                echo '<tr>';
                echo '<td>';
                foreach ($connecteds as $connected) {
                    $conAvatar = null;
                    $conAvatar = getFieldValue('image', $connected->avatar, $connected);
                    $emailIMG = getFieldValue('primaryemailaddress', $connected->email, $connected, null, 1);
                    $pmIMG = getFieldValue('pm', $connected->username, $connected, null, 1);
                    $onlineIMG = $ueConfig['allow_onlinestatus'] == 1 ? getFieldValue('status', $connected->isOnline, $connected, null, 1) : '';
                    if ($connected->accepted == 1 && $connected->pending == 1) {
                        $actionIMG = '<img src="components/com_comprofiler/images/pending.png" border="0" alt="' . _UE_CONNECTIONPENDING . '" title="' . _UE_CONNECTIONPENDING . '" /> ' . '<a href="' . cbSef('index.php?option=com_comprofiler&amp;act=connections&amp;task=denyConnection&amp;connectionid=' . $connected->memberid . ($Itemid ? '&amp;Itemid=' . (int) $Itemid : '')) . '" onclick="return confirmSubmit();">' . '<img src="components/com_comprofiler/images/publish_x.png" border="0" alt="' . _UE_REMOVECONNECTION . '" title="' . _UE_REMOVECONNECTION . '" /></a>';
                    } elseif ($connected->accepted == 1 && $connected->pending == 0) {
                        $actionIMG = '<a href="' . cbSef('index.php?option=com_comprofiler&amp;act=connections&amp;task=denyConnection&amp;connectionid=' . $connected->referenceid . ($Itemid ? '&amp;Itemid=' . (int) $Itemid : '')) . '" onclick="return confirmSubmit();">' . '<img src="components/com_comprofiler/images/publish_x.png" border="0" alt="' . _UE_REMOVECONNECTION . '" title="' . _UE_REMOVECONNECTION . '" /></a>';
                    } elseif ($connected->accepted == 0) {
                        $actionIMG = '<a href="' . cbSef('index.php?option=com_comprofiler&amp;act=connections&amp;task=acceptConnection&amp;connectionid=' . $connected->referenceid . ($Itemid ? '&amp;Itemid=' . (int) $Itemid : '')) . '">' . '<img src="components/com_comprofiler/images/tick.png" border="0" alt="' . _UE_ACCEPTCONNECTION . '" title="' . _UE_ACCEPTCONNECTION . '" /></a> ' . '<a href="' . cbSef('index.php?option=com_comprofiler&amp;act=connections&amp;task=denyConnection&amp;connectionid=' . $connected->referenceid . ($Itemid ? '&amp;Itemid=' . (int) $Itemid : '')) . '" onclick="return confirmSubmit();">' . '<img src="components/com_comprofiler/images/publish_x.png" border="0" alt="' . _UE_REMOVECONNECTION . '" title="' . _UE_DECLINECONNECTION . '" /></a>';
                    }
                    $tipField = '<b>' . _UE_CONNECTEDSINCE . '</b> : ' . dateConverter($connected->membersince, 'Y-m-d', $ueConfig['date_format']);
                    if (getLangDefinition($connected->type) != null) {
                        $tipField .= '<br /><b>' . _UE_CONNECTIONTYPE . '</b> : ' . getLangDefinition($connected->type);
                    }
                    if ($connected->description != null) {
                        $tipField .= '<br /><b>' . _UE_CONNECTEDCOMMENT . '</b> : ' . htmlspecialchars($connected->description);
                    }
                    $tipTitle = _UE_CONNECTEDDETAIL;
                    $htmltext = $conAvatar;
                    $style = 'style="padding:5px;"';
                    $tooltip = cbFieldTip($ui, $tipField, $tipTitle, $width, $icon, $htmltext, $href, $style, '', false);
                    echo '<div class="connectionBox">';
                    echo $actionIMG . '<br />';
                    echo $tooltip . '<br />';
                    echo $onlineIMG . ' ' . getNameFormat($connected->name, $connected->username, $ueConfig['name_format']);
                    echo '<br /><a href="' . cbSef('index.php?option=com_comprofiler&amp;task=userProfile&amp;user='******'&amp;Itemid=' . (int) $Itemid : '')) . '"><img src="components/com_comprofiler/images/profiles.gif" border="0" alt="' . _UE_VIEWPROFILE . '" title="' . _UE_VIEWPROFILE . '" /></a> ' . $emailIMG . ' ' . $pmIMG . "\n";
                    echo " </div>\n";
                }
                echo '</td>';
                echo '</tr>';
                echo '</table>';
            }
            echo $tabs->endTab();
        }
        echo $tabs->endPane();
        if (isset($_REQUEST['tab'])) {
            $_CB_framework->outputCbJQuery("showCBTabPaneMy( '" . addslashes(urldecode(stripslashes(cbGetParam($_REQUEST, 'tab')))) . "' );");
        } elseif (!(count($actions) > 0)) {
            $_CB_framework->outputCbJQuery("tabPanemyCon.setSelectedIndex( 1 );");
        }
        echo '<div style="clear:both;padding:5px"><a href="' . cbSef('index.php?option=com_comprofiler' . getCBprofileItemid(true)) . '">' . _UE_BACK_TO_YOUR_PROFILE . '</a></div>';
    }
Пример #17
0
	/**
	 * render frontend wall edit
	 *
	 * @param WallTable              $row
	 * @param array                  $input
	 * @param GroupTable             $group
	 * @param UserTable              $user
	 * @param CBplug_cbgroupjivewall $plugin
	 * @return string
	 */
	static function showWallEdit( $row, $input, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$pageTitle					=	( $row->get( 'id' ) ? CBTxt::T( 'Edit Post' ) : CBTxt::T( 'New Post' ) );

		$_CB_framework->setPageTitle( $pageTitle );

		cbValidator::loadValidation();
		initToolTip();

		$isModerator				=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$canModerate				=	( CBGroupJive::getGroupStatus( $user, $group ) >= 2 );
		$return						=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayWallEdit', array( &$return, &$row, &$input, $group, $user ) );

		$return						.=	'<div class="gjWallEdit">'
									.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'wall', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjWallEditForm" id="gjWallEditForm" class="cb_form gjWallEditForm form-auto cbValidation">'
									.			( $pageTitle ? '<div class="gjWallEditTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null );

		if ( $isModerator || $canModerate || ( $row->get( 'id' ) && ( $row->get( 'published' ) != -1 ) ) || ( $group->params()->get( 'wall', 1 ) != 2 ) ) {
			$return					.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
									.				'<label for="published" class="col-sm-3 control-label">' . CBTxt::T( 'Published' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['published']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Select publish state of this post. Unpublished posts will not be visible to the public.' ) )
									.				'</div>'
									.			'</div>';
		}

		if ( $row->reply()->get( 'id' ) ) {
			$return					.=			'<div class="cbft_delimiter form-group cb_form_line clearfix">'
									.				'<label class="col-sm-3 control-label">' . CBTxt::T( 'Reply' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$row->reply()->post()
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
									.				'<label for="post" class="col-sm-3 control-label">' . CBTxt::T( 'Post' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['post']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the post to share.' ) )
									.				'</div>'
									.			'</div>';

		if ( $isModerator ) {
			$return					.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
									.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					$input['user_id']
									.					getFieldIcons( null, 1, null, CBTxt::T( 'Input the post owner id. Post owner determines the creator of the post specified as User ID.' ) )
									.				'</div>'
									.			'</div>';
		}

		$return						.=			'<div class="form-group cb_form_line clearfix cbtwolines">'
									.				'<div class="col-sm-offset-3 col-sm-9">'
									.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Post' ) : CBTxt::T( 'Post' ) ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" ' . cbValidator::getSubmitBtnHtmlAttributes() . ' />'
									.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '\'; })" />'
									.				'</div>'
									.			'</div>'
									.			( ! $row->get( 'id' ) ? '<input type="hidden" id="group" name="group" value="' . (int) $group->get( 'id' ) . '" />' : null )
									.			cbGetSpoofInputTag( 'plugin' )
									.		'</form>'
									.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayWallEdit', array( &$return, $row, $input, $group, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #18
0
	/**
	 * render frontend videos
	 *
	 * @param VideoTable[]    $rows
	 * @param cbPageNav       $pageNav
	 * @param bool            $searching
	 * @param array           $input
	 * @param array           $counters
	 * @param GroupTable      $group
	 * @param UserTable       $user
	 * @param cbgjVideoPlugin $plugin
	 * @return string
	 */
	static function showVideos( $rows, $pageNav, $searching, $input, &$counters, $group, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$_CB_framework->outputCbJQuery( "$( '.gjVideoPlayer' ).mediaelementplayer();", 'media' );

		$counters[]						=	'<span class="gjGroupVideoIcon fa-before fa-film"> ' . CBTxt::T( 'GROUP_VIDEOS_COUNT', '%%COUNT%% Video|%%COUNT%% Videos', array( '%%COUNT%%' => (int) $pageNav->total ) ) . '</span>';

		initToolTip();

		$isModerator					=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$isOwner						=	( $user->get( 'id' ) == $group->get( 'user_id' ) );
		$userStatus						=	CBGroupJive::getGroupStatus( $user, $group );
		$canCreate						=	CBGroupJive::canCreateGroupContent( $user, $group, 'video' );
		$canSearch						=	( $plugin->params->get( 'groups_video_search', 1 ) && ( $searching || $pageNav->total ) );
		$return							=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayVideos', array( &$return, &$rows, $group, $user ) );

		$return							.=	'<div class="gjGroupVideo">'
										.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, true, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '" method="post" name="gjGroupVideoForm" id="gjGroupVideoForm" class="gjGroupVideoForm">';

		if ( $canCreate || $canSearch ) {
			$return						.=			'<div class="gjHeader gjGroupVideoHeader row">';

			if ( $canCreate ) {
				$return					.=				'<div class="' . ( ! $canSearch ? 'col-sm-12' : 'col-sm-8' ) . ' text-left">'
										.					'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'video', 'func' => 'new', 'group' => (int) $group->get( 'id' ) ) ) . '\';" class="gjButton gjButtonNewVideo btn btn-success"><span class="fa fa-plus-circle"></span> ' . CBTxt::T( 'New Video' ) . '</button>'
										.				'</div>';
			}

			if ( $canSearch ) {
				$return					.=				'<div class="' . ( ! $canCreate ? 'col-sm-offset-8 ' : null ) . 'col-sm-4 text-right">'
										.					'<div class="input-group">'
										.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
										.						$input['search']
										.					'</div>'
										.				'</div>';
			}

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

		$return							.=			'<div class="gjGroupVideoRows">';

		if ( $rows ) foreach ( $rows as $row ) {
			$rowCounters				=	array();
			$content					=	null;
			$menu						=	array();

			$_PLUGINS->trigger( 'gj_onDisplayVideo', array( &$row, &$rowCounters, &$content, &$menu, $group, $user ) );

			$return						.=				'<div class="gjGroupVideoRow gjContainerBox img-thumbnail">'
										.					'<div class="gjContainerBoxHeader">'
										.						'<video width="640" height="360" style="width: 100%; height: 100%;" id="gjVideoPlayer' . (int) $row->get( 'id' ) . '" src="' . htmlspecialchars( $row->get( 'url' ) ) . '" type="' . htmlspecialchars( $row->mimeType() ) . '" controls="controls" preload="none" class="gjVideoPlayer"></video>'
										.					'</div>'
										.					'<div class="gjContainerBoxBody text-left">'
										.						'<div class="gjContainerBoxTitle">'
										.							'<a href="' . htmlspecialchars( $row->get( 'url' ) ) . '" target="_blank" rel="nofollow">' . htmlspecialchars( ( $row->get( 'title' ) ? $row->get( 'title' ) : $row->name() ) ) . '</a>'
										.						'</div>'
										.						'<div class="gjContainerBoxCounters text-muted small row">'
										.							'<div class="gjGroupVideoPublisher gjContainerBoxCounter col-sm-6">' . CBuser::getInstance( (int) $row->get( 'user_id' ), false )->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) . '</div>'
										.							'<div class="gjContainerBoxCounter col-sm-6 text-right">'
										.								'<span title="' . htmlspecialchars( $row->get( 'date' ) ) . '">'
										.									cbFormatDate( $row->get( 'date' ), true, false, CBTxt::T( 'GROUP_VIDEO_DATE_FORMAT', 'M j, Y' ) )
										.								'</span>'
										.							'</div>'
										.							( $rowCounters ? '<div class="gjContainerBoxCounter col-sm-6">' . implode( '</div><div class="gjContainerBoxCounter col-sm-6">', $rowCounters ) . '</div>' : null )
										.						'</div>'
										.						( $content ? '<div class="gjContainerBoxContent">' . $content . '</div>' : null )
										.						( $row->get( 'caption' ) ? '<div class="gjContainerBoxDescription">' . cbTooltip( 1, $row->get( 'caption' ), $row->name(), 400, null, '<span class="fa fa-info-circle text-muted"></span>' ) . '</div>' : null );

			if ( ( $isModerator || $isOwner || ( $userStatus >= 2 ) ) && ( $row->get( 'published' ) == -1 ) && ( $group->params()->get( 'video', 1 ) == 2 ) ) {
				$return					.=						'<div class="gjContainerBoxButton text-right">'
										.							'<button type="button" onclick="window.location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'publish', 'id' => (int) $row->get( 'id' ) ) ) . '\';" class="gjButton gjButtonApprove btn btn-xs btn-success">' . CBTxt::T( 'Approve' ) . '</button>'
										.						'</div>';
			}

			$return						.=					'</div>';

			if ( $isModerator || $isOwner || ( $user->get( 'id' ) == $row->get( 'user_id' ) ) || ( $userStatus >= 2 ) || $menu ) {
				$menuItems				=	'<ul class="gjVideoMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">';

				if ( $isModerator || $isOwner || ( $user->get( 'id' ) == $row->get( 'user_id' ) ) || ( $userStatus >= 2 ) ) {
					$menuItems			.=		'<li class="gjVideoMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'Edit' ) . '</a></li>';

					if ( ( $row->get( 'published' ) == -1 ) && ( $group->params()->get( 'video', 1 ) == 2 ) ) {
						if ( $isModerator || $isOwner || ( $userStatus >= 2 ) ) {
							$menuItems	.=		'<li class="gjVideoMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'publish', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Approve' ) . '</a></li>';
						}
					} elseif ( $row->get( 'published' ) == 1 ) {
						$menuItems		.=		'<li class="gjVideoMenuItem"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to unpublish this Video?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'video', 'func' => 'unpublish', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-times-circle"></span> ' . CBTxt::T( 'Unpublish' ) . '</a></li>';
					} else {
						$menuItems		.=		'<li class="gjVideoMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'video', 'func' => 'publish', 'id' => (int) $row->get( 'id' ) ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Publish' ) . '</a></li>';
					}
				}

				if ( $menu ) {
					$menuItems			.=		'<li class="gjVideoMenuItem">' . implode( '</li><li class="gjVideoMenuItem">', $menu ) . '</li>';
				}

				if ( $isModerator || $isOwner || ( $user->get( 'id' ) == $row->get( 'user_id' ) ) || ( $userStatus >= 2 ) ) {
					$menuItems			.=		'<li class="gjVideoMenuItem"><a href="javascript: void(0);" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to delete this Video?' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'video', 'func' => 'delete', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })"><span class="fa fa-trash-o"></span> ' . CBTxt::T( 'Delete' ) . '</a></li>';
				}

				$menuItems				.=	'</ul>';

				$menuAttr				=	cbTooltip( 1, $menuItems, null, 'auto', null, null, null, 'class="btn btn-default btn-xs" data-cbtooltip-menu="true" data-cbtooltip-classes="qtip-nostyle"' );

				$return					.=					'<div class="gjContainerBoxMenu">'
										.						'<div class="gjVideoMenu btn-group">'
										.							'<button type="button" ' . trim( $menuAttr ) . '><span class="fa fa-cog"></span> <span class="fa fa-caret-down"></span></button>'
										.						'</div>'
										.					'</div>';
			}

			$return						.=				'</div>';
		} else {
			if ( $searching ) {
				$return					.=				CBTxt::T( 'No group video search results found.' );
			} else {
				$return					.=				CBTxt::T( 'This group currently has no videos.' );
			}
		}

		$return							.=			'</div>';

		if ( $plugin->params->get( 'groups_video_paging', 1 ) && ( $pageNav->total > $pageNav->limit ) ) {
			$return						.=			'<div class="gjGroupVideoPaging text-center">'
										.				$pageNav->getListLinks()
										.			'</div>';
		}

		$return							.=			$pageNav->getLimitBox( false )
										.		'</form>'
										.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayVideos', array( &$return, $rows, $group, $user ) );

		return $return;
	}
Пример #19
0
	/**
	 * render frontend about edit
	 *
	 * @param GroupTable              $row
	 * @param array                   $input
	 * @param UserTable               $user
	 * @param CBplug_cbgroupjiveabout $plugin
	 * @return string
	 */
	static function showAboutEdit( $row, $input, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$pageTitle					=	CBTxt::T( 'About' );

		$_CB_framework->setPageTitle( $pageTitle );

		cbValidator::loadValidation();
		initToolTip();

		$return						=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayAboutEdit', array( &$return, &$row, &$input, $user ) );

		$return						.=	'<div class="gjAboutEdit">'
									.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'about', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="gjAboutEditForm" id="gjAboutEditForm" class="cb_form gjAboutEditForm form-auto cbValidation">'
									.			( $pageTitle ? '<div class="gjAboutEditTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
									.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix cbtwolines">'
									.				'<div class="cb_field col-sm-12">'
									.					$input['about']
									.					getFieldIcons( null, 0, null, CBTxt::T( 'Optionally input a detailed description about this group.' ) )
									.				'</div>'
									.			'</div>';

		if ( ( ! CBGroupJive::isModerator( $user->get( 'id' ) ) ) && $plugin->params->get( 'groups_about_captcha', 0 ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha				=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha			=	$captcha[0];

				$return				.=			'<div class="form-group cb_form_line clearfix">'
									.				'<label class="col-sm-3 control-label">' . CBTxt::T( 'Captcha' ) . '</label>'
									.				'<div class="cb_field col-sm-9">'
									.					( isset( $captcha[0] ) ? $captcha[0] : null )
									.				'</div>'
									.			'</div>'
									.			'<div class="form-group cb_form_line clearfix">'
									.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
									.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
									.					getFieldIcons( null, 1, null )
									.				'</div>'
									.			'</div>';
			}
		}

		$return						.=			'<div class="form-group cb_form_line clearfix cbtwolines">'
									.				'<div class="col-sm-12">'
									.					'<input type="submit" value="' . htmlspecialchars( CBTxt::T( 'Update About' ) ) . '" class="gjButton gjButtonSubmit btn btn-primary" ' . cbValidator::getSubmitBtnHtmlAttributes() . ' />'
									.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="cbjQuery.cbconfirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ).done( function() { window.location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $row->get( 'id' ) ) ) . '\'; })" />'
									.				'</div>'
									.			'</div>'
									.			cbGetSpoofInputTag( 'plugin' )
									.		'</form>'
									.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayAboutEdit', array( &$return, $row, $input, $user ) );

		$_CB_framework->setMenuMeta();

		echo $return;
	}
Пример #20
0
 /**
  * Writes the edit form for new and existing module
  *
  * A new record is defined when <var>$row</var> is passed with the <var>id</var>
  * property set to 0.
  *
  * @param  array                     $options
  * @param  array                     $actionPath
  * @param  SimpleXMLElement          $viewModel
  * @param  TableInterface|\stdClass  $data
  * @param  RegistryEditController    $params
  * @param  PluginTable               $pluginRow
  * @param  string                    $viewType     ( 'view', 'param', 'depends': means: <param> tag => param, <field> tag => view )
  * @param  string                    $cbprevstate
  * @param  boolean                   $htmlOutput   True to output headers for CSS and Javascript
  */
 public static function editPluginView($options, $actionPath, $viewModel, $data, $params, $pluginRow, $viewType, $cbprevstate, $htmlOutput)
 {
     global $_CB_framework, $_CB_Backend_Title, $_PLUGINS, $ueConfig;
     $name = $viewModel->attributes('name');
     $label = $viewModel->attributes('label');
     $iconPair = explode(':', $viewModel->attributes('icon'));
     if (count($iconPair) > 1) {
         $iconset = isset($iconPair[0]) ? $iconPair[0] : null;
         $icon = isset($iconPair[1]) ? $iconPair[1] : null;
     } else {
         $iconset = 'fa';
         $icon = isset($iconPair[0]) ? $iconPair[0] : null;
     }
     if ($icon) {
         if ($iconset == 'fa') {
             $icon = 'fa fa-' . $icon;
         } elseif ($iconset) {
             $icon = $iconset . $icon;
         }
     }
     $id = null;
     if (is_object($data)) {
         $dataArray = get_object_vars($data);
         if (in_array('id', $dataArray)) {
             // General object
             $id = (int) $data->id;
         } elseif (in_array('tabid', $dataArray)) {
             // Field object
             $id = (int) $data->tabid;
         } elseif (in_array('fieldid', $dataArray)) {
             // Tab object
             $id = (int) $data->fieldid;
         }
     }
     if ($id !== null) {
         if (isset($data->title)) {
             $item = $data->title;
         } elseif (isset($data->name)) {
             $item = $data->name;
         } else {
             $item = $id;
         }
         $title = ($id ? CBTxt::T('Edit') : CBTxt::T('New')) . ($label ? ' ' . htmlspecialchars(CBTxt::T($label)) . ' ' : null) . ($item ? ' [' . htmlspecialchars(CBTxt::T($item)) . ']' : null);
     } else {
         $title = $label ? htmlspecialchars(CBTxt::T($label)) : null;
     }
     if ($viewModel->attributes('label')) {
         $showDisclaimer = true;
         if ($pluginRow) {
             if (!$icon) {
                 $icon = 'cb-' . str_replace('.', '_', $pluginRow->element) . '-' . $name;
             }
             $_CB_Backend_Title = array(0 => array($icon, htmlspecialchars(CBTxt::T($pluginRow->name)) . ($title ? ': ' . $title : null)));
         } else {
             if (!$icon) {
                 $icon = 'cb-' . $name;
             }
             $_CB_Backend_Title = array(0 => array($icon, htmlspecialchars(CBTxt::T('Community Builder')) . ($title ? ': ' . $title : null)));
         }
         // Null the label so the view form doesn't output it as we already did as page title:
         $viewModel->addAttribute('label', null);
     } else {
         $showDisclaimer = false;
     }
     $htmlFormatting = $viewModel->attributes('viewformatting');
     if (!$htmlFormatting) {
         if ($_CB_framework->getUi() == 1 && (isset($ueConfig['use_divs']) && $ueConfig['use_divs'] == 1)) {
             $htmlFormatting = 'div';
         } else {
             $htmlFormatting = 'table';
         }
     }
     new cbTabs(true, 2);
     $settingsHtml = $params->draw(null, null, null, null, null, null, false, $viewType, $htmlFormatting);
     if ($htmlOutput) {
         outputCbTemplate();
         outputCbJs();
         self::outputAdminJs();
         initToolTip();
         self::outputRegTemplate();
     }
     $return = null;
     if ($pluginRow && $pluginRow->id) {
         if (!$pluginRow->published) {
             $return .= '<div class="alert alert-danger">' . CBTxt::T('PLUGIN_NAME_IS_NOT_PUBLISHED', '[plugin_name] is not published.', array('[plugin_name]' => htmlspecialchars(CBTxt::T($pluginRow->name)))) . '</div>';
         }
         if (!$_PLUGINS->checkPluginCompatibility($pluginRow)) {
             $return .= '<div class="alert alert-danger">' . CBTxt::T('PLUGIN_NAME_IS_NOT_COMPATIBLE_WITH_YOUR_CURRENT_CB_VERSION', '[plugin_name] is not compatible with your current CB version.', array('[plugin_name]' => htmlspecialchars(CBTxt::T($pluginRow->name)))) . '</div>';
         }
     }
     if (is_object($data) && isset($data->id) && $data->id) {
         if (isset($data->published) && !$data->published) {
             $return .= '<div class="alert alert-danger">' . CBTxt::T('NAME_IS_NOT_PUBLISHED', '[name] is not published.', array('[name]' => htmlspecialchars(CBTxt::T($label)))) . '</div>';
         }
         if (isset($data->enabled) && !$data->enabled) {
             $return .= '<div class="alert alert-danger">' . CBTxt::T('NAME_IS_NOT_ENABLED', '[name] is not enabled.', array('[name]' => htmlspecialchars(CBTxt::T($label)))) . '</div>';
         }
     }
     if ($viewModel->attributes('formformatting') == 'none') {
         $return .= $settingsHtml ? $settingsHtml : null;
     } else {
         cbValidator::loadValidation();
         $cssClass = RegistryEditView::buildClasses($viewModel);
         if (!$cssClass) {
             $cssClass = 'cb_form form-auto';
         }
         $return .= '<form enctype="multipart/form-data" action="' . $_CB_framework->backendUrl('index.php') . '" method="post" name="adminForm" class="cbValidation ' . htmlspecialchars($cssClass) . '" id="cbAdminFormForm">' . ($settingsHtml ? $settingsHtml : null) . '<input type="hidden" name="option" value="' . htmlspecialchars($options['option']) . '" />' . ($pluginRow ? '<input type="hidden" name="cid" value="' . (int) $pluginRow->id . '" />' : null) . ($cbprevstate ? '<input type="hidden" name="cbprevstate" value="' . htmlspecialchars($cbprevstate) . '" />' : null);
         if ($actionPath) {
             foreach ($actionPath as $k => $v) {
                 $return .= '<input type="hidden" name="' . htmlspecialchars($k) . '" value="' . htmlspecialchars($v) . '" />';
             }
         }
         $return .= cbGetSpoofInputTag('plugin') . '</form>';
     }
     if ($showDisclaimer) {
         $disclaimerTitle = 'Disclaimer';
         $disclaimerText = 'This software comes "as is" with no guarantee for accuracy, function or fitness for any purpose.';
         $disclaimerTitleTr = CBTxt::Th('Disclaimer');
         $disclaimerTextTr = CBTxt::Th('This software comes "as is" with no guarantee for accuracy, function or fitness for any purpose.');
         $return .= '<div class="cbregCopyrightfooter content-spacer" style="font-size:11px; color:black; display:block;">' . CBTxt::Th('CB_FOOTNOTE_OPEN_SOURCE_WITH_PLUGINS', 'Community Builder for Joomla, an open-source social framework by <a href="http://www.joomlapolis.com/?pk_campaign=in-cb&amp;pk_kwd=footer" target="_blank">Joomlapolis.com</a>, easy to extend with <a href="http://www.joomlapolis.com/cb-solutions?pk_campaign=in-cb&pk_kwd=footer" target="_blank">CB plugins</a>. Professional <a href="http://www.joomlapolis.com/support?pk_campaign=in-cb&pk_kwd=footer" target="_blank">Support</a> is available with a <a href="http://www.joomlapolis.com/memberships?pk_campaign=in-cb&pk_kwd=footer" target="_blank">Membership</a>.') . '<br /><strong>' . $disclaimerTitle . ':</strong> ' . $disclaimerText . ($disclaimerText != $disclaimerTextTr ? '<br /><strong>' . $disclaimerTitleTr . ':</strong> ' . $disclaimerTextTr : null) . '<br />' . CBTxt::Th('CB_FOOTNOTE_REVIEW_AND_RATE_AT_JED', 'If you use Community Builder, please post a rating and a review on the <a href="[JEDURL]" target="_blank">Joomla! Extensions Directory</a>.', array('[JEDURL]' => htmlspecialchars('http://extensions.joomla.org/extensions/clients-a-communities/communities/210 '))) . '</div>';
     }
     echo $return;
 }
Пример #21
0
 /**
  * Handles the backend plugin edition
  *
  * @param  string           $option
  * @param  string           $action
  * @param  SimpleXMLElement $element
  * @param  string           $mode
  * @return string                        HTML
  *
  * @throws \LogicException
  */
 public function drawView($option, $action, $element, $mode)
 {
     global $_CB_Backend_Menu;
     $ui = $this->clientId == 1 ? 2 : 1;
     $context = new Context();
     $pluginParams = $context->getParams();
     $interfaceUi = $ui == 2 ? 'admin' : 'frontend';
     $adminActionsModel = $element->getChildByNameAttr('actions', 'ui', $interfaceUi);
     if (!$adminActionsModel) {
         $adminActionsModel = $element->getChildByNameAttr('actions', 'ui', 'all');
     }
     if (!$adminActionsModel) {
         throw new \LogicException('No ' . $interfaceUi . ' actions defined in XML');
     }
     // Check permission if specified:
     if (!Access::authorised($adminActionsModel)) {
         return CBTxt::T("Access to these actions is not authorized by the permissions of your user groups.");
     }
     // General-purpose extenders:
     $extenders = $adminActionsModel->xpath('extend');
     /** @var SimpleXMLElement[] $extenders */
     foreach ($extenders as $k => $extends) {
         $error = RegistryEditView::extendXMLnode($extenders[$k], $element, null, $context->getPluginObject());
         if ($error) {
             echo $error;
         }
     }
     $found = false;
     $actionPath = array();
     if ($action) {
         $actionsModel = $adminActionsModel->getChildByNameAttr('action', 'name', $action);
         $found = $actionsModel != null;
         if ($found) {
             $requests = explode(' ', $actionsModel->attributes('request'));
             $values = explode(' ', $actionsModel->attributes('action'));
             $actionPath = array();
             for ($i = 0, $n = count($requests); $i < $n; $i++) {
                 $actionPath[$requests[$i]] = $values[$i];
             }
         }
     }
     if (!$found) {
         // EVENT: select the event from URL and compute the selected $actionPath
         $found = false;
         $actionsModel = null;
         foreach ($adminActionsModel->children() as $actionsModel) {
             /** @var SimpleXMLElement $actionsModel */
             $request = $actionsModel->attributes('request');
             if ($request) {
                 $requests = explode(' ', $request);
                 $values = explode(' ', $actionsModel->attributes('action'));
                 $actionPath = array();
                 for ($i = 0, $n = count($requests); $i < $n; $i++) {
                     $actionPath[$requests[$i]] = $this->input->get($requests[$i], null, GetterInterface::STRING);
                     // Temporary fix for older versions of CBSubs before CBSubs 4.0.0 stable to avoid warnings on ajax version checks:
                     if ($requests[$i] === 'view' && $actionPath['view'] === null) {
                         $actionPath['view'] = $this->input->get('task', null, GetterInterface::STRING);
                     }
                     if ($actionPath[$requests[$i]] != $values[$i]) {
                         break;
                     }
                 }
                 if ($i == $n) {
                     $found = true;
                     break;
                 }
             }
         }
     }
     if (!$found) {
         $actionPath = array();
         // try finding first default one:
         if ($ui == 2) {
             $actionsModel = $adminActionsModel->getChildByNameAttr('action', 'request', '');
         }
         if (!isset($actionsModel)) {
             return CBTxt::T('AHAWOW_REQUESTED_ACTION_NOT_DEFINED_IN_XML', "Requested action '[ACTION]' not defined in XML.", array('[ACTION]' => htmlspecialchars($action)));
         }
     }
     // Check permission if specified:
     if (!isset($actionsModel) || !Access::authorised($actionsModel)) {
         return CBTxt::T("This action is not authorized by the permissions of your user groups.");
     }
     if (!isset($actionPath['view'])) {
         $actionPath['view'] = $ui == 2 ? 'editPlugin' : '';
         //TODO: 2nd should come from target routing
     } elseif ($actionPath['view'] != 'editPlugin') {
         $actionPath['act'] = '';
     }
     // EVENT: fetch the input parameters from URL:
     $parametersNames = explode(' ', $actionsModel->attributes('requestparameters'));
     $parametersValues = array();
     foreach ($parametersNames as $paraNam) {
         $parametersValues[$paraNam] = null;
         if (strpos($paraNam, '[') === false) {
             if (trim($paraNam)) {
                 $parametersValues[$paraNam] = $this->input->get($paraNam, '', GetterInterface::STRING);
             }
         } else {
             $matches = null;
             preg_match_all('/(.*)(?:\\[(.*)\\])+/', $paraNam, $matches);
             if (is_array($matches) && count($matches) >= 3 && count($matches[2]) >= 1) {
                 $parametersValues[$paraNam] = $this->input->get($matches[1][0] . '.' . $matches[2][0], null, GetterInterface::STRING);
             }
         }
     }
     $keyValues = array();
     // Action-specific general extenders:
     $extenders = $adminActionsModel->xpath('actionspecific/extend');
     /** @var SimpleXMLElement[] $extenders */
     foreach ($extenders as $k => $extends) {
         $error = RegistryEditView::extendXMLnode($extenders[$k], $element, $actionsModel, $context->getPluginObject());
         if ($error) {
             echo $error;
         }
     }
     // First extend what can be extended so the showview's below have a complete XML tree:
     /** @var $actionItem SimpleXMLElement */
     foreach ($actionsModel->xpath('extend') as $actionItem) {
         $error = RegistryEditView::extendXMLnode($actionItem, $element, $actionsModel, $context->getPluginObject());
         if ($error) {
             echo $error;
         }
     }
     /** @var $actionItem SimpleXMLElement */
     foreach ($actionsModel->children() as $actionItem) {
         // CONTROLLER: select the controller:
         switch ($actionItem->getName()) {
             case 'extend':
                 // Treated just above.
                 break;
             case 'showview':
                 $viewName = $actionItem->attributes('view');
                 $showviewType = $actionItem->attributes('type');
                 $viewMode = $actionItem->attributes('mode');
                 // MODEL: load data to view:
                 $dataModel = $actionItem->getElementByPath('data');
                 if ($dataModel) {
                     $dataModelType = $dataModel->attributes('type');
                     $cbDatabase = $this->db;
                     if (in_array($dataModelType, array('sql:row', 'sql:multiplerows', 'sql:field', 'parameters'))) {
                         $xmlsql = new XmlQuery($cbDatabase, null, $pluginParams);
                         $data = $xmlsql->loadObjectFromData($dataModel);
                         if ($data === null) {
                             return 'showview::sql:row: load failed: ' . $cbDatabase->getErrorMsg();
                         }
                         $dataModelValueName = $dataModel->attributes('value');
                         $dataModelValueType = $dataModel->attributes('valuetype');
                         // if the value of key is a parameter name, replace it with the corresponding parameter:
                         $dataModelValueTypeArray = explode(':', $dataModelValueType);
                         if ($dataModelValueTypeArray[0] == 'request') {
                             if (isset($parametersValues[$dataModelValueName])) {
                                 $dataModelValue = $parametersValues[$dataModelValueName];
                                 // database escaping to int is done at request time
                                 $keyValues[$dataModelValueName] = $dataModelValue;
                                 unset($parametersValues[$dataModelValueName]);
                             } else {
                                 echo sprintf('showview::sql::row %s: request %s not in parameters of action.', $dataModel->attributes('name'), $dataModelValueName);
                             }
                         }
                         if ($dataModelType == 'sql:field') {
                             $data = new Registry($data);
                         }
                     } elseif ($dataModelType == 'class') {
                         $dataModelClass = $dataModel->attributes('class');
                         $dataModelValue = $dataModel->attributes('value');
                         $dataModelValueName = $dataModelValue;
                         $dataModelValueType = $dataModel->attributes('valuetype');
                         $dataModelValueTypeArray = explode(':', $dataModelValueType);
                         if ($dataModelValueTypeArray[0] == 'request') {
                             if (isset($parametersValues[$dataModelValueName])) {
                                 $dataModelValue = $parametersValues[$dataModelValueName];
                                 $keyValues[$dataModelValueName] = $dataModelValue;
                                 unset($parametersValues[$dataModelValueName]);
                             } else {
                                 echo sprintf('showview::sql::row %s: request %s not in parameters of action.', $dataModel->attributes('name'), $dataModelValue);
                             }
                         }
                         if (strpos($dataModelClass, '::') === false) {
                             $data = new $dataModelClass($cbDatabase);
                             // normal clas="className"
                             /** @var $data TableInterface */
                             $data->load($dataModelValue);
                         } else {
                             $dataModelSingleton = explode('::', $dataModelClass);
                             // class object loader from singleton: class="loaderClass::loadStaticMethor" with 1 parameter, the key value.
                             if (is_callable($dataModelSingleton)) {
                                 if (is_callable(array($dataModelSingleton[0], 'getInstance'))) {
                                     $instance = call_user_func_array(array($dataModelSingleton[0], 'getInstance'), array(&$cbDatabase));
                                     $rows = call_user_func_array(array($instance, $dataModelSingleton[1]), array($dataModelValue));
                                 } else {
                                     $rows = call_user_func_array($dataModelSingleton, array($dataModelValue));
                                 }
                             } else {
                                 echo sprintf('showview::class %s: missing singleton class creator %s.', $dataModel->attributes('name'), $dataModelClass);
                                 $std = new \stdClass();
                                 $rows = array($std);
                             }
                             $data = $rows[0];
                         }
                     } else {
                         $data = null;
                         echo 'showview: Data model type ' . $dataModelType . ' is not implemented !';
                     }
                 } else {
                     if ($this->_data instanceof TableInterface || $this->_data instanceof \comprofilerDBTable) {
                         $data = $this->_data;
                         $dataModelType = 'sql:row';
                     } elseif ($this->_data instanceof ParamsInterface) {
                         $data = $this->_data;
                         $dataModelType = 'sql:row';
                     } else {
                         $data = null;
                         $dataModelType = null;
                     }
                 }
                 // VIEW: select view:
                 $allViewsModels = $element->getElementByPath('views');
                 if ($viewName && (!$showviewType || $showviewType == 'view')) {
                     ////// $viewModel		= $allViewsModels->getChildByNameAttributes( 'view', array( 'name' => $viewName ) );
                     $xpathUi = '/*/views/view[@ui="' . $interfaceUi . '" and @name="' . $viewName . '"]';
                     $xpathAll = '/*/views/view[@ui="all" and @name="' . $viewName . '"]';
                     $viewModel = $element->xpath($xpathUi);
                     if (!$viewModel) {
                         $viewModel = $element->xpath($xpathAll);
                     }
                     if (!$viewModel) {
                         $viewModel = RegistryEditView::xpathWithAutoLoad($element, $xpathUi);
                     }
                     if (!$viewModel) {
                         $viewModel = RegistryEditView::xpathWithAutoLoad($element, $xpathAll);
                     }
                     /*
                     						if ( ! $viewModel ) {
                     							$viewModel		=	RegistryEditView::xpathWithAutoLoad( $element, '/ * / views/view[not(@ui) and @name="' . $viewName . '"]' );
                     						}
                     */
                     if ($viewModel) {
                         $viewModel = $viewModel[0];
                     } else {
                         return 'XML:showview: View ' . $viewName . ' not defined in ui ' . $interfaceUi . ' in XML';
                     }
                 } elseif ($showviewType == 'xml') {
                     // e.g.: <showview name="gateway_paymentstatus_information" mode="view" type="xml" file="processors/{payment_method}/edit.gateway" path="/*/views/view[@name=&quot;paymentstatusinformation&quot;]" mandatory="false" />
                     $fromNode = $actionItem->attributes('path');
                     $fromFile = $actionItem->attributes('file');
                     if ($fromNode && $fromFile !== null) {
                         // $this->substituteName( $fromFile, true );
                         // $this->substituteName( $fromNode, false );
                         $fromFile = $context->getPluginPath() . '/' . $fromFile . '.xml';
                         if ($fromFile === '' || is_readable($fromFile)) {
                             if ($fromFile === '') {
                                 $fromRoot = $element;
                             } else {
                                 $fromRoot = new SimpleXMLElement($fromFile, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0), true);
                             }
                             $viewModel = $fromRoot->xpath($fromNode);
                             if (!$viewModel) {
                                 trigger_error('Admin:showview: View ' . $viewName . ': file ' . $fromFile . ', path: ' . $fromNode . ' does not exist or is empty.', E_USER_NOTICE);
                             }
                             $viewModel = $viewModel[0];
                         } else {
                             throw new \LogicException('Admin:showview: View ' . $viewName . ': file ' . $fromFile . ' does not exist or is not readable.');
                         }
                     } else {
                         throw new \LogicException('Admin:showview: View ' . $viewName . ' file or path not defined..', E_USER_NOTICE);
                     }
                 } else {
                     throw new \LogicException('Admin:showview: View ' . $viewName . ' not of supported type.', E_USER_NOTICE);
                 }
                 $viewUi = $viewModel->attributes('ui');
                 if ($viewUi & $viewUi != 'all' && $viewUi != $interfaceUi) {
                     throw new \LogicException('showview: View ' . $viewName . ' not allowed for ' . $interfaceUi);
                 }
                 $extendedParser = $allViewsModels->getElementByPath('extendxmlparser');
                 $actionPath = array_merge($actionPath, $keyValues);
                 $options = array_merge($this->getBaseOptions(), $actionPath, $parametersValues);
                 if ($ui == 2) {
                     $options = array_merge($options, $actionPath, $parametersValues);
                 }
                 $cbprevstate = $this->input->get('cbprevstate', null, GetterInterface::STRING);
                 $params = new RegistryEditController($this->input, $this->db, new Registry(), $viewModel, $element, $context->getPluginObject());
                 $displayData = $this->bindInput($viewMode, $data);
                 // Set the parameters with the $displayData :
                 $registry = new Registry();
                 $registry->load($displayData);
                 $registry->setStorage($displayData);
                 $params->setRegistry($registry);
                 $params->setPluginParams($pluginParams);
                 $params->setOptions($options);
                 if ($extendedParser) {
                     $params->setExtendedViewParser($extendedParser);
                 }
                 $extenders = $allViewsModels->xpath('extend');
                 foreach ($extenders as $extends) {
                     RegistryEditView::extendXMLnode($extends, $element, $actionsModel, $context->getPluginObject());
                 }
                 $viewType = $viewModel->attributes('type');
                 switch ($viewType) {
                     case 'params':
                         if ($mode == 'edit') {
                             if ($viewMode == 'edit' || $viewMode == 'show') {
                                 $viewTypeMode = $viewMode == 'edit' ? 'param' : 'view';
                                 if ($ui == 2) {
                                     $htmlOutput = $this->input->get('no_html', 0, GetterInterface::COMMAND) != 1 && $this->input->get('format', null, GetterInterface::COMMAND) != 'raw';
                                     ActionViewAdmin::editPluginView($options, $actionPath, $viewModel, $displayData, $params, $context->getPluginObject(), $viewTypeMode, $cbprevstate, $htmlOutput);
                                     $settings = null;
                                     $html = null;
                                 } else {
                                     /** @global \stdClass $_CB_Backend_Menu   : 'show' : only displays close button, 'edit' : special close button */
                                     global $_CB_Backend_Menu;
                                     $_CB_Backend_Menu = new \stdClass();
                                     $html = '';
                                     outputCbTemplate();
                                     outputCbJs();
                                     // $_CB_framework->outputCbJQuery( '' );
                                     initToolTip();
                                     $htmlFormatting = $viewModel->attributes('viewformatting');
                                     if (!$htmlFormatting) {
                                         global $ueConfig;
                                         if (isset($ueConfig['use_divs']) && $ueConfig['use_divs'] == 1) {
                                             $htmlFormatting = 'div';
                                         } else {
                                             $htmlFormatting = 'table';
                                         }
                                     }
                                     $settings = $params->draw(null, null, null, null, null, null, false, $viewTypeMode, $htmlFormatting);
                                 }
                                 if ($ui == 2) {
                                     $_CB_Backend_Menu->mode = $viewMode;
                                     // Implemented in lower level in RegistryEditView:  $toolbarMenu = $viewModel->getElementByPath( 'toolbarmenu' );
                                 }
                                 if ($ui != 2) {
                                     $actionView = new ActionView();
                                     $buttonSaveText = $actionsModel->attributes('label');
                                     if (!$buttonSaveText) {
                                         $buttonSaveText = 'Save';
                                     }
                                     $buttonSaveText = CBTxt::Th($buttonSaveText);
                                     //	CBTxt::Th("Save"); For translation strings extraction
                                     $warning = null;
                                     if ($viewTypeMode == 'param') {
                                         $settings .= '<div class="cbControlButtonsLine">' . "\n\t" . '<span class="cb_button_wrapper">' . '<button type="submit" name="actbutton" value="' . 'save' . $action . '" class="button cbregButton cbregSaveButton">' . $buttonSaveText . '</button>' . '</span>' . "\n\t" . '</div>' . "\n";
                                         $postedActionPath = $actionPath;
                                         unset($postedActionPath['view']);
                                         $formHiddens = array_merge($this->getBaseOptions(), array('act' => 'save' . $action), $postedActionPath);
                                     } else {
                                         $formHiddens = null;
                                     }
                                     $html .= $actionView->drawForm($settings, $warning, $formHiddens, array_merge($this->_getParams, array('act' => $action)), RegistryEditView::buildClasses($viewModel));
                                     return $html;
                                 }
                             } else {
                                 echo 'showview::params: mode is ' . $mode . ' but view mode is ' . $viewMode . ' instead of edit.';
                             }
                         } elseif (in_array($mode, array('apply', 'save', 'savenew', 'savecopy'))) {
                             $this->savePluginView($options, $actionPath, $keyValues, $parametersValues, $viewModel, $data, $params, $mode, $dataModelType, $context->getPluginObject(), $dataModel, $pluginParams, $cbprevstate, $ui);
                             if ($ui == 2 && $mode == 'apply') {
                                 // We arrive here only in case of saving error, as redirect (performed in savePluginView) would loose the inputs:
                                 return $this->drawView($option, $action, $element, 'edit');
                             }
                         } else {
                             echo 'showview::params: view type params mode ' . $mode . ' is not implemented !';
                         }
                         break;
                     default:
                         echo 'showview::not-params: type of view ' . $viewType . ' is not implemented !';
                         break;
                 }
                 break;
             default:
                 echo 'action::not-showview: child xml element "' . $actionItem->getName() . '" of action is not implemented !';
                 break;
         }
     }
     return null;
 }
 /**
  * @param  array       $connections
  * @param  array       $actions
  * @param  int         $total
  * @param  cbTabs      $connMgmtTabs
  * @param  array       $pagingParams
  * @param  int         $perpage
  * @param  array|null  $connecteds
  */
 static function manageConnections($connections, $actions, $total, &$connMgmtTabs, &$pagingParams, $perpage, $connecteds = null)
 {
     global $_CB_framework, $ueConfig, $_PLUGINS, $_REQUEST;
     $results = $_PLUGINS->trigger('onBeforeManageConnectionsFormDisplay', array(&$connections, &$actions, &$total, &$connMgmtTabs, &$pagingParams, &$perpage, &$connecteds));
     if ($_PLUGINS->is_errors()) {
         echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
         exit;
     }
     outputCbTemplate(1);
     initToolTip(1);
     cbValidator::loadValidation();
     $js = "if ( typeof confirmSubmit != 'function' ) {" . "function confirmSubmit() {" . "if ( confirm( '" . addslashes(CBTxt::T('UE_CONFIRMREMOVECONNECTION', 'Are you sure you want to remove this connection?')) . "' ) ) {" . "return true;" . "} else {" . "return false;" . "}" . "};" . "}";
     $_CB_framework->document->addHeadScriptDeclaration($js);
     $connectionCategories = explode("\n", $ueConfig['connection_categories']);
     $connectionTypes = array();
     if ($connectionCategories) {
         foreach ($connectionCategories as $connectionCategory) {
             if (trim($connectionCategory) != null && trim($connectionCategory) != "") {
                 $connectionTypes[] = moscomprofilerHTML::makeOption(trim($connectionCategory), CBTxt::T(trim($connectionCategory)));
             }
         }
     }
     $tabs = new cbTabs(0, 1);
     $pageClass = $_CB_framework->getMenuPageClass();
     $return = '<div class="cbManageConnections cb_template cb_template_' . selectTemplate('dir') . ($pageClass ? ' ' . htmlspecialchars($pageClass) : null) . '">';
     if (is_array($results)) {
         $return .= implode('', $results);
     }
     $return .= '<div class="page-header"><h3>' . CBTxt::Th('UE_MANAGECONNECTIONS', 'Manage Connections') . '</h3></div>' . $tabs->startPane('myCon') . $tabs->startTab('myCon', CBTxt::Th('UE_MANAGEACTIONS', 'Manage Actions') . ' <span class="badge">' . count($actions) . '</span>', 'action');
     if (!count($actions) > 0) {
         $return .= '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_NOACTIONREQUIRED', 'No Pending Actions') . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
     } else {
         $return .= '<form action="' . $_CB_framework->viewUrl('processconnectionactions') . '" method="post" id="adminForm" name="adminForm" class="cb_form form-auto cbValidation">' . '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_CONNECT_ACTIONREQUIRED', 'Below you see users proposing to connect with you. You have the choice to accept or decline their request.') . '</div>' . '<div class="table">';
         foreach ($actions as $action) {
             $cbUser = CBuser::getInstance((int) $action->id, false);
             $tipField = '<b>' . CBTxt::Th('UE_CONNECTIONREQUIREDON', 'Connection Required on') . '</b>: ' . $_CB_framework->getUTCDate(array($ueConfig['date_format'], 'Y-m-d'), $action->membersince);
             if ($action->reason != null) {
                 $tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTIONMESSAGE', 'Personal message included') . '</b>: <br />' . htmlspecialchars($action->reason, ENT_QUOTES);
             }
             $tipTitle = CBTxt::Th('UE_CONNECTIONREQUESTDETAIL', 'Connection Request Details');
             $htmlText = $cbUser->getField('avatar', null, 'html', 'none', 'list', 0, true);
             $tooltip = cbTooltip(1, $tipField, $tipTitle, 300, null, $htmlText, null, 'style="display: inline-block; padding: 5px;"');
             $return .= '<div class="containerBox img-thumbnail">' . '<div class="containerBoxInner" style="min-height: 130px; min-width: 90px;">' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '<br />' . '<span class="fa fa-check" title="' . htmlspecialchars(CBTxt::T('UE_ACCEPTCONNECTION', 'Accept Connection')) . '"></span>' . ' <input type="radio" name="' . (int) $action->id . 'action" value="a" checked="checked" />' . ' <span class="fa fa-times" title="' . htmlspecialchars(CBTxt::T('UE_DECLINECONNECTION', 'Decline Connection')) . '"></span>' . ' <input type="radio" name="' . (int) $action->id . 'action" value="d" />' . '<input type="hidden" name="uid[]" value="' . (int) $action->id . '" />' . '</div>' . '</div>';
         }
         $return .= '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="submit" class="btn btn-primary cbMngConnSubmit" value="' . htmlspecialchars(CBTxt::Th('UE_UPDATE', 'Update')) . '"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />' . ' <input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>' . cbGetSpoofInputTag('manageconnections') . '</form>';
     }
     $return .= $tabs->endTab() . $tabs->startTab('myCon', CBTxt::Th('UE_MANAGECONNECTIONS', 'Manage Connections'), 'connections');
     if (!count($connections) > 0) {
         $return .= '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_NOCONNECTIONS', 'This user has no current connections.') . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
     } else {
         $return .= '<form action="' . $_CB_framework->viewUrl('saveconnections') . '" method="post" id="adminForm" name="adminForm" class="cb_form form-auto cbValidation">' . '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_CONNECT_MANAGECONNECTIONS', 'Below you see users to whom you are connected directly. ') . '</div>' . '<table class="table table-hover table-responsive">' . '<thead>' . '<tr>' . '<th style="width: 25%;" class="text-center">' . CBTxt::Th('UE_CONNECTION', 'Connections') . '</th>' . '<th style="width: 35%;" class="text-center">' . CBTxt::Th('UE_CONNECTIONTYPE', 'Type') . '</th>' . '<th style="width: 40%;" class="text-center">' . CBTxt::Th('UE_CONNECTIONCOMMENT', 'Comment') . '</th>' . '</tr>' . '</thead>' . '<tbody>';
         $i = 1;
         foreach ($connections as $connection) {
             $cbUser = CBuser::getInstance((int) $connection->id, false);
             $tipField = '<b>' . CBTxt::Th('UE_CONNECTEDSINCE', 'Connected Since') . '</b>: ' . $_CB_framework->getUTCDate(array($ueConfig['date_format'], 'Y-m-d'), $connection->membersince);
             if ($connection->type != null) {
                 $tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTIONTYPE', 'Type') . '</b>: ' . getConnectionTypes($connection->type);
             }
             if ($connection->description != null) {
                 $tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTEDCOMMENT', 'Comment') . '</b>: ' . htmlspecialchars($connection->description);
             }
             $tipTitle = CBTxt::Th('UE_CONNECTEDDETAIL', 'Connection Details');
             $htmlText = $cbUser->getField('avatar', null, 'html', 'none', 'list', 0, true);
             $tooltip = cbTooltip(1, $tipField, $tipTitle, 300, null, $htmlText, null, 'style="display: inline-block; padding: 5px;"');
             if ($connection->accepted == 1 && $connection->pending == 1) {
                 $actionImg = '<span class="fa fa-clock-o" title="' . htmlspecialchars(CBTxt::T('UE_CONNECTIONPENDING', 'Connection Pending')) . '"></span>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
             } elseif ($connection->accepted == 1 && $connection->pending == 0) {
                 $actionImg = '<a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
             } elseif ($connection->accepted == 0) {
                 $actionImg = '<a href="' . $_CB_framework->viewUrl('acceptconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-check-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_ACCEPTCONNECTION', 'Accept Connection')) . '"></span>' . '</a>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
             } else {
                 $actionImg = null;
             }
             $return .= '<tr>' . '<td class="text-center">' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '<br />' . $actionImg . ' <a href="' . $_CB_framework->userProfileUrl((int) $connection->memberid) . '">' . '<span class="fa fa-user" title="' . htmlspecialchars(CBTxt::T('UE_VIEWPROFILE', 'View Profile')) . '"></span>' . '</a>' . ' ' . $cbUser->getField('email', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('pm', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . '</td>' . '<td class="text-center">' . moscomprofilerHTML::selectList($connectionTypes, $connection->id . 'connectiontype[]', 'class="form-control" multiple="multiple" size="5"', 'value', 'text', explode('|*|', trim($connection->type)), 0) . '</td>' . '<td class="text-center">' . '<textarea cols="25" class="form-control"  rows="5" name="' . (int) $connection->id . 'description">' . htmlspecialchars($connection->description) . '</textarea>' . '<input type="hidden" name="uid[]" value="' . (int) $connection->id . '" />' . '</td>' . '</tr>';
             $i = $i == 1 ? 2 : 1;
         }
         $return .= '</tbody>' . '</table>';
         if ($perpage < $total) {
             $return .= '<div class="form-group cb_form_line text-center clearfix">' . $connMgmtTabs->_writePaging($pagingParams, 'connections_', $perpage, $total, 'manageconnections') . '</div>';
         }
         $return .= '<div class="form-group cb_form_line clearfix">' . '<input type="submit" class="btn btn-primary cbMngConnSubmit" value="' . htmlspecialchars(CBTxt::Th('UE_UPDATE', 'Update')) . '"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />' . ' <input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>' . cbGetSpoofInputTag('manageconnections') . '</form>';
     }
     $return .= $tabs->endTab();
     if ($ueConfig['autoAddConnections'] == 0) {
         $return .= $tabs->startTab('myCon', CBTxt::Th('UE_CONNECTEDWITH', 'Manage Connections With Me'), 'connected');
         if (!count($connecteds) > 0) {
             $return .= '<div class="form-group cb_form_line clearfix tab_description">' . CBTxt::Th('UE_NOCONNECTEDWITH', 'There are currently no users connected with you.') . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
         } else {
             $htmlConnectedWidth = CBTxt::Th('UE_CONNECT_CONNECTEDWITH', '');
             $return .= ($htmlConnectedWidth ? '<div class="form-group cb_form_line clearfix tab_description">' . $htmlConnectedWidth . '</div>' : null) . '<div class="table">';
             foreach ($connecteds as $connected) {
                 $cbUser = CBuser::getInstance((int) $connected->id, false);
                 $tipField = '<b>' . CBTxt::Th('UE_CONNECTEDSINCE', 'Connected Since') . '</b>: ' . $_CB_framework->getUTCDate(array($ueConfig['date_format'], 'Y-m-d'), $connected->membersince);
                 if ($connected->type != null) {
                     $tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTIONTYPE', 'Type') . '</b>: ' . getConnectionTypes($connected->type);
                 }
                 if ($connected->description != null) {
                     $tipField .= '<br /><b>' . CBTxt::Th('UE_CONNECTEDCOMMENT', 'Comment') . '</b>: ' . htmlspecialchars($connected->description);
                 }
                 $tipTitle = CBTxt::Th('UE_CONNECTEDDETAIL', 'Connection Details');
                 $htmlText = $cbUser->getField('avatar', null, 'html', 'none', 'list', 0, true);
                 $tooltip = cbTooltip(1, $tipField, $tipTitle, 300, null, $htmlText, null, 'style="padding: 5px;"');
                 if ($connected->accepted == 1 && $connected->pending == 1) {
                     $actionImg = '<span class="fa fa-clock-o" title="' . htmlspecialchars(CBTxt::T('UE_CONNECTIONPENDING', 'Connection Pending')) . '"></span>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'manage', 'connectionid' => (int) $connected->memberid)) . '" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
                 } elseif ($connected->accepted == 1 && $connected->pending == 0) {
                     $actionImg = '<a href="' . $_CB_framework->viewUrl('denyconnection', true, array('act' => 'manage', 'connectionid' => (int) $connected->referenceid)) . '" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
                 } elseif ($connected->accepted == 0) {
                     $actionImg = '<a href="' . $_CB_framework->viewUrl('acceptconnection', true, array('act' => 'manage', 'connectionid' => (int) $connected->referenceid)) . '" >' . '<span class="fa fa-check-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_ACCEPTCONNECTION', 'Accept Connection')) . '"></span>' . '</a>' . ' <a href="' . $_CB_framework->viewUrl('denyconnection', true, array('act' => 'manage', 'connectionid' => (int) $connected->referenceid)) . '" >' . '<span class="fa fa-times-circle-o" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
                 } else {
                     $actionImg = null;
                 }
                 $return .= '<div class="containerBox img-thumbnail">' . '<div class="containerBoxInner" style="min-height: 130px; min-width: 90px;">' . $actionImg . '<br />' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '<br />' . ' <a href="' . $_CB_framework->userProfileUrl((int) $connected->referenceid) . '">' . '<span class="fa fa-user" title="' . htmlspecialchars(CBTxt::T('UE_VIEWPROFILE', 'View Profile')) . '"></span>' . '</a>' . ' ' . $cbUser->getField('email', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('pm', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . '</div>' . '</div>';
             }
             $return .= '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="button" class="btn btn-default cbMngConnCancel" value="' . htmlspecialchars(CBTxt::Th('UE_CANCEL', 'Cancel')) . '" onclick="window.location=\'' . $_CB_framework->userProfileUrl() . '\'; return false;" />' . '</div>';
         }
         $return .= $tabs->endTab();
     }
     $return .= $tabs->endPane() . '</div>' . cbPoweredBy();
     echo $return;
     $_CB_framework->setMenuMeta();
 }
Пример #23
0
    function edituser($user, $option, $newCBuser, &$postdata)
    {
        global $_CB_framework, $_PLUGINS;
        $results = $_PLUGINS->trigger('onBeforeUserProfileEditDisplay', array(&$user, 2));
        if ($_PLUGINS->is_errors()) {
            echo "<script type=\"text/javascript\">alert(\"" . str_replace(array("\n", '<br />'), array('\\n', '\\n'), addslashes($_PLUGINS->getErrorMSG())) . "\"); window.history.go(-1); </script>\n";
            exit;
        }
        _CBsecureAboveForm('edituser');
        outputCbTemplate(2);
        initToolTip(2);
        $tabs = new cbTabs($_CB_framework->getUi() == 2 && !isset($_REQUEST['tab']) ? 1 : 0, 2);
        // use cookies in backend to remember selected tab.
        $tabcontent = $tabs->getEditTabs($user, $postdata);
        outputCbJs(2);
        global $_CB_Backend_Title;
        //OLD:	$_CB_Backend_Title	=	array( 0 => array( 'cbicon-48-users', "Community Builder User: <small>" . ( $user->id ? "Edit" . ' [ '. $user->username .' ]' : "New" ) . '</small>' ) );
        //NEW:
        $_CB_Backend_Title = array(0 => array('cbicon-48-users', CBTxt::T('Community Builder User') . ": <small>" . ($user->id ? CBTxt::T('Edit') . ' [ ' . $user->username . ' ]' : CBTxt::T('New')) . '</small>'));
        ob_start();
        if (defined('_CB_VALIDATE_NEW')) {
            cbimport('cb.validator');
            cbValidator::renderGenericJs();
            ?>

$('div.cbtoolbaractions .cbtoolbaraction').click( function() {
		if ( $(this).attr('href') ) {
			var taskVal = $(this).attr('href').substring(1);
		} else if ( $(this).attr('value') ) {
			taskVal = $(this).attr('value').substring(1);
		}
		$('#cbcheckedadminForm input[name=task]').val( taskVal );
		if (taskVal == 'showusers') {
			$('#cbcheckedadminForm')[0].submit();
		} else {
			$('#cbcheckedadminForm').submit();
		}
		return false;
	} );

<?php 
            $cbjavascript = ob_get_contents();
            ob_end_clean();
            $_CB_framework->outputCbJQuery($cbjavascript, array('metadata', 'validate'));
        } else {
            // old way:
            ?>
var cbDefaultFieldbackgroundColor;
function cbFrmSubmitButton() {
	var me = this.elements;
<?php 
            $version = checkJversion();
            if ($version == 1) {
                // var r = new RegExp("^[a-zA-Z](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i");
                ?>
	var r = new RegExp("^[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]*$", "i");
<?php 
            } elseif ($version == -1) {
                ?>
	var r = new RegExp("[^A-Za-z0-9]", "i");
<?php 
            } else {
                ?>
	var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
<?php 
            }
            ?>
	var errorMSG = '';
	var iserror=0;
	if (cbDefaultFieldbackgroundColor === undefined) cbDefaultFieldbackgroundColor = ((me['username'].style.getPropertyValue) ? me['username'].style.getPropertyValue("backgroundColor") : me['username'].style.backgroundColor);
<?php 
            echo $tabs->fieldJS;
            ?>
	if (me['username'].value == "") {
		errorMSG += "<?php 
            echo str_replace(array("\n", "\r"), ' ', CBTxt::html_entity_decode(_REGWARN_UNAME));
            ?>
\n";
		me['username'].style.backgroundColor = "red";
		iserror=1;
	} else if (r.exec(me['username'].value) || (me['username'].value.length < 3)) {
		errorMSG += "<?php 
            echo str_replace(array("\n", "\r"), ' ', sprintf(CBTxt::html_entity_decode(_VALID_AZ09), CBTxt::html_entity_decode(_PROMPT_UNAME), 2));
            ?>
\n";
		me['username'].style.backgroundColor = "red";
		iserror=1;
	} else if (me['username'].style.backgroundColor.slice(0,3)=="red") {
		me['username'].style.backgroundColor = cbDefaultFieldbackgroundColor;
	}
	if ((me['password'].value != "") && (me['password'].value != me['password__verify'].value)){
		errorMSG += "<?php 
            echo CBTxt::html_entity_decode(_REGWARN_VPASS2);
            ?>
\n";
		me['password'].style.backgroundColor = "red"; me['password__verify'].style.backgroundColor = "red";
		iserror=1;
	} else {
		if (me['password'].style.backgroundColor.slice(0,3)=="red") me['password'].style.backgroundColor = cbDefaultFieldbackgroundColor;
		if (me['password__verify'].style.backgroundColor.slice(0,3)=="red") me['password__verify'].style.backgroundColor = cbDefaultFieldbackgroundColor;
	}
	if (!$('input[name^=\"gid\"],select[name^=\"gid\"]').val()) {
		errorMSG += '<?php 
            echo addslashes(CBTxt::T('You must assign user to a group.'));
            ?>
' + "\n";
		iserror=1;
	}

	// loop through all input elements in form
	var fieldErrorMessages = new Array;
	for (var i=0; i < me.length; i++) {
		// check if element is mandatory; here mosReq=1
		if ( (typeof(me[i].getAttribute('mosReq')) != "undefined") && ( me[i].getAttribute('mosReq') == 1) ) {
			if (me[i].type == 'radio' || me[i].type == 'checkbox') {
				var rOptions = me[me[i].getAttribute('name')];
				var rChecked = 0;
				if(rOptions.length > 1) {
					for (var r=0; r < rOptions.length; r++) {
						if ( (typeof(rOptions[r].getAttribute('mosReq')) != "undefined") && ( rOptions[r].getAttribute('mosReq') == 1) ) {
							if (rOptions[r].checked) {
								rChecked=1;
							}
						}
					}
				} else {
					if (me[i].checked) {
						rChecked=1;
					}
				}
				if(rChecked==0) {
					for (var k=0; k < me.length; k++) {
						if (me[i].getAttribute('name') == me[k].getAttribute('name')) {
							if (me[k].checked) {
								rChecked=1;
								break;
							}
						}
					}
				}
				if(rChecked==0) {
					var alreadyFlagged = false;
					for (var j = 0, n = fieldErrorMessages.length; j < n; j++) {
						if (fieldErrorMessages[j] == me[i].getAttribute('name')) {
							alreadyFlagged = true;
							break
						}
					}
					if ( ! alreadyFlagged ) {
						fieldErrorMessages.push(me[i].getAttribute('name'));
						// add up all error messages
						errorMSG += me[i].getAttribute('mosLabel') + ' : <?php 
            echo CBTxt::html_entity_decode(_UE_REQUIRED_ERROR);
            ?>
\n';
						// notify user by changing background color, in this case to red
						me[i].style.backgroundColor = "red";
						iserror=1;
					}
				} else if (me[i].style.backgroundColor.slice(0,3)=="red") me[i].style.backgroundColor = cbDefaultFieldbackgroundColor;
			}
			if (me[i].value == '') {
				// add up all error messages
				errorMSG += me[i].getAttribute('mosLabel') + ' : <?php 
            echo CBTxt::html_entity_decode(_UE_REQUIRED_ERROR);
            ?>
\n';
				// notify user by changing background color, in this case to red
				me[i].style.backgroundColor = "red";
				iserror=1;
			} else if (me[i].style.backgroundColor.slice(0,3)=="red") me[i].style.backgroundColor = cbDefaultFieldbackgroundColor;
		}
	}
	if(iserror==1) {
		alert(errorMSG);
		return false;
	} else {
		return true;
	}
}
$('#cbcheckedadminForm').submit( cbFrmSubmitButton );
$('div.cbtoolbaractions .cbtoolbaraction').click( function() {
		if ( $(this).attr('href') ) {
			var taskVal = $(this).attr('href').substring(1);
		} else if ( $(this).attr('value') ) {
			taskVal = $(this).attr('value').substring(1);
		}
		$('#cbcheckedadminForm input[name=task]').val( taskVal );
		if (taskVal == 'showusers') {
			$('#userEditTable input').val('');
			$('#cbcheckedadminForm')[0].submit();
		} else {
			$('#cbcheckedadminForm').submit();
		}
		return false;
	} );
<?php 
            $cbjavascript = ob_get_contents();
            ob_end_clean();
            $_CB_framework->outputCbJQuery($cbjavascript);
            // end of old way
        }
        if (is_array($results)) {
            echo implode('', $results);
        }
        $this->_overideWebFxLayout();
        ?>
<div id="cbErrorMessages"></div>
<form action="<?php 
        echo $_CB_framework->backendUrl('index.php');
        ?>
" method="post" name="adminForm" id="cbcheckedadminForm" enctype="multipart/form-data" autocomplete="off">
<?php 
        echo "<table cellspacing='0' cellpadding='4' border='0' width='100%' id='userEditTable'><tr><td width='100%'>\n";
        echo $tabcontent;
        echo "</td></tr></table>";
        ?>
  <input type="hidden" name="id" value="<?php 
        echo $user->id;
        ?>
" />
  <input type="hidden" name="newCBuser" value="<?php 
        echo $newCBuser;
        ?>
" />
  <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
  <input type="hidden" name="task" value="save" />
  <?php 
        echo cbGetSpoofInputTag('user');
        ?>
</form>
<div style="align:center;">
<?php 
        echo getFieldIcons(2, true, true, "", "", true);
        if (isset($_REQUEST['tab'])) {
            $_CB_framework->outputCbJQuery("showCBTab( '" . addslashes(urldecode(stripslashes(cbGetParam($_REQUEST, 'tab')))) . "' );");
        }
        ?>
</div>
<?php 
    }
Пример #24
0
	/**
	* Writes a list of the defined modules
	* @param array An array of category objects
	*/
	static function showPlugins( &$rows, &$pageNav, $option, &$lists, $search ) {
		global $_CB_framework, $_PLUGINS;

		HTML_comprofiler::secureAboveForm('showPlugins');

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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



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

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

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

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

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

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

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

		?>
		</table>
	</div>
		<?php
	}
Пример #25
0
 /**
  * Installs the plugin By in-place Discovery
  *
  * @param  string   $plgFile  Directory discovered
  * @return boolean            Success
  */
 private function installPluginDisc($plgFile)
 {
     global $_CB_framework;
     // Try extending time, as unziping/ftping took already quite some... :
     @set_time_limit(240);
     _CBsecureAboveForm('showPlugins');
     outputCbTemplate(2);
     outputCbJs(2);
     initToolTip(2);
     $installer = new cbInstallerPlugin();
     // Check if file xml exists
     if (!$plgFile) {
         cbInstaller::showInstallMessage(CBTxt::T('No file selected'), CBTxt::T('Install new plugin from discovery - error'), false);
         return false;
     }
     $path = _cbPathName($_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/' . $plgFile);
     if (!is_dir($path)) {
         $path = dirname($path);
     }
     if (!is_dir($path)) {
         cbInstaller::showInstallMessage(CBTxt::T('FILE_DOES_NOT_EXIST_FILE', 'File does not exist - [file]', array('[file]' => $path)), CBTxt::T('INSTALL_NEW_PLUGIN_FROM_DISCOVERY_ERROR', 'Install new plugin from discovery - error'), false);
         return false;
     }
     $ret = $installer->install($path, true);
     cbInstaller::showInstallMessage($installer->getError(), CBTxt::T('INSTALL_NEW_PLUGIN_FROM_DISCOVERY_ERROR_FILE_STATUS', 'Install new plugin from discovery - [file] - [status]', array('[file]' => $path, '[status]' => $ret ? CBTxt::T('Success') : CBTxt::T('Failed'))), $ret);
     return $ret;
 }
Пример #26
0
	/**
	 * render frontend event attending
	 *
	 * @param AttendanceTable[]        $rows
	 * @param cbPageNav                $pageNav
	 * @param bool                     $searching
	 * @param array                    $input
	 * @param EventTable               $event
	 * @param UserTable                $user
	 * @param CBplug_cbgroupjiveevents $plugin
	 * @return string
	 */
	static function showAttending( $rows, $pageNav, $searching, $input, $event, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		initToolTip();

		$canSearch						=	( $plugin->params->get( 'groups_events_attending_search', 0 ) && ( $searching || $pageNav->total ) );
		$returnUrl						=	CBGroupJive::getReturn( true, true );

		if ( ! $returnUrl ) {
			$returnUrl					=	$_CB_framework->pluginClassUrl( $plugin->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $event->group()->get( 'id' ) ) );
		}

		$return							=	null;

		$_PLUGINS->trigger( 'gj_onBeforeDisplayAttending', array( &$return, &$rows, $event, $user ) );

		$return							.=	'<div class="gjEventAttending">'
										.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'events', 'func' => 'attending', 'id' => (int) $event->get( 'id' ) ) ) . '" method="post" name="gjEventAttendingForm" id="gjEventAttendingForm" class="gjEventAttendingForm">'
										.			'<div class="gjEventAttendingTitle page-header"><h3>' . htmlspecialchars( $event->get( 'title' ) ) . '</h3></div>';

		if ( $canSearch ) {
			$return						.=			'<div class="gjHeader gjEventAttendingHeader row">'
										.				'<div class="col-sm-offset-8 col-sm-4 text-right">'
										.					'<div class="input-group">'
										.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
										.						$input['search']
										.					'</div>'
										.				'</div>'
										.			'</div>';
		}

		$return							.=			'<div class="gjEventAttendingRows">';

		if ( $rows ) foreach ( $rows as $row ) {
			$cbUser						=	CBuser::getInstance( (int) $row->get( 'user_id' ), false );

			$return						.=				'<div class="gjEventAttendingUser gjContainerBox img-thumbnail">'
										.					'<div class="gjContainerBoxHeader">'
										.						'<div class="gjContainerBoxCanvas text-left">'
										.							$cbUser->getField( 'canvas', null, 'html', 'none', 'profile', 0, true )
										.						'</div>'
										.						'<div class="gjContainerBoxLogo text-left">'
										.							$cbUser->getField( 'avatar', null, 'html', 'none', 'list', 0, true )
										.						'</div>'
										.					'</div>'
										.					'<div class="gjContainerBoxBody text-left">'
										.						'<div class="gjContainerBoxTitle">'
										.							$cbUser->getField( 'onlinestatus', null, 'html', 'none', 'list', 0, true, array( '_imgMode' => 1 ) )
										.							' <strong>' . $cbUser->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) . '</strong>'
										.						'</div>'
										.					'</div>'
										.				'</div>';
		} else {
			if ( $searching ) {
				$return					.=				CBTxt::T( 'No event guest search results found.' );
			} else {
				$return					.=				CBTxt::T( 'This event currently has no guests.' );
			}
		}

		$return							.=			'</div>';

		if ( $plugin->params->get( 'groups_events_attending_paging', 1 ) && ( $pageNav->total > $pageNav->limit ) ) {
			$return						.=			'<div class="gjEventAttendingPaging text-center">'
										.				$pageNav->getListLinks()
										.			'</div>';
		}

		$return							.=			$pageNav->getLimitBox( false )
										.			'<div class="form-group cb_form_line clearfix text-right">'
										.				'<input type="button" value="' . htmlspecialchars( CBTxt::T( 'Back' ) ) . '" class="gjButton gjButtonCancel btn btn-default" onclick="window.location.href = \'' . $returnUrl . '\';" />'
										.			'</div>'
										.		'</form>'
										.	'</div>';

		$_PLUGINS->trigger( 'gj_onAfterDisplayAttending', array( &$return, &$rows, $event, $user ) );

		echo $return;
	}
Пример #27
0
 public function outputScripts()
 {
     initToolTip(1);
 }
Пример #28
0
	/**
	 * @param  OrderedTable  $row
	 * @param  string[]      $input
	 * @param  UserTable     $user
	 * @param  stdClass      $model
	 * @param  PluginTable   $plugin
	 */
	static function showBlogEdit( $row, $input, $user, /** @noinspection PhpUnusedParameterInspection */ $model, $plugin )
	{
		global $_CB_framework, $_PLUGINS, $_LANG;

		cbValidator::loadValidation();

		$blogMode			=	$plugin->params->get( 'hangout_mode', 1 );
		$pageTitle			=	( $row->get( 'id' ) ? $_LANG['Edit Hangout'] : $_LANG['Create Hangout'] );
		$cbModerator		=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( $_LANG['Hangout'] ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbhangoutTab' ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'hangout', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'hangout', 'func' => 'new' ) ) ) );

		initToolTip();

		$return				=	'<div class="blogEdit">'
							.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'hangout', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="blogForm" id="blogForm" class="cb_form blogForm form-auto cbValidation">'
							.			( $pageTitle ? '<div class="blogsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null );

		if ( $cbModerator || ( ! $plugin->params->get( 'hangout_approval', 0 ) ) ) {
			$return			.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
							.				'<label for="published" class="col-sm-3 control-label">' . CBTxt::Th( 'Published' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['published']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'hangout_category_config', 1 ) || $cbModerator ) {
			$return			.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
							.				'<label for="category" class="col-sm-3 control-label">' . CBTxt::Th( 'Category' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['category']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'hangout_access_config', 1 ) || $cbModerator ) {
			$return			.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
							.				'<label for="access" class="col-sm-3 control-label">' . CBTxt::Th( 'Access' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['access']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		$return				.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="title" class="col-sm-3 control-label">' . CBTxt::Th( 'Title' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['title']
							.					getFieldIcons( 1, 1, null, '' )
							.				'</div>'
							.			'</div>';

		if ( in_array( $blogMode, array( 1, 2 ) ) ) {
			$return			.=			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="hangout_intro" class="col-sm-3 control-label">' . ( $blogMode == 1 ? $_LANG['Text intro'] : $_LANG['Text intro'] ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['hangout_intro']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( in_array( $blogMode, array( 1, 3 ) ) ) {
			$return			.=			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="hangout_full" class="col-sm-3 control-label">' . ( $blogMode == 1 ? $_LANG['Text full'] : $_LANG['Text full'] ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['hangout_full']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
                        
                        $return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="title" class="col-sm-3 control-label">' . $_LANG['Price'] . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['price']
							.					getFieldIcons( 1, 0, null, $_LANG['Input price']  )
							.				'</div>'
							.			'</div>';
                        
		}

		if ( $cbModerator ) {
			$return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['user']
							.					getFieldIcons( 1, 1, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'hangout_captcha', 0 ) && ( ! $cbModerator ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha		=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha	=	$captcha[0];

				$return		.=			'<div class="form-group cb_form_line clearfix">'
							.				'<label class="col-sm-3 control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					( isset( $captcha[0] ) ? $captcha[0] : null )
							.				'</div>'
							.			'</div>'
							.			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
							.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
							.					getFieldIcons( 1, 1, null )
							.				'</div>'
							.			'</div>';
			}
		}

		$return				.=			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="col-sm-offset-3 col-sm-9">'
							.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? $_LANG["Update Hangout"] : $_LANG["Create Hangout"] ) ) . '" class="blogsButton blogsButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;'
							.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="blogsButton blogsButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbhangoutTab' ) . '\'; }" />'
							.				'</div>'
							.			'</div>'
							.			cbGetSpoofInputTag( 'plugin' )
							.		'</form>'
							.	'</div>';

		echo $return;
	}
 /**
  * Renders a CB Tooltip
  *
  * @param int $ui determines tooltip image location (1 = frontend and 2 = backend)
  * @param string $tooltip tooltip content message
  * @param null|string $title tooltip title
  * @param null|int|array $size tooltip size (single int width or array of width and height)
  * @param string $image tooltip icon
  * @param null|string $html tooltip custom html (overrides image display)
  * @param null|string $href tooltip url
  * @param null|string $attributes custom tooltip element html attributes
  * @param null|string $imageAttributes custom tooltip image html attributes
  * @return string
  */
 function cbTooltip($ui, $tooltip, $title = null, $size = null, $image = null, $html = '<span class="fa fa-info-circle"></span>', $href = null, $attributes = null, $imageAttributes = null)
 {
     global $_CB_framework;
     static $init = 0;
     if (!$init++) {
         initToolTip();
     }
     if ($image) {
         if (preg_match('%^/%', $image)) {
             $imagePath = $_CB_framework->getCfg('live_site') . $image;
         } elseif (preg_match('/^http/i', $image)) {
             $imagePath = $image;
         } else {
             $imagePath = selectTemplate($ui) . $image;
         }
     } else {
         $imagePath = null;
     }
     if (strpos($attributes, 'data-hascbtooltip="true"') !== false) {
         $class = null;
     } else {
         $class = 'cbTooltip';
     }
     if ($attributes) {
         $attributes = trim(stripslashes($attributes));
         if (preg_match('/class=(?:\'|")([^\'"]+)(?:\'|")/', $attributes, $classes)) {
             $attributes = preg_replace('/class=(?:\'|")([^\'"]+)(?:\'|")/', '', $attributes);
             $class .= ' ' . $classes[1];
         }
     }
     if ($imageAttributes) {
         $imageAttributes = trim(stripslashes($imageAttributes));
     }
     if ($size) {
         if (is_array($size)) {
             if (count($size) > 1) {
                 $width = $size[0] == 'auto' ? false : ($size[0] ? $size[0] : null);
                 $height = $size[1] == 'auto' ? false : ($size[1] ? $size[1] : null);
             } else {
                 $width = $size[0] == 'auto' ? false : ($size[0] ? $size[0] : null);
                 $height = null;
             }
         } else {
             $width = $size == 'auto' ? false : ($size ? $size : null);
             $height = null;
         }
     } else {
         $width = null;
         $height = null;
     }
     $toolTipAttributes = ($class ? ' class="' . htmlspecialchars($class) . '"' : null) . ' data-cbtooltip-tooltip="' . htmlspecialchars(stripslashes($tooltip)) . '"' . ($title ? ' data-cbtooltip-title="' . htmlspecialchars(stripslashes($title)) . '"' : null) . ($width !== null ? ' data-cbtooltip-width="' . htmlspecialchars($width) . '"' : null) . ($height !== null ? ' data-cbtooltip-height="' . htmlspecialchars($height) . '"' : null) . ($attributes ? ' ' . $attributes : null);
     if ($image || $html || $href) {
         if ($href) {
             if (!$html) {
                 if ($imagePath) {
                     $html = '<img src="' . htmlspecialchars($imagePath) . '""' . ($imageAttributes ? ' ' . $imageAttributes : null) . ' />';
                 } else {
                     $html = $href;
                 }
             }
             $return = '<a href="' . htmlspecialchars($href) . '"' . $toolTipAttributes . '>' . $html . '</a>';
         } else {
             if ($html) {
                 $return = '<span' . $toolTipAttributes . '>' . $html . '</span>';
             } elseif ($imagePath) {
                 $return = '<img src="' . htmlspecialchars($imagePath) . '"' . $toolTipAttributes . ($imageAttributes ? ' ' . $imageAttributes : null) . ' />';
             } else {
                 $return = null;
             }
         }
     } else {
         $return = $toolTipAttributes;
     }
     return $return;
 }
Пример #30
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 
    }