public static function export(Tiki_Profile_Writer $writer, $id, $withTopic = false, $withType = false) { $artlib = TikiLib::lib('art'); $info = $artlib->get_article($id, false); if (!$info) { return false; } $bodypage = "article_{$id}_body"; $writer->writeExternal($bodypage, $writer->getReference('wiki_content', $info['body'])); $out = array('title' => $info['title'], 'author' => $info['authorName'], 'body' => "wikicontent:{$bodypage}", 'type' => $writer->getReference('article_type', $info['type']), 'publication_date' => $info['publishDate'], 'expiration_date' => $info['expireDate'], 'topline' => $info['topline'], 'subtitle' => $info['subtitle'], 'link_to' => $info['linkto'], 'language' => $info['lang']); if ($info['topicId']) { if ($withTopic) { Tiki_Profile_InstallHandler_ArticleTopic::export($writer, $info['topicId']); } $out['topic'] = $writer->getReference('article_topic', $info['topicId']); } if ($info['heading']) { $headerpage = "article_{$id}_heading"; $writer->writeExternal($headerpage, $writer->getReference('wiki_content', $info['heading'])); $out['heading'] = "wikicontent:{$headerpage}"; } $out = array_filter($out); $writer->addObject('article', $id, $out); if ($withType) { Tiki_Profile_InstallHandler_ArticleType::export($writer, $info['type']); } return true; }
public static function export(Tiki_Profile_Writer $writer, $page) { $tikilib = \TikiLib::lib('tiki'); if (!($info = $tikilib->get_page_info($page))) { return false; } $writer->writeExternal($page, $writer->getReference('wiki_content', $info['data'])); $writer->addObject('wiki_page', $page, array('name' => $page, 'content' => "wikicontent:{$page}", 'description' => $info['description'], 'lang' => $info['lang'])); return true; }