function editform_action() { chkpw('defined_form_edit'); $this->view->table=front::get('table'); if(front::post('submit') &&$this->check_mytable()) { $post=front::$post; if(!preg_match('/^(myform)\/(\w)+\.html$/i', $post['template'])){ exit('非法参数'); } unset($post['submit']); setting::$_var[front::post('name')]['myform']=$post; setting::save(); front::flash('修改成功!'); front::redirect(url::modify('act/listform',true)); } }
function batch_action(){ if(is_array(front::$post['select']) && !empty(front::$post['select'])){ foreach(front::$post['select'] as $v){ if(!preg_match('/^my_.+/',$v)) { front::flash('字段名称不正确!'); } $delete=$this->_table->query("ALTER TABLE `{$this->_table->name}` DROP `".$v."`"); if(!$delete) { front::flash('字段删除失败!'); }else { unset(setting::$var[$this->table][$v]); setting::save(); front::flash('字段删除成功!'); front::redirect(url::modify('act/list',true)); } } } }