示例#1
0
文件: Topic.php 项目: emilymwang8/cms
 public function handle_request()
 {
     $p = $this->request->get_parameters();
     $topic_id = $p['topic_id'];
     $r = Bll_Topic::get_topic_info_api($topic_id);
     header('Content-Type: application/json; charset=utf-8');
     echo json_encode($r);
 }
示例#2
0
文件: Edit.php 项目: emilymwang8/cms
 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';
 }