public function handle_request() { $p = $this->request->get_parameters(); if ($p) { $this->handle_form($p); } $uploader = APF::get_instance()->get_config('uploader'); $prop_types = Const_Prop::get_prop_types(); foreach ($prop_types as $k => $v) { $method = 'get_' . $k . '_fields'; $fields = Const_Prop::$method(); $this->request->set_attribute($k, $fields); } $this->request->set_attribute('img_host', APF::get_instance()->get_config('img_host')); $this->request->set_attribute('prop_types', $prop_types); $this->request->set_attribute('uploader', $uploader); return 'Topic_Add'; }
public function handle_request() { if ($_GET['dbg'] === '1') { $debug = TRUE; } else { $debug = FALSE; } $p = $this->request->get_parameters(); if ($p and !$debug) { $this->handle_form($p); } $id = $this->get_topic_id_from_url(); $info = Bll_Topic::get_topic_info_api($id); foreach ($info['sort'] as $key => $value) { $method = 'get_' . $value['fangyuantype'] . '_fields'; $fields = Const_Prop::$method(); $info['sort'][$key]['prop_fields'] = $fields; } if ($debug) { see($info); exit; } $this->request->set_attribute('info', $info); $uploader = APF::get_instance()->get_config('uploader'); $img_host = APF::get_instance()->get_config('img_host'); $prop_types = Const_Prop::get_prop_types(); foreach ($prop_types as $k => $v) { $method = 'get_' . $k . '_fields'; $fields = Const_Prop::$method(); $this->request->set_attribute($k, $fields); } $this->request->set_attribute('prop_types', $prop_types); $this->request->set_attribute('uploader', $uploader); $this->request->set_attribute('img_host', $img_host); $this->request->set_attribute('topic_id', $id); return 'Topic_Edit'; }