/** * Used during post editing so we can render the necessary blocks * * @since 5.0 * @access public * @param string * @return */ public function renderEditorContent() { if ($this->doctype == 'ebd') { // If this is a empty document, // start with a text block. if (empty($this->document)) { $blocks = EB::blocks(); $block = $blocks->createBlock("text"); $content = $blocks->renderEditableBlock($block); // If this is an existing document, // get editable content. } else { $document = EB::document($this->document); $content = $document->getEditableContent(); } } else { // Format the post content now $content = $this->intro; // Append the readmore if necessary if (!empty($this->intro) && !empty($this->content)) { $content .= '<hr id="system-readmore" />'; } // Append the rest of the contents $content .= $this->content; } return $content; }
/** * Retrieves the document object for this revision * * @since 5.0 * @access public * @param string * @return */ public function getDocument() { static $documents = array(); if (!isset($documents[$this->id])) { $content = $this->getContent(); $document = EB::document($content->document); $documents[$this->id] = $document; } return $documents[$this->id]; }
/** * Retrieves the document object * * @since 5.0 * @access public * @param string * @return */ public function getDocument() { static $documents = array(); if (!isset($documents[$this->id])) { $document = EB::document(); $document->load($this->data); $documents[$this->id] = $document; } return $documents[$this->id]; }