Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/user_profile/user_profile_tp.php
Show All 33 Lines | |||||
if ( $user_field ) { | if ( $user_field ) { | ||||
$params['name'] = $user_field; | $params['name'] = $user_field; | ||||
} | } | ||||
return $this->Application->ProcessParsedTag('u.profile', 'Field', $params); | return $this->Application->ProcessParsedTag('u.profile', 'Field', $params); | ||||
} | } | ||||
if ( $user_field ) { | if ( $user_field ) { | ||||
// Determine if field should be shown on "Public Profile" page. | // Determine if field should be shown on "Public Profile" page (always checkbox). | ||||
$block_params = array('name' => 'DisplayToPublic', 'value' => $user_field); | $block_params = array('name' => 'DisplayToPublic', 'value' => $user_field); | ||||
$selected = $this->Application->ProcessParsedTag( | $selected = $this->Application->ProcessParsedTag( | ||||
$this->getUserPrefixSpecial(), | $this->getUserPrefixSpecial(), | ||||
'Selected', | 'Selected', | ||||
$block_params | $block_params | ||||
); | ); | ||||
$value = $selected ? 1 : 0; | |||||
} | } | ||||
else { | else { | ||||
// New user-defined public profile field - fallback to persistent session storage. | // Custom user preference (can by field of any type) - fallback to persistent session storage. | ||||
$selected = $this->recallUserProfileVar($field) == 1; | $value = $this->recallUserProfileVar($field); | ||||
$selected = $value == 1; | |||||
} | } | ||||
if ( isset($params['checked']) && $params['checked'] ) { | if ( isset($params['checked']) && $params['checked'] ) { | ||||
return $selected ? 'checked' : ''; | return $selected ? 'checked' : ''; | ||||
} | } | ||||
return $selected ? 1 : 0; | return $value; | ||||
} | } | ||||
/** | /** | ||||
* Returns prefix and special of user to operate with | * Returns prefix and special of user to operate with | ||||
* | * | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
function getUserPrefixSpecial() | function getUserPrefixSpecial() | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |