Project

General

Profile

Feature proposal #2279 » 2279-rev2.patch

krileon, 02 February 2011 18:46

View differences:

administrator/components/com_comprofiler/plugin.foundation.php
return null;
}
}
function getTab( $tab ) {
function getTab( $tab, $output = 'html', $formatting = null, $reason = 'profile' ) {
$tabs =& $this->_getCbTabs();
$tabs->generateViewTabsContent( $this->_cbuser, '', $tab );
$tabs->generateViewTabsContent( $this->_cbuser, '', $tab, $output, $formatting, $reason );
return $tabs->getProfileTabHtml( $tab );
}
function getProfileView( $position = '' ) {
......
}
function _evaluateCbTags( $input ) {
$regex = '#\[cb:user(data +field|field +field|tab +tab|position +position)="([a-zA-Z0-9_]+)"(?: +user="([^"/\] ]+)")? */\]#';
$regex = '#\[cb:user(data +field|field +field|tab +tab|position +position)="([a-zA-Z0-9_]+)"(?: +user="([^"/\] ]+)")?(?: +output="([a-zA-Z]+)")?(?: +formatting="([a-zA-Z]+)")?(?: +reason="([a-zA-Z]+)")? */\]#';
if ( is_array( $input ) ) {
if ( isset( $input[3] ) ) {
$user =& $this->_evaluateUserAttrib( $input[3] );
$user =& $this->_evaluateUserAttrib( $input[3] );
} else {
$user =& $this;
$user =& $this;
}
if ( ( $user !== null ) && is_object( $user->_cbuser ) && isset( $user->_cbuser->id ) ) {
$output = ( isset( $input[4] ) ? ( $input[4] !== '' ? $input[4] : 'html' ) : 'html' );
$formatting = ( isset( $input[5] ) ? ( $input[5] !== '' ? $input[5] : 'none' ) : 'none' );
$reason = ( isset( $input[6] ) ? ( $input[6] !== '' ? $input[6] : 'profile' ) : 'profile' );
switch ( substr( $input[1], 0, 3 ) ) {
case 'dat':
return $user->_cbuser->get( $input[2] );
break;
case 'fie':
return $user->getField( $input[2] );
return $user->getField( $input[2], null, $output, $formatting, $reason );
break;
case 'tab':
return $user->getTab( $input[2] );
return $user->getTab( $input[2], $output, $formatting, $reason );
break;
case 'pos':
return $user->getPosition( $input[2] );
(2-2/2)