[ Index ]

PHP Cross Reference of phpBB-3.3.0-deutsch

title

Body

[close]

/includes/ucp/ -> ucp_prefs.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  /**
  15  * @ignore
  16  */
  17  if (!defined('IN_PHPBB'))
  18  {
  19      exit;
  20  }
  21  
  22  /**
  23  * ucp_prefs
  24  * Changing user preferences
  25  */
  26  class ucp_prefs
  27  {
  28      var $u_action;
  29  
  30  	function main($id, $mode)
  31      {
  32          global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $request;
  33  
  34          $submit = (isset($_POST['submit'])) ? true : false;
  35          $error = $data = array();
  36          $s_hidden_fields = '';
  37  
  38          switch ($mode)
  39          {
  40              case 'personal':
  41                  add_form_key('ucp_prefs_personal');
  42                  $data = array(
  43                      'notifymethod'    => $request->variable('notifymethod', $user->data['user_notify_type']),
  44                      'dateformat'    => $request->variable('dateformat', $user->data['user_dateformat'], true),
  45                      'lang'            => basename($request->variable('lang', $user->data['user_lang'])),
  46                      'user_style'        => $request->variable('user_style', (int) $user->data['user_style']),
  47                      'tz'            => $request->variable('tz', $user->data['user_timezone']),
  48  
  49                      'viewemail'        => $request->variable('viewemail', (bool) $user->data['user_allow_viewemail']),
  50                      'massemail'        => $request->variable('massemail', (bool) $user->data['user_allow_massemail']),
  51                      'hideonline'    => $request->variable('hideonline', (bool) !$user->data['user_allow_viewonline']),
  52                      'allowpm'        => $request->variable('allowpm', (bool) $user->data['user_allow_pm']),
  53                  );
  54  
  55                  if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml')))
  56                  {
  57                      // Jabber isnt enabled, or no jabber field filled in. Update the users table to be sure its correct.
  58                      $data['notifymethod'] = NOTIFY_BOTH;
  59                  }
  60  
  61                  /**
  62                  * Add UCP edit global settings data before they are assigned to the template or submitted
  63                  *
  64                  * To assign data to the template, use $template->assign_vars()
  65                  *
  66                  * @event core.ucp_prefs_personal_data
  67                  * @var    bool    submit        Do we display the form only
  68                  *                            or did the user press submit
  69                  * @var    array    data        Array with current ucp options data
  70                  * @var    array    error        Array with list of errors
  71                  * @since 3.1.0-a1
  72                  * @changed 3.1.4-RC1 Added error variable to the event
  73                  */
  74                  $vars = array('submit', 'data', 'error');
  75                  extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
  76  
  77                  if ($submit)
  78                  {
  79                      if ($config['override_user_style'])
  80                      {
  81                          $data['user_style'] = (int) $config['default_style'];
  82                      }
  83                      else if (!phpbb_style_is_active($data['user_style']))
  84                      {
  85                          $data['user_style'] = (int) $user->data['user_style'];
  86                      }
  87  
  88                      $error = array_merge(validate_data($data, array(
  89                          'dateformat'    => array('string', false, 1, 64),
  90                          'lang'            => array('language_iso_name'),
  91                          'tz'            => array('timezone'),
  92                      )), $error);
  93  
  94                      if (!check_form_key('ucp_prefs_personal'))
  95                      {
  96                          $error[] = 'FORM_INVALID';
  97                      }
  98  
  99                      if (!count($error))
 100                      {
 101                          $sql_ary = array(
 102                              'user_allow_pm'            => $data['allowpm'],
 103                              'user_allow_viewemail'    => $data['viewemail'],
 104                              'user_allow_massemail'    => $data['massemail'],
 105                              'user_allow_viewonline'    => ($auth->acl_get('u_hideonline')) ? !$data['hideonline'] : $user->data['user_allow_viewonline'],
 106                              'user_notify_type'        => $data['notifymethod'],
 107                              'user_options'            => $user->data['user_options'],
 108  
 109                              'user_dateformat'        => $data['dateformat'],
 110                              'user_lang'                => $data['lang'],
 111                              'user_timezone'            => $data['tz'],
 112                              'user_style'            => $data['user_style'],
 113                          );
 114  
 115                          /**
 116                          * Update UCP edit global settings data on form submit
 117                          *
 118                          * @event core.ucp_prefs_personal_update_data
 119                          * @var    array    data        Submitted display options data
 120                          * @var    array    sql_ary        Display options data we update
 121                          * @since 3.1.0-a1
 122                          */
 123                          $vars = array('data', 'sql_ary');
 124                          extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_update_data', compact($vars)));
 125  
 126                          $sql = 'UPDATE ' . USERS_TABLE . '
 127                              SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
 128                              WHERE user_id = ' . $user->data['user_id'];
 129                          $db->sql_query($sql);
 130  
 131                          meta_refresh(3, $this->u_action);
 132                          $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
 133                          trigger_error($message);
 134                      }
 135  
 136                      // Replace "error" strings with their real, localised form
 137                      $error = array_map(array($user, 'lang'), $error);
 138                  }
 139  
 140                  $dateformat_options = '';
 141  
 142                  foreach ($user->lang['dateformats'] as $format => $null)
 143                  {
 144                      $dateformat_options .= '<option value="' . $format . '"' . (($format == $data['dateformat']) ? ' selected="selected"' : '') . '>';
 145                      $dateformat_options .= $user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $user->lang['VARIANT_DATE_SEPARATOR'] . $user->format_date(time(), $format, true) : '');
 146                      $dateformat_options .= '</option>';
 147                  }
 148  
 149                  $s_custom = false;
 150  
 151                  $dateformat_options .= '<option value="custom"';
 152                  if (!isset($user->lang['dateformats'][$data['dateformat']]))
 153                  {
 154                      $dateformat_options .= ' selected="selected"';
 155                      $s_custom = true;
 156                  }
 157                  $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
 158  
 159                  phpbb_timezone_select($template, $user, $data['tz'], true);
 160  
 161                  // check if there are any user-selectable languages
 162                  $sql = 'SELECT COUNT(lang_id) as languages_count
 163                                  FROM ' . LANG_TABLE;
 164                  $result = $db->sql_query($sql);
 165                  if ($db->sql_fetchfield('languages_count') > 1)
 166                  {
 167                      $s_more_languages = true;
 168                  }
 169                  else
 170                  {
 171                      $s_more_languages = false;
 172                  }
 173                  $db->sql_freeresult($result);
 174  
 175                  // check if there are any user-selectable styles
 176                  $sql = 'SELECT COUNT(style_id) as styles_count
 177                                  FROM ' . STYLES_TABLE . '
 178                                  WHERE style_active = 1';
 179                  $result = $db->sql_query($sql);
 180                  if ($db->sql_fetchfield('styles_count') > 1)
 181                  {
 182                      $s_more_styles = true;
 183                  }
 184                  else
 185                  {
 186                      $s_more_styles = false;
 187                  }
 188                  $db->sql_freeresult($result);
 189  
 190                  $template->assign_vars(array(
 191                      'ERROR'                => (count($error)) ? implode('<br />', $error) : '',
 192  
 193                      'S_NOTIFY_EMAIL'    => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false,
 194                      'S_NOTIFY_IM'        => ($data['notifymethod'] == NOTIFY_IM) ? true : false,
 195                      'S_NOTIFY_BOTH'        => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false,
 196                      'S_VIEW_EMAIL'        => $data['viewemail'],
 197                      'S_MASS_EMAIL'        => $data['massemail'],
 198                      'S_ALLOW_PM'        => $data['allowpm'],
 199                      'S_HIDE_ONLINE'        => $data['hideonline'],
 200  
 201                      'DATE_FORMAT'            => $data['dateformat'],
 202                      'A_DATE_FORMAT'            => addslashes($data['dateformat']),
 203                      'S_DATEFORMAT_OPTIONS'    => $dateformat_options,
 204                      'S_CUSTOM_DATEFORMAT'    => $s_custom,
 205                      'DEFAULT_DATEFORMAT'    => $config['default_dateformat'],
 206                      'A_DEFAULT_DATEFORMAT'    => addslashes($config['default_dateformat']),
 207  
 208                      'S_MORE_LANGUAGES'    => $s_more_languages,
 209                      'S_MORE_STYLES'            => $s_more_styles,
 210  
 211                      'S_LANG_OPTIONS'        => language_select($data['lang']),
 212                      'S_STYLE_OPTIONS'        => ($config['override_user_style']) ? '' : style_select($data['user_style']),
 213                      'S_CAN_HIDE_ONLINE'        => ($auth->acl_get('u_hideonline')) ? true : false,
 214                      'S_SELECT_NOTIFY'        => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
 215                  );
 216  
 217              break;
 218  
 219              case 'view':
 220  
 221                  add_form_key('ucp_prefs_view');
 222  
 223                  $data = array(
 224                      'topic_sk'        => $request->variable('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'),
 225                      'topic_sd'        => $request->variable('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'),
 226                      'topic_st'        => $request->variable('topic_st', (!empty($user->data['user_topic_show_days'])) ? (int) $user->data['user_topic_show_days'] : 0),
 227  
 228                      'post_sk'        => $request->variable('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'),
 229                      'post_sd'        => $request->variable('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'),
 230                      'post_st'        => $request->variable('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0),
 231  
 232                      'images'        => $request->variable('images', (bool) $user->optionget('viewimg')),
 233                      'flash'            => $request->variable('flash', (bool) $user->optionget('viewflash')),
 234                      'smilies'        => $request->variable('smilies', (bool) $user->optionget('viewsmilies')),
 235                      'sigs'            => $request->variable('sigs', (bool) $user->optionget('viewsigs')),
 236                      'avatars'        => $request->variable('avatars', (bool) $user->optionget('viewavatars')),
 237                      'wordcensor'    => $request->variable('wordcensor', (bool) $user->optionget('viewcensors')),
 238                  );
 239  
 240                  /**
 241                  * Add UCP edit display options data before they are assigned to the template or submitted
 242                  *
 243                  * To assign data to the template, use $template->assign_vars()
 244                  *
 245                  * @event core.ucp_prefs_view_data
 246                  * @var    bool    submit        Do we display the form only
 247                  *                            or did the user press submit
 248                  * @var    array    data        Array with current ucp options data
 249                  * @since 3.1.0-a1
 250                  */
 251                  $vars = array('submit', 'data');
 252                  extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_data', compact($vars)));
 253  
 254                  if ($submit)
 255                  {
 256                      $error = validate_data($data, array(
 257                          'topic_sk'    => array(
 258                              array('string', false, 1, 1),
 259                              array('match', false, '#(a|r|s|t|v)#'),
 260                          ),
 261                          'topic_sd'    => array(
 262                              array('string', false, 1, 1),
 263                              array('match', false, '#(a|d)#'),
 264                          ),
 265                          'post_sk'    => array(
 266                              array('string', false, 1, 1),
 267                              array('match', false, '#(a|s|t)#'),
 268                          ),
 269                          'post_sd'    => array(
 270                              array('string', false, 1, 1),
 271                              array('match', false, '#(a|d)#'),
 272                          ),
 273                      ));
 274  
 275                      if (!check_form_key('ucp_prefs_view'))
 276                      {
 277                          $error[] = 'FORM_INVALID';
 278                      }
 279  
 280                      if (!count($error))
 281                      {
 282                          $user->optionset('viewimg', $data['images']);
 283                          $user->optionset('viewflash', $data['flash']);
 284                          $user->optionset('viewsmilies', $data['smilies']);
 285                          $user->optionset('viewsigs', $data['sigs']);
 286                          $user->optionset('viewavatars', $data['avatars']);
 287  
 288                          if ($auth->acl_get('u_chgcensors'))
 289                          {
 290                              $user->optionset('viewcensors', $data['wordcensor']);
 291                          }
 292  
 293                          $sql_ary = array(
 294                              'user_options'                => $user->data['user_options'],
 295                              'user_topic_sortby_type'    => $data['topic_sk'],
 296                              'user_post_sortby_type'        => $data['post_sk'],
 297                              'user_topic_sortby_dir'        => $data['topic_sd'],
 298                              'user_post_sortby_dir'        => $data['post_sd'],
 299  
 300                              'user_topic_show_days'    => $data['topic_st'],
 301                              'user_post_show_days'    => $data['post_st'],
 302                          );
 303  
 304                          /**
 305                          * Update UCP edit display options data on form submit
 306                          *
 307                          * @event core.ucp_prefs_view_update_data
 308                          * @var    array    data        Submitted display options data
 309                          * @var    array    sql_ary        Display options data we update
 310                          * @since 3.1.0-a1
 311                          */
 312                          $vars = array('data', 'sql_ary');
 313                          extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_update_data', compact($vars)));
 314  
 315                          $sql = 'UPDATE ' . USERS_TABLE . '
 316                              SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
 317                              WHERE user_id = ' . $user->data['user_id'];
 318                          $db->sql_query($sql);
 319  
 320                          meta_refresh(3, $this->u_action);
 321                          $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
 322                          trigger_error($message);
 323                      }
 324  
 325                      // Replace "error" strings with their real, localised form
 326                      $error = array_map(array($user, 'lang'), $error);
 327                  }
 328  
 329                  $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
 330  
 331                  // Topic ordering options
 332                  $limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
 333  
 334                  $sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
 335                  $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views');
 336  
 337                  // Post ordering options
 338                  $limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
 339  
 340                  $sort_by_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
 341                  $sort_by_post_sql = array('a' => 'u.username_clean', 't' => 'p.post_id', 's' => 'p.post_subject');
 342  
 343                  $_options = array('topic', 'post');
 344                  foreach ($_options as $sort_option)
 345                  {
 346                      ${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
 347                      foreach (${'limit_' . $sort_option . '_days'} as $day => $text)
 348                      {
 349                          $selected = ($data[$sort_option . '_st'] == $day) ? ' selected="selected"' : '';
 350                          ${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
 351                      }
 352                      ${'s_limit_' . $sort_option . '_days'} .= '</select>';
 353  
 354                      ${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
 355                      foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text)
 356                      {
 357                          $selected = ($data[$sort_option . '_sk'] == $key) ? ' selected="selected"' : '';
 358                          ${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
 359                      }
 360                      ${'s_sort_' . $sort_option . '_key'} .= '</select>';
 361  
 362                      ${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">';
 363                      foreach ($sort_dir_text as $key => $value)
 364                      {
 365                          $selected = ($data[$sort_option . '_sd'] == $key) ? ' selected="selected"' : '';
 366                          ${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
 367                      }
 368                      ${'s_sort_' . $sort_option . '_dir'} .= '</select>';
 369                  }
 370  
 371                  /**
 372                  * Run code before view form is displayed
 373                  *
 374                  * @event core.ucp_prefs_view_after
 375                  * @var    bool    submit                Do we display the form only
 376                  *                                    or did the user press submit
 377                  * @var    array    data                Array with current ucp options data
 378                  * @var    array    sort_dir_text        Array with sort dir language strings
 379                  * @var    array    limit_topic_days    Topic ordering options
 380                  * @var    array    sort_by_topic_text    Topic ordering language strings
 381                  * @var    array    sort_by_topic_sql    Topic ordering sql
 382                  * @var    array    limit_post_days        Post ordering options
 383                  * @var    array    sort_by_post_text    Post ordering language strings
 384                  * @var    array    sort_by_post_sql    Post ordering sql
 385                  * @var    array    _options            Sort options
 386                  * @var    string    s_limit_topic_days    Sort limit topic by days select box
 387                  * @var    string    s_sort_topic_key    Sort topic key select box
 388                  * @var    string    s_sort_topic_dir    Sort topic dir select box
 389                  * @var    string    s_limit_post_days    Sort limit post by days select box
 390                  * @var    string    s_sort_post_key        Sort post key select box
 391                  * @var    string    s_sort_post_dir        Sort post dir select box
 392                  * @since 3.1.8-RC1
 393                  */
 394                  $vars = array(
 395                      'submit',
 396                      'data',
 397                      'sort_dir_text',
 398                      'limit_topic_days',
 399                      'sort_by_topic_text',
 400                      'sort_by_topic_sql',
 401                      'limit_post_days',
 402                      'sort_by_post_text',
 403                      'sort_by_post_sql',
 404                      '_options',
 405                      's_limit_topic_days',
 406                      's_sort_topic_key',
 407                      's_sort_topic_dir',
 408                      's_limit_post_days',
 409                      's_sort_post_key',
 410                      's_sort_post_dir',
 411                  );
 412                  extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_after', compact($vars)));
 413  
 414                  $template->assign_vars(array(
 415                      'ERROR'                => (count($error)) ? implode('<br />', $error) : '',
 416  
 417                      'S_IMAGES'            => $data['images'],
 418                      'S_FLASH'            => $data['flash'],
 419                      'S_SMILIES'            => $data['smilies'],
 420                      'S_SIGS'            => $data['sigs'],
 421                      'S_AVATARS'            => $data['avatars'],
 422                      'S_DISABLE_CENSORS'    => $data['wordcensor'],
 423  
 424                      'S_CHANGE_CENSORS'        => ($auth->acl_get('u_chgcensors') && $config['allow_nocensors']) ? true : false,
 425  
 426                      'S_TOPIC_SORT_DAYS'        => $s_limit_topic_days,
 427                      'S_TOPIC_SORT_KEY'        => $s_sort_topic_key,
 428                      'S_TOPIC_SORT_DIR'        => $s_sort_topic_dir,
 429                      'S_POST_SORT_DAYS'        => $s_limit_post_days,
 430                      'S_POST_SORT_KEY'        => $s_sort_post_key,
 431                      'S_POST_SORT_DIR'        => $s_sort_post_dir)
 432                  );
 433  
 434              break;
 435  
 436              case 'post':
 437  
 438                  $data = array(
 439                      'bbcode'    => $request->variable('bbcode', $user->optionget('bbcode')),
 440                      'smilies'    => $request->variable('smilies', $user->optionget('smilies')),
 441                      'sig'        => $request->variable('sig', $user->optionget('attachsig')),
 442                      'notify'    => $request->variable('notify', (bool) $user->data['user_notify']),
 443                  );
 444                  add_form_key('ucp_prefs_post');
 445  
 446                  /**
 447                  * Add UCP edit posting defaults data before they are assigned to the template or submitted
 448                  *
 449                  * To assign data to the template, use $template->assign_vars()
 450                  *
 451                  * @event core.ucp_prefs_post_data
 452                  * @var    bool    submit        Do we display the form only
 453                  *                            or did the user press submit
 454                  * @var    array    data        Array with current ucp options data
 455                  * @since 3.1.0-a1
 456                  */
 457                  $vars = array('submit', 'data');
 458                  extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_data', compact($vars)));
 459  
 460                  if ($submit)
 461                  {
 462                      if (check_form_key('ucp_prefs_post'))
 463                      {
 464                          $user->optionset('bbcode', $data['bbcode']);
 465                          $user->optionset('smilies', $data['smilies']);
 466                          $user->optionset('attachsig', $data['sig']);
 467  
 468                          $sql_ary = array(
 469                              'user_options'    => $user->data['user_options'],
 470                              'user_notify'    => $data['notify'],
 471                          );
 472  
 473                          /**
 474                          * Update UCP edit posting defaults data on form submit
 475                          *
 476                          * @event core.ucp_prefs_post_update_data
 477                          * @var    array    data        Submitted display options data
 478                          * @var    array    sql_ary        Display options data we update
 479                          * @since 3.1.0-a1
 480                          */
 481                          $vars = array('data', 'sql_ary');
 482                          extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_update_data', compact($vars)));
 483  
 484                          $sql = 'UPDATE ' . USERS_TABLE . '
 485                              SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
 486                              WHERE user_id = ' . $user->data['user_id'];
 487                          $db->sql_query($sql);
 488  
 489                          $msg = $user->lang['PREFERENCES_UPDATED'];
 490                      }
 491                      else
 492                      {
 493                          $msg = $user->lang['FORM_INVALID'];
 494                      }
 495                      meta_refresh(3, $this->u_action);
 496                      $message = $msg . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
 497                      trigger_error($message);
 498                  }
 499  
 500                  $template->assign_vars(array(
 501                      'S_BBCODE'    => $data['bbcode'],
 502                      'S_SMILIES'    => $data['smilies'],
 503                      'S_SIG'        => $data['sig'],
 504                      'S_NOTIFY'    => $data['notify'])
 505                  );
 506              break;
 507          }
 508  
 509          /**
 510          * Modify UCP preferences data before the page load
 511          *
 512          * @event core.ucp_prefs_modify_common
 513          * @var    array    data        Array with current/submitted UCP options data
 514          * @var    array    error        Errors data
 515          * @var    string    mode        UCP prefs operation mode
 516          * @var    string    s_hidden_fields        Hidden fields data
 517          * @since 3.1.0-RC3
 518          */
 519          $vars = array(
 520              'data',
 521              'error',
 522              'mode',
 523              's_hidden_fields',
 524          );
 525          extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_modify_common', compact($vars)));
 526  
 527          $template->assign_vars(array(
 528              'L_TITLE'            => $user->lang['UCP_PREFS_' . strtoupper($mode)],
 529  
 530              'S_HIDDEN_FIELDS'    => $s_hidden_fields,
 531              'S_UCP_ACTION'        => $this->u_action)
 532          );
 533  
 534          $this->tpl_name = 'ucp_prefs_' . $mode;
 535          $this->page_title = 'UCP_PREFS_' . strtoupper($mode);
 536      }
 537  }


Generated: Tue Apr 7 19:44:41 2020 Cross-referenced by PHPXref 0.7.1