コード例 #1
0
ファイル: Model.php プロジェクト: kosmosby/medicine-prof
	/**
	 * @return array
	 */
	public function getCategories()
	{
		$rows			=	\KunenaForumCategoryHelper::getChildren( 0, 10, array( 'action' => 'admin', 'unpublished' => true ) );
		$options		=	array();

		foreach ( $rows as $row ) {
			$options[]	=	\moscomprofilerHTML::makeOption( (string) $row->id, str_repeat( '- ', $row->level + 1  ) . ' ' . $row->name );
		}

		return $options;
	}
コード例 #2
0
ファイル: cb.lists.php プロジェクト: rkern21/videoeditor
	function drawUsersList( $uid, $listid, $searchFormValuesRAW ) {
		global $_CB_database, $_CB_framework, $ueConfig, $Itemid, $_PLUGINS;
	
		$search					=	null;
		$searchGET				=	cbGetParam( $searchFormValuesRAW, 'search' );
		$limitstart				=	(int) cbGetParam( $searchFormValuesRAW, 'limitstart', 0 );
		$searchmode				=	(int) cbGetParam( $searchFormValuesRAW, 'searchmode', 0 );
		$randomParam			=	(int) cbGetParam( $searchFormValuesRAW, 'rand', 0 );
	
		// old search on formated name:
	
	/*	if ( $searchPOST || count( $_POST ) ) {
			// simple spoof check security
			cbSpoofCheck( 'usersList' );
			if ( cbGetParam( $searchFormValuesRAW, "action" ) == "search" ) {
				$search			=	$searchPOST;
			}
		} else
			if ( isset( $searchFormValuesRAW['limitstart'] ) ) {
				$search				=	stripslashes( $searchGET );
			}
	*/
		// get my user and gets the list of user lists he is allowed to see (ACL):
	
		$myCbUser				=&	CBuser::getInstance( $uid );
		if ( $myCbUser === null ) {
			$myCbUser			=&	CBuser::getInstance( null );
		}
		$myUser					=&	$myCbUser->getUserData();
	/*
		$myUser					=	new moscomprofilerUser( $_CB_database );
		if ( $uid ) {
			$myUser->load( (int) $uid );
		}
	*/
		$useraccessgroupSQL		=	" AND useraccessgroupid IN (".implode(',',getChildGIDS(userGID($uid))).")";
		$_CB_database->setQuery( "SELECT listid, title FROM #__comprofiler_lists WHERE published=1" . $useraccessgroupSQL . " ORDER BY ordering" );
		$plists					=	$_CB_database->loadObjectList();
		$lists					=	array();
		$publishedlists			=	array();
	
		for ( $i=0, $n=count( $plists ); $i < $n; $i++ ) {
			$plist				=&	$plists[$i];
			$listTitleNoHtml	=	strip_tags( cbReplaceVars( getLangDefinition( $plist->title ), $myUser, false, false ) );
		   	$publishedlists[]	=	moscomprofilerHTML::makeOption( $plist->listid, $listTitleNoHtml );
		}
	
		// select either list selected or default list to which he has access (ACL):
	
		if ( $listid == 0 ) {
			$_CB_database->setQuery( "SELECT listid FROM #__comprofiler_lists "
			. "\n WHERE `default`=1 AND published=1" . $useraccessgroupSQL );
			$listid				=	(int) $_CB_database->loadresult();
			if ( $listid == 0 && ( count( $plists ) > 0 ) ) {
				$listid			=	(int) $plists[0]->listid;
			}
		}
		if ( ! ( $listid > 0 ) ) {
			echo _UE_NOLISTFOUND;
			return;
		}
	
		// generates the drop-down list of lists:
	
		if ( count( $plists ) > 1 ) {
			$lists['plists']	=	moscomprofilerHTML::selectList( $publishedlists, 'listid', 'class="inputbox" size="1" onchange="this.form.submit();"', 'value', 'text', $listid, 1 );
		}
	
		// loads the list record:
	
		$row					=	new moscomprofilerLists( $_CB_database );
		if ( ( ! $row->load( (int) $listid ) ) || ( $row->published != 1 ) ) {
			echo _UE_LIST_DOES_NOT_EXIST;
			return;
		}
		if ( ! allowAccess( $row->useraccessgroupid,'RECURSE', userGID($uid) ) ) {
			echo _UE_NOT_AUTHORIZED;
			return;
		}
	
		$params					=	new cbParamsBase( $row->params );
	
		$hotlink_protection		=	$params->get( 'hotlink_protection', 0 );
		if ( $hotlink_protection == 1 ) {
			if ( ( $searchGET !== null ) || $limitstart ) {
				cbSpoofCheck( 'usersList', 'GET' );
			}
		}
	
		$limit					=	(int) $params->get( 'list_limit' );
		if ( $limit == 0 ) {
			$limit				=	(int) $ueConfig['num_per_page'];
		}
	
		$showPaging				=	$params->get( 'list_paging', 1 );
		if ( $showPaging != 1 ) {
			$limitstart			=	0;
		}
	
		$isModerator			=	isModerator( $_CB_framework->myId() );
	
		$_PLUGINS->loadPluginGroup( 'user' );
		// $plugSearchFieldsArray	=	$_PLUGINS->trigger( 'onStartUsersList', array( &$listid, &$row, &$search, &$limitstart, &$limit ) );
		$_PLUGINS->trigger( 'onStartUsersList', array( &$listid, &$row, &$search, &$limitstart, &$limit ) );
	
		// handles the users allowed to be listed in the list by ACL:
	
		$allusergids			=	array();
		$usergids				=	explode( ',', $row->usergroupids );
	/*	This was a bug tending to list admins when "public backend" was checked, and all frontend users when "public backend was checked. Now just ignore them:
		foreach( $usergids AS $usergid ) {
			$allusergids[]		=	$usergid;
			if ($usergid==29 || $usergid==30) {
				$groupchildren	=	array();
				$groupchildren	=	$_CB_framework->acl->get_group_children( $usergid, 'ARO','RECURSE' );
				$allusergids	=	array_merge($allusergids,$groupchildren);
			}
		}
	*/
		$allusergids			=	array_diff( $usergids, array( 29, 30 ) );
		$usergids				=	implode( ",", $allusergids );
	
		// build SQL Select query:
	
		$random					=	0;
		if( $row->sortfields != '' ) {
			$matches			=	null;
			if ( preg_match( '/^RAND\(\)\s(ASC|DESC)$/', $row->sortfields, $matches ) ) {
				// random sorting needs to have same seed on pages > 1 to not have probability to show same users:
				if ( $limitstart ) {
					$random		=	(int) $randomParam;
				}
				if ( ! $random ) {
					$random		=	rand( 0, 32767 );
				}
				$row->sortfields =	'RAND(' . (int) $random . ') ' . $matches[1];
			}
			$orderby			=	"\n ORDER BY " . $row->sortfields;
		}
		$filterby				=	'';
		if ( $row->filterfields != '' ) {
			$filterRules		=	utf8RawUrlDecode( substr( $row->filterfields, 1 ) );
	
			if ( $_CB_framework->myId() ) {
				$user			=	new moscomprofilerUser( $_CB_database );
				if ( $user->load( (int) $_CB_framework->myId() ) ) {
					$filterRules	=	cbReplaceVars( $filterRules, $user, array( $_CB_database, 'getEscaped' ), false, array() );
				}
			}
			$filterby			=	" AND ". $filterRules;
		}
	
		// Prepare part after SELECT .... " and before "FROM" :
	
		$tableReferences		=	array( '#__comprofiler' => 'ue', '#__users' => 'u' );
	
		// Fetch all fields:
	
		$tabs					=	$myCbUser->_getCbTabs();		//	new cbTabs( 0, 1 );		//TBD: later: this private method should not be called here, but the whole users-list should go into there and be called here.
	
		$allFields				=	$tabs->_getTabFieldsDb( null, $myUser, 'list' );
		// $_CB_database->setQuery( "SELECT * FROM #__comprofiler_fields WHERE published = 1" );
		// $allFields				=	$_CB_database->loadObjectList( 'fieldid', 'moscomprofilerFields', array( &$_CB_database ) );
	
	
		//Make columns array. This array will later be constructed from the tabs table:
	
		$columns				=	array();
	
		for ( $i = 1; $i < 50; ++$i ) {
			$enabledVar			=	"col".$i."enabled";
	
			if ( ! isset( $row->$enabledVar ) ) {
				break;
			}
			$titleVar			=	"col".$i."title";
			$fieldsVar			=	"col".$i."fields";
			$captionsVar		=	"col".$i."captions";
	
			if ( $row->$enabledVar == 1 ) {
				$col			=	new stdClass();
				$col->fields	=	( $row->$fieldsVar ? explode( '|*|', $row->$fieldsVar ) : array() );
				$col->title		=	$row->$titleVar;
				$col->titleRendered		=	$myCbUser->replaceUserVars( $col->title );
				$col->captions	=	$row->$captionsVar;
				// $col->sort	=	1; //All columns can be sorted
				$columns[$i]	=	$col;
			}
		}
	
		// build fields and tables accesses, also check for searchable fields:
	
		$searchableFields		=	array();
		$fieldsSQL				=	cbUsersList::getFieldsSQL( $columns, $allFields, $tableReferences, $searchableFields, $params );
	
		$_PLUGINS->trigger( 'onAfterUsersListFieldsSql', array( &$columns, &$allFields, &$tableReferences ) );
	
		$tablesSQL				=	array();
		$joinsSQL				=	array();
		$tablesWhereSQL			=	array(	'block'		=>	'u.block = 0',
											'approved'	=>	'ue.approved = 1',
											'confirmed'	=>	'ue.confirmed = 1'
										 );
	
		if ( checkJversion() == 2 ) {
			$joinsSQL[]				=	'JOIN #__user_usergroup_map g ON g.`user_id` = u.`id`';
		}
	
		if ( ! $isModerator ) {
			$tablesWhereSQL['banned']	=	'ue.banned = 0';
		}
		if ( $usergids ) {
			if ( checkJversion() == 2 ) {
				$tablesWhereSQL['gid']	=	'g.group_id IN (' . $usergids . ')';
			} else {
				$tablesWhereSQL['gid']	=	'u.gid IN (' . $usergids . ')';
			}
		}
	
		foreach ( $tableReferences as $table => $name ) {
			$tablesSQL[]				=	$table . ' ' . $name;
			if ( $name != 'u' ) {
				$tablesWhereSQL[]		=	"u.`id` = " . $name . ".`id`";
			}
		}
	
		// handles search criterias:
	
		$list_compare_types		=	$params->get( 'list_compare_types', 0 );
		$searchVals				=	new stdClass();
		$searchesFromFields		=	$tabs->applySearchableContents( $searchableFields, $searchVals, $searchFormValuesRAW, $list_compare_types );
		$whereFields			=	$searchesFromFields->reduceSqlFormula( $tableReferences, $joinsSQL, TRUE );
		if ( $whereFields ) {
			$tablesWhereSQL[]	=	'(' . $whereFields . ')';
	/*
			if ( $search === null ) {
				$search			=	'';
			}
	*/
		}
	
		$_PLUGINS->trigger( 'onBeforeUsersListBuildQuery', array( &$tablesSQL, &$joinsSQL, &$tablesWhereSQL ) );
	
		$queryFrom				=	"FROM " . implode( ', ', $tablesSQL )
								.	( count( $joinsSQL ) ? "\n " . implode( "\n ", $joinsSQL ) : '' )
								.	"\n WHERE " . implode( "\n AND ", $tablesWhereSQL );
	
		// handles old formatted names search:
	/*
		if ( $search != '' ) {
			$searchSQL			=	cbEscapeSQLsearch( strtolower( $_CB_database->getEscaped( $search ) ) );
			$queryFrom 			.=	" AND (";
	
			$searchFields		=	array();
			if ( $ueConfig['name_format']!='3' ) {
				$searchFields[]	=	"u.name LIKE '%%s%'";
			}
			if ( $ueConfig['name_format']!='1' ) {
				$searchFields[]	=	"u.username LIKE '%%s%'";
			}
			if ( is_array( $plugSearchFieldsArray ) ) {
				foreach ( $plugSearchFieldsArray as $v ) {
					if ( is_array( $v ) ) {
						$searchFields	=	array_merge( $searchFields, $v );
					}
				}
			}
			$queryFrom			.=	str_replace( '%s', $searchSQL, implode( " OR ", $searchFields ) );
			$queryFrom			.=	")";
		}
	*/
		$queryFrom				.=	" " . $filterby;
	
		$_PLUGINS->trigger( 'onBeforeUsersListQuery', array( &$queryFrom, 1, $listid ) );	// $uid = 1
	
		$errorMsg		=	null;
	
		// counts number of users and loads the listed fields of the users if not in search-form-only mode:
	
		if ( $searchmode == 0 ) {
			if ( checkJversion() == 2 ) {
				$_CB_database->setQuery( "SELECT COUNT(DISTINCT u.id) " . $queryFrom );
			} else {
			$_CB_database->setQuery( "SELECT COUNT(*) " . $queryFrom );
			}
			$total					=	$_CB_database->loadResult();
	
			if ( ( $limit > $total ) || ( $limitstart >= $total ) ) {
				$limitstart			=	0;
			}
	
			// $query					=	"SELECT u.id, ue.banned, '' AS 'NA' " . ( $fieldsSQL ? ", " . $fieldsSQL . " " : '' ) . $queryFrom . " " . $orderby
			if ( checkJversion() == 2 ) {
				$query				=	"SELECT DISTINCT ue.*, u.*, '' AS 'NA' " . ( $fieldsSQL ? ", " . $fieldsSQL . " " : '' ) . $queryFrom . " " . $orderby;
			} else {
				$query				=	"SELECT ue.*, u.*, '' AS 'NA' " . ( $fieldsSQL ? ", " . $fieldsSQL . " " : '' ) . $queryFrom . " " . $orderby;
			}
			$_CB_database->setQuery( $query, (int) $limitstart, (int) $limit );
			$users				=	$_CB_database->loadObjectList( null, 'moscomprofilerUser', array( &$_CB_database ) );
	
			if ( ! $_CB_database->getErrorNum() ) {
				// creates the CBUsers in cache corresponding to the $users:
				foreach ( array_keys( $users ) as $k) {
					CBuser::setUserGetCBUserInstance( $users[$k] );
				}
			} else {
				$users			=	array();
				$errorMsg		=	_UE_ERROR_IN_QUERY_TURN_SITE_DEBUG_ON_TO_VIEW;
			}
	
			if ( count( get_object_vars( $searchVals ) ) > 0 ) {
				$search			=	'';
			} else {
				$search			=	null;
			}
	
		} else {
			$total				=	null;
			$users				=	array();
			if ( $search === null ) {
				$search			=	'';
			}
		}
	
		// Compute itemId of users in users-list:
	
		if ( $Itemid ) {
			$option_itemid		=	(int) $Itemid;
		} else {
			$option_itemid		=	getCBprofileItemid( 0 );
		}
		HTML_comprofiler::usersList( $row, $users, $columns, $allFields, $lists, $listid, $search, $searchmode, $option_itemid, $limitstart, $limit, $total, $myUser, $searchableFields, $searchVals, $tabs, $list_compare_types, $showPaging, $hotlink_protection, $errorMsg, $random );
	}
コード例 #3
0
ファイル: cb.params.php プロジェクト: rkern21/videoeditor
	/**
	* @param string The name of the form element
	* @param string The value of the element
	* @param CBSimpleXMLElement  $node The xml element for the parameter
	* @param string The control name
	* @return string The html for the element
	*/
	function _form_usergroup( $name, $value, &$node, $control_name ) {
		$gtree = cbGetAllUsergroupsBelowMe();
	/*
		if ( ! $value ) {
			$value = $_CB_framework->acl->get_group_id('Registered','ARO');
			// array_unshift( $gtree, moscomprofilerHTML::makeOption( '0', '- Select User Group -' ) );
		}
	*/
		if ( ( $node->attributes( 'blanktext' ) ) && ( ( $node->attributes( 'hideblanktext' ) != 'true' ) || ( $value == 0 ) ) ) {
			array_unshift( $gtree, moscomprofilerHTML::makeOption( '0', $node->attributes( 'blanktext' ) ) );
		}
		$content	=	moscomprofilerHTML::selectList( $gtree, $this->control_name( $control_name, $name ), 'class="inputbox" id="' . $this->control_id( $control_name, $name ) . '" size="1"', 'value', 'text', (int) $value, 2, false, false );	//  size="10"
		return $content;
	}
コード例 #4
0
 function loadNewslettersList($name, $value, $control_name)
 {
     $newslettersList = $this->getNewslettersList();
     $newslettersRegList = array();
     if ($newslettersList !== false) {
         foreach ($newslettersList as $nl) {
             $newslettersRegList[] = moscomprofilerHTML::makeOption($nl->id, $nl->list_name);
         }
     }
     $valAsObj = isset($value) ? array_map(create_function('$v', '$o=new stdClass(); $o->value=$v; return $o;'), explode("|*|", $value)) : null;
     return moscomprofilerHTML::selectList($newslettersRegList, $control_name . '[' . $name . '][]', 'size="4" multiple="multiple"', 'value', 'text', $valAsObj, true);
 }
コード例 #5
0
	/**
	 * Returns an options array of available groups
	 *
	 * @param bool  $raw
	 * @param array $excludeCategories
	 * @param array $excludeGroups
	 * @return array|\stdClass[]
	 */
	static public function getGroupOptions( $raw = false, $excludeCategories = array(), $excludeGroups = array() )
	{
		global $_CB_database;

		if ( Application::Cms()->getClientId() ) {
			$raw					=	false;
			$excludeCategories		=	array();
			$excludeGroups			=	array();
		}

		static $cache				=	array();

		$userId						=	Application::MyUser()->getUserId();

		if ( ! isset( $cache[$userId] ) ) {
			$query					=	'SELECT g.' . $_CB_database->NameQuote( 'id' ) . ' AS value'
									.	', g.' . $_CB_database->NameQuote( 'name' ) . ' AS text'
									.	', g.' . $_CB_database->NameQuote( 'category' )
									.	', c.' . $_CB_database->NameQuote( 'name' ) . ' AS category_name'
									.	"\n FROM " . $_CB_database->NameQuote( '#__groupjive_groups' ) . " AS g"
									.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__groupjive_categories' ) . " AS c"
									.	' ON c.' . $_CB_database->NameQuote( 'id' ) . ' = g.' . $_CB_database->NameQuote( 'category' );

			if ( ( ! self::isModerator( $userId ) ) && ( ! Application::Cms()->getClientId() ) ) {
				$query				.=	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__groupjive_users' ) . " AS u"
									.	' ON u.' . $_CB_database->NameQuote( 'group' ) . ' = g.' . $_CB_database->NameQuote( 'id' )
									.	' AND u.' . $_CB_database->NameQuote( 'user_id' ) . ' = ' . (int) $userId
									.	' AND u.' . $_CB_database->NameQuote( 'status' ) . ' >= 1'
									.	"\n WHERE c." . $_CB_database->NameQuote( 'published' ) . " = 1"
									.	"\n AND c." . $_CB_database->NameQuote( 'access' ) . " IN " . $_CB_database->safeArrayOfIntegers( self::getAccess( $userId ) )
									.	"\n AND ( g." . $_CB_database->NameQuote( 'user_id' ) . " = " . (int) $userId
									.		' OR ( ( g.' . $_CB_database->NameQuote( 'published' ) . ' = 1 )'
									.		' AND ( ( g.' . $_CB_database->NameQuote( 'type' ) . ' IN ( 1, 2 ) )'
									.		' OR ( u.' . $_CB_database->NameQuote( 'id' ) . ' IS NOT NULL ) ) ) )'
									.	( $excludeCategories ? "\n AND c." . $_CB_database->NameQuote( 'id' ) . " NOT IN " . $_CB_database->safeArrayOfIntegers( $excludeCategories ) : null )
									.	( $excludeGroups ? "\n AND g." . $_CB_database->NameQuote( 'id' ) . " NOT IN " . $_CB_database->safeArrayOfIntegers( $excludeGroups ) : null );
			} else {
				$query				.=	( $excludeCategories ? "\n WHERE c." . $_CB_database->NameQuote( 'id' ) . " NOT IN " . $_CB_database->safeArrayOfIntegers( $excludeCategories ) : null )
									.	( $excludeGroups ? "\n " . ( $excludeCategories ? 'AND' : 'WHERE' ) . " g." . $_CB_database->NameQuote( 'id' ) . " NOT IN " . $_CB_database->safeArrayOfIntegers( $excludeGroups ) : null );
			}

			$query					.=	"\n ORDER BY c." . $_CB_database->NameQuote( 'ordering' ) . ", g." . $_CB_database->NameQuote( 'ordering' );
			$_CB_database->setQuery( $query );
			$cache[$userId]			=	$_CB_database->loadObjectList();
		}

		if ( $raw === true ) {
			return $cache[$userId];
		}

		$optGroups					=	array();
		$options					=	array();

		foreach ( $cache[$userId] as $group ) {
			$category				=	(int) $group->category;

			if ( ! in_array( $category, $optGroups ) ) {
				$options[]			=	\moscomprofilerHTML::makeOptGroup( ( $category ? CBTxt::T( $group->category_name ) : CBTxt::T( 'Uncategorized' ) ) );

				$optGroups[]		=	$category;
			}

			$options[]				=	\moscomprofilerHTML::makeOption( (int) $group->value, CBTxt::T( $group->text ) );
		}

		return $options;
	}
コード例 #6
0
	/**
	 * prepare frontend event edit render
	 *
	 * @param int       $id
	 * @param UserTable $user
	 */
	private function showEventEdit( $id, $user )
	{
		global $_CB_framework;

		$row					=	CBGroupJiveEvents::getEvent( (int) $id );
		$isModerator			=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$groupId				=	$this->input( 'group', null, GetterInterface::INT );

		if ( $groupId === null ) {
			$group				=	$row->group();
		} else {
			$group				=	CBGroupJive::getGroup( $groupId );
		}

		$returnUrl				=	$_CB_framework->pluginClassUrl( $this->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) );

		if ( ! CBGroupJive::canAccessGroup( $group, $user ) ) {
			cbRedirect( $returnUrl, CBTxt::T( 'Group does not exist.' ), 'error' );
		} elseif ( ! $isModerator ) {
			if ( ( ! $row->get( 'id' ) ) && ( ! CBGroupJive::canCreateGroupContent( $user, $group, 'events' ) ) ) {
				cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to schedule an event in this group.' ), 'error' );
			} elseif ( $row->get( 'id' ) && ( $user->get( 'id' ) != $row->get( 'user_id' ) ) && ( CBGroupJive::getGroupStatus( $user, $group ) < 2 ) ) {
				cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to edit this event.' ), 'error' );
			}
		}

		CBGroupJive::getTemplate( 'event_edit', true, true, $this->element );

		$input					=	array();

		$publishedTooltip		=	cbTooltip( null, CBTxt::T( 'Select publish state of this event. Unpublished events will not be visible to the public.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['published']		=	moscomprofilerHTML::yesnoSelectList( 'published', 'class="form-control"' . $publishedTooltip, (int) $this->input( 'post/published', $row->get( 'published', 1 ), GetterInterface::INT ) );

		$titleTooltup			=	cbTooltip( 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.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['title']			=	'<input type="text" id="title" name="title" value="' . htmlspecialchars( $this->input( 'post/title', $row->get( 'title' ), GetterInterface::STRING ) ) . '" class="form-control required" size="35"' . $titleTooltup . ' />';

		$event					=	$_CB_framework->displayCmsEditor( 'event', $this->input( 'post/event', $row->get( 'event' ), GetterInterface::HTML ), '100%', null, 40, 10, false );

		$input['event']			=	cbTooltip( null, CBTxt::T( 'Input a detailed description about this event.' ), null, null, null, $event, null, 'style="display:block;"' );

		$locationTooltup		=	cbTooltip( null, CBTxt::T( 'Input the location for this event (e.g. My House, The Park, Restaurant Name, etc..).' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['location']		=	'<input type="text" id="location" name="location" value="' . htmlspecialchars( $this->input( 'post/location', $row->get( 'location' ), GetterInterface::STRING ) ) . '" class="form-control required" size="35"' . $locationTooltup . ' />';

		$addressTooltup			=	cbTooltip( null, CBTxt::T( 'Optionally input the address for this event or click the map button to attempt to find your current location.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['address']		=	'<input type="text" id="address" name="address" value="' . htmlspecialchars( $this->input( 'post/address', $row->get( 'address' ), GetterInterface::STRING ) ) . '" class="form-control" size="45"' . $addressTooltup . ' />';

		$calendars				=	new cbCalendars( 1 );
		$minYear				=	(int) Application::Date( ( $row->get( 'id' ) ? $row->get( 'start' ) : 'now' ), 'UTC' )->format( 'Y' );

		$startTooltup			=	cbTooltip( null, CBTxt::T( 'Select the date and time this event starts.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['start']			=	$calendars->cbAddCalendar( 'start', null, true, $this->input( 'post/start', $row->get( 'start' ), GetterInterface::STRING ), false, true, $minYear, ( $minYear + 30 ), $startTooltup );

		$endTooltup				=	cbTooltip( null, CBTxt::T( 'Optionally select the end date and time for this event.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['end']			=	$calendars->cbAddCalendar( 'end', null, false, $this->input( 'post/end', $row->get( 'end' ), GetterInterface::STRING ), false, true, $minYear, ( $minYear + 30 ), $endTooltup );

		$limitTooltip			=	cbTooltip( null, CBTxt::T( 'Optionally input a guest limit for this event.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['limit']			=	'<input type="text" id="limit" name="limit" value="' . (int) $this->input( 'post/limit', $row->get( 'limit' ), GetterInterface::INT ) . '" class="digits form-control" size="6"' . $limitTooltip . ' />';

		$ownerTooltip			=	cbTooltip( null, CBTxt::T( 'Input the event owner id. Event owner determines the creator of the event specified as User ID.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['user_id']		=	'<input type="text" id="user_id" name="user_id" value="' . (int) $this->input( 'post/user_id', $this->input( 'user', $row->get( 'user_id', $user->get( 'id' ) ), GetterInterface::INT ), GetterInterface::INT ) . '" class="digits required form-control" size="6"' . $ownerTooltip . ' />';

		HTML_groupjiveEventEdit::showEventEdit( $row, $input, $group, $user, $this );
	}
コード例 #7
0
ファイル: acymailing.php プロジェクト: kosmosby/medicine-prof
	/**
	 * @return array
	 */
	public function lists()
	{
		global $_CB_framework;

		$lists					=	array();

		if ( $this->installed() ) {
			require_once( $_CB_framework->getCfg( 'absolute_path' ) . '/administrator/components/com_acymailing/helpers/helper.php' );

			/** @var listClass $acyListAPI */
			$acyListAPI			=	acymailing::get( 'class.list' );
			$acyLists			=	$acyListAPI->getLists();

			if ( $acyLists ) {
				foreach ( $acyLists as $acyList ) {
					$lists[]	=	moscomprofilerHTML::makeOption( (string) $acyList->listid, $acyList->name );
				}
			}
		}

		return $lists;
	}
コード例 #8
0
	public function getAutoEdit( $id, $user, $plugin, $message = null ) {
		global $_CB_framework;

		cbgjClass::getTemplate( 'cbgroupjiveauto_edit' );

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

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

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

		$input						=	array();

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

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

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

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

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

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

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

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

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

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

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

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

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

		$listGroups					=	array();

		$categories					=	cbgjData::getCategories();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		cbgjClass::displayMessage( $message );

		if ( class_exists( 'HTML_cbgroupjiveautoEdit' ) ) {
			HTML_cbgroupjiveautoEdit::showAutoEdit( $row, $input, $user, $plugin );
		} else {
			$this->showAutoEdit( $row, $input, $user, $plugin );
		}
	}
コード例 #9
0
 function loadFieldList($name, $value, $control_name)
 {
     global $_CB_database;
     $_CB_database->setQuery("SELECT `name`, `title` FROM #__comprofiler_fields WHERE `published`=1 ORDER BY `title` ASC");
     $fieldList = $_CB_database->loadObjectList();
     $fieldRegList = array();
     $fieldRegList[] = moscomprofilerHTML::makeOption('', '');
     if ($fieldList !== false) {
         foreach ($fieldList as $fld) {
             $fieldRegList[] = moscomprofilerHTML::makeOption($fld->name, $fld->title);
         }
     }
     $valAsObj = isset($value) ? array_map(create_function('$v', '$o=new stdClass(); $o->value=$v; return $o;'), explode("|*|", $value)) : null;
     return moscomprofilerHTML::selectList($fieldRegList, $control_name . '[' . $name . '][]', '', 'value', 'text', $valAsObj, true);
 }
コード例 #10
0
	/**
	 * @param  null|int     $id
	 * @param  UserTable    $user
	 * @param  stdClass     $model
	 * @param  PluginTable  $plugin
	 * @param  null|string  $message
	 * @param  null|string  $messageType
	 */
	public function showBlogEdit( $id, $user, $model, $plugin, $message = null, $messageType = 'error' )
	{
		global $_CB_framework;

		$blogLimit						=	(int) $plugin->params->get( 'blog_limit', null );
		$blogMode						=	$plugin->params->get( 'blog_mode', 1 );
		$cbModerator					=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();

		$row							=	new cbblogsBlogTable();

		$canAccess						=	false;

		if ( $row->load( (int) $id ) ) {
			if ( ! $row->get( 'id' ) ) {
				if ( $cbModerator ) {
					$canAccess			=	true;
				} elseif ( $user->get( 'id' ) && Application::MyUser()->canViewAccessLevel( $plugin->params->get( 'blog_create_access', 2 ) ) ) {
					if ( ( ! $blogLimit ) || ( $blogLimit && ( cbblogsModel::getBlogsTotal( null, $user, $user, $plugin ) < $blogLimit ) ) ) {
						$canAccess		=	true;
					}
				}
			} elseif ( $cbModerator || ( $row->get( 'user' ) == $user->get( 'id' ) ) ) {
				$canAccess				=	true;
			}
		}

		$profileUrl						=	$_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbblogsTab' );

		if ( $canAccess ) {
			cbblogsClass::getTemplate( 'blog_edit' );

			$input						=	array();

			$publishedTooltip			=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Select publish status of the blog. Unpublished blogs will not be visible to the public.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

			$input['published']			=	moscomprofilerHTML::yesnoSelectList( 'published', 'class="form-control"' . ( $publishedTooltip ? ' ' . $publishedTooltip : null ), (int) $this->input( 'post/published', $row->get( 'published', ( $cbModerator || ( ! $plugin->params->get( 'blog_approval', 0 ) ) ? 1 : 0 ) ), GetterInterface::INT ) );

			$categoryTooltip			=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Select blog category. Select the category that best describes your blog.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

			$listCategory				=	cbblogsModel::getCategoriesList();
			$input['category']			=	moscomprofilerHTML::selectList( $listCategory, 'category', 'class="form-control"' . ( $categoryTooltip ? ' ' . $categoryTooltip : null ), 'value', 'text', $this->input( 'post/category', $row->get( 'category' ), GetterInterface::STRING ), 1, false, false );

			$accessTooltip				=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Select access to blog; all groups above that level will also have access to the blog.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

			$listAccess					=	Application::CmsPermissions()->getAllViewAccessLevels( true, Application::MyUser() );
			$input['access']			=	moscomprofilerHTML::selectList( $listAccess, 'access', 'class="form-control"' . ( $accessTooltip ? ' ' . $accessTooltip : null ), 'value', 'text', (int) $this->input( 'post/access', $row->get( 'access', $plugin->params->get( 'blog_access_default', 1 ) ), GetterInterface::INT ), 1, false, false );

			$titleTooltip				=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input blog title. This is the title that will distinguish this blog from others. Suggested to input something unique and intuitive.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

			$input['title']				=	'<input type="text" id="title" name="title" value="' . htmlspecialchars( $this->input( 'post/title', $row->get( 'title' ), GetterInterface::STRING ) ) . '" class="required form-control" size="30"' . ( $titleTooltip ? ' ' . $titleTooltip : null ) . ' />';

			if ( in_array( $blogMode, array( 1, 2 ) ) ) {
				$blogIntro				=	$_CB_framework->displayCmsEditor( 'blog_intro', $this->input( 'post/blog_intro', $row->get( 'blog_intro' ), GetterInterface::HTML ), 400, 200, 40, 7 );

				$input['blog_intro']	=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input HTML supported blog intro contents. Suggested to use minimal but well formatting for easy readability.' ), null, null, null, $blogIntro, null, 'style="display:block;"' );
			}

			if ( in_array( $blogMode, array( 1, 3 ) ) ) {
				$blogFull				=	$_CB_framework->displayCmsEditor( 'blog_full', $this->input( 'post/blog_full', $row->get( 'blog_full' ), GetterInterface::HTML ), 400, 200, 40, 7 );

				$input['blog_full']		=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input HTML supported blog contents. Suggested to use minimal but well formatting for easy readability.' ), null, null, null, $blogFull, null, 'style="display:block;"' );
			}

			$userTooltip				=	cbTooltip( $_CB_framework->getUi(), CBTxt::T( 'Input owner of blog as single integer user_id.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

			$input['user']				=	'******' . (int) ( $cbModerator ? $this->input( 'post/user', $row->get( 'user', $user->get( 'id' ) ), GetterInterface::INT ) : $user->get( 'id' ) ) . '" class="digits required form-control" size="4"' . ( $userTooltip ? ' ' . $userTooltip : null ) . ' />';

			if ( $message ) {
				$_CB_framework->enqueueMessage( $message, $messageType );
			}

			HTML_cbblogsBlogEdit::showBlogEdit( $row, $input, $user, $model, $plugin );
		} else {
			cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' );
		}
	}
 /**
  * Intercepts CB User Manager list Viewer to add filters
  *
  * @param  int        $listId
  * @param  UserTable  $rows
  * @param  cbPageNav  $pageNav
  * @param  string     $search
  * @param  string[]   $lists
  * @param  string     $option
  * @param  string     $select_tag_attribs
  * @return array
  */
 public function onAfterBackendUsersList($listId, &$rows, &$pageNav, &$search, &$lists, $option, $select_tag_attribs)
 {
     if (!cbpaidApp::authoriseAction('cbsubs.usersubscriptionview')) {
         return array();
     }
     $this->outputRegTemplate();
     // 1. Filters:
     // 1.a. prepare dropdown selector filter with the list of published plans:
     $plansMgr = cbpaidPlansMgr::getInstance();
     $plans = $plansMgr->loadPublishedPlans(CBuser::getMyUserDataInstance(), true, 'any', null);
     $plansList = array();
     $plansList[] = moscomprofilerHTML::makeOption(0, CBPTXT::T('- Select Subscription Plan - '));
     foreach ($plans as $k => $plan) {
         $plansList[] = moscomprofilerHTML::makeOption($k, $plan->get('alias'));
     }
     if (count($plans) > 0) {
         $plansList[] = moscomprofilerHTML::makeOption(-1, CBPTXT::T('ANY PLAN ACTIVE'));
         $plansList[] = moscomprofilerHTML::makeOption(-2, CBPTXT::T('NO PLAN ACTIVE'));
     }
     $lists['cbpaidplan'] = moscomprofilerHTML::selectList($plansList, 'filter_cbpaidplan', $select_tag_attribs, 'value', 'text', $this->filter_cbpaidplan, 2);
     // 1.b. prepare additional selector filter for status of subscriptions:
     if ($this->filter_cbpaidplan && $this->filter_cbpaidplan != -2) {
         // any plan or specific plan:		// no plan: nothing for now to do
         $statesList = array();
         $statesList[] = moscomprofilerHTML::makeOption('A', CBPTXT::T('Active'));
         $statesList[] = moscomprofilerHTML::makeOption('X', CBPTXT::T('Expired'));
         $statesList[] = moscomprofilerHTML::makeOption('C', CBPTXT::T('Cancelled'));
         $statesList[] = moscomprofilerHTML::makeOption('U', CBPTXT::T('Upgraded'));
         $lists['cbpaidsubstate'] = moscomprofilerHTML::selectList($statesList, 'filter_cbpaidsubstate', $select_tag_attribs, 'value', 'text', $this->filter_cbpaidsubstate, 1);
         $datesList = array();
         $datesList[] = moscomprofilerHTML::makeOption('', CBPTXT::T('- Select expiry date -'));
         if ($this->filter_cbpaidsubstate == 'A') {
             $datesList[] = moscomprofilerHTML::makeOption('1 DAY', sprintf(CBPTXT::T('Expiring within %s hours'), 24));
             foreach (array(2, 3, 4, 5, 6, 7) as $v) {
                 $datesList[] = moscomprofilerHTML::makeOption($v . ' DAY', sprintf(CBPTXT::T('Expiring within %s days'), $v));
             }
             foreach (array(2, 3, 4) as $v) {
                 $datesList[] = moscomprofilerHTML::makeOption($v . ' WEEK', sprintf(CBPTXT::T('Expiring within %s weeks'), $v));
             }
             $datesList[] = moscomprofilerHTML::makeOption('1 MONTH', CBPTXT::T('Expiring within in 1 month'));
             foreach (array(2, 3, 4, 6, 9, 12) as $v) {
                 $datesList[] = moscomprofilerHTML::makeOption($v . ' MONTH', sprintf(CBPTXT::T('Expiring within %s months'), $v));
             }
         } else {
             $datesList[] = moscomprofilerHTML::makeOption('-1 DAY', sprintf(CBPTXT::T('Expired last %s hours'), 24));
             foreach (array(2, 3, 4, 5, 6, 7) as $v) {
                 $datesList[] = moscomprofilerHTML::makeOption('-' . $v . ' DAY', sprintf(CBPTXT::T('Expired last %s days'), $v));
             }
             foreach (array(2, 3, 4) as $v) {
                 $datesList[] = moscomprofilerHTML::makeOption('-' . $v . ' WEEK', sprintf(CBPTXT::T('Expired last %s weeks'), $v));
             }
             $datesList[] = moscomprofilerHTML::makeOption('-1 MONTH', CBPTXT::T('Expired last month'));
             foreach (array(2, 3, 4, 6, 9, 12) as $v) {
                 $datesList[] = moscomprofilerHTML::makeOption('-' . $v . ' MONTH', sprintf(CBPTXT::T('Expired last %s months'), $v));
             }
         }
         $lists['cbpaidsubexpdate'] = moscomprofilerHTML::selectList($datesList, 'filter_cbpaidsubexpdate', $select_tag_attribs, 'value', 'text', $this->filter_cbpaidsubexpdate, 1);
     }
     // 2. add subscriptions colum to backend users-lists:
     $pluginColumns = array();
     foreach ($rows as $row) {
         $paidUserExtension = cbpaidUserExtension::getInstance((int) $row->id);
         $subscriptions = $paidUserExtension->getUserSubscriptions('A', true);
         $displayPlans = array();
         foreach ($subscriptions as $sub) {
             $plan = $sub->getPlan();
             if ($plan) {
                 $cssclass = $plan->get('cssclass');
                 $aliasHtml = htmlspecialchars($plan->get('alias'));
             } else {
                 $cssclass = null;
                 $aliasHtml = CBPTXT::Ph("PLAN OF SUBSCRIPTION ID [SUB_ID] IS DELETED", array('[SUB_ID]' => $sub->id));
             }
             $displayPlans[] = '<span' . ($cssclass ? ' class="' . htmlspecialchars($cssclass) . '"' : '') . '>' . $aliasHtml . '</span>';
         }
         $pluginColumns[$row->id] = implode(', ', $displayPlans);
     }
     return array(CBPTXT::T('Subscriptions') => $pluginColumns);
 }
コード例 #12
0
	/**
	 * Renders a <select> drop-down with currency
	 *
	 * @param  string  $selectedCurrency
	 * @param  string  $currencyInputName
	 * @return string
	 */
	private function drawCurrencySelect( $selectedCurrency, $currencyInputName ) {
		$allCurrencies						=	$this->getAllCurrencies();
		if ( ! in_array( $selectedCurrency, $allCurrencies ) ) {
			array_unshift( $allCurrencies, $selectedCurrency );
		}
		$values								=	array();
		foreach ( $allCurrencies as $currency ) {
			$values[]						=	moscomprofilerHTML::makeOption( $currency, CBPTXT::T( $currency ) );
		}
		return moscomprofilerHTML::selectList( $values, $currencyInputName, 'class="cpayCurrency cpayOrderCurrency"', 'value', 'text', $selectedCurrency, 2 );
	}
コード例 #13
0
 /**
  * converts each value to an option element of the array
  *
  * @param  array   $options
  * @param  array   $arr
  * @param  string  $currency
  */
 protected function _valuesToOptions(&$options, &$arr, $currency)
 {
     $cbpaidMoney = cbpaidMoney::getInstance();
     for ($i = 0, $n = count($arr); $i < $n; $i++) {
         $displayAmount = $cbpaidMoney->renderPrice($arr[$i], $currency, true);
         $options[] = moscomprofilerHTML::makeOption($arr[$i], $displayAmount);
     }
 }
コード例 #14
0
 function editField($fid = 0, $option = 'com_comprofiler', $task = 'editField')
 {
     global $_CB_database, $_CB_framework, $_PLUGINS;
     $this->_importNeeded();
     $canEditState = CBuser::getMyInstance()->authoriseAction('core.edit.state');
     $row = new moscomprofilerFields($_CB_database);
     $paramsEditorHtml = null;
     if ($fid == 0) {
         // default values for new types:
         $row->type = 'text';
         $row->tabid = 11;
         // contact info by default
         $row->profile = 1;
         $row->registration = 1;
         $row->displaytitle = 1;
         $row->published = 1;
         $row->required = 0;
         $row->readonly = 0;
         $paramsEditorHtml = array(array('title' => CBTxt::T('Parameters'), 'content' => "<strong>" . CBTxt::T('To see Parameters, first save new field') . "</strong>"));
     } else {
         // load the row from the db table
         $row->load((int) $fid);
         $fieldTab = new moscomprofilerTabs($_CB_database);
         // load the row from the db table
         $fieldTab->load((int) $row->tabid);
         // Check if user is a super user:
         if (!$_CB_framework->acl->amIaSuperAdmin()) {
             // Check if user belongs to useraccessgroupid:
             if (!in_array($fieldTab->useraccessgroupid, $_CB_framework->acl->get_groups_below_me(null, true))) {
                 echo "<script type=\"text/javascript\"> alert('" . addslashes(CBTxt::T('Unauthorized Access')) . "'); window.history.go(-1);</script>\n";
                 exit;
             }
             // Check if user belongs to viewaccesslevel:
             if (!in_array($fieldTab->viewaccesslevel, CBuser::getMyInstance()->getAuthorisedViewLevelsIds(false))) {
                 echo "<script type=\"text/javascript\"> alert('" . addslashes(CBTxt::T('Unauthorized Access')) . "'); window.history.go(-1);</script>\n";
                 exit;
             }
         }
     }
     $_PLUGINS->loadPluginGroup('user');
     if ($task == 'reloadField') {
         if (!$this->_prov_bind_CB_field($row, $fid)) {
             echo "<script type=\"text/javascript\"> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
             exit;
         }
     }
     if ($fid == 0) {
         if ($row->tablecolumns != '' && !in_array($row->type, array('password', 'userparams'))) {
             $row->searchable = 1;
         } else {
             $row->searchable = 0;
         }
     }
     // params:
     $paramsEditorHtml = array();
     $options = array('option' => $option, 'task' => $task, 'cid' => $row->fieldid);
     // field-specific own parameters:
     $fieldHandler = new cbFieldHandler();
     $fieldOwnParamsEditHtml = $fieldHandler->drawParamsEditor($row, $options);
     if ($fieldOwnParamsEditHtml) {
         $paramsEditorHtml[] = array('title' => CBTxt::T('Field-specific Parameters'), 'content' => $fieldOwnParamsEditHtml);
     }
     // additional non-specific other parameters:
     $fieldsParamsPlugins = $_PLUGINS->getUserFieldParamsPluginIds();
     foreach ($fieldsParamsPlugins as $pluginId => $fieldParamHandlerClassName) {
         $fieldParamHandler = new $fieldParamHandlerClassName($pluginId, $row);
         // cbFieldParamsHandler();
         $addParamsHtml = $fieldParamHandler->drawParamsEditor($options);
         if ($addParamsHtml) {
             $addParamsTitle = $fieldParamHandler->getFieldsParamsLabel();
             $paramsEditorHtml[] = array('title' => $addParamsTitle, 'content' => $addParamsHtml);
         }
     }
     $where = array();
     $where[] = "`fields` = 1";
     if (!$_CB_framework->acl->amIaSuperAdmin()) {
         $where[] = "useraccessgroupid IN (" . implode(',', $_CB_framework->acl->get_groups_below_me(null, true)) . ")";
     }
     $_CB_database->setQuery("SELECT tabid, title FROM #__comprofiler_tabs WHERE " . implode(' AND ', $where) . " ORDER BY ordering");
     $tabs = $_CB_database->loadObjectList();
     $lists = array();
     $tablist = array();
     for ($i = 0, $n = count($tabs); $i < $n; $i++) {
         $tab =& $tabs[$i];
         $tablist[] = moscomprofilerHTML::makeOption($tab->tabid, getLangDefinition($tab->title));
     }
     $lists['tabs'] = moscomprofilerHTML::selectList($tablist, 'tabid', 'class="inputbox" size="1" mosReq=1 mosLabel="' . htmlspecialchars(CBTxt::T('Tab')) . '"' . ($canEditState ? '' : ' disabled="disabled"'), 'value', 'text', $row->tabid, 2);
     $types = array();
     if ($fid == 0) {
         $typeHandlers = array();
         $registeredTypes = $_PLUGINS->getUserFieldTypes();
         foreach ($registeredTypes as $typ) {
             $typeHandlers[$typ] = new cbFieldHandler();
             $tmpField = new moscomprofilerFields($_CB_database);
             $tmpField->type = $typ;
             $typLabel = $typeHandlers[$typ]->getFieldTypeLabel($tmpField);
             if ($typLabel) {
                 $types[] = moscomprofilerHTML::makeOption($typ, $typLabel);
             }
         }
     } else {
         $types[] = moscomprofilerHTML::makeOption($row->type, $fieldHandler->getFieldTypeLabel($row, false));
     }
     $webaddrtypes = array();
     $webaddrtypes[] = moscomprofilerHTML::makeOption('0', CBTxt::T('URL only'));
     $webaddrtypes[] = moscomprofilerHTML::makeOption('2', CBTxt::T('Hypertext and URL'));
     $profiles = array();
     $profiles[] = moscomprofilerHTML::makeOption('0', CBTxt::T('No'));
     $profiles[] = moscomprofilerHTML::makeOption('1', CBTxt::T('Yes: on 1 Line'));
     $profiles[] = moscomprofilerHTML::makeOption('2', CBTxt::T('Yes: on 2 Lines'));
     $fvalues = $_CB_database->setQuery("SELECT fieldtitle " . "\n FROM #__comprofiler_field_values" . "\n WHERE fieldid=" . (int) $fid . "\n ORDER BY ordering");
     $fvalues = $_CB_database->loadObjectList();
     $lists['webaddresstypes'] = moscomprofilerHTML::selectList($webaddrtypes, 'webaddresstypes', 'class="inputbox" size="1"', 'value', 'text', $row->rows, 2);
     $lists['type'] = moscomprofilerHTML::selectList($types, 'type', 'class="inputbox" size="1"', 'value', 'text', $row->type, 2);
     $lists['required'] = moscomprofilerHTML::yesnoSelectList('required', 'class="inputbox" size="1"' . ($canEditState ? '' : ' disabled="disabled"'), $row->required === null ? 0 : $row->required);
     $lists['published'] = moscomprofilerHTML::yesnoSelectList('published', 'class="inputbox" size="1"' . ($canEditState ? '' : ' disabled="disabled"'), $row->published);
     $lists['readonly'] = moscomprofilerHTML::yesnoSelectList('readonly', 'class="inputbox" size="1"' . ($canEditState ? '' : ' disabled="disabled"'), $row->readonly === null ? 0 : $row->readonly);
     $lists['profile'] = moscomprofilerHTML::selectList($profiles, 'profile', 'class="inputbox" size="1"' . ($canEditState ? '' : ' disabled="disabled"'), 'value', 'text', $row->profile, 2);
     $lists['displaytitle'] = moscomprofilerHTML::yesnoSelectList('displaytitle', 'class="inputbox" size="1"', $row->displaytitle);
     if ($row->tablecolumns != '' && !in_array($row->type, array('password', 'userparams'))) {
         $lists['searchable'] = moscomprofilerHTML::yesnoSelectList('searchable', 'class="inputbox" size="1"' . ($canEditState ? '' : ' disabled="disabled"'), $row->searchable);
     } else {
         $lists['searchable'] = _UE_NO . '<input type="hidden" name="searchable" value="0" />';
     }
     $lists['registration'] = moscomprofilerHTML::yesnoSelectList('registration', 'class="inputbox" size="1"' . ($canEditState ? '' : ' disabled="disabled"'), $row->registration);
     $pluginView = _CBloadView('field');
     $pluginView->editfield($row, $lists, $fvalues, $option, $paramsEditorHtml);
 }
コード例 #15
0
	function editTab( $tid='0', $option='com_comprofiler', $task='editTab' ) {
		global $_CB_database, $_CB_framework, $_PLUGINS;

		$this->_importNeeded();

		$row = new moscomprofilerTabs( $_CB_database );
		// load the row from the db table
		$row->load( (int) $tid );
	
		if ( $tid && ! in_array( $row->useraccessgroupid, getChildGIDS( userGID( $_CB_framework->myId() ) ) ) ) {
			echo "<script type=\"text/javascript\"> alert('" . addslashes( CBTxt::T('Unauthorized Access') ) . "'); window.history.go(-1);</script>\n";
			exit;
		}
	 	$lists = array();
		if($row->sys=='2') $lists['enabled'] = "Yes";
		else $lists['enabled'] = moscomprofilerHTML::yesnoSelectList( 'enabled', 'class="inputbox" size="1"', ( $row->enabled !== null ? $row->enabled : 1 ) );
	
		/*
		-------------------------
		!          head         !
		!-----------------------!
		!      !        !       !
		! left ! middle ! right !
		!      !        !       !
		!-----------------------!
		!                       !
		!        tabmain        !
		!                       !
		!-----------------------!
		!        underall       !
		-------------------------
		!      !        !       !
		! L1C1 ! L1C2   ! L1C3  !   L1C1...C9
		!      !        !       !
		!-----------------------!
		!      !        !       !
		! L2C1 ! L2C4   ! L2C8  !   ...
		!      !        !       !
		!-----------------------!
		!                       !
		!        L4C7           !
		!                       !
		!-----------------------!
		!          !            !
		!   L8C3   !    L8C4    !   ...L9C9
		!          !            !
		!-----------------------!
	    ! + not_on_profile_1..9
		*/
		$position = array();
		$position[] = moscomprofilerHTML::makeOption( 'cb_head', _UE_POS_CB_HEAD );
		$position[] = moscomprofilerHTML::makeOption( 'cb_left', _UE_POS_CB_LEFT );
		$position[] = moscomprofilerHTML::makeOption( 'cb_middle', _UE_POS_CB_MIDDLE );
		$position[] = moscomprofilerHTML::makeOption( 'cb_right', _UE_POS_CB_RIGHT );
		$position[] = moscomprofilerHTML::makeOption( 'cb_tabmain', _UE_POS_CB_MAIN );
		$position[] = moscomprofilerHTML::makeOption( 'cb_underall', _UE_POS_CB_BOTTOM );
		for ( $i = 1 ; $i <= 9; $i++ ) {
			for ( $j = 1 ; $j <= 9; $j++ ) {
				$position[] = moscomprofilerHTML::makeOption( 'L'.$i.'C'.$j, CBTxt::T('Line') . ' ' . $i . ' ' . CBTxt::T('Column') . ' ' . $j );
			}
		}
		for ( $i = 1 ; $i <= 9; $i++ ) {
			$position[] = moscomprofilerHTML::makeOption( 'not_on_profile_'.$i, CBTxt::T('Not displayed on profile') . ' ' . $i );
		}
	
		if ( ! $row->position ) {
			$row->position		=	'cb_tabmain';
		}
		$lists['position'] = moscomprofilerHTML::selectList( $position, 'position', 'class="inputbox" size="1"', 'value', 'text', $row->position, 2 );
	
		$displaytype = array();
		$displaytype[] = moscomprofilerHTML::makeOption( 'tab', _UE_DISPLAY_TAB );
		$displaytype[] = moscomprofilerHTML::makeOption( 'div', _UE_DISPLAY_DIV );
		$displaytype[] = moscomprofilerHTML::makeOption( 'rounddiv', _UE_DISPLAY_ROUNDED_DIV );
		$displaytype[] = moscomprofilerHTML::makeOption( 'html', _UE_DISPLAY_HTML );
		$displaytype[] = moscomprofilerHTML::makeOption( 'overlib', _UE_DISPLAY_OVERLIB );
		$displaytype[] = moscomprofilerHTML::makeOption( 'overlibfix', _UE_DISPLAY_OVERLIBFIX );
		$displaytype[] = moscomprofilerHTML::makeOption( 'overlibsticky', _UE_DISPLAY_OVERLIBSTICKY );
		if ( ! $row->displaytype ) {
			$row->displaytype	=	'tab';
		}
		$lists['displaytype'] = moscomprofilerHTML::selectList( $displaytype, 'displaytype', 'class="inputbox" size="1"', 'value', 'text', $row->displaytype, 2 );
	
		if ($tid) {
			if ( $row->ordering > -10000 && $row->ordering < 10000 ) {
				// build the html select list for ordering
				$query = "SELECT ordering AS value, title AS text"
				. "\n FROM #__comprofiler_tabs"
				. "\n WHERE position='" . $_CB_database->getEscaped( $row->position ) . "'"
				. "\n AND enabled > 0"
				. "\n AND ordering > -10000"
				. "\n AND ordering < 10000"
				. "\n ORDER BY ordering"
				;
				$order = $this->_cbGetOrderingList( $query );
				$lists['ordering'] = moscomprofilerHTML::selectList( $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ), 2 );
			} else {
				$lists['ordering'] = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />' . CBTxt::T('This plugin cannot be reordered') ;
			}
		} else {
			$row->ordering 				= 999;
			$row->ordering_register		= 10;
			$row->published 			= 1;
			$row->description 			= '';
			$row->useraccessgroupid		= -2;
			$lists['ordering']	= '<input type="hidden" name="ordering" value="'. $row->ordering
								.'" />'. CBTxt::T('New items default to the last place. Ordering can be changed after this item is saved.');
		}
	
		$gtree3=array();
	    $gtree3[] = moscomprofilerHTML::makeOption( -2 , '- ' . CBtxt::T('Everybody') . ' -' );
	    $gtree3[] = moscomprofilerHTML::makeOption( -1 , '- ' . CBtxt::T('All Registered Users') . ' -' );
		$gtree3 = array_merge( $gtree3, $_CB_framework->acl->get_group_children_tree( null, 'USERS', false ));
	
		$lists['useraccessgroup']=moscomprofilerHTML::selectList( $gtree3, 'useraccessgroupid', 'size="4"', 'value', 'text', $row->useraccessgroupid, 2, false );
	
		// params:
		$paramsEditorHtml			=	array();
		$options					=	array( 'option' => $option, 'task' => $task, 'cid' => $row->tabid );
	
		// additional non-specific other parameters:
		$_PLUGINS->loadPluginGroup( 'user' );
	
		$fieldsParamsPlugins		=	$_PLUGINS->getUserTabParamsPluginIds();
		foreach ($fieldsParamsPlugins as $pluginId => $fieldParamHandlerClassName ) {
			$fieldParamHandler		=	new $fieldParamHandlerClassName( $pluginId, $row );			// cbFieldParamsHandler();
			$addParamsHtml			=	$fieldParamHandler->drawParamsEditor( $options );
			if ( $addParamsHtml ) {
				$addParamsTitle		=	$fieldParamHandler->getFieldsParamsLabel();
				$paramsEditorHtml[]	=	array( 'title' => $addParamsTitle, 'content' => $addParamsHtml );
			}
		}
	
		$pluginView				=	_CBloadView( 'tab' );
		$pluginView->edittab( $row, $option, $lists, $tid, $paramsEditorHtml );
	}
コード例 #16
0
ファイル: cb.core.php プロジェクト: bobozhangshao/HeartCare
 /**
  *
  *
  * @param  FieldTable  $field
  * @param  UserTable   $user
  * @param  string      $output             'html', 'xml', 'json', 'php', 'csvheader', 'csv', 'rss', 'fieldslist', 'htmledit'
  * @param  string      $reason             'profile' for user profile view, 'edit' for profile edit, 'register' for registration, 'list' for user-lists
  * @param  boolean     $displayFieldIcons
  * @return string                          HTML: <tag type="$type" value="$value" xxxx="xxx" yy="y" />
  */
 function _htmlEditForm(&$field, &$user, $output, $reason, $displayFieldIcons = true)
 {
     global $_CB_framework;
     $fieldName = $field->get('name');
     $value = $user->get($fieldName);
     $required = $this->_isRequired($field, $user, $reason);
     $uploadSizeLimitMax = $field->params->get('fieldValidateAudio_sizeMax', 1024);
     $uploadSizeLimitMin = $field->params->get('fieldValidateAudio_sizeMin', 0);
     $uploadExtensionLimit = $this->allowedExtensions();
     $restrictions = array();
     if ($uploadExtensionLimit) {
         $restrictions[] = CBTxt::Th('AUDIO_FILE_UPLOAD_LIMITS_EXT', 'Your audio file must be of [ext] type.', array('[ext]' => implode(', ', $uploadExtensionLimit)));
     }
     if ($uploadSizeLimitMin) {
         $restrictions[] = CBTxt::Th('AUDIO_FILE_UPLOAD_LIMITS_MIN', 'Your audio file should exceed [size].', array('[size]' => $this->formattedFileSize($uploadSizeLimitMin * 1024)));
     }
     if ($uploadSizeLimitMax) {
         $restrictions[] = CBTxt::Th('AUDIO_FILE_UPLOAD_LIMITS_MAX', 'Your audio file should not exceed [size].', array('[size]' => $this->formattedFileSize($uploadSizeLimitMax * 1024)));
     }
     $existingFile = $user->get('id') ? $value != null ? true : false : false;
     $choices = array();
     if ($reason == 'register' || $reason == 'edit' && $user->id == 0) {
         if ($required == 0) {
             $choices[] = moscomprofilerHTML::makeOption('', CBTxt::T('No audio file'));
         }
     } else {
         if ($existingFile || $required == 0) {
             $choices[] = moscomprofilerHTML::makeOption('', CBTxt::T('No change of audio file'));
         }
     }
     $selected = null;
     if ($required == 1 && !$existingFile) {
         $selected = 'upload';
     }
     if ($field->params->get('audio_allow_links', 1)) {
         $choices[] = moscomprofilerHTML::makeOption('link', $existingFile ? CBTxt::T('Link to new audio file') : CBTxt::T('Link to audio file'));
     }
     $choices[] = moscomprofilerHTML::makeOption('upload', $existingFile ? CBTxt::T('Upload new audio file') : CBTxt::T('Upload audio file'));
     if ($existingFile && $required == 0) {
         $choices[] = moscomprofilerHTML::makeOption('delete', CBTxt::T('Remove audio file'));
     }
     $return = null;
     if ($reason != 'register' && $user->id != 0 && $existingFile) {
         $return .= '<div class="form-group cb_form_line clearfix">' . $this->getEmbed($field, $user, $value, $reason) . '</div>';
     }
     if (count($choices) > 1) {
         static $functOut = false;
         $additional = ' class="form-control"';
         if ($_CB_framework->getUi() == 1 && $reason == 'edit' && $field->get('readonly')) {
             $additional .= ' disabled="disabled"';
         }
         $translatedTitle = $this->getFieldTitle($field, $user, 'html', $reason);
         $htmlDescription = $this->getFieldDescription($field, $user, 'htmledit', $reason);
         $trimmedDescription = trim(strip_tags($htmlDescription));
         $tooltip = $trimmedDescription ? cbTooltip($_CB_framework->getUi(), $htmlDescription, $translatedTitle, null, null, null, null, $additional) : $additional;
         $return .= '<div class="form-group cb_form_line clearfix">' . moscomprofilerHTML::selectList($choices, $fieldName . '__choice', $tooltip, 'value', 'text', $selected, $required, true, null, false) . $this->_fieldIconsHtml($field, $user, 'htmledit', $reason, 'select', '', null, '', array(), $displayFieldIcons, $required) . '</div>';
         if (!$functOut) {
             $js = "function cbslideAudioFile( choice, name ) {" . "if ( ( choice == '' ) || ( choice == 'delete' ) ) {" . "\$( '#cbaudiofile_upload_' + name + ',#cbaudiofile_link_' + name ).slideUp( 'slow' );" . "\$( '#cbaudiofile_upload_' + name + ' input,#cbaudiofile_link_' + name + ' input' ).prop( 'readonly', true );" . "} else if ( choice == 'upload' ) {" . "\$( '#cbaudiofile_link_' + name ).slideUp( 'slow' );" . "\$( '#cbaudiofile_upload_' + name ).slideDown( 'slow' );" . "\$( '#cbaudiofile_link_' + name + ' input' ).prop( 'readonly', true );" . "\$( '#cbaudiofile_upload_' + name + ' input' ).prop( 'readonly', false );" . "} else if ( choice == 'link' ) {" . "\$( '#cbaudiofile_upload_' + name ).slideUp( 'slow' );" . "\$( '#cbaudiofile_link_' + name ).slideDown( 'slow' );" . "\$( '#cbaudiofile_upload_' + name + ' input' ).prop( 'readonly', true );" . "\$( '#cbaudiofile_link_' + name + ' input' ).prop( 'readonly', false );" . "}" . "}";
             $_CB_framework->outputCbJQuery($js);
             $functOut = true;
         }
         $js = "\$( '#cbaudiofile_upload_" . addslashes($fieldName) . ",#cbaudiofile_link_" . addslashes($fieldName) . "' ).hide();" . "\$( '#cbaudiofile_upload_" . addslashes($fieldName) . " input,#cbaudiofile_link_" . addslashes($fieldName) . " input' ).prop( 'readonly', true );" . "\$( '#" . addslashes($fieldName) . "__choice' ).on( 'click change', function() {" . "cbslideAudioFile( \$( this ).val(), '" . addslashes($fieldName) . "' );" . "}).change();";
         $_CB_framework->outputCbJQuery($js);
     } else {
         $return .= '<input type="hidden" name="' . htmlspecialchars($fieldName) . '__choice" value="' . htmlspecialchars($choices[0]->value) . '" />';
     }
     $validationAttributes = array();
     $validationAttributes[] = cbValidator::getRuleHtmlAttributes('extension', implode(',', $uploadExtensionLimit));
     if ($uploadSizeLimitMin || $uploadSizeLimitMax) {
         $validationAttributes[] = cbValidator::getRuleHtmlAttributes('filesize', array($uploadSizeLimitMin, $uploadSizeLimitMax, 'KB'));
     }
     $return .= '<div id="cbaudiofile_upload_' . htmlspecialchars($fieldName) . '" class="form-group cb_form_line clearfix">' . ($restrictions ? '<div class="help-block">' . implode(' ', $restrictions) . '</div>' : null) . '<div>' . CBTxt::T('Select audio file') . ' <input type="file" name="' . htmlspecialchars($fieldName) . '__file" value="" class="form-control' . ($required == 1 ? ' required' : null) . '"' . implode(' ', $validationAttributes) . ' />' . (count($choices) <= 0 ? $this->_fieldIconsHtml($field, $user, 'htmledit', $reason, 'select', '', null, '', array(), $displayFieldIcons, $required) : null) . '</div>' . '<div class="help-block">';
     if ($field->params->get('audio_terms', 0)) {
         $termsOutput = $field->params->get('terms_output', 'url');
         $termsType = CBTxt::T($field->params->get('terms_type', null));
         $termsDisplay = $field->params->get('terms_display', 'modal');
         $termsURL = $field->params->get('terms_url', null);
         $termsText = $field->params->get('terms_text', null);
         $termsWidth = (int) $field->params->get('terms_width', 400);
         $termsHeight = (int) $field->params->get('terms_height', 200);
         if (!$termsType) {
             $termsType = CBTxt::T('TERMS_AND_CONDITIONS', 'Terms and Conditions');
         }
         if (!$termsWidth) {
             $termsWidth = 400;
         }
         if (!$termsHeight) {
             $termsHeight = 200;
         }
         if ($termsOutput == 'url' && $termsURL || $termsOutput == 'text' && $termsText) {
             if ($termsDisplay == 'iframe') {
                 if (is_numeric($termsHeight)) {
                     $termsHeight .= 'px';
                 }
                 if (is_numeric($termsWidth)) {
                     $termsWidth .= 'px';
                 }
                 if ($termsOutput == 'url') {
                     $return .= '<div class="embed-responsive cbTermsFrameContainer" style="padding-bottom: ' . htmlspecialchars($termsHeight) . ';">' . '<iframe class="embed-responsive-item cbTermsFrameURL" style="width: ' . htmlspecialchars($termsWidth) . ';" src="' . htmlspecialchars($termsURL) . '"></iframe>' . '</div>';
                 } else {
                     $return .= '<div class="cbTermsFrameText" style="height:' . htmlspecialchars($termsHeight) . ';width:' . htmlspecialchars($termsWidth) . ';overflow:auto;">' . $termsText . '</div>';
                 }
                 $return .= CBTxt::Th('BY_UPLOADING_YOU_CERTIFY_THAT_YOU_HAVE_THE_RIGHT_TO_DISTRIBUTE_THIS_AUDIO_FILE_TERMS', 'By uploading, you certify that you have the right to distribute this audio file and that it does not violate the above [type].', array('[type]' => $termsType));
             } else {
                 $attributes = ' class="cbTermsLink"';
                 if ($termsOutput == 'text' && $termsDisplay == 'window') {
                     $termsDisplay = 'modal';
                 }
                 if ($termsDisplay == 'modal') {
                     // Tooltip height percentage would be based off window height (including scrolling); lets change it to be based off the viewport height:
                     $termsHeight = substr($termsHeight, -1) == '%' ? (int) substr($termsHeight, 0, -1) . 'vh' : $termsHeight;
                     if ($termsOutput == 'url') {
                         $tooltip = '<iframe class="cbTermsModalURL" height="100%" width="100%" src="' . htmlspecialchars($termsURL) . '"></iframe>';
                     } else {
                         $tooltip = '<div class="cbTermsModalText" style="height:100%;width:100%;overflow:auto;">' . $termsText . '</div>';
                     }
                     $url = 'javascript:void(0);';
                     $attributes .= ' ' . cbTooltip($_CB_framework->getUi(), $tooltip, $termsType, array($termsWidth, $termsHeight), null, null, null, 'data-hascbtooltip="true" data-cbtooltip-modal="true"');
                 } else {
                     $url = htmlspecialchars($termsURL);
                     $attributes .= ' target="_blank"';
                 }
                 $return .= CBTxt::Th('BY_UPLOADING_YOU_CERTIFY_THAT_YOU_HAVE_THE_RIGHT_TO_DISTRIBUTE_THIS_AUDIO_FILE_URL_TERMS', 'By uploading, you certify that you have the right to distribute this audio file and that it does not violate the <a href="[url]"[attributes]>[type]</a>', array('[url]' => $url, '[attributes]' => $attributes, '[type]' => $termsType));
             }
         } else {
             $return .= CBTxt::Th('BY_UPLOADING_YOU_CERTIFY_THAT_YOU_HAVE_THE_RIGHT_TO_DISTRIBUTE_THIS_AUDIO_FILE', 'By uploading, you certify that you have the right to distribute this audio file.');
         }
     } else {
         $return .= CBTxt::Th('BY_UPLOADING_YOU_CERTIFY_THAT_YOU_HAVE_THE_RIGHT_TO_DISTRIBUTE_THIS_AUDIO_FILE', 'By uploading, you certify that you have the right to distribute this audio file.');
     }
     $return .= '</div>' . '</div>' . '<div id="cbaudiofile_link_' . htmlspecialchars($fieldName) . '" class="form-group cb_form_line clearfix">' . '<p>';
     if ($field->params->get('audio_allow_links', 1)) {
         $linkField = new FieldTable($field->getDbo());
         foreach (array_keys(get_object_vars($linkField)) as $k) {
             $linkField->set($k, $field->get($k));
         }
         $linkField->set('type', 'text');
         $linkField->set('description', null);
         $user->set($fieldName, strpos($value, '/') !== false || strpos($value, '\\') !== false ? $value : null);
         $return .= parent::getField($linkField, $user, $output, $reason, 0);
         $user->set($fieldName, $value);
         unset($linkField);
     }
     $return .= '</p>' . '</div>';
     return $return;
 }
コード例 #17
0
	/**
	 * prepare frontend wall edit render
	 *
	 * @param int       $id
	 * @param UserTable $user
	 */
	private function showWallEdit( $id, $user )
	{
		global $_CB_framework;

		$row					=	CBGroupJiveWall::getPost( (int) $id );
		$isModerator			=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$groupId				=	$this->input( 'group', null, GetterInterface::INT );

		if ( $groupId === null ) {
			$group				=	$row->group();
		} else {
			$group				=	CBGroupJive::getGroup( $groupId );
		}

		$returnUrl				=	$_CB_framework->pluginClassUrl( $this->_gjPlugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) );

		if ( ! CBGroupJive::canAccessGroup( $group, $user ) ) {
			cbRedirect( $returnUrl, CBTxt::T( 'Group does not exist.' ), 'error' );
		} elseif ( ! $isModerator ) {
			if ( ( ! $row->get( 'id' ) ) && ( ! CBGroupJive::canCreateGroupContent( $user, $group, 'wall' ) ) ) {
				cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to post in this group.' ), 'error' );
			} elseif ( $row->get( 'id' ) && ( $user->get( 'id' ) != $row->get( 'user_id' ) ) && ( CBGroupJive::getGroupStatus( $user, $group ) < 2 ) ) {
				cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to edit this post.' ), 'error' );
			}
		}

		CBGroupJive::getTemplate( 'wall_edit', true, true, $this->element );

		$input					=	array();

		$publishedTooltip		=	cbTooltip( null, CBTxt::T( 'Select publish state of this post. Unpublished posts will not be visible to the public.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['published']		=	moscomprofilerHTML::yesnoSelectList( 'published', 'class="form-control"' . $publishedTooltip, (int) $this->input( 'post/published', $row->get( 'published', 1 ), GetterInterface::INT ) );

		$postTooltip			=	cbTooltip( null, CBTxt::T( 'Input the post to share.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['post']			=	'<textarea id="post" name="post" class="form-control required" cols="55" rows="8"' . $postTooltip . '>' . htmlspecialchars( $this->input( 'post/post', $row->get( 'post' ), GetterInterface::HTML ) ) . '</textarea>';

		$ownerTooltip			=	cbTooltip( null, CBTxt::T( 'Input the post owner id. Post owner determines the creator of the post specified as User ID.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['user_id']		=	'<input type="text" id="user_id" name="user_id" value="' . (int) $this->input( 'post/user_id', $this->input( 'user', $row->get( 'user_id', $user->get( 'id' ) ), GetterInterface::INT ), GetterInterface::INT ) . '" class="digits required form-control" size="6"' . $ownerTooltip . ' />';

		HTML_groupjiveWallEdit::showWallEdit( $row, $input, $group, $user, $this );
	}
コード例 #18
0
 /**
  * Outputs search format including $html being html with input fields
  *
  * @param  moscomprofilerFields  $field
  * @param  moscomprofilerUser    $user
  * @param  string                $html
  * @param  string                $type   'text', 'choice', 'isisnot', 'none'
  * @param  int                   $list_compare_types   IF reason == 'search' : 0 : simple 'is' search, 1 : advanced search with modes, 2 : simple 'any' search
  * @param  string                $class  Extra-class (e.g. for jQuery)
  * @return string
  */
 function _fieldSearchModeHtml(&$field, &$user, $html, $type, $list_compare_types, $class = '')
 {
     switch ($list_compare_types) {
         case 1:
             // Advanced: all possibilities:
             $col = $field->name . '__srmch';
             $selected = $user->get($col);
             switch ($type) {
                 case 'text':
                     $choices = array('is' => _UE_MATCH_IS_EXACTLY, 'phrase' => _UE_MATCH_PHRASE, 'all' => _UE_MATCH_ALL, 'any' => _UE_MATCH_ANY, '-' => _UE_MATCH_EXCLUSIONS . ':', 'isnot' => _UE_MATCH_IS_EXACTLY_NOT, 'phrasenot' => _UE_MATCH_PHRASE_NOT, 'allnot' => _UE_MATCH_ALL_NOT, 'anynot' => _UE_MATCH_ANY_NOT);
                     break;
                 case 'singlechoice':
                     $choices = array('is' => _UE_MATCH_IS, 'anyis' => _UE_MATCH_IS_ONE_OF, '-' => _UE_MATCH_EXCLUSIONS . ':', 'isnot' => _UE_MATCH_IS_NOT, 'anyisnot' => _UE_MATCH_IS_NOT_ONE_OF);
                     break;
                 case 'multiplechoice':
                     $choices = array('is' => _UE_MATCH_ARE_EXACTLY, 'all' => _UE_MATCH_INCLUDE_ALL_OF, 'any' => _UE_MATCH_INCLUDE_ANY_OF, '-' => _UE_MATCH_EXCLUSIONS . ':', 'isnot' => _UE_MATCH_ARE_EXACTLY_NOT, 'allnot' => _UE_MATCH_INCLUDE_ALL_OF_NOT, 'anynot' => _UE_MATCH_INCLUDE_ANY_OF_NOT);
                     break;
                 case 'isisnot':
                     $choices = array('is' => _UE_MATCH_IS, '-' => _UE_MATCH_EXCLUSIONS . ':', 'isnot' => _UE_MATCH_IS_NOT);
                     break;
                 case 'none':
                 default:
                     $choices = null;
                     break;
             }
             if ($choices !== null) {
                 $drop = array();
                 $drop[] = moscomprofilerHTML::makeOption('', _UE_NO_PREFERENCE);
                 $group = false;
                 foreach ($choices as $k => $v) {
                     if ($k == '-') {
                         $drop[] = moscomprofilerHTML::makeOptGroup($v);
                         $group = true;
                     } else {
                         $drop[] = moscomprofilerHTML::makeOption($k, $v);
                     }
                 }
                 if ($group) {
                     $drop[] = moscomprofilerHTML::makeOptGroup(null);
                 }
                 $additional = ' class="inputbox"';
                 $list = moscomprofilerHTML::selectList($drop, $field->name . '__srmch', $additional, 'value', 'text', $selected, 1);
             } else {
                 $list = null;
             }
             $return = '<div class="cbSearchContainer cbSearchAdvanced">' . ($list ? '<div class="cbSearchKind">' . $list . '</div>' : '') . '<div class="cbSearchCriteria' . ($class ? ' ' . $class : '') . '">' . $html . '</div>' . '</div>';
             break;
         case 2:
             // Simple "contains" and ranges:
         // Simple "contains" and ranges:
         case 0:
         default:
             // Simple: Only 'is' and ranges:
             $return = '<div class="cbSearchContainer cbSearchSimple">' . '<div class="cbSearchCriteria' . ($class ? ' ' . $class : '') . '">' . $html . '</div>' . '</div>';
             break;
     }
     return $return;
 }
コード例 #19
0
	/**
	 * Outputs calendar driven field
	 *
	 * @param  string          $name             Name of field
	 * @param  null|string     $label            Label of field
	 * @param  boolean         $required         Is required ?
	 * @param  null|string     $value            Current value
	 * @param  boolean         $readOnly         Read-only field ?
	 * @param  boolean         $showTime         Show time too ?
	 * @param  null|int        $minYear          Minimum year to display
	 * @param  null|int        $maxYear          Maximum year to display
	 * @param  null|string     $attributes       Other HTML attributes
	 * @param  boolean         $serverTimeOffset False: don't offset, true: offset if time also in $date
	 * @param  null|string|int $offsetOverride   Offset override for time display
	 * @return string                    HTML for calendar
	 */
	public function cbAddCalendar( $name, $label = null, $required = false, $value = null, $readOnly = false, $showTime = false, $minYear = null, $maxYear = null, $attributes = null, $serverTimeOffset = true, $offsetOverride = null )
	{
		global $_CB_framework;

		if ( ( ! $value ) || ( $value == '0000-00-00 00:00:00' ) || ( $value == '0000-00-00' ) ) {
			if ( $showTime ) {
				$value						=	'0000-00-00 00:00:00';
			} else {
				$value						=	'0000-00-00';
			}
		} else {
			// Something sent an invalid format length; lets pad the date to fix this:
			if ( strlen( $value ) < 10 ) {
				if ( strlen( $value ) < 5 ) {
					// We seam to only have the year; lets give fake month-day:
					$value					=	$value . '-01-01';
				} else {
					if ( preg_match( '/\d{4}-\d+/i', $value ) ) {
						// We seam to have year and month; lets fake day:
						$value				=	rtrim( $value, '-' ) . '-01';
					} else {
						// We seam to have month-day: lets fake the year:
						$value				=	'1970-' . ltrim( $value, '-' );
					}
				}
			}

			// We always expect an SQL formatted date or timestamp; if it's anything otherwise then this function was used wrong:
			$value							=	$_CB_framework->getUTCDate( 'Y-m-d' . ( $showTime ? ' H:i:s' : null ), $value );
		}

		if ( ( ! $value ) || ( $value == '0000-00-00 00:00:00' ) || ( $value == '0000-00-00' ) ) {
			$isEmpty						=	true;
			$value							=	'';
		} else {
			$isEmpty						=	false;
		}

		// Initially set the offset value to the current value and we'll pass it through offset parsing if we need to:
		$offsetValue						=	$value;

		if ( ( $this->calendarType == 2 ) && ( ! $readOnly ) ) {
			$addPopup						=	true;
		} else {
			$addPopup						=	false;
		}

		$return								=	null;

		// When name is missing the bindings break so lets just make one:
		if ( ! $name ) {
			$name							=	uniqid();
		}

		$inputId							=	moscomprofilerHTML::htmlId( $name );

		if ( $readOnly ) {
			$return							=	htmlspecialchars( $value );
		} else {
			$attributes						.=	' data-cbdatepicker-calendartype="' . (int) $this->calendarType . '"'
											.	' data-cbdatepicker-target="#' . htmlspecialchars( $inputId ) . '"';

			if ( ( $minYear !== null ) && ( $maxYear !== null ) ) {
				$attributes					.=	' data-cbdatepicker-minyear="' . (int) $minYear . '" data-cbdatepicker-maxyear="' . (int) $maxYear . '"';
			}

			if ( $_CB_framework->document->getDirection() == 'rtl' ) {
				$attributes					.=	' data-cbdatepicker-isrtl="true"';
			}

			if ( in_array( $this->calendarType, array( 2, 3 ) ) ) {
				$tooltipTarget				=	'#' . htmlspecialchars( $inputId ) . 'Picker + .combodate';

				$attributes					.=	' data-cbtooltip-open-target="' . $tooltipTarget . '" data-cbtooltip-close-target="' . $tooltipTarget . '" data-cbtooltip-position-target="' . $tooltipTarget . '"'
											.	' data-cbdatepicker-format="' . htmlspecialchars( $this->dateFormat[2][2] . ( $showTime ? ' ' . $this->timeFormat[2][2] : null ) ) . '"'
											.	' data-cbdatepicker-template="' . htmlspecialchars( $this->dateFormat[2][1] . ( $showTime ? '  ' . $this->timeFormat[2][1] : null ) ) . '"';

				if ( $required && ( ! $isEmpty ) ) {
					$attributes				.=	' data-cbdatepicker-firstitem="none"';
				}
			}

			if ( ( $this->calendarType == 1 ) || $addPopup ) {
				$return						=	'&nbsp;&nbsp;<span id="' . htmlspecialchars( $inputId ) . 'Calendar" class="hasCalendar fa fa-calendar" title="' . htmlspecialchars( CBTxt::T( 'UE_CALENDAR_TITLE', 'Calendar' ) ) . '"></span>';

				if ( $showTime ) {
					$attributes				.=	' data-cbdatepicker-showtime="true" data-cbdatepicker-timeformat="' . htmlspecialchars( $this->timeFormat[1] ) . '"';
				}

				if ( $addPopup ) {
					$attributes				.=	' data-cbdatepicker-addpopup="true"';
				}

				$firstDay					=	CBTxt::T( 'UE_CALENDAR_FIRSTDAY', '' );

				if ( $firstDay != '' ) {
					$attributes				.=	' data-cbdatepicker-firstday="' . (int) CBTxt::T( 'UE_CALENDAR_FIRSTDAY', '' ) . '"';
				}

				$attributes					.=	' data-cbdatepicker-dateformat="' . htmlspecialchars( $this->dateFormat[1] ) . '"';
			}

			// If server time offset is enabled then tell jquery the offset in minutes:
			if ( $showTime && $serverTimeOffset ) {
				$offset						=	( $offsetOverride !== null ? $offsetOverride : $_CB_framework->getCfg( 'offset' ) );

				// Ignore offset entirely if there is no offset value:
				if ( $offset ) {
					// If the date has a time then offset it and send it to the jquery:
					if ( ( strlen( $offsetValue ) > 10 ) && $offsetValue ) {
						$offsetValue		=	$_CB_framework->getUTCDate( 'Y-m-d H:i:s', $offsetValue, $offset );
					}

					// Pass the UTC offset in minutes for momentjs:
					$attributes				.=	' data-cbdatepicker-offset="' . htmlspecialchars( ( $_CB_framework->getUTCDate( 'Z', null, $offset ) / 60 ) ) . '"';
				}
			}

			$return							=	'<input type="hidden" name="' . htmlspecialchars( $name ) . '" id="' . htmlspecialchars( $inputId ) . '" value="' . htmlspecialchars( $value ) . '" />'
											.	'<input type="text" id="' . htmlspecialchars( $inputId ) . 'Picker" value="' . htmlspecialchars( $offsetValue ) . '" class="cbDatePicker form-control' . ( $required ? ' required' : null ) . '"' . ( $readOnly ? ' disabled="disabled"' : null ) . ( $label ? ' title="' . htmlspecialchars( $label ) . '"' : null ) . ( trim( $attributes ) ? ' ' . $attributes : null ) . ' />'
											.	$return;
		}

		return $return;
	}
コード例 #20
0
ファイル: cbFieldHandler.php プロジェクト: Raul-mz/web-erpcya
 /**
  * Outputs search format including $html being html with input fields
  *
  * @param  FieldTable  $field
  * @param  UserTable   $user
  * @param  string      $html
  * @param  string      $type                'text', 'choice', 'isisnot', 'none'
  * @param  int         $list_compare_types  IF reason == 'search' : 0 : simple 'is' search, 1 : advanced search with modes, 2 : simple 'any' search
  * @param  string      $class               Extra-class (e.g. for jQuery)
  * @return string
  */
 protected function _fieldSearchModeHtml(&$field, &$user, $html, $type, $list_compare_types, $class = '')
 {
     switch ($list_compare_types) {
         case 1:
             // Advanced: all possibilities:
             $col = $field->name . '__srmch';
             $selected = $user->get($col);
             switch ($type) {
                 case 'text':
                     $choices = array('is' => CBTxt::T('UE_MATCH_IS_EXACTLY', 'is exactly'), 'phrase' => CBTxt::T('UE_MATCH_PHRASE', 'contains phrase'), 'all' => CBTxt::T('UE_MATCH_ALL', 'contains all of'), 'any' => CBTxt::T('UE_MATCH_ANY', 'contains any of'), '-' => CBTxt::T('UE_MATCH_EXCLUSIONS', 'Exclusions:'), 'isnot' => CBTxt::T('UE_MATCH_IS_EXACTLY_NOT', 'is exactly not'), 'phrasenot' => CBTxt::T('UE_MATCH_PHRASE_NOT', 'doesn\'t contain phrase'), 'allnot' => CBTxt::T('UE_MATCH_ALL_NOT', 'doesn\'t contain all of'), 'anynot' => CBTxt::T('UE_MATCH_ANY_NOT', 'doesn\'t contain any of'));
                     break;
                 case 'singlechoice':
                     $choices = array('is' => CBTxt::T('UE_MATCH_IS', 'is'), 'anyis' => CBTxt::T('UE_MATCH_IS_ONE_OF', 'is one of'), '-' => CBTxt::T('UE_MATCH_EXCLUSIONS', 'Exclusions:'), 'isnot' => CBTxt::T('UE_MATCH_IS_NOT', 'is not'), 'anyisnot' => CBTxt::T('UE_MATCH_IS_NOT_ONE_OF', 'is not one of'));
                     break;
                 case 'multiplechoice':
                     $choices = array('is' => CBTxt::T('UE_MATCH_ARE_EXACTLY', 'are exactly'), 'all' => CBTxt::T('UE_MATCH_INCLUDE_ALL_OF', 'include all of'), 'any' => CBTxt::T('UE_MATCH_INCLUDE_ANY_OF', 'include any of'), '-' => CBTxt::T('Exclusions:'), 'isnot' => CBTxt::T('UE_MATCH_ARE_EXACTLY_NOT', 'are exactly not'), 'allnot' => CBTxt::T('UE_MATCH_INCLUDE_ALL_OF_NOT', 'don\'t include all of'), 'anynot' => CBTxt::T('UE_MATCH_INCLUDE_ANY_OF_NOT', 'don\'t include any of'));
                     break;
                 case 'isisnot':
                     $choices = array('is' => CBTxt::T('UE_MATCH_IS', 'is'), '-' => CBTxt::T('UE_MATCH_EXCLUSIONS_COLUMN', 'Exclusions:'), 'isnot' => CBTxt::T('UE_MATCH_IS_NOT', 'is not'));
                     break;
                 case 'none':
                 default:
                     $choices = null;
                     break;
             }
             if ($choices !== null) {
                 $drop = array();
                 $drop[] = moscomprofilerHTML::makeOption('', CBTxt::T('UE_NO_PREFERENCE', 'No preference'));
                 $group = false;
                 foreach ($choices as $k => $v) {
                     if ($k == '-') {
                         $drop[] = moscomprofilerHTML::makeOptGroup($v);
                         $group = true;
                     } else {
                         $drop[] = moscomprofilerHTML::makeOption($k, $v);
                     }
                 }
                 if ($group) {
                     $drop[] = moscomprofilerHTML::makeOptGroup(null);
                 }
                 $additional = ' class="form-control"';
                 $list = moscomprofilerHTML::selectList($drop, $field->name . '__srmch', $additional, 'value', 'text', $selected, 1);
             } else {
                 $list = null;
             }
             $return = '<div class="cbSearchContainer cbSearchAdvanced' . ($type ? ' cbSearchAdvanced' . ucfirst($type) : '') . '">' . ($list ? '<div class="cbSearchKind' . ($type ? ' cbSearchKind' . ucfirst($type) : '') . '">' . $list . '</div>' : '') . '<div class="cbSearchCriteria' . ($type ? ' cbSearchCriteria' . ucfirst($type) : '') . ($class ? ' ' . $class : '') . '">' . $html . '</div>' . '</div>';
             break;
         case 2:
             // Simple "contains" and ranges:
         // Simple "contains" and ranges:
         case 0:
         default:
             // Simple: Only 'is' and ranges:
             $return = '<div class="cbSearchContainer cbSearchSimple">' . '<div class="cbSearchCriteria' . ($class ? ' ' . $class : '') . '">' . $html . '</div>' . '</div>';
             break;
     }
     return $return;
 }
コード例 #21
0
 /**
  * simple Javascript Cloaking
  * email cloacking
  * by default replaces an email with a mailto link with email cloacked
  */
 static function emailCloaking($mail, $mailto = 1, $text = '', $email = 1, $cloaktext = true)
 {
     global $_CB_framework;
     static $spanId = null;
     if ($spanId == null) {
         $spanId = rand(1, 100000);
     } else {
         $spanId += 1;
     }
     // convert text
     $mail = moscomprofilerHTML::encoding_converter($mail);
     // split email by @ symbol
     $mail = explode('@', $mail);
     if (count($mail) > 1) {
         $mail_parts = explode('.', $mail[1]);
     } else {
         $mail_parts = array('');
     }
     // random number
     $rand = rand(1, 100000);
     $replacement = '<span id="cbMa' . $spanId . '" class="cbMailRepl">...</span>';
     $js = '	{' . "\n\t\tvar prefix='&#109;a'+'i&#108;'+'&#116;o';" . "\n\t\tvar path = 'hr'+ 'ef'+'=';" . "\n\t\tvar addy" . $rand . "= '" . @$mail[0] . "'+ '&#64;' +'" . implode("' + '&#46;' + '", $mail_parts) . "';";
     if ($mailto) {
         // special handling when mail text is different from mail addy
         if ($text) {
             if ($cloaktext) {
                 if ($email) {
                     // convert text
                     $text = moscomprofilerHTML::encoding_converter($text);
                     // split email by @ symbol
                     $text = explode('@', $text);
                     $text_parts = explode('.', $text[1]);
                     $js .= "\n\t\tvar addy_text" . $rand . " = '" . @$text[0] . "' + '&#64;' + '" . implode("' + '&#46;' + '", @$text_parts) . "';";
                 } else {
                     $text = moscomprofilerHTML::encoding_converter($text);
                     $js .= "\n\t\tvar addy_text" . $rand . " = '" . $text . "';";
                 }
             } else {
                 $js .= "\n\t\tvar addy_text" . $rand . " = '" . $text . "';";
             }
             $js .= "\n\t\t\$('#cbMa" . $spanId . "').html(" . "'<a ' + path + '\\'' + prefix + ':' + addy" . $rand . " + '\\'>'" . " + addy_text" . $rand . " + '</a>'" . ");";
         } else {
             $js .= "\n\t\t\$('#cbMa" . $spanId . "').html(" . "'<a ' + path + '\\'' + prefix + ':' + addy" . $rand . " + '\\'>'" . " + addy" . $rand . " + '</a>'" . ");";
         }
     } else {
         $js .= "\n\t\t\$('#cbMa" . $spanId . "').html(addy" . $rand . ");";
     }
     $js .= "\n\t}";
     $replacement .= "<noscript> \n";
     $replacement .= _UE_CLOAKED;
     $replacement .= "\n</noscript> \n";
     $_CB_framework->outputCbJQuery($js);
     return $replacement;
 }
コード例 #22
0
	/**
	 * prepare frontend invite edit render
	 *
	 * @param int       $id
	 * @param UserTable $user
	 */
	private function showInviteEdit( $id, $user )
	{
		global $_CB_framework;

		$row							=	new InviteTable();

		$row->load( (int) $id );

		$isModerator					=	CBGroupJive::isModerator( $user->get( 'id' ) );
		$groupId						=	$this->input( 'group', null, GetterInterface::INT );

		if ( $groupId === null ) {
			$group						=	$row->group();
		} else {
			$group						=	CBGroupJive::getGroup( $groupId );
		}

		$returnUrl						=	$_CB_framework->pluginClassUrl( $this->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) );

		if ( ! CBGroupJive::canAccessGroup( $group, $user ) ) {
			cbRedirect( $returnUrl, CBTxt::T( 'Group does not exist.' ), 'error' );
		} elseif ( $row->get( 'id' ) && ( $user->get( 'id' ) != $row->get( 'user_id' ) ) ) {
			cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to edit this invite.' ), 'error' );
		} elseif ( ! $isModerator ) {
			if ( ( $row->get( 'published' ) == -1 ) || ( ( ! $this->params->get( 'groups_invites_display', 1 ) ) && ( $group->get( 'type' ) != 3 ) ) ) {
				cbRedirect( $returnUrl, CBTxt::T( 'You do not have access to invites in this group.' ), 'error' );
			} elseif ( ( ! $row->get( 'id' ) ) && ( ! CBGroupJive::canCreateGroupContent( $user, $group, 'invites' ) ) ) {
				cbRedirect( $returnUrl, CBTxt::T( 'You do not have sufficient permissions to create an invite in this group.' ), 'error' );
			}
		}

		CBGroupJive::getTemplate( 'invite_edit' );

		$input								=	array();

		$inviteBy							=	array();
		$inviteByLimit						=	explode( '|*|', $this->params->get( 'groups_invites_by', '1|*|2|*|3|*|4' ) );

		if ( ! $inviteByLimit ) {
			$inviteByLimit					=	array( 1, 2, 3, 4 );
		}

		if ( in_array( 1, $inviteByLimit ) ) {
			$inviteBy[]						=	CBTxt::T( 'User ID' );
		}

		if ( in_array( 2, $inviteByLimit ) ) {
			$inviteBy[]						=	CBTxt::T( 'Username' );
		}

		if ( in_array( 3, $inviteByLimit ) ) {
			$inviteBy[]						=	CBTxt::T( 'Name' );
		}

		if ( in_array( 4, $inviteByLimit ) ) {
			$inviteBy[]						=	CBTxt::T( 'Email Address' );
		}

		$input['invite_by']					=	$inviteBy;

		$listConnections					=	array();

		if ( Application::Config()->get( 'allowConnections' ) ) {
			$cbConnection					=	new cbConnection( (int) $user->get( 'id' ) );

			foreach( $cbConnection->getConnectedToMe( (int) $user->get( 'id' ) ) as $connection ) {
				$listConnections[]			=	moscomprofilerHTML::makeOption( (string) $connection->id, getNameFormat( $connection->name, $connection->username, Application::Config()->get( 'name_format', 3 ) ) );
			}
		}

		if ( $listConnections ) {
			array_unshift( $listConnections, moscomprofilerHTML::makeOption( '0', CBTxt::T( '- Select Connection -' ) ) );

			$listTooltip					=	cbTooltip( null, CBTxt::T( 'Select a connection to invite.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

			$input['list']					=	moscomprofilerHTML::selectList( $listConnections, 'selected', 'class="gjInviteConnection form-control"' . $listTooltip, 'value', 'text', (int) $this->input( 'post/selected', 0, GetterInterface::INT ), 1, false, false );
		} else {
			$input['list']					=	null;
		}

		$toTooltup							=	cbTooltip( null, CBTxt::T( 'GROUP_INVITE_BY', 'Input the recipient as [invite_by].', array( '[invite_by]' => implode( ', ', $inviteBy ) ) ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['to']						=	'<input type="text" id="to" name="to" value="' . htmlspecialchars( $this->input( 'post/to', ( $row->get( 'user' ) ? (int) $row->get( 'user' ) : $row->get( 'email' ) ), GetterInterface::STRING ) ) . '" class="gjInviteOther form-control" size="40"' . $toTooltup . ' />';

		$messageTooltip						=	cbTooltip( null, CBTxt::T( 'Optionally input private message to include with the invite.' ), null, null, null, null, null, 'data-hascbtooltip="true"' );

		$input['message']					=	'<textarea id="message" name="message" class="form-control" cols="40" rows="5"' . $messageTooltip . '>' . htmlspecialchars( $this->input( 'post/message', $row->get( 'message' ), GetterInterface::STRING ) ) . '</textarea>';

		HTML_groupjiveInviteEdit::showInviteEdit( $row, $input, $group, $user, $this );
	}
コード例 #23
0
ファイル: cb.menu.php プロジェクト: bobozhangshao/HeartCare
 /**
  * @param  \CB\Database\Table\TabTable   $tab       the tab database entry
  * @param  \CB\Database\Table\UserTable  $user      the user being displayed
  * @param  int                           $ui        1 for front-end, 2 for back-end
  * @return boolean
  */
 public function getMenuAndStatus($tab, $user, $ui)
 {
     global $_CB_framework, $_CB_database, $ueConfig, $_REQUEST, $_POST;
     $params = $this->params;
     $userId = $user->id && $_CB_framework->myId() == $user->id ? null : $user->id;
     $firstMenuName = $params->get('firstMenuName', '');
     // CBTxt::T( '_UE_MENU_CB', 'Community' )
     $firstSubMenuName = $params->get('firstSubMenuName', '');
     // CBTxt::T( '_UE_MENU_ABOUT_CB', 'About Community Builder...' )
     $firstSubMenuHref = $params->get('firstSubMenuHref', '');
     $secondSubMenuName = $params->get('secondSubMenuName', '');
     $secondSubMenuHref = $params->get('secondSubMenuHref', '');
     // ----- CUSTOM MENU -----
     if ($firstMenuName != '') {
         $customMenu = array();
         $customMenu['arrayPos'] = $firstMenuName;
         $customMenu['position'] = 'menuBar';
         $customMenu['caption'] = CBTxt::T($firstMenuName);
         $this->addMenu($customMenu);
         if ($firstSubMenuName != '') {
             // Custom 1:
             $first = array();
             $first['arrayPos'] = array($firstMenuName => array('_UE_FIRST' => null));
             $first['position'] = 'menuBar';
             $first['caption'] = CBTxt::T($firstSubMenuName);
             $first['url'] = $firstSubMenuHref == '' ? "javascript: void( 0 );" : cbSef($firstSubMenuHref);
             $first['target'] = '';
             $first['img'] = '';
             $first['tooltip'] = '';
             $this->addMenu($first);
             if ($secondSubMenuName != '') {
                 // Custom 2:
                 $second = array();
                 $second['arrayPos'] = array($firstMenuName => array('_UE_SECOND' => null));
                 $second['position'] = 'menuBar';
                 $second['caption'] = CBTxt::T($secondSubMenuName);
                 $second['url'] = $secondSubMenuHref == '' ? "javascript: void( 0 );" : cbSef($secondSubMenuHref);
                 $second['target'] = '';
                 $second['img'] = '';
                 $second['tooltip'] = '';
                 $this->addMenu($second);
             }
         }
     }
     // ----- VIEW MENU -----
     $viewMenu = array();
     $viewMenu['arrayPos'] = '_UE_MENU_VIEW';
     $viewMenu['position'] = 'menuBar';
     $viewMenu['caption'] = CBTxt::T('_UE_MENU_VIEW', 'View');
     $this->addMenu($viewMenu);
     if ($_CB_framework->myId() > 0) {
         if ($_CB_framework->displayedUser() === null || $_CB_framework->myId() != $user->id && $_CB_framework->displayedUser() !== null) {
             // View My Profile:
             $myProfile = array();
             $myProfile['arrayPos'] = array('_UE_MENU_VIEW' => array('_UE_MENU_VIEWMYPROFILE' => null));
             $myProfile['position'] = 'menuBar';
             $myProfile['caption'] = CBTxt::T('UE_MENU_VIEWMYPROFILE', 'View Your Profile');
             $myProfile['url'] = $_CB_framework->userProfileUrl();
             $myProfile['target'] = '';
             $myProfile['img'] = '<span class="fa fa-home"></span> ';
             $myProfile['tooltip'] = CBTxt::T('UE_MENU_VIEWMYPROFILE_DESC', 'View your own profile');
             $this->addMenu($myProfile);
         }
     }
     // ----- EDIT MENU -----
     $editMenu = array();
     $editMenu['arrayPos'] = '_UE_MENU_EDIT';
     $editMenu['position'] = 'menuBar';
     $editMenu['caption'] = CBTxt::T('_UE_MENU_EDIT', 'Edit');
     $this->addMenu($editMenu);
     if (!cbCheckIfUserCanPerformUserTask($user->id, 'allowModeratorsUserEdit')) {
         if ($user->id == $_CB_framework->myId()) {
             $menuTexts = array('_UE_UPDATEPROFILE' => CBTxt::T('UE_UPDATEPROFILE', 'Update Your Profile'), '_UE_MENU_UPDATEPROFILE_DESC' => CBTxt::T('UE_MENU_UPDATEPROFILE_DESC', 'Change your profile settings'));
         } else {
             $menuTexts = array('_UE_UPDATEPROFILE' => CBTxt::T('UE_MOD_MENU_UPDATEPROFILE', 'Update user profile'), '_UE_MENU_UPDATEPROFILE_DESC' => CBTxt::T('UE_MOD_MENU_UPDATEPROFILE_DESC', 'Change profile settings of this user profile'));
         }
         // Update Profile:
         $updateProfile = array();
         $updateProfile['arrayPos'] = array('_UE_MENU_EDIT' => array('_UE_UPDATEPROFILE' => null));
         $updateProfile['position'] = 'menuBar';
         $updateProfile['caption'] = $menuTexts['_UE_UPDATEPROFILE'];
         $updateProfile['url'] = $_CB_framework->userProfileEditUrl($userId);
         $updateProfile['target'] = '';
         $updateProfile['img'] = '<span class="fa fa-edit"></span> ';
         $updateProfile['tooltip'] = $menuTexts['_UE_MENU_UPDATEPROFILE_DESC'];
         $this->addMenu($updateProfile);
     }
     // ----- MESSAGES MENU -----
     $messagesMenu = array();
     $messagesMenu['arrayPos'] = '_UE_MENU_MESSAGES';
     $messagesMenu['position'] = 'menuBar';
     $messagesMenu['caption'] = CBTxt::T('_UE_MENU_MESSAGES', 'Messages');
     $this->addMenu($messagesMenu);
     if ($_CB_framework->myId() != $user->id && $_CB_framework->myId() > 0) {
         global $_CB_PMS;
         $resultArray = $_CB_PMS->getPMSlinks($user->id, $_CB_framework->myId(), '', '', 1);
         if (count($resultArray) > 0) {
             foreach ($resultArray as $res) {
                 if (is_array($res)) {
                     // Send Private Message:
                     $sendMessage = array();
                     $sendMessage['arrayPos'] = array('_UE_MENU_MESSAGES' => array('_UE_PM_USER' => null));
                     $sendMessage['position'] = 'menuBar';
                     $sendMessage['caption'] = $res['caption'];
                     // Already translated in CB Menu
                     $sendMessage['url'] = cbSef($res['url']);
                     $sendMessage['target'] = '';
                     $sendMessage['img'] = '<span class="fa fa-comment"></span> ';
                     $sendMessage['tooltip'] = $res['tooltip'];
                     // Already translated in CB Menu
                     $this->addMenu($sendMessage);
                 }
             }
         }
     }
     if ($ueConfig['allow_email_display'] != 4 && $_CB_framework->myId() != $user->id && $_CB_framework->myId() > 0) {
         switch ($ueConfig['allow_email_display']) {
             case 1:
                 // Display Email only
                 $caption = moscomprofilerHTML::emailCloaking(htmlspecialchars($user->email), 0);
                 $url = "javascript: void( 0 );;";
                 $desc = CBTxt::T('UE_MENU_USEREMAIL_DESC', 'Email address of this user');
                 break;
             case 2:
                 // Display Email with link
                 $caption = moscomprofilerHTML::emailCloaking(htmlspecialchars($user->email), 1);
                 $url = "javascript: void( 0 );;";
                 $desc = CBTxt::T('UE_MENU_SENDUSEREMAIL_DESC', 'Send an Email to this user');
                 break;
             case 3:
                 // Display Email-to text with link to web-form
             // Display Email-to text with link to web-form
             default:
                 $caption = CBTxt::T('UE_MENU_SENDUSEREMAIL', 'Send Email to User');
                 $url = $_CB_framework->viewUrl('emailuser', true, array('uid' => $userId));
                 $desc = CBTxt::T('UE_MENU_SENDUSEREMAIL_DESC', 'Send an Email to this user');
                 break;
         }
         // Send Email:
         $sendEmail = array();
         $sendEmail['arrayPos'] = array('_UE_MENU_MESSAGES' => array('_UE_MENU_SENDUSEREMAIL' => null));
         $sendEmail['position'] = 'menuBar';
         $sendEmail['caption'] = $caption;
         $sendEmail['url'] = $url;
         $sendEmail['target'] = '';
         $sendEmail['img'] = '<span class="fa fa-envelope"></span> ';
         $sendEmail['tooltip'] = $desc;
         $this->addMenu($sendEmail);
     }
     // ----- CONNECTIONS MENU -----
     $connectionsMenu = array();
     $connectionsMenu['arrayPos'] = '_UE_MENU_CONNECTIONS';
     $connectionsMenu['position'] = 'menuBar';
     $connectionsMenu['caption'] = CBTxt::T('_UE_MENU_CONNECTIONS', 'Connections');
     $this->addMenu($connectionsMenu);
     if ($ueConfig['allowConnections'] && $_CB_framework->myId() > 0) {
         // Manage My Connections:
         $manageConnections = array();
         $manageConnections['arrayPos'] = array('_UE_MENU_CONNECTIONS' => array('_UE_MENU_MANAGEMYCONNECTIONS' => null));
         $manageConnections['position'] = 'menuBar';
         $manageConnections['caption'] = CBTxt::T('UE_MENU_MANAGEMYCONNECTIONS', 'Manage Your Connections');
         $manageConnections['url'] = $_CB_framework->viewUrl('manageconnections');
         $manageConnections['target'] = '';
         $manageConnections['img'] = '<span class="fa fa-users"></span> ';
         $manageConnections['tooltip'] = CBTxt::T('UE_MENU_MANAGEMYCONNECTIONS_DESC', 'Manage your existing connections and pending connections actions');
         $this->addMenu($manageConnections);
         if ($_CB_framework->myId() != $user->id) {
             $cbConnection = new cbConnection((int) $_CB_framework->myId());
             $cbUser =& CBuser::getInstance((int) $user->id, false);
             $connClass = null;
             $connLink = null;
             $connDesc = null;
             $connMsg = null;
             $connImg = null;
             $isConnection = $cbConnection->isConnected((int) $user->id);
             if ($isConnection) {
                 $isApproved = $cbConnection->isConnectionApproved((int) $user->id);
                 $isAccepted = $cbConnection->isConnectionAccepted((int) $user->id);
             } else {
                 $isApproved = false;
                 $isAccepted = false;
             }
             if (!$isConnection) {
                 $connUrl = $_CB_framework->viewUrl('addconnection', true, array('connectionid' => (int) $user->id));
                 if ($ueConfig['useMutualConnections'] == 1) {
                     $connClass = 'UE_ADDCONNECTIONREQUEST';
                     $connMsg = CBTxt::T('UE_ADDCONNECTIONREQUEST', 'Request Connection');
                     $connDesc = CBTxt::T('UE_ADDCONNECTIONREQUEST_DESC', 'Request a Connection to that user');
                 } else {
                     $connClass = 'UE_ADDCONNECTION';
                     $connMsg = CBTxt::T('UE_ADDCONNECTION', 'Add Connection');
                     $connDesc = CBTxt::T('UE_ADDCONNECTION_DESC', 'Add a Connection to that user');
                 }
                 if ($ueConfig['conNotifyType'] != 0) {
                     cbValidator::loadValidation();
                     $tooltipTitle = sprintf(CBTxt::T('UE_CONNECTTO', 'Connect to %s'), $cbUser->getField('formatname', null, 'html', 'none', 'profile', 0, true));
                     $connectionInvitationMsg = CBTxt::T('UE_CONNECTIONINVITATIONMSG', 'Personalize your invitation to connect by adding a message that will be included with your connection.');
                     $tooltip = null;
                     if ($connectionInvitationMsg) {
                         $tooltip .= '<div class="form-group cb_form_line clearfix">' . $connectionInvitationMsg . '</div>';
                     }
                     $tooltip .= '<form action="' . $connUrl . '" method="post" id="connOverForm" name="connOverForm" class="cb_form cbValidation">' . '<div class="form-group cb_form_line clearfix">' . '<label for="message" class="control-label">' . CBTxt::T('UE_MESSAGE', 'Message') . '</label>' . '<div class="cb_field">' . '<textarea cols="40" rows="8" name="message" class="form-control"></textarea>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<input type="submit" class="btn btn-primary cbConnReqSubmit" value="' . htmlspecialchars(CBTxt::Th('UE_SENDCONNECTIONREQUEST', 'Request Connection')) . '"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />' . ' <input type="button" id="cbConnReqCancel" class="btn btn-default cbConnReqCancel cbTooltipClose" value="' . htmlspecialchars(CBTxt::Th('UE_CANCELCONNECTIONREQUEST', 'Cancel')) . '" />' . '</div>' . '</form>';
                     $connLink = cbTooltip($ui, $tooltip, $tooltipTitle, 400, null, '<span class="fa fa-heart"></span> ' . CBTxt::Th($connMsg), 'javascript: void( 0 );', 'data-hascbtooltip="true" data-cbtooltip-modal="true"');
                 } else {
                     $connLink = $connUrl;
                     $connImg = '<span class="fa fa-heart"></span> ';
                 }
             } else {
                 if ($isAccepted) {
                     $connUrl = $_CB_framework->viewUrl('removeconnection', true, array('connectionid' => (int) $user->id));
                     if ($isApproved) {
                         $connClass = 'UE_REMOVECONNECTION';
                         $connMsg = CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection');
                         $connDesc = CBTxt::T('UE_REMOVECONNECTION_DESC', 'Remove Connection to that user');
                     } else {
                         $connClass = 'UE_REVOKECONNECTIONREQUEST';
                         $connMsg = CBTxt::T('UE_REVOKECONNECTIONREQUEST', 'Revoke Connection Request');
                         $connDesc = CBTxt::T('UE_REVOKECONNECTIONREQUEST_DESC', 'Cancel the Connection Request to that user');
                     }
                     $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);
                     $connLink = $connUrl . '" onclick="return confirmSubmit();';
                     $connImg = '<span class="fa fa-heart-o"></span> ';
                 } else {
                     $connClass = null;
                     $connMsg = null;
                 }
             }
             if ($connMsg) {
                 // Request/Add/Remove/Revoke Connection:
                 $connectionRequest = array();
                 $connectionRequest['arrayPos'] = array('_UE_MENU_CONNECTIONS' => array($connClass => null));
                 $connectionRequest['position'] = 'menuBar';
                 $connectionRequest['caption'] = $connMsg;
                 $connectionRequest['url'] = $connLink;
                 $connectionRequest['target'] = '';
                 $connectionRequest['img'] = $connImg;
                 $connectionRequest['tooltip'] = $connDesc;
                 $this->addMenu($connectionRequest);
             }
         }
     }
     // ----- MODERATE MENU -----
     $moderateMenu = array();
     $moderateMenu['arrayPos'] = '_UE_MENU_MODERATE';
     $moderateMenu['position'] = 'menuBar';
     $moderateMenu['caption'] = CBTxt::T('_UE_MENU_MODERATE', 'Moderate');
     $this->addMenu($moderateMenu);
     if ($_CB_framework->myId() == $user->id) {
         if ($user->banned == 1 && $this->cbUserIsModerator == 0 && $ueConfig['allowUserBanning'] == 1) {
             // Request Unban:
             $requestUnban = array();
             $requestUnban['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_REQUESTUNBANPROFILE' => null));
             $requestUnban['position'] = 'menuBar';
             $requestUnban['caption'] = CBTxt::T('UE_REQUESTUNBANPROFILE', 'Submit Unban Request');
             $requestUnban['url'] = $_CB_framework->viewUrl('banprofile', true, array('act' => 2, 'reportform' => 1, 'uid' => (int) $user->id));
             $requestUnban['target'] = '';
             $requestUnban['img'] = '<span class="fa fa-envelope"></span> ';
             $requestUnban['tooltip'] = CBTxt::T('UE_MENU_REQUESTUNBANPROFILE_DESC', 'Submit a request to the site moderator to unban your profile');
             $this->addMenu($requestUnban);
         }
     } else {
         if ($ueConfig['allowUserReports'] == 1 && $this->cbUserIsModerator == 0 && $_CB_framework->myId() > 0) {
             // Report User:
             $reportUser = array();
             $reportUser['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_REPORTUSER' => null));
             $reportUser['position'] = 'menuBar';
             $reportUser['caption'] = CBTxt::T('UE_REPORTUSER', 'Report User');
             $reportUser['url'] = $_CB_framework->viewUrl('reportuser', true, array('uid' => (int) $user->id));
             $reportUser['target'] = '';
             $reportUser['img'] = '<span class="fa fa-bullhorn"></span> ';
             $reportUser['tooltip'] = CBTxt::T('UE_MENU_REPORTUSER_DESC', 'Report this user to the site moderator so that he can take appropriate action');
             $this->addMenu($reportUser);
         }
         if ($this->cbMyIsModerator == 1 && $this->cbUserIsModerator == 0) {
             $query = 'SELECT COUNT(*)' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_userreports') . "\n WHERE " . $_CB_database->NameQuote('reporteduser') . " = " . (int) $user->id . "\n AND " . $_CB_database->NameQuote('reportedstatus') . " = 0";
             $_CB_database->setQuery($query);
             $pendingReports = $_CB_database->loadResult();
             $query = 'SELECT COUNT(*)' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_userreports') . "\n WHERE " . $_CB_database->NameQuote('reporteduser') . " = " . (int) $user->id;
             $_CB_database->setQuery($query);
             $processedReports = $_CB_database->loadResult();
             if ($ueConfig['allowUserBanning'] == 1) {
                 if ($user->banned != 0) {
                     // Unban Profile:
                     $unbanUser = array();
                     $unbanUser['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_UNBANPROFILE' => null));
                     $unbanUser['position'] = 'menuBar';
                     $unbanUser['caption'] = CBTxt::T('UE_UNBANPROFILE', 'Unban Profile');
                     $unbanUser['url'] = $_CB_framework->viewUrl('banprofile', true, array('act' => 0, 'reportform' => 0, 'uid' => (int) $user->id));
                     $unbanUser['target'] = '';
                     $unbanUser['img'] = '<span class="fa fa-check-circle-o"></span> ';
                     $unbanUser['tooltip'] = CBTxt::T('UE_MENU_UNBANPROFILE_DESC', 'As Site Moderator: Unban this profile, making it visible to other users');
                     $this->addMenu($unbanUser);
                 } else {
                     // Ban Profile:
                     $banUser = array();
                     $banUser['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_BANPROFILE' => null));
                     $banUser['position'] = 'menuBar';
                     $banUser['caption'] = CBTxt::T('UE_BANPROFILE', 'Ban Profile');
                     $banUser['url'] = $_CB_framework->viewUrl('banprofile', true, array('act' => 1, 'uid' => (int) $user->id));
                     $banUser['target'] = '';
                     $banUser['img'] = '<span class="fa fa-ban"></span> ';
                     $banUser['tooltip'] = CBTxt::T('UE_MENU_BANPROFILE_DESC', 'As Site Moderator: Ban this profile, making it invisible to other users');
                     $this->addMenu($banUser);
                 }
                 if ($user->bannedby) {
                     // Ban History:
                     $banHistory = array();
                     $banHistory['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_MENU_BANPROFILE_HISTORY' => null));
                     $banHistory['position'] = 'menuBar';
                     $banHistory['caption'] = CBTxt::T('UE_MENU_BANPROFILE_HISTORY', 'Ban history');
                     $banHistory['url'] = $_CB_framework->viewUrl('moderatebans', true, array('act' => 2, 'uid' => (int) $user->id));
                     $banHistory['target'] = '';
                     $banHistory['img'] = '<span class="fa fa-book"></span> ';
                     $banHistory['tooltip'] = CBTxt::T('UE_MENU_BANPROFILE_HISTORY_DESC', 'As Site Moderator: See ban history of this profile');
                     $this->addMenu($banHistory);
                 }
             }
             if ($ueConfig['allowUserReports'] == 1 && $pendingReports > 0) {
                 // View Pending Reports:
                 $userReports = array();
                 $userReports['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_VIEWUSERREPORTS' => null));
                 $userReports['position'] = 'menuBar';
                 $userReports['caption'] = CBTxt::T('UE_VIEWUSERREPORTS', 'View User Reports');
                 $userReports['url'] = $_CB_framework->viewUrl('viewreports', true, array('uid' => (int) $user->id));
                 $userReports['target'] = '';
                 $userReports['img'] = '<span class="fa fa-warning"></span> ';
                 $userReports['tooltip'] = CBTxt::T('UE_MENU_VIEWUSERREPORTS_DESC', 'As Site Moderator: View User Reports for this user');
                 $this->addMenu($userReports);
             } elseif ($ueConfig['allowUserReports'] == 1 && $processedReports > 0) {
                 // View Processed Reports:
                 $userReports = array();
                 $userReports['arrayPos'] = array('_UE_MENU_MODERATE' => array('_UE_VIEWUSERREPORTS' => null));
                 $userReports['position'] = 'menuBar';
                 $userReports['caption'] = CBTxt::T('UE_MOD_MENU_VIEWOLDUSERREPORTS', 'View processed user reports');
                 $userReports['url'] = $_CB_framework->viewUrl('viewreports', true, array('act' => 1, 'uid' => (int) $user->id));
                 $userReports['target'] = '';
                 $userReports['img'] = '<span class="fa fa-warning"></span> ';
                 $userReports['tooltip'] = CBTxt::T('UE_MOD_MENU_VIEWOLDUSERREPORTS_DESC', 'As site moderator: View processed user reports for this user');
                 $this->addMenu($userReports);
             }
         }
     }
 }
コード例 #24
0
ファイル: activity.php プロジェクト: kosmosby/medicine-prof
	/**
	 * @param ActivityTable   $row
	 * @param Activity        $stream
	 * @param int             $output 0: Normal, 1: Raw, 2: Inline, 3: Load, 4: Save
	 * @param UserTable       $user
	 * @param UserTable       $viewer
	 * @param cbPluginHandler $plugin
	 * @return null|string
	 */
	static public function showEdit( $row, $stream, $output, $user, $viewer, $plugin )
	{
		global $_PLUGINS;

		$cbModerator				=	CBActivity::isModerator( (int) $viewer->get( 'id' ) );
		$messageLimit				=	( $cbModerator ? 0 : (int) $stream->get( 'message_limit', 400 ) );
		$showActions				=	(int) $stream->get( 'actions', 1 );
		$actionLimit				=	( $cbModerator ? 0 : (int) $stream->get( 'actions_message_limit', 100 ) );
		$showLocations				=	(int) $stream->get( 'locations', 1 );
		$locationLimit				=	( $cbModerator ? 0 : (int) $stream->get( 'locations_address_limit', 200 ) );
		$showLinks					=	(int) $stream->get( 'links', 1 );
		$linkLimit					=	( $cbModerator ? 0 : (int) $stream->get( 'links_link_limit', 5 ) );
		$showTags					=	(int) $stream->get( 'tags', 1 );

		$actionTooltip				=	cbTooltip( null, CBTxt::T( 'What are you doing or feeling?' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
		$locationTooltip			=	cbTooltip( null, CBTxt::T( 'Share your location.' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
		$tagTooltip					=	cbTooltip( null, CBTxt::T( 'Are you with anyone?' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
		$linkTooltip				=	cbTooltip( null, CBTxt::T( 'Have a link to share?' ), null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-classes="qtip-simple"' );
		$actionOptions				=	( $showActions ? CBActivity::loadActionOptions() : array() );
		$locationOptions			=	( $showLocations ? CBActivity::loadLocationOptions() : array() );

		$rowId						=	$stream->id() . '_edit_' . (int) $row->get( 'id' );
		$actionId					=	null;
		$locationId					=	null;
		$tags						=	array();
		$links						=	array();

		$editBody					=	null;
		$editFooter					=	null;

		$_PLUGINS->trigger( 'activity_onDisplayActivityEdit', array( &$row, &$editBody, &$editFooter, $stream, $output ) );

		$return						=	'<div class="streamItemEdit activityContainerContentEdit border-default hidden">'
									.		'<form action="' . $stream->endpoint( 'save', array( 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="' . $rowId . 'Form" id="' . $rowId . 'Form" class="cb_form streamItemForm form">'
									.			'<textarea id="' . $stream->id() . '_message_edit_' . (int) $row->get( 'id' ) . '" name="message" rows="3" class="streamInput streamInputAutosize streamInputMessage form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What's on your mind?" ) ) . '" data-cbactivity-input-size="3"' . ( $messageLimit ? ' data-cbactivity-input-limit="' . (int) $messageLimit . '" maxlength="' . (int) $messageLimit . '"' : null ) . '>' . htmlspecialchars( $row->get( 'message' ) ) . '</textarea>';

		if ( $showLinks ) {
			$links					=	$row->attachments();

			if ( $links ) {
				$return				.=			'<div class="streamPanelBody streamItemInputGroup streamInputAttachmentsContainer panel-body border-default clearfix">'
									.				self::showAttachments( $row, $stream, $output, $user, $viewer, $plugin )
									.			'</div>';
			}

			if ( ( ! $linkLimit ) || ( $linkLimit > 1 ) ) {
				$return				.=			'<div class="streamItemInputGroup streamInputLinkContainer cbRepeat border-default clearfix' . ( ! $links ? ' hidden' : null ) . '" data-cbrepeat-sortable="false"' . ( $linkLimit ? ' data-cbrepeat-max="' . (int) $linkLimit . '"' : null ) . '>';

				if ( $links ) {
					foreach ( $links as $i => $link ) {
						$return		.=				'<div class="streamItemInputGroupRow cbRepeatRow border-default">'
									.					'<span class="streamItemInputGroupLabel form-control">'
									.						'<button type="button" class="cbRepeatRowAdd btn btn-xs btn-success"><span class="fa fa-plus "></span></button>'
									.						'<button type="button" class="cbRepeatRowRemove btn btn-xs btn-danger"><span class="fa fa-minus"></span></button>'
									.					'</span>'
									.					'<div class="streamItemInputGroupInput border-default">'
									.						'<input type="text" id="' . $stream->id() . '_links__' . $i . '__url_edit_' . (int) $row->get( 'id' ) . '" name="links[' . $i . '][url]" value="' . htmlspecialchars( $link['url'] ) . '" class="streamInput streamInputLinkURL form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What link would you like to share?" ) ) . '" />'
									.					'</div>'
									.				'</div>';
					}
				} else {
					$return			.=				'<div class="streamItemInputGroupRow cbRepeatRow border-default">'
									.					'<span class="streamItemInputGroupLabel form-control">'
									.						'<button type="button" class="cbRepeatRowAdd btn btn-xs btn-success"><span class="fa fa-plus "></span></button>'
									.						'<button type="button" class="cbRepeatRowRemove btn btn-xs btn-danger"><span class="fa fa-minus"></span></button>'
									.					'</span>'
									.					'<div class="streamItemInputGroupInput border-default">'
									.						'<input type="text" id="' . $stream->id() . '_links__0__url_edit_' . (int) $row->get( 'id' ) . '" name="links[0][url]" class="streamInput streamInputLinkURL form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What link would you like to share?" ) ) . '" disabled="disabled" />'
									.					'</div>'
									.				'</div>';
				}

				$return				.=			'</div>';
			} else {
				$return				.=			'<div class="streamItemInputGroup streamInputLinkContainer border-default clearfix' . ( ! $links ? ' hidden' : null ) . '">'
									.				'<input type="text" id="' . $stream->id() . '_links__0__url_edit_' . (int) $row->get( 'id' ) . '" name="links[0][url]" value="' . htmlspecialchars( ( $links ? $links[0]['url'] : null ) ) . '" class="streamInput streamInputLinkURL form-control no-border" placeholder="' . htmlspecialchars( CBTxt::T( "What link would you like to share?" ) ) . '"' . ( ! $links ? ' disabled="disabled"' : null ) . ' />'
									.			'</div>';
			}
		}

		if ( $actionOptions ) {
			$action					=	$row->params()->subTree( 'action' );
			$actionId				=	(int) $action->get( 'id' );
			$emoteOptions			=	CBActivity::loadEmoteOptions();

			$return					.=			'<div class="streamItemInputGroup streamInputActionContainer border-default clearfix' . ( ! $actionId ? ' hidden' : null ) . '">'
									.				'<span class="streamItemInputGroupLabel streamInputSelectToggleLabel form-control"></span>'
									.				'<div class="streamItemInputGroupInput border-default">'
									.					'<input type="text" id="' . $stream->id() . '_actions_message_edit_' . (int) $row->get( 'id' ) . '" name="actions[message]" value="' . htmlspecialchars( $action->get( 'message' ) ) . '" class="streamInput streamInputActionMessage streamInputSelectTogglePlaceholder form-control no-border"' . ( $actionLimit ? ' maxlength="' . (int) $actionLimit . '"' : null ) . ( ! $actionId ? ' disabled="disabled"' : null ) . ' />'
									.					( $emoteOptions ? str_replace( 'action__emote', $stream->id() . '_actions_emote_edit_' . (int) $row->get( 'id' ), moscomprofilerHTML::selectList( $emoteOptions, 'actions[emote]', 'class="streamInputSelect streamInputEmote" data-cbselect-width="auto" data-cbselect-height="100%" data-cbselect-dropdown-css-class="streamEmoteOptions"' . ( ! $actionId ? ' disabled="disabled"' : null ), 'value', 'text', $action->get( 'emote' ), 0, false, false, false ) ) : null )
									.				'</div>'
									.			'</div>';
		}

		if ( $locationOptions ) {
			$location				=	$row->params()->subTree( 'location' );
			$locationId				=	(int) $location->get( 'id' );

			$return					.=			'<div class="streamItemInputGroup streamInputLocationContainer border-default clearfix' . ( ! $locationId ? ' hidden' : null ) . '">'
									.				'<span class="streamItemInputGroupLabel streamInputSelectToggleLabel form-control"></span>'
									.				'<div class="streamItemInputGroupInput border-default">'
									.					'<input type="text" id="' . $stream->id() . '_location_place_edit_' . (int) $row->get( 'id' ) . '" name="location[place]" value="' . htmlspecialchars( $location->get( 'place' ) ) . '" class="streamInput streamInputLocationPlace form-control no-border" placeholder="' . CBTxt::T( 'Where are you?' ) . '"' . ( $locationLimit ? ' maxlength="' . (int) $locationLimit . '"' : null ) . ( ! $locationId ? ' disabled="disabled"' : null ) . ' />'
									.					'<input type="text" id="' . $stream->id() . '_location_address_edit_' . (int) $row->get( 'id' ) . '" name="location[address]" value="' . htmlspecialchars( $location->get( 'address' ) ) . '" class="streamInput streamInputLocationAddress form-control no-border" placeholder="' . CBTxt::T( 'Have the address to share?' ) . '"' . ( $locationLimit ? ' maxlength="' . (int) $locationLimit . '"' : null ) . ( ! $locationId ? ' disabled="disabled"' : null ) . ' />'
							.							'<div class="streamFindLocation fa fa-map-marker fa-lg" data-cbactivity-location-target=".streamInputLocationAddress"></div>'
									.				'</div>'
									.			'</div>';
		}

		if ( $showTags ) {
			if ( $row->get( '_tags' ) ) {
				$tagsStream			=	$row->tags( $stream->source() );

				if ( $tagsStream ) {
					foreach ( $tagsStream->data() as $tag ) {
						/** @var TagTable $tag */
						$tags[]		=	(string) $tag->get( 'user' );
					}
				}
			}

			$tagOptions				=	CBActivity::loadTagOptions( (int) $row->get( 'id' ), (int) $row->get( 'user_id' ) );

			$return					.=			'<div class="streamItemInputGroup streamInputTagContainer border-default clearfix' . ( ! $tags ? ' hidden' : null ) . '">'
									.				str_replace( 'tags__', $stream->id() . '_tags_edit_' . (int) $row->get( 'id' ), moscomprofilerHTML::selectList( $tagOptions, 'tags[]', 'multiple="multiple" class="streamInputSelect streamInputTags form-control no-border" data-cbselect-placeholder="' . htmlspecialchars( CBTxt::T( 'Who are you with?' ) ) . '" data-cbselect-tags="true" data-cbselect-width="100%" data-cbselect-height="100%" data-cbselect-dropdown-css-class="streamTagsOptions"' . ( ! $tags ? ' disabled="disabled"' : null ), 'value', 'text', $tags, 0, true, false, false ) )
									.			'</div>';
		}

		$return						.=			$editBody
									.			'<div class="streamPanelFooter activityContainerFooter panel-footer">'
									.				'<div class="activityContainerFooterRow clearfix">'
									.					'<div class="activityContainerFooterRowLeft pull-left">'
									.						( $actionOptions ? str_replace( 'actions__id', $stream->id() . '_actions_id_edit_' . (int) $row->get( 'id' ), moscomprofilerHTML::selectList( $actionOptions, 'actions[id]', 'class="streamInputSelect streamInputSelectToggle streamInputAction btn btn-xs ' . ( $actionId ? 'btn-primary' : 'btn-default' ) . '" data-cbactivity-toggle-target=".streamInputActionContainer" data-cbactivity-toggle-active-classes="btn-primary" data-cbactivity-toggle-inactive-classes="btn-default" data-cbactivity-toggle-icon="fa fa-smile-o" data-cbselect-dropdown-css-class="streamSelectOptions"' . $actionTooltip, 'value', 'text', $actionId, 0, false, false, false ) ) : null )
									.						( $locationOptions ? ( $actionOptions ? ' ' : null ) . str_replace( 'location__id', $stream->id() . '_location_id_edit_' . (int) $row->get( 'id' ), moscomprofilerHTML::selectList( $locationOptions, 'location[id]', 'class="streamInputSelect streamInputSelectToggle streamInputLocation btn btn-xs ' . ( $locationId ? 'btn-primary' : 'btn-default' ) . '" data-cbactivity-toggle-target=".streamInputLocationContainer" data-cbactivity-toggle-active-classes="btn-primary" data-cbactivity-toggle-inactive-classes="btn-default" data-cbactivity-toggle-icon="fa fa-map-marker" data-cbselect-dropdown-css-class="streamSelectOptions"' . $locationTooltip, 'value', 'text', $locationId, 0, false, false, false ) ) : null )
									.						( $showTags ? ( $actionOptions || $locationOptions ? ' ' : null ) . '<button type="button" id="' . $stream->id() . '_tags_edit_' . (int) $row->get( 'id' ) . '" class="streamToggle streamInputTag btn btn-xs' . ( $tags ? ' btn-primary streamToggleOpen' : ' btn-default' ) . '" data-cbactivity-toggle-target=".streamInputTagContainer" data-cbactivity-toggle-active-classes="btn-primary" data-cbactivity-toggle-inactive-classes="btn-default"' . $tagTooltip . '><span class="fa fa-user"></span></button>' : null )
									.						( $showLinks ? ( $actionOptions || $locationOptions || $showTags ? ' ' : null ) . '<button type="button" id="' . $stream->id() . '_links_edit_' . (int) $row->get( 'id' ) . '" class="streamToggle streamInputLink btn btn-xs' . ( $links ? ' btn-primary streamToggleOpen' : ' btn-default' ) . '" data-cbactivity-toggle-target=".streamInputLinkContainer" data-cbactivity-toggle-active-classes="btn-primary" data-cbactivity-toggle-inactive-classes="btn-default"' . $linkTooltip . '><span class="fa fa-link"></span></button>' : null )
									.						$editFooter
									.					'</div>'
									.					'<div class="activityContainerFooterRowRight pull-right text-right">'
									.						'<button type="submit" class="activityButton activityButtonEditSave streamItemEditSave btn btn-primary btn-xs">' . CBTxt::T( 'Done Editing' ) . '</button>'
									.						' <button type="button" class="activityButton activityButtonEditCancel streamItemEditCancel btn btn-default btn-xs">' . CBTxt::T( 'Cancel' ) . '</button>'
									.					'</div>'
									.				'</div>'
									.			'</div>'
									.		'</form>'
									.	'</div>';

		return $return;
	}
コード例 #25
0
ファイル: internal.php プロジェクト: kosmosby/medicine-prof
	/**
	 * @param  boolean  $raw
	 * @return array
	 */
	static public function getCategoriesList( $raw = false )
	{
		static $cache				=	null;

		if ( ! isset( $cache ) ) {
			$plugin					=	cbconsultationsClass::getPlugin();
			$categories				=	explode( ',', $plugin->params->get( 'consultation_categories', 'General,Movies,Music,Games,Sports' ) );
			$cache					=	array();

			if ( $categories ) foreach ( $categories as $category ) {
				$cache[]			=	moscomprofilerHTML::makeOption( $category, CBTxt::T( $category ) );
			}
		}

		$rows						=	$cache;

		if ( $rows ) {
			if ( $raw === true ) {
				$categories			=	array();

				foreach ( $rows as $row ) {
					$categories[]	=	$row->value;
				}

				$rows				=	$categories;
			}
		} else {
			$rows					=	array();
		}

		return $rows;
	}
コード例 #26
0
	/**
	 * render frontend events group notifications edit params
	 *
	 * @param string            $return
	 * @param NotificationTable $row
	 * @param array             $input
	 * @param GroupTable        $group
	 * @param UserTable         $user
	 * @return string
	 */
	public function editNotifications( &$return, &$row, &$input, $group, $user )
	{
		CBGroupJive::getTemplate( 'notifications', true, true, $this->element );

		$listToggle					=	array();
		$listToggle[]				=	moscomprofilerHTML::makeOption( '0', CBTxt::T( "Don't Notify" ) );
		$listToggle[]				=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Notify' ) );

		$input['event_new']			=	moscomprofilerHTML::yesnoSelectList( 'params[event_new]', 'class="form-control"', (int) $this->input( 'post/params.event_new', $row->params()->get( 'event_new', $this->params->get( 'notifications_default_event_new', 0 ) ), GetterInterface::INT ), CBTxt::T( 'Notify' ), CBTxt::T( "Don't Notify" ), false );
		$input['event_edit']		=	moscomprofilerHTML::yesnoSelectList( 'params[event_edit]', 'class="form-control"', (int) $this->input( 'post/params.event_edit', $row->params()->get( 'event_edit', $this->params->get( 'notifications_default_event_edit', 0 ) ), GetterInterface::INT ), CBTxt::T( 'Notify' ), CBTxt::T( "Don't Notify" ), false );
		$input['event_approve']		=	moscomprofilerHTML::yesnoSelectList( 'params[event_approve]', 'class="form-control"', (int) $this->input( 'post/params.event_approve', $row->params()->get( 'event_approve', $this->params->get( 'notifications_default_event_approve', 0 ) ), GetterInterface::INT ), CBTxt::T( 'Notify' ), CBTxt::T( "Don't Notify" ), false );
		$input['event_attend']		=	moscomprofilerHTML::yesnoSelectList( 'params[event_attend]', 'class="form-control"', (int) $this->input( 'post/params.event_attend', $row->params()->get( 'event_attend', $this->params->get( 'notifications_default_event_attend', 0 ) ), GetterInterface::INT ), CBTxt::T( 'Notify' ), CBTxt::T( "Don't Notify" ), false );
		$input['event_unattend']	=	moscomprofilerHTML::yesnoSelectList( 'params[event_unattend]', 'class="form-control"', (int) $this->input( 'post/params.event_unattend', $row->params()->get( 'event_unattend', $this->params->get( 'notifications_default_event_unattend', 0 ) ), GetterInterface::INT ), CBTxt::T( 'Notify' ), CBTxt::T( "Don't Notify" ), false );

		return HTML_groupjiveEventNotifications::showEventNotifications( $row, $input, $group, $user, $this );
	}
コード例 #27
0
 /**
  * View for <param  type="private" class="cbpaidParamsExt" method="datalist">...
  *
  * @param  string              $value                  Stored Data of Model Value associated with the element
  * @param  ParamsInterface     $pluginParams           Main settigns parameters of the plugin
  * @param  string              $name                   Name attribute
  * @param  CBSimpleXMLElement  $param                  This XML node
  * @param  string              $control_name           Name of the control
  * @param  string              $control_name_name      css id-encode of the names of the controls surrounding this node
  * @param  boolean             $view                   TRUE: view, FALSE: edit
  * @param  cbpaidTable         $modelOfData            Data of the Model corresponding to this View
  * @param  cbpaidTable[]       $modelOfDataRows        Displayed Rows if it is a table
  * @param  int                 $modelOfDataRowsNumber  Total Number of rows
  * @return null|string
  */
 public function datalist($value, &$pluginParams, $name, &$param, $control_name, $control_name_name, $view, &$modelOfData, &$modelOfDataRows, &$modelOfDataRowsNumber)
 {
     global $_CB_database;
     //TBD	$multi					=	( $param->attributes( 'multiple' ) == 'true' );
     $data = $param->getElementByPath('data');
     if ($data) {
         $dataTable = $data->attributes('table');
         if (!$dataTable) {
             if (isset($this->table)) {
                 $dataTable = $this->table;
             } elseif (is_object($modelOfData) && $modelOfData instanceof TableInterface) {
                 $dataTable = $modelOfData->getTableName();
             } elseif (is_object($modelOfData) && isset($modelOfData->_tbl)) {
                 $dataTable = $modelOfData->_tbl;
             } else {
                 $dataTable = null;
             }
         }
         $xmlsql = new XmlQuery($_CB_database, $dataTable, $pluginParams);
         $xmlsql->setExternalDataTypeValues('modelofdata', $modelOfData);
         $xmlsql->process_orderby($data->getElementByPath('orderby'));
         // <data><orderby><field> fields
         $xmlsql->process_fields($data->getElementByPath('rows'));
         // <data><rows><field> fields
         $xmlsql->process_where($data->getElementByPath('where'));
         // <data><where><column> fields
         $groupby = $data->getElementByPath('groupby');
         if (!$groupby) {
             $groupby = 'value';
         }
         if ($data->attributes('dogroupby') != 'false') {
             $xmlsql->process_groupby($groupby);
         }
         $fieldValuesInDb = $xmlsql->queryLoadObjectsList($data);
         // get the records
         if ($view) {
             if (is_array($fieldValuesInDb)) {
                 foreach ($fieldValuesInDb as $v) {
                     if ($v->value == $value) {
                         $value = $v->text;
                         break;
                     }
                 }
             }
             return htmlspecialchars($value);
         } else {
             // check if value is in possible values:
             if ($value != $param->attributes('default') && is_array($fieldValuesInDb)) {
                 $setToDefault = true;
                 foreach ($fieldValuesInDb as $v) {
                     if ($v->value == $value) {
                         $setToDefault = false;
                         break;
                     }
                 }
                 if ($setToDefault) {
                     $value = $param->attributes('default');
                 }
             }
             if ($param->attributes('blanktext') && ($param->attributes('hideblanktext') != 'true' || $value == $param->attributes('default'))) {
                 $default = (string) $param->attributes('default');
                 array_unshift($fieldValuesInDb, moscomprofilerHTML::makeOption($default, CBPTXT::T($param->attributes('blanktext'))));
             }
             //TBD	$selected			=	explode( '|*|', $value );
             $classes = 'class="' . RegistryEditView::buildClasses($param, array('form-control')) . '"';
             return moscomprofilerHTML::selectList($fieldValuesInDb, $control_name_name, $classes . $this->_title($param), 'value', 'text', $value, 2);
             // return $this->selectList( $fieldValuesInDb, $param, $control_name, $name, $selected, $multi );
         }
     }
     return null;
 }
コード例 #28
0
ファイル: cbPageNav.php プロジェクト: bobozhangshao/HeartCare
 /**
  * builds and returns limitbox select input or hidden limit input
  *
  * @param bool $showLimitBox
  * @param bool $showLabel
  * @return string
  */
 public function getLimitBox($showLimitBox = true, $showLabel = false)
 {
     if ($showLimitBox) {
         if (!in_array((int) $this->limit, $this->limits)) {
             $this->limits[] = (int) $this->limit;
             cbArrayToInts($this->limits);
             sort($this->limits);
         }
         $limits = array();
         foreach ($this->limits as $i) {
             $limits[] = moscomprofilerHTML::makeOption($i);
         }
         $return = '<span class="' . htmlspecialchars($this->classes['cbPaginationLimit']) . '">' . ($showLabel ? CBTxt::Th('PAGENAV_DISPLAY_NUMBER_PER_PAGE', 'Display #') . ' ' : null) . moscomprofilerHTML::selectList($limits, $this->fieldName('limit'), 'class="' . htmlspecialchars($this->classes['cbPageLimitbox']) . '" onchange="' . $this->limitstartJs(0) . '"', 'value', 'text', (int) $this->limit, 2) . '</span>';
     } else {
         $return = '<input type="hidden" name="' . $this->fieldName('limit') . '" value="' . (int) $this->limit . '" />';
     }
     $return .= '<input type="hidden" name="' . $this->fieldName('limitstart') . '" value="' . (int) $this->limitstart . '" />';
     return $return;
 }
コード例 #29
0
	function showUsers( $option, $task, $cid ) {
		global $_CB_database, $_CB_framework, $_POST, $_PLUGINS, $_CB_TxtIntStore;

		$this->_importNeeded();

		$limit						=	(int) $_CB_framework->getCfg( 'list_limit' );
		if ( $limit == 0 ) {
			$limit					=	10;
		}
		$filter_type				=	$_CB_framework->getUserStateFromRequest( "filter_type{$option}", 'filter_type', 0 );
		$filter_status				=	$_CB_framework->getUserStateFromRequest( "filter_status{$option}", 'filter_status', 0 );
		$filter_logged				=	intval( $_CB_framework->getUserStateFromRequest( "filter_logged{$option}", 'filter_logged', 0 ) );
		$lastCBlist					=	$_CB_framework->getUserState( "view{$option}lastCBlist", null );
		if( $lastCBlist == 'showusers' ) {
			if ( $task == 'showusers' ) {
				$limit				=	$_CB_framework->getUserStateFromRequest( "viewlistlimit", 'limit', $limit );
				$limitstart			=	$_CB_framework->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 );
			}
			$lastSearch 			=	$_CB_framework->getUserState( "search{$option}", null );
			$search					=	$_CB_framework->getUserStateFromRequest( "search{$option}", 'search', '' );
			if ( $lastSearch != $search ) {
				$limitstart			=	0;
				$_CB_framework->setUserState( "view{$option}limitstart", $limitstart );
			}
			$search					=	stripslashes( trim( ( $_CB_TxtIntStore->_iso != 'UTF-8' ) ? strtolower( $search ) : ( is_callable( 'mb_convert_case' ) ? mb_convert_case( $search, MB_CASE_LOWER, "UTF-8") : utf8_encode(strtolower(utf8_decode( $search ) ) ) ) ) );
		} else {
			$filter_type			=	0;
			$filter_status			=	0;
			$filter_logged			=	0;
			clearSearchBox();
			$search					=	'';
			$limitstart				=	0;
			$_CB_framework->setUserState( "view{$option}limitstart", $limitstart );
			$_CB_framework->setUserState( "view{$option}lastCBlist", "showusers" );
		}
	
		if ( $task !== 'showusers' ) {
			if ( $task == 'ajaxemailusers' ) {
				$limitstart			=	cbGetParam( $_POST, 'limitstart', 0 );
				$limit				=	cbGetParam( $_POST, 'limit', 0 );
			} else {
				$limitstart			=	0;
				if ( $task == 'emailusers' ) {
					$limit			=	101;		// so that first 100 users and more... is displayed.
				} else {
					$limit			=	cbGetParam( $_POST, 'limit', 0 );
				}
			}
		}
		
		$tablesSQL					=	array( 'u'	=> '#__users AS u' );
		$joinsSQL					=	array( 'ue'	=> 'LEFT JOIN #__comprofiler AS ue ON u.id = ue.id' );
		$tablesWhereSQL				=	array();
	
		if ( isset( $search ) && ( $search != "") ) {
			$tablesWhereSQL[]		=	"(u.username LIKE '%" . $_CB_database->getEscaped( $search, true ) . "%' OR u.email LIKE '%" . $_CB_database->getEscaped( $search, true ) . "%' OR u.name LIKE '%" . $_CB_database->getEscaped( $search, true ) . "%')";
		}
		if ( $filter_type ) {
			if ( checkJversion() == 2 ) {
				$tablesWhereSQL[]	=	"aro.group_id = " . (int)  $filter_type;
			} else {
				if ( $filter_type == 'Public Frontend' ) {
					$tablesWhereSQL[]	=	"(u.usertype = 'Registered' OR u.usertype = 'Author' OR u.usertype = 'Editor'OR u.usertype = 'Publisher')";
				} else if ( $filter_type == 'Public Backend' ) {
					$tablesWhereSQL[]	=	"( u.usertype = 'Manager' OR u.usertype = 'Administrator' OR u.usertype = 'Super Administrator' )";
				} else {
					$tablesWhereSQL[]	=	"u.usertype = " . $_CB_database->Quote( $filter_type );
				}
			}
		}
		$tBlocked					=	CBTxt::T('Blocked');
		$tEnabled					=	CBTxt::T('Enabled');
		$tUnconfirmed				=	CBTxt::T('Unconfirmed');
		$tConfirmed					=	CBTxt::T('Confirmed');
		$tUnapproved				=	CBTxt::T('Unapproved');
		$tDisapproved				=	CBTxt::T('Disapproved');
		$tApproved					=	CBTxt::T('Approved');
		$tBanned					=	CBTxt::T('Banned');
		$p							=	' + ';
		$userstates	=	array(
						$tBlocked											=>	'u.block = 1',
						$tEnabled											=>	'u.block = 0',
						$tUnconfirmed										=>	'ue.confirmed = 0',
						$tConfirmed											=>	'ue.confirmed = 1',
						$tUnapproved										=>	'ue.approved = 0',
						$tDisapproved										=>	'ue.approved = 2',
						$tApproved											=>	'ue.approved = 1',
						$tBanned											=>	'ue.banned <> 0',
						$tBlocked . $p . $tUnconfirmed . $p . $tUnapproved	=>	'(u.block = 1 AND ue.confirmed = 0 AND ue.approved = 0)',
						$tEnabled . $p . $tUnconfirmed . $p . $tUnapproved	=>	'(u.block = 0 AND ue.confirmed = 0 AND ue.approved = 0)',
						$tBlocked . $p . $tConfirmed   . $p . $tUnapproved	=>	'(u.block = 1 AND ue.confirmed = 1 AND ue.approved = 0)',
						$tEnabled . $p . $tConfirmed   . $p . $tUnapproved	=>	'(u.block = 0 AND ue.confirmed = 1 AND ue.approved = 0)',
						$tBlocked . $p . $tUnconfirmed . $p . $tDisapproved	=>	'(u.block = 1 AND ue.confirmed = 0 AND ue.approved = 2)',
						$tEnabled . $p . $tUnconfirmed . $p . $tDisapproved	=>	'(u.block = 0 AND ue.confirmed = 0 AND ue.approved = 2)',
						$tBlocked . $p . $tConfirmed   . $p . $tDisapproved	=>	'(u.block = 1 AND ue.confirmed = 1 AND ue.approved = 2)',
						$tEnabled . $p . $tConfirmed   . $p . $tDisapproved	=>	'(u.block = 0 AND ue.confirmed = 1 AND ue.approved = 2)',
						$tBlocked . $p . $tUnconfirmed . $p . $tApproved	=>	'(u.block = 1 AND ue.confirmed = 0 AND ue.approved = 1)',
						$tEnabled . $p . $tUnconfirmed . $p . $tApproved	=>	'(u.block = 0 AND ue.confirmed = 0 AND ue.approved = 1)',
						$tBlocked . $p . $tConfirmed   . $p . $tApproved	=>	'(u.block = 1 AND ue.confirmed = 1 AND ue.approved = 1)',
						$tEnabled . $p . $tConfirmed   . $p . $tApproved	=>	'(u.block = 0 AND ue.confirmed = 1 AND ue.approved = 1)',
						CBTxt::T('Avatar not approved')						=>	"(ue.avatar > '' AND ue.avatarapproved = 0)" );
		if ( $filter_status ) {
			$tablesWhereSQL[]		=	$userstates[$filter_status];
		}
		if ( $filter_logged == 1 ) {
			$tablesWhereSQL[]		=	"s.userid = u.id";
		} else if ($filter_logged == 2) {
			$tablesWhereSQL[]		=	"s.userid IS NULL";
		}
	
		// exclude any child group id's for this user
		//$_CB_framework->acl->_debug = true;
		$pgids						=	$_CB_framework->acl->get_group_children( userGID( $_CB_framework->myId() ), 'ARO', 'RECURSE' );
		if ( is_array( $pgids ) && (count( $pgids ) > 0 ) ) {
			if ( checkJversion() == 2 ) {
				$tablesWhereSQL[]	=	"( aro.group_id NOT IN ( " . implode( ',', $pgids ) . " ) )";
			} else {
				$tablesWhereSQL[]	=	"( u.gid NOT IN ( " . implode( ',', $pgids ) . " ) )";
			}
		}
		// Filter the checkmarked users only:
		if ( $task !== 'showusers' ) {
			if ( is_array( $cid ) && ( count( $cid ) > 0 ) ) {
				cbArrayToInts( $cid );
				$tablesWhereSQL[]		=	"( u.id IN ( " . implode( ',', $cid ) . " ) )";
			}
		}
	
		// Advanced searches:
		$myCbUser				=&	CBuser::getInstance( $_CB_framework->myId() );
		$myUser					=&	$myCbUser->getUserData();
		$tabs					=	$myCbUser->_getCbTabs();		//	new cbTabs( 0, 1 );		//TBD: later: this private method should not be called here, but the whole users-list should go into there and be called here.
		$allFields				=	$tabs->_getTabFieldsDb( null, $myUser, 'adminfulllist' );
		foreach ( $allFields as $k => $v ) {
			if ( in_array( $v->type, array( 'pm', 'status', 'formatname', 'hidden', 'delimiter', 'userparams' ) ) ) {
				unset( $allFields[$k] );		// delimiter, userparams do not have search for now!
			}
		}
		$searchVals				=	new stdClass();
		$list_compare_types		=	1;		// Advanced: all possibilities (WARNING: can be slow)
		$tableReferences		=	array( '#__comprofiler' => 'ue', '#__users' => 'u' );
		$searchesFromFields		=	$tabs->applySearchableContents( $allFields, $searchVals, $_POST, $list_compare_types );
		$whereFields			=	$searchesFromFields->reduceSqlFormula( $tableReferences, $joinsSQL, TRUE );
		if ( $whereFields ) {
			$tablesWhereSQL[]	=	'(' . $whereFields . ')';
		}
		$searchTabContent		=	$tabs->getSearchablesContents( $allFields, $myUser, $searchVals, $list_compare_types );
		
		if ($filter_logged == 1 || $filter_logged == 2) {
			$joinsSQL[]				.=	"\n INNER JOIN #__session AS s ON s.userid = u.id";
		// } else {		done later, to avoid blocking site:
		//	$joinsSQL[]				.=	"\n LEFT JOIN #__session AS s ON s.userid = u.id";
		}
	
		if ( checkJversion() == 2 ) {
			$joinsSQL[]				=	"INNER JOIN #__user_usergroup_map AS aro ON aro.user_id = u.id";			// map user to aro for selection (and display if no selection)
			if ( $filter_type ) {
				$joinsSQL[]			=	"LEFT JOIN #__user_usergroup_map AS arodisplay ON arodisplay.user_id = u.id";	// map user to aro for display of all groups
				$joinsSQL[]			=	"INNER JOIN #__usergroups AS g ON g.id = arodisplay.group_id"; 					// map aro to group for display group name
			} else {
				$joinsSQL[]			=	"INNER JOIN #__usergroups AS g ON g.id = aro.group_id"; 					// map aro to group
			}
		}
	
	   	$_PLUGINS->loadPluginGroup('user');
		$_PLUGINS->trigger( 'onBeforeBackendUsersListBuildQuery', array( &$tablesSQL, &$joinsSQL, &$tablesWhereSQL, $option ) );
	
		$queryFrom					=	"\n FROM " . implode( ', ', $tablesSQL )
									.	( count( $joinsSQL ) ? "\n " . implode( "\n ", $joinsSQL ) : '' )
									.	( count( $tablesWhereSQL ) ? "\n WHERE " . implode( ' AND ', $tablesWhereSQL ) : '' )
									;
	
		// Counting query:
		$query						=	"SELECT COUNT(DISTINCT u.id)"
									.	$queryFrom
									;
		$_CB_database->setQuery( $query );
		$total						=	$_CB_database->loadResult();
		if ( $total === null ) {
			echo $_CB_database->getErrorMsg();
		}
		if ( $total <= $limitstart ) {
			$limitstart				=	0;
		}
	
		cbimport( 'cb.pagination' );
		$pageNav					=	new cbPageNav( $total, $limitstart, $limit  );
	
		if ( checkJversion() == 2 ) {
			$grp_name				=	'title';
		} elseif ( checkJversion() == 1 ) {
			$grp_name				=	'name';
			$joinsSQL[]				=	"INNER JOIN #__core_acl_aro AS aro ON aro.value = u.id";					// map user to aro
			$joinsSQL[]				=	"INNER JOIN #__core_acl_groups_aro_map AS gm ON gm.aro_id = aro.id";		// map aro to group
			$joinsSQL[]				=	"INNER JOIN #__core_acl_aro_groups AS g ON g.id = gm.group_id";
			$tablesWhereSQL[]		=	"aro.section_value = 'users'";
		} else {
			$grp_name				=	'name';
			$joinsSQL[]				=	"INNER JOIN #__core_acl_aro AS aro ON aro.value = u.id";					// map user to aro
			$joinsSQL[]				=	"INNER JOIN #__core_acl_groups_aro_map AS gm ON gm.aro_id = aro.aro_id";	// map aro to group
			$joinsSQL[]				=	"INNER JOIN #__core_acl_aro_groups AS g ON g.group_id = gm.group_id";
			$tablesWhereSQL[]		=	"aro.section_value = 'users'";
		}
	
		$queryFrom					=	"\n FROM " . implode( ', ', $tablesSQL )
									.	( count( $joinsSQL ) ? "\n " . implode( "\n ", $joinsSQL ) : '' )
									.	( count( $tablesWhereSQL ) ? "\n WHERE " . implode( ' AND ', $tablesWhereSQL ) : '' )
									;
	
		// Main query:
		if ( checkJversion() == 2 ) {
			$query					=	"SELECT u.*, GROUP_CONCAT( DISTINCT g.$grp_name ORDER BY g.$grp_name SEPARATOR ', ') AS groupname, ue.approved, ue.confirmed"
									.	$queryFrom
									.	' GROUP BY u.id'
									;
		} else {
			$query					=	"SELECT DISTINCT u.*, g.$grp_name AS groupname, ue.approved, ue.confirmed"
									.	$queryFrom
									;
		}
		$_CB_database->setQuery( $query, (int) $pageNav->limitstart, (int) $pageNav->limit );
		$rows						=	$_CB_database->loadObjectList( null, 'moscomprofilerUser', array( &$_CB_database ) );
		if ($_CB_database->getErrorNum()) {
			echo $_CB_database->stderr();
			return false;
		}
		// creates the CBUsers in cache corresponding to the $users:
		foreach ( array_keys( $rows ) as $k) {
			// do not do this otherwise substitutions do not work: 
			// CBuser::setUserGetCBUserInstance( $rows[$k] );
		}
	
		$template				=	'SELECT COUNT(s.userid) FROM #__session AS s WHERE s.userid = ';
		$n						=	count( $rows );
		for ( $i = 0; $i < $n; $i++ ) {
			$row				=	&$rows[$i];
			$query				=	$template . (int) $row->id;
			$_CB_database->setQuery( $query );
			$row->loggedin		=	$_CB_database->loadResult();
		}
	
		$select_tag_attribs		=	'class="inputbox" size="1" onchange="document.adminForm.submit( );"';
		$inputTextExtras		=	'';
		if ( $task != 'showusers' ) {
			$inputTextExtras	=	' disabled="disabled"';
			$select_tag_attribs	.=	$inputTextExtras;
		}
	
		// get list of Log Status for dropdown filter
		$logged[]				=	moscomprofilerHTML::makeOption( 0, CBTxt::T('- Select Login State -'));
		$logged[]				=	moscomprofilerHTML::makeOption( 1, CBTxt::T('Logged In'));
		$lists['logged']		=	moscomprofilerHTML::selectList( $logged, 'filter_logged', $select_tag_attribs, 'value', 'text', "$filter_logged", 2 );
	
		// get list of Groups for dropdown filter
		if ( checkJversion() == 2 ) {
			$query				=	"SELECT id AS value, title AS text"
								.	"\n FROM #__usergroups";
		} else {
			$query				=	"SELECT name AS value, name AS text"
								.	"\n FROM #__core_acl_aro_groups"
								.	"\n WHERE name != 'ROOT'"
								.	"\n AND name != 'USERS'";
		}
	
		$types[]				=	moscomprofilerHTML::makeOption( '0', CBTxt::T('- Select Group -') );
		$_CB_database->setQuery( $query );
		$types					=	array_merge( $types, $_CB_database->loadObjectList() );
		$lists['type']			=	moscomprofilerHTML::selectList( $types, 'filter_type', $select_tag_attribs, 'value', 'text', "$filter_type", 2 );
	
		$status[]				=	moscomprofilerHTML::makeOption( 0, CBTxt::T('- Select User Status -'));
		foreach ( array_keys( $userstates ) as $k ) {
			$status[]			=	moscomprofilerHTML::makeOption( $k, $k );
		}
		$lists['status']		=	moscomprofilerHTML::selectList( $status, 'filter_status', $select_tag_attribs, 'value', 'text', "$filter_status", 2 );
	
		$pluginAdditions		=	$_PLUGINS->trigger( 'onAfterBackendUsersList', array( 1, &$rows, &$pageNav, &$search, &$lists, $option, $select_tag_attribs ) );
		$pluginColumns			=	array();
		foreach ( $pluginAdditions as $addition ) {
			if ( is_array( $addition ) ) {
				$pluginColumns	=	array_merge( $pluginColumns, $addition );
			}
		}
	
		if ( $task == 'showusers' ) {
			$usersView			=	_CBloadView( 'users' );
			$usersView->showUsers( $rows, $pageNav, $search, $option, $lists, $pluginColumns, $inputTextExtras, $searchTabContent );
		} else {
			$emailSubject		=	stripslashes( cbGetParam( $_POST, 'emailsubject', '' ) );
			$emailBody			=	stripslashes( cbGetParam( $_POST, 'emailbody', '', _CB_ALLOWRAW | _CB_NOTRIM ) );
			$emailsPerBatch		=	stripslashes( cbGetParam( $_POST, 'emailsperbatch', 50 ) );
			$emailPause			=	stripslashes( cbGetParam( $_POST, 'emailpause', 30 ) );
			$simulationMode		=	stripslashes( cbGetParam( $_POST, 'simulationmode', '' ) );
			if ( count( $cid ) > 0 && count( $cid ) < $total ) {
				$total			=	count( $cid );
			}
			if ( $task == 'emailusers' ) {
				$pluginRows		=	$_PLUGINS->trigger( 'onBeforeBackendUsersEmailForm', array( &$rows, &$pageNav, &$search, &$lists, &$cid, &$emailSubject, &$emailBody, &$inputTextExtras, &$select_tag_attribs, $simulationMode, $option ) );
				$usersView		=	_CBloadView( 'users' );
				$usersView->emailUsers( $rows, $total, $search, $option, $lists, $cid, $inputTextExtras, $searchTabContent, $emailSubject, $emailBody, $emailsPerBatch, $emailPause, $simulationMode, $pluginRows );
			} elseif ( $task == 'startemailusers' ) {
				$pluginRows		=	$_PLUGINS->trigger( 'onBeforeBackendUsersEmailStart', array( &$rows, $total, $search, $lists, $cid, &$emailSubject, &$emailBody, &$inputTextExtras, $simulationMode, $option ) );
				$usersView		=	_CBloadView( 'users' );
				$usersView->startEmailUsers( $rows, $search, $option, $lists, $cid, $inputTextExtras, $searchTabContent, $emailSubject, $emailBody, $emailsPerBatch, $emailPause, $total, $simulationMode, $pluginRows );
			} elseif ( $task == 'ajaxemailusers' ) {
				$this->_cbadmin_emailUsers( $rows, $emailSubject, $emailBody, $limitstart, $limit, $total, $simulationMode );
			}
		}
		return true;
	}
コード例 #30
-1
ファイル: cbUsersList.php プロジェクト: ankaau/GathBandhan
 /**
  * Draws Users list (ECHO)
  *
  * @param  int      $userId
  * @param  int      $listId
  * @param  array    $postData
  * @return void
  */
 public function drawUsersList($userId, $listId, $postData)
 {
     global $_CB_database, $_PLUGINS;
     $_PLUGINS->loadPluginGroup('user');
     $searchData = cbGetParam($postData, 'search');
     $limitstart = (int) cbGetParam($postData, 'limitstart');
     $searchMode = (int) cbGetParam($postData, 'searchmode', 0);
     $random = (int) cbGetParam($postData, 'rand', 0);
     $cbUser = CBuser::getInstance((int) $userId, false);
     $user = $cbUser->getUserData();
     $search = null;
     $input = array();
     $publishedLists = array();
     $query = 'SELECT *' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_lists') . "\n WHERE " . $_CB_database->NameQuote('published') . " = 1" . "\n AND " . $_CB_database->NameQuote('viewaccesslevel') . " IN " . $_CB_database->safeArrayOfIntegers(Application::MyUser()->getAuthorisedViewLevels()) . "\n ORDER BY " . $_CB_database->NameQuote('ordering');
     $_CB_database->setQuery($query);
     /** @var ListTable[] $userLists */
     $userLists = $_CB_database->loadObjectList(null, '\\CB\\Database\\Table\\ListTable', array($_CB_database));
     if ($userLists) {
         foreach ($userLists as $userList) {
             $publishedLists[] = moscomprofilerHTML::makeOption((int) $userList->listid, strip_tags($cbUser->replaceUserVars($userList->title, false, false)));
             if (!$listId && $userList->default) {
                 $listId = (int) $userList->listid;
             }
         }
         if (!$listId) {
             $listId = (int) $userLists[0]->listid;
         }
     }
     if (!$listId) {
         echo CBTxt::Th('UE_NOLISTFOUND', 'There are no published user lists!');
         return;
     }
     if ($userLists) {
         $input['plists'] = moscomprofilerHTML::selectList($publishedLists, 'listid', 'class="form-control input-block" onchange="this.form.submit();"', 'value', 'text', (int) $listId, 1);
     }
     $row = self::getInstance((int) $listId);
     if (!$row) {
         echo CBTxt::Th('UE_LIST_DOES_NOT_EXIST', 'This list does not exist');
         return;
     }
     if (!$cbUser->authoriseView('userslist', $row->listid)) {
         echo CBTxt::Th('UE_NOT_AUTHORIZED', 'You are not authorized to view this page!');
         return;
     }
     $params = new Registry($row->params);
     if ($params->get('hotlink_protection', 0) == 1) {
         if ($searchData !== null || $limitstart) {
             cbSpoofCheck('userslist', 'GET');
         }
     }
     $limit = (int) $params->get('list_limit', 30);
     if (!$limit) {
         $limit = 30;
     }
     if ($params->get('list_paging', 1) != 1) {
         $limitstart = 0;
     }
     $isModerator = Application::MyUser()->isGlobalModerator();
     $_PLUGINS->trigger('onStartUsersList', array(&$listId, &$row, &$search, &$limitstart, &$limit));
     // Prepare query variables:
     $userGroupIds = explode('|*|', $row->usergroupids);
     $orderBy = self::getSorting($listId, $userId, $random);
     $filterBy = self::getFiltering($listId, $userId);
     $columns = self::getColumns($listId, $userId);
     // Grab all the fields the $user can access:
     $tabs = new cbTabs(0, 1);
     $fields = $tabs->_getTabFieldsDb(null, $user, 'list');
     // Build the field SQL:
     $tableReferences = array('#__comprofiler' => 'ue', '#__users' => 'u');
     $searchableFields = array();
     $fieldsSQL = cbUsersList::getFieldsSQL($columns, $fields, $tableReferences, $searchableFields, $params);
     $_PLUGINS->trigger('onAfterUsersListFieldsSql', array(&$columns, &$fields, &$tableReferences));
     // Build the internal joins and where statements best off list parameters:
     $tablesSQL = array();
     $joinsSQL = array();
     $tablesWhereSQL = array();
     if ($isModerator) {
         if (!$params->get('list_show_blocked', 0)) {
             $tablesWhereSQL['block'] = 'u.block = 0';
         }
         if (!$params->get('list_show_banned', 1)) {
             $tablesWhereSQL['banned'] = 'ue.banned = 0';
         }
         if (!$params->get('list_show_unapproved', 0)) {
             $tablesWhereSQL['approved'] = 'ue.approved = 1';
         }
         if (!$params->get('list_show_unconfirmed', 0)) {
             $tablesWhereSQL['confirmed'] = 'ue.confirmed = 1';
         }
     } else {
         $tablesWhereSQL = array('block' => 'u.block = 0', 'approved' => 'ue.approved = 1', 'confirmed' => 'ue.confirmed = 1', 'banned' => 'ue.banned = 0');
     }
     $joinsSQL[] = 'JOIN #__user_usergroup_map g ON g.`user_id` = u.`id`';
     if ($userGroupIds) {
         $tablesWhereSQL['gid'] = 'g.group_id IN ' . $_CB_database->safeArrayOfIntegers($userGroupIds);
     }
     foreach ($tableReferences as $table => $name) {
         if ($name == 'u') {
             $tablesSQL[] = $table . ' ' . $name;
         } else {
             $joinsSQL[] = 'JOIN ' . $table . ' ' . $name . ' ON ' . $name . '.`id` = u.`id`';
         }
     }
     // Build the search criteria:
     $searchValues = new stdClass();
     $searchesFromFields = $tabs->applySearchableContents($searchableFields, $searchValues, $postData, $params->get('list_compare_types', 0));
     $whereFields = $searchesFromFields->reduceSqlFormula($tableReferences, $joinsSQL, true);
     if ($whereFields) {
         $tablesWhereSQL[] = '(' . $whereFields . ')';
     }
     $_PLUGINS->trigger('onBeforeUsersListBuildQuery', array(&$tablesSQL, &$joinsSQL, &$tablesWhereSQL));
     // Construct the FROM and WHERE for the userlist query:
     $queryFrom = "FROM " . implode(', ', $tablesSQL) . (count($joinsSQL) ? "\n " . implode("\n ", $joinsSQL) : '') . "\n WHERE " . implode("\n AND ", $tablesWhereSQL) . " " . $filterBy;
     $_PLUGINS->trigger('onBeforeUsersListQuery', array(&$queryFrom, 1, $listId));
     // $ui = 1 (frontend)
     $errorMsg = null;
     // Checks if the list is being actively searched and it allows searching; otherwise reset back to normal:
     $searchCount = count(get_object_vars($searchValues));
     if ($params->get('list_search', 1) > 0 && $params->get('list_search_empty', 0) && !$searchCount) {
         $searchMode = 1;
         $listAll = false;
     } else {
         $listAll = $searchCount ? true : false;
     }
     if ($searchMode == 0 || $searchMode == 1 && $searchCount || $searchMode == 2) {
         // Prepare the userlist count query for pagination:
         $_CB_database->setQuery("SELECT COUNT( DISTINCT u.id ) " . $queryFrom);
         $total = $_CB_database->loadResult();
         if ($limit > $total || $limitstart >= $total) {
             $limitstart = 0;
         }
         // Prepare the actual userlist query to build a list of users:
         $query = "SELECT DISTINCT ue.*, u.*, '' AS 'NA' " . ($fieldsSQL ? ", " . $fieldsSQL . " " : '') . $queryFrom . " " . $orderBy;
         $_CB_database->setQuery($query, (int) $limitstart, (int) $limit);
         /** @var UserTable[] $users */
         $users = $_CB_database->loadObjectList(null, '\\CB\\Database\\Table\\UserTable', array($_CB_database));
         if (!$_CB_database->getErrorNum()) {
             $profileLink = $params->get('allow_profilelink', 1);
             // If users exist lets cache them and disable profile linking if necessary:
             if ($users) {
                 foreach (array_keys($users) as $k) {
                     // Add this user to cache:
                     CBuser::setUserGetCBUserInstance($users[$k]);
                     if (!$profileLink) {
                         $users[$k]->set('_allowProfileLink', 0);
                     }
                 }
             }
         } else {
             $errorMsg = CBTxt::T('UE_ERROR_IN_QUERY_TURN_SITE_DEBUG_ON_TO_VIEW', 'There is an error in the database query. Site admin can turn site debug to on to view and fix the query.');
         }
         if ($searchCount) {
             $search = '';
         } else {
             $search = null;
         }
         if ($search === null && ($searchMode == 1 && $searchCount || $searchMode == 2)) {
             $search = '';
         }
     } else {
         $total = 0;
         $users = array();
         if ($search === null) {
             $search = '';
         }
     }
     $pageNav = new cbPageNav($total, $limitstart, $limit);
     HTML_comprofiler::usersList($row, $users, $columns, $fields, $input, $search, $searchMode, $pageNav, $user, $searchableFields, $searchValues, $tabs, $errorMsg, $listAll, $random);
 }