private function onEdit() { $form = $this->formEdit(); if (false !== ($error = $form->validate($this->module))) { return $error . $this->templateEdit(); } $data = array('wf_cat' => $form->getVar('wf_cat'), 'wf_score' => $form->getVar('wf_score'), 'wf_title' => $form->getVar('wf_title'), 'wf_url' => $form->getVar('wf_url'), 'wf_authors' => $form->getVar('wf_authors'), 'wf_status' => $form->getVar('wf_status'), 'wf_login' => $form->getVar('wf_login'), 'wf_created_at' => $form->getVar('wf_created_at')); $f = $form->getVar('password'); if ($f !== '') { $data['wf_flag_enc'] = WC_Warflag::hashPassword($f); } if (!$this->flag->saveVars($data)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)) . $this->templateOverview(); } $site = $this->warbox->getSite(); if ($site->isLinear()) { $site->saveVar('site_maxscore', WC_Warflag::getTotalscoreForSite($site)); } $this->warbox->recalcTotalscore(); $site->recalcSite(); return $this->module->message('msg_edit_flag') . $this->templateOverview(); }