Feature proposal #1895 » 1895-rev2.patch
administrator/components/com_comprofiler/plugin.foundation.php | ||
---|---|---|
}
|
||
|
||
function _evaluateCbTags( $input ) {
|
||
$regex = '#\[cb:user(data +field|field +field|tab +tab|position +position)="([a-zA-Z0-9_]+)"(?: +user="([^"/\] ]+)")? */\]#';
|
||
global $_CB_framework;
|
||
$regex = '#\[cb:user(data +field|field +field|tab +tab|position +position|date +date|url +url|config +config)="([a-zA-Z0-9-_/]+)"(?: +user="([^"/\] ]+)")?(?: +list="([0-9]+)")? */\]#';
|
||
if ( is_array( $input ) ) {
|
||
if ( isset( $input[3] ) ) {
|
||
$user =& $this->_evaluateUserAttrib( $input[3] );
|
||
... | ... | |
$user =& $this;
|
||
}
|
||
if ( ( $user !== null ) && is_object( $user->_cbuser ) && isset( $user->_cbuser->id ) ) {
|
||
switch ( substr( $input[1], 0, 3 ) ) {
|
||
case 'dat':
|
||
switch ( trim( substr( $input[1], 0, 4 ) ) ) {
|
||
case 'data':
|
||
return $user->_cbuser->get( $input[2] );
|
||
break;
|
||
case 'fie':
|
||
case 'fiel':
|
||
return $user->getField( $input[2] );
|
||
break;
|
||
case 'tab':
|
||
return $user->getTab( $input[2] );
|
||
break;
|
||
case 'pos':
|
||
case 'posi':
|
||
return $user->getPosition( $input[2] );
|
||
break;
|
||
case 'date':
|
||
return date( $input[2], $_CB_framework->now() );
|
||
break;
|
||
case 'url':
|
||
switch ( $input[2] ) {
|
||
case 'login':
|
||
case 'logout':
|
||
case 'registers':
|
||
case 'lostpassword':
|
||
case 'manageconnections':
|
||
return $_CB_framework->viewUrl( $input[2], false );
|
||
break;
|
||
case 'profile_view':
|
||
return $_CB_framework->userProfileUrl( $user->_cbuser->id, false );
|
||
break;
|
||
case 'profile_edit':
|
||
return $_CB_framework->userProfileEditUrl( $user->_cbuser->id, false );
|
||
break;
|
||
case 'list':
|
||
return $_CB_framework->userProfilesListUrl( ( isset( $input[4] ) ? $input[4] : null ), false );
|
||
break;
|
||
case 'itemid':
|
||
return getCBprofileItemid( false );
|
||
break;
|
||
default:
|
||
return '';
|
||
}
|
||
break;
|
||
case 'conf':
|
||
switch ( $input[2] ) {
|
||
case 'live_site':
|
||
case 'absolute_path':
|
||
case 'sitename':
|
||
case 'lang':
|
||
case 'lang_name':
|
||
case 'lang_tag':
|
||
case 'new_usertype':
|
||
return $_CB_framework->getCfg( $input[2] );
|
||
break;
|
||
default:
|
||
return '';
|
||
}
|
||
break;
|
||
default:
|
||
return '';
|
||
}
|