Exemplo n.º 1
0
 public function cellPreview()
 {
     $intCellId = intval($this->input['intCellId']);
     $arData = $this->input['arData'];
     if (!$intCellId) {
         $this->errorOutput('NO CELLID');
     }
     if (!class_exists('cell')) {
         include CUR_CONF_PATH . 'lib/cell.class.php';
     }
     $objCell = new cell();
     $arCellInfo = $objCell->detail(' AND id = ' . $intCellId);
     if (!class_exists('Magic')) {
         include CUR_CONF_PATH . 'lib/magic.class.php';
     }
     $objMagic = new Magic();
     $arCellInfo = $objMagic->cellProcess($arCellInfo, 'false', $arData);
     $this->addItem($arCellInfo);
     $this->output();
 }
Exemplo n.º 2
0
 public function cellDataUpdate()
 {
     $intCellId = intval($this->input['intCellId']);
     $intContentId = $this->input['intContentId'];
     if (!$intCellId || !$intContentId) {
         $this->errorOutput('NO ID');
     }
     if (!empty($this->input['arIndexPic'])) {
         $this->input['arIndexPic'] = array('host' => $this->input['arIndexPic']['host'], 'dir' => $this->input['arIndexPic']['dir'], 'filepath' => $this->input['arIndexPic']['filepath'], 'filename' => $this->input['arIndexPic']['filename']);
     }
     $arData = array('title' => $this->input['strTitle'], 'brief' => $this->input['strBrief'], 'content_url' => $this->input['strContentUrl'], 'indexpic' => $this->input['arIndexPic'] ? serialize($this->input['arIndexPic']) : '');
     if (!class_exists('cell')) {
         include CUR_CONF_PATH . 'lib/cell.class.php';
     }
     $objCell = new cell();
     $arContent = $objCell->detail(' AND cell_id = ' . $intCellId . ' AND content_id = ' . $intContentId, 'cell_data');
     if (empty($arContent)) {
         $arData['cell_id'] = $intCellId;
         $arData['content_id'] = $intContentId;
         $this->db->insert_data($arData, 'cell_data');
     } else {
         $this->db->update_data($arData, 'cell_data', 'cell_id = ' . $intCellId . ' AND content_id = ' . $intContentId);
     }
     $arCellInfo = $objCell->detail(' AND id = ' . $intCellId);
     //删除单元内容缓存
     $objCell->delete_cell_data_cache($intCellId);
     //重新处理该单元信息
     if (!class_exists('Magic')) {
         include CUR_CONF_PATH . 'lib/magic.class.php';
     }
     $objMagic = new Magic();
     $arCellInfo = $objMagic->cellProcess($arCellInfo, true);
     $this->addItem($arCellInfo);
     $this->output();
 }