From 708e27025050105cf7de3be8eebfed3fb9061de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Thu, 1 Feb 2018 10:51:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0AMP=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/amp.php | 62 +++++++ application/views/amp_editor.php | 85 ++++++++++ .../views/bootstrap3/information_edit.php | 155 +++++++++--------- 3 files changed, 228 insertions(+), 74 deletions(-) create mode 100644 application/controllers/amp.php create mode 100644 application/views/amp_editor.php diff --git a/application/controllers/amp.php b/application/controllers/amp.php new file mode 100644 index 00000000..e24c449a --- /dev/null +++ b/application/controllers/amp.php @@ -0,0 +1,62 @@ +permission->is_admin(); + //$this->output->enable_profiler(TRUE); + $this->load->model('Information_model'); + $this->load->model('InfoMetas_model'); + } + + public function index() { + $data = array(); + $this->load->view('bootstrap3/header', $data); + $this->load->view('amp_editor'); + $this->load->view('bootstrap3/footer'); + } + + public function edit($ic_id) { + $data = array(); + $data['information'] = $this->Information_model->detail_by_ic_id($ic_id); + if ($data['information'] == FALSE) { + show_404(); + } + $this->load->view('bootstrap3/header', $data); + $this->load->view('amp_editor'); + $this->load->view('bootstrap3/footer'); + } + + public function edit_save() { + $data = array(); + $ic_id = $this->input->post('ic_id'); + $textarea_htmlcode = $this->input->post('textarea_htmlcode'); + $amp_status = $this->input->post('amp_status'); + $data['information'] = $this->Information_model->detail_by_ic_id($ic_id); + if ($data['information'] == FALSE) { + show_404(); + } + + $amp = $this->InfoMetas_model->get($ic_id, 'AMP'); + if ($amp === false) { + $this->InfoMetas_model->add($ic_id, 'AMP', $textarea_htmlcode); + } else { + $this->InfoMetas_model->update($ic_id, 'AMP', $textarea_htmlcode); + } + + $amp_status_value = $this->InfoMetas_model->get($ic_id, 'AMP_STATUS'); + if ($amp_status_value === false) { + $this->InfoMetas_model->add($ic_id, 'AMP_STATUS', $amp_status); + } else { + $this->InfoMetas_model->update($ic_id, 'AMP_STATUS', $amp_status); + } + + $data[] = array('name' => 'ok', 'value' => $this->lang->line('form_info_success')); + echo json_encode($data); + } + +} diff --git a/application/views/amp_editor.php b/application/views/amp_editor.php new file mode 100644 index 00000000..974e7e5b --- /dev/null +++ b/application/views/amp_editor.php @@ -0,0 +1,85 @@ + + + +
+
+
+
+
+
+
+ + + +
+ +
+ + +
+
+ +
+
+
+
+
+
+ + + + + + + + + diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 9409aae5..038c8268 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -1,4 +1,4 @@ - + From a085651a5b926ef0d5fc5969374313a458d6e473 Mon Sep 17 00:00:00 2001 From: "lmr@hainatravel.com" <59361885@qq.com> Date: Thu, 1 Feb 2018 11:38:04 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/bootstrap3/information_edit.php | 369 +++++++----------- 1 file changed, 139 insertions(+), 230 deletions(-) diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 038c8268..70098812 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -534,22 +534,20 @@
- ic_id, 'AMP_STATUS') === '1'){ ?> - - - - + ic_id, 'AMP_STATUS') === '1') {?> + + + +
- +
@@ -563,9 +561,9 @@
链接地址 - ic_sitecode == 'cht') { ?> + ic_sitecode == 'cht') {?> - +
@@ -578,10 +576,10 @@ - + - +
@@ -607,16 +605,16 @@
@@ -666,7 +664,7 @@ - - ic_sitecode == 'cht') { ?> + ic_sitecode == 'cht') { + ?>
@@ -737,7 +736,10 @@
-
+
+if ($information->ic_ht_area_type == 'c') { + echo 'col-sm-4'; + } else { + echo 'col-sm-9'; + } + ?>">
@@ -797,7 +799,7 @@ - +
@@ -805,7 +807,7 @@
- +