1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-14 03:25:37 +02:00

[ticket/11747] ucp_prefs_personal core events

PHPBB3-11747
This commit is contained in:
Matt Friedman 2013-07-26 18:29:06 -07:00
parent 37ceb57d12
commit 79cd86bcbc

View File

@ -55,6 +55,20 @@ class ucp_prefs
$data['notifymethod'] = NOTIFY_BOTH;
}
/**
* Add UCP edit global settings data before they are assigned to the template or submitted
*
* To assign data to the template, use $template->assign_vars()
*
* @event core.ucp_prefs_personal_data
* @var bool submit Do we display the form only
* or did the user press submit
* @var array data Array with current ucp options data
* @since 3.1-A1
*/
$vars = array('submit', 'data');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
if ($submit)
{
if ($config['override_user_style'])
@ -93,6 +107,17 @@ class ucp_prefs
'user_style' => $data['style'],
);
/**
* Update UCP edit global settings data on form submit
*
* @event core.ucp_prefs_personal_update_data
* @var array data Submitted display options data
* @var array sql_ary Display options data we udpate
* @since 3.1-A1
*/
$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_update_data', compact($vars)));
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];