コード例 #1
0
 protected function set_personal_settings()
 {
     if ($this->request->is_set_post('submit')) {
         $gallery_settings = array('watch_own' => $this->request->variable('watch_own', false), 'watch_com' => $this->request->variable('watch_com', false), 'user_allow_comments' => $this->request->variable('allow_comments', false));
         $additional_settings = array();
         /**
          * Event set personal settings
          *
          * @event phpbbgallery.core.ucp.set_settings_submit
          * @var	array	additional_settings		array of additional settings
          * @since 1.2.0
          */
         $vars = array('additional_settings');
         extract($this->dispatcher->trigger_event('phpbbgallery.core.ucp.set_settings_submit', compact($vars)));
         $gallery_settings = array_merge($gallery_settings, $additional_settings);
         if (!$this->config['phpbb_gallery_allow_comments'] || !$this->config['phpbb_gallery_comment_user_control']) {
             unset($gallery_settings['user_allow_comments']);
         }
         $this->gallery_user->set_user_id($this->user->data['user_id']);
         $this->gallery_user->update_data($gallery_settings);
         meta_refresh(3, $this->u_action);
         trigger_error($this->user->lang['WATCH_CHANGED'] . '<br /><br />' . sprintf($this->user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'));
     }
     /**
      * Event no submit personal settings
      *
      * @event phpbbgallery.core.ucp.set_settings_nosubmit
      * @since 1.2.0
      */
     $this->dispatcher->dispatch('phpbbgallery.core.ucp.set_settings_nosubmit');
     $this->template->assign_vars(array('S_PERSONAL_SETTINGS' => true, 'S_UCP_ACTION' => $this->u_action, 'L_TITLE' => $this->user->lang['UCP_GALLERY_SETTINGS'], 'L_TITLE_EXPLAIN' => $this->user->lang['WATCH_NOTE'], 'S_WATCH_OWN' => $this->gallery_user->get_data('watch_own'), 'S_WATCH_COM' => $this->gallery_user->get_data('watch_com'), 'S_ALLOW_COMMENTS' => $this->gallery_user->get_data('user_allow_comments'), 'S_COMMENTS_ENABLED' => $this->config['phpbb_gallery_allow_comments'] && $this->config['phpbb_gallery_comment_user_control']));
 }