Ejemplo n.º 1
0
 protected function doPost()
 {
     $upp = User_poll_prefs::getKV('user_id', $this->scoped->getID());
     $orig = null;
     if ($upp instanceof User_poll_prefs) {
         $orig = clone $upp;
     } else {
         $upp = new User_poll_prefs();
         $upp->user_id = $this->scoped->getID();
         $upp->created = common_sql_now();
     }
     $upp->hide_responses = $this->boolean('hide_responses');
     $upp->modified = common_sql_now();
     if ($orig instanceof User_poll_prefs) {
         $upp->update($orig);
     } else {
         $upp->insert();
     }
     // TRANS: Confirmation shown when user profile settings are saved.
     return _('Settings saved.');
 }
Ejemplo n.º 2
0
 /**
  * Handler method
  *
  * @param array $argarray is ignored since it's now passed in in prepare()
  *
  * @return void
  */
 function handlePost()
 {
     $user = common_current_user();
     $upp = User_poll_prefs::getKV('user_id', $user->id);
     $orig = null;
     if (!empty($upp)) {
         $orig = clone $upp;
     } else {
         $upp = new User_poll_prefs();
         $upp->user_id = $user->id;
         $upp->created = common_sql_now();
     }
     $upp->hide_responses = $this->boolean('hide_responses');
     $upp->modified = common_sql_now();
     if (!empty($orig)) {
         $upp->update($orig);
     } else {
         $upp->insert();
     }
     // TRANS: Confirmation shown when user profile settings are saved.
     $this->showForm(_('Settings saved.'), true);
     return;
 }