|
|
|
@ -14,6 +14,7 @@ class Welcome extends CI_Controller {
|
|
|
|
|
$this->load->model('Information_model');
|
|
|
|
|
$this->load->model('InfoContents_model');
|
|
|
|
|
$this->load->model('Coupon_model');
|
|
|
|
|
$this->load->model('Logs_model');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function index() {
|
|
|
|
@ -103,6 +104,7 @@ class Welcome extends CI_Controller {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path);
|
|
|
|
|
$data['last_backup'] = $this->Logs_model->get_last_backup($is_parent_id);
|
|
|
|
|
$this->load->view('bootstrap/header', $data);
|
|
|
|
|
$this->load->view('bootstrap/static_url', $data);
|
|
|
|
|
$this->load->view('bootstrap/footer');
|
|
|
|
@ -110,11 +112,12 @@ class Welcome extends CI_Controller {
|
|
|
|
|
|
|
|
|
|
public function change_static_url($info_id) {
|
|
|
|
|
$information = $this->Information_model->Detail($info_id);
|
|
|
|
|
$htm_doc = new DOMDocument();
|
|
|
|
|
$htm_doc = new DOMDocument();//('1.0', 'UTF-8');
|
|
|
|
|
//$htm_doc->encoding='UTF-8';
|
|
|
|
|
libxml_use_internal_errors(true);
|
|
|
|
|
$htm_doc->strictErrorChecking = false;
|
|
|
|
|
//$htm_doc->strictErrorChecking = false;
|
|
|
|
|
if (empty($information->ic_content)) {
|
|
|
|
|
$this->echo_json([
|
|
|
|
|
$this->echo_json(array[
|
|
|
|
|
'status' => 'error',
|
|
|
|
|
'infoId' => $info_id,
|
|
|
|
|
'message' => 'info content is empty'
|
|
|
|
@ -122,6 +125,11 @@ class Welcome extends CI_Controller {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$htm_doc->loadHTML($information->ic_content);
|
|
|
|
|
$htm_doc->loadHTML(
|
|
|
|
|
mb_convert_encoding($information->ic_content, 'HTML-ENTITIES', 'UTF-8'));
|
|
|
|
|
// $htm_doc->loadHTML(
|
|
|
|
|
// utf8_decode($information->ic_content));
|
|
|
|
|
// $htm_doc->loadHTML($information->ic_content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
|
|
|
|
$htm_doc->normalizeDocument();
|
|
|
|
|
$img_list = $htm_doc->getElementsByTagName('img');
|
|
|
|
|
foreach ($img_list as $img) {
|
|
|
|
@ -130,10 +138,10 @@ class Welcome extends CI_Controller {
|
|
|
|
|
$img->setAttribute('src', $img_src);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// $information->ic_content = utf8_encode($htm_doc->saveHTML());
|
|
|
|
|
$information->ic_content = $htm_doc->saveHTML();
|
|
|
|
|
|
|
|
|
|
$this->InfoContents_model->Update(
|
|
|
|
|
$information->is_ic_id,
|
|
|
|
|
$information->is_id,
|
|
|
|
|
$information->ic_url,
|
|
|
|
|
$information->ic_url_title,
|
|
|
|
|
$information->ic_type,
|
|
|
|
@ -157,10 +165,11 @@ class Welcome extends CI_Controller {
|
|
|
|
|
$information->ic_ht_product_type,
|
|
|
|
|
$information->ic_author);
|
|
|
|
|
|
|
|
|
|
$this->echo_json([
|
|
|
|
|
$this->echo_json(array[
|
|
|
|
|
'status' => 'ok',
|
|
|
|
|
'infoId' => $info_id,
|
|
|
|
|
'message' => 'success'
|
|
|
|
|
'message' => 'success',
|
|
|
|
|
'date' => date('Y-m-d h:i:s')
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|