Пример #1
0
 public function toHtml(array $data)
 {
     $html = "<div class='row'>";
     //        echo "<pre>";
     //        print_r($data);
     //        die();
     foreach ($data['columns'] as $column) {
         $html .= "<div class='col-md-" . $column['width'] . "'>";
         $converter = new Converter();
         $HTMLContent = $converter->toHtml(json_encode(array("data" => $column["blocks"])));
         $html .= $HTMLContent;
         $html .= "</div>";
     }
     $html .= "</div>";
     return $html;
 }
Пример #2
0
 function updatePost($id)
 {
     // Update the post
     if ($this->input->post('content') != "") {
         $sirTrevorInput = $this->input->post('content');
         $converter = new Converter();
         $HTMLContent = $converter->toHtml($sirTrevorInput);
     } else {
         $HTMLContent = "";
     }
     $data = array('postTitle' => $this->input->post('postTitle'), 'categoryID' => $this->input->post('categoryID'), 'postURL' => $this->input->post('postURL'), 'postContent' => $this->input->post('content'), 'postContentHTML' => $HTMLContent, 'postExcerpt' => $this->input->post('postExcerpt'), 'datePosted' => $this->input->post('datePosted'), 'unixStamp' => $this->input->post('unixStamp'));
     if ($this->input->post('postImage') != "") {
         $data['postImage'] = $this->input->post('postImage');
     }
     $this->db->where("postID", $id);
     $this->db->update('hoosk_post', $data);
 }