function edit() { DB::escapePost('data'); $modul = Module::getModuleById($_POST['module']); if ($modul['type'] == 'cat') { $model = new Catalog(); $model->edit(); } else { $model = new Work(); $model->edit(); } if ($modul['type'] == 'struct') { Fields::setFeatures(); } //if($_POST['submitbutton']=='Применить'){ $_SESSION['HTTP_REFERER'] = $_POST['redirect']; $this->redirect($_SERVER['HTTP_REFERER']); /*}else{ $_SESSION['HTTP_REFERER']=''; if($_POST['redirect'] && strpos($_POST['redirect'],'tree=new')===false){ $this->redirect($_POST['redirect']); }elseif($_POST['parent']){ $this->redirect('/work/'.$_POST['parent'].'/'); }else{ $this->redirect('/'); } }*/ }