Index: trunk/core/units/user_profile/user_profile_tp.php =================================================================== diff -u -N --- trunk/core/units/user_profile/user_profile_tp.php (revision 0) +++ trunk/core/units/user_profile/user_profile_tp.php (revision 8615) @@ -0,0 +1,39 @@ +SelectParam($params, 'name,field'); + + if (isset($params['user_value']) && $params['user_value']) { + $profile_mapping = Array ( + 'pp_firstname' => 'FirstName', + 'pp_lastname' => 'LastName', + 'pp_dob' => 'dob', + 'pp_email' => 'Email', + 'pp_phone' => 'Phone', + 'pp_street' => 'Street', + 'pp_city' => 'City', + 'pp_state' => 'State', + 'pp_zip' => 'Zip', + 'pp_country' => 'Country', + ); + + $params['name'] = $profile_mapping[$field]; + $value = $this->Application->ProcessParsedTag('u.current', 'Field', $params); + } + else { + $value = $this->Application->RecallPersistentVar($field); + } + + if (isset($params['checked']) && $params['checked']) { + $checked_value = isset($params['value']) ? $params['value'] : 1; + $value = ($value == $checked_value) ? 'checked' : ''; + } + + return $value; + } + } + +?> \ No newline at end of file Index: trunk/kernel/units/user_profile/user_profile_tp.php =================================================================== diff -u -N --- trunk/kernel/units/user_profile/user_profile_tp.php (revision 0) +++ trunk/kernel/units/user_profile/user_profile_tp.php (revision 8615) @@ -0,0 +1,39 @@ +SelectParam($params, 'name,field'); + + if (isset($params['user_value']) && $params['user_value']) { + $profile_mapping = Array ( + 'pp_firstname' => 'FirstName', + 'pp_lastname' => 'LastName', + 'pp_dob' => 'dob', + 'pp_email' => 'Email', + 'pp_phone' => 'Phone', + 'pp_street' => 'Street', + 'pp_city' => 'City', + 'pp_state' => 'State', + 'pp_zip' => 'Zip', + 'pp_country' => 'Country', + ); + + $params['name'] = $profile_mapping[$field]; + $value = $this->Application->ProcessParsedTag('u.current', 'Field', $params); + } + else { + $value = $this->Application->RecallPersistentVar($field); + } + + if (isset($params['checked']) && $params['checked']) { + $checked_value = isset($params['value']) ? $params['value'] : 1; + $value = ($value == $checked_value) ? 'checked' : ''; + } + + return $value; + } + } + +?> \ No newline at end of file Index: trunk/core/units/users/users_config.php =================================================================== diff -u -N -r8397 -r8615 --- trunk/core/units/users/users_config.php (.../users_config.php) (revision 8397) +++ trunk/core/units/users/users_config.php (.../users_config.php) (revision 8615) @@ -34,7 +34,7 @@ 'DoSpecial' => '*', 'DoEvent' => 'OnSubstituteSubscriber', ), - + Array ( 'Mode' => hBEFORE, 'Conditional' => false, @@ -118,7 +118,7 @@ ) ), - 'SubItems' => Array('addr', 'u-cdata', 'u-ug', 'fav'), + 'SubItems' => Array('addr', 'u-cdata', 'u-ug', 'fav', 'user-profile'), 'FilterMenu' => Array( 'Groups' => Array( Index: trunk/core/units/user_profile/user_profile_config.php =================================================================== diff -u -N --- trunk/core/units/user_profile/user_profile_config.php (revision 0) +++ trunk/core/units/user_profile/user_profile_config.php (revision 8615) @@ -0,0 +1,41 @@ + 'user-profile', + 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array('class' => 'UserProfileEventHandler', 'file' => 'user_profile_eh.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array('class' => 'UserProfileTagProcessor', 'file' => 'user_profile_tp.php', 'build_event' => 'OnBuild'), + 'AutoLoad' => true, + + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), + + 'IDField' => 'UserProfileId', + 'TableName' => TABLE_PREFIX.'PersistantSessionData', + + 'ForeignKey' => 'PortalUserId', + 'ParentTableKey' => 'PortalUserId', + 'ParentPrefix' => 'u', + 'AutoDelete' => true, + 'AutoClone' => true, + + 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s',), + 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s',), + + 'Fields' => Array ( + 'PortalUserId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'VariableName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), + 'VariableValue' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + ), + + 'VirtualFields' => Array ( + 'UserProfileId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), + ), + ); + +?> \ No newline at end of file Index: trunk/core/units/user_profile/user_profile_eh.php =================================================================== diff -u -N --- trunk/core/units/user_profile/user_profile_eh.php (revision 0) +++ trunk/core/units/user_profile/user_profile_eh.php (revision 8615) @@ -0,0 +1,36 @@ + Array('subitem' => true), + ); + + $this->permMapping = array_merge($this->permMapping, $permissions); + } + + /** + * Saves user profile to database + * + * @param kEvent $event + */ + function OnUpdate(&$event) + { + $items_info = $this->Application->GetVar('user_profile'); + + foreach ($items_info as $variable_name => $variable_value) { + $this->Application->StorePersistentVar($variable_name, $variable_value); + } + } + + + } + +?> \ No newline at end of file Index: trunk/kernel/units/user_profile/user_profile_config.php =================================================================== diff -u -N --- trunk/kernel/units/user_profile/user_profile_config.php (revision 0) +++ trunk/kernel/units/user_profile/user_profile_config.php (revision 8615) @@ -0,0 +1,41 @@ + 'user-profile', + 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array('class' => 'UserProfileEventHandler', 'file' => 'user_profile_eh.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array('class' => 'UserProfileTagProcessor', 'file' => 'user_profile_tp.php', 'build_event' => 'OnBuild'), + 'AutoLoad' => true, + + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), + + 'IDField' => 'UserProfileId', + 'TableName' => TABLE_PREFIX.'PersistantSessionData', + + 'ForeignKey' => 'PortalUserId', + 'ParentTableKey' => 'PortalUserId', + 'ParentPrefix' => 'u', + 'AutoDelete' => true, + 'AutoClone' => true, + + 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s',), + 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s',), + + 'Fields' => Array ( + 'PortalUserId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'VariableName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), + 'VariableValue' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + ), + + 'VirtualFields' => Array ( + 'UserProfileId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), + ), + ); + +?> \ No newline at end of file Index: trunk/themes/default2007/platform/my_account/my_preferences.tpl =================================================================== diff -u -N --- trunk/themes/default2007/platform/my_account/my_preferences.tpl (revision 0) +++ trunk/themes/default2007/platform/my_account/my_preferences.tpl (revision 8615) @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + +
+
+ + Profile

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
 
+
img/s.gif" width="3" height="1" alt=""/>
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" /> +
+   + +
+ "/> +

+ +
+
+
+ +
+ + \ No newline at end of file Index: trunk/kernel/units/user_profile/user_profile_eh.php =================================================================== diff -u -N --- trunk/kernel/units/user_profile/user_profile_eh.php (revision 0) +++ trunk/kernel/units/user_profile/user_profile_eh.php (revision 8615) @@ -0,0 +1,36 @@ + Array('subitem' => true), + ); + + $this->permMapping = array_merge($this->permMapping, $permissions); + } + + /** + * Saves user profile to database + * + * @param kEvent $event + */ + function OnUpdate(&$event) + { + $items_info = $this->Application->GetVar('user_profile'); + + foreach ($items_info as $variable_name => $variable_value) { + $this->Application->StorePersistentVar($variable_name, $variable_value); + } + } + + + } + +?> \ No newline at end of file Index: trunk/themes/default2007/platform/designs/preferences.tpl =================================================================== diff -u -N --- trunk/themes/default2007/platform/designs/preferences.tpl (revision 0) +++ trunk/themes/default2007/platform/designs/preferences.tpl (revision 8615) @@ -0,0 +1,17 @@ + + + + + + ]" name="user_profile[]" value=""/> + ]" onchange="update_checkbox(this, document.getElementById('user_profile[]'));"/> + + + + + +
img/s.gif" width="3" height="1" alt=""/>
+ + +
+
\ No newline at end of file Index: trunk/themes/default2007/platform/my_account/preferences_tab.tpl =================================================================== diff -u -N --- trunk/themes/default2007/platform/my_account/preferences_tab.tpl (revision 0) +++ trunk/themes/default2007/platform/my_account/preferences_tab.tpl (revision 8615) @@ -0,0 +1 @@ +