function getContent() { global $current_theme_path, $base_url; $mc = new SBMicroContent(); $mc->set_mc_type($this->sb_mc_type); $edit = $instance = null; // if we've clicked an 'edit' button, parse the existing // structured content and pre-fill the form. note that we don't // do this on POST, as in that case all the data we want is in // $_POST. if ($this->content_id && $_SERVER['REQUEST_METHOD'] == "GET") { $mc->load($this->content_id); $body = $mc->body; $edit = "edit"; $instance = $mc->parse_structured_content($body); } $editor = $mc->get_mc_editor($edit, $instance); return $editor; }
function getContent() { $mc = new SBMicroContent(); $mc->set_mc_type($this->sb_mc_type); $edit = $instance = null; // if we've clicked an 'edit' button, parse the existing // structured content and pre-fill the form. note that we don't // do this on POST, as in that case all the data we want is in // $_POST. if ($this->content_id && $_SERVER['REQUEST_METHOD'] == "GET") { $mc->load($this->content_id); $body = $mc->body; $edit = "edit"; $instance = $mc->parse_structured_content($body); if (!$instance) { throw new PAException(GENERAL_SOME_ERROR, "Failed to parse structured blogging content in content id {$this->content_id}"); } } $editor = $mc->get_mc_editor($edit, $instance); return $editor; }