diff options
author | Matt Friedman <maf675@gmail.com> | 2013-07-26 18:33:27 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2013-07-26 18:33:27 -0700 |
commit | 01e133f3563181e163aa0fc85e89a6fc35d31c0f (patch) | |
tree | 947da39af4405d88326fd5a06a8908318890e5e4 | |
parent | b716e1177d0fc94f1b5b8102fd35b61a6874e324 (diff) | |
download | forums-01e133f3563181e163aa0fc85e89a6fc35d31c0f.tar forums-01e133f3563181e163aa0fc85e89a6fc35d31c0f.tar.gz forums-01e133f3563181e163aa0fc85e89a6fc35d31c0f.tar.bz2 forums-01e133f3563181e163aa0fc85e89a6fc35d31c0f.tar.xz forums-01e133f3563181e163aa0fc85e89a6fc35d31c0f.zip |
[ticket/11747] ucp_prefs_post core events
PHPBB3-11747
-rw-r--r-- | phpBB/includes/ucp/ucp_prefs.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 31cf5a4447..e80cc2dce3 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -385,6 +385,20 @@ class ucp_prefs ); add_form_key('ucp_prefs_post'); + /** + * Add UCP edit posting defaults data before they are assigned to the template or submitted + * + * To assign data to the template, use $template->assign_vars() + * + * @event core.ucp_prefs_post_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_post_data', compact($vars))); + if ($submit) { if (check_form_key('ucp_prefs_post')) @@ -398,6 +412,17 @@ class ucp_prefs 'user_notify' => $data['notify'], ); + /** + * Update UCP edit posting defaults data on form submit + * + * @event core.ucp_prefs_post_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_post_update_data', compact($vars))); + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $user->data['user_id']; |