Пример #1
0
 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);
 }
Пример #2
0
 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;
 }
Пример #3
0
 public function DeleteRecord($pkVal)
 {
     parent::DeleteRecord($pkVal);
     AjaxEcho('window.location.reload();');
 }