public function UpdateField($fieldAlias, $newValue, &$pkVal = NULL) { $oldPkVal = $pkVal; $ret = parent::UpdateField($fieldAlias, $newValue, $pkVal); if ($ret === NULL) { AjaxEcho("window.location.reload(false);"); } elseif ($oldPkVal !== $pkVal) { // updated PK $filters = $_GET; unset($filters['_n_' . $this->GetModuleId()]); $f = $this->FindFilter($this->GetPrimaryKey()); if ($f) { $filters['_f_' . $f['uid']] = $pkVal; } else { $filters[$this->GetPrimaryKey()] = $filters; } $url = $this->GetURL($filters); AjaxEcho("window.location.replace('{$url}');"); } return $ret; }
public function UpdateField($fieldAlias, $newValue, &$pkVal = NULL) { if ($fieldAlias == 'username') { $newValue = trim($newValue); if (!preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $newValue)) { uNotices::AddNotice('You must enter a valid email address.', NOTICE_TYPE_ERROR); return FALSE; } } return parent::UpdateField($fieldAlias, $newValue, $pkVal); }