public function exportValue(\SimpleXMLElement $akn) { $av = $akn->addChild('value'); $fo = $this->getValue(); if (is_object($fo)) { $av->addChild('fID', ContentExporter::replaceFileWithPlaceHolder($fo->getFileID())); } else { $av->addChild('fID', 0); } }
public function export(\SimpleXMLElement $blockNode) { $tables[] = $this->getBlockTypeDatabaseTable(); if (isset($this->btExportTables)) { $tables = $this->btExportTables; } $db = Database::connection(); foreach ($tables as $tbl) { if (!$tbl) { continue; } $data = $blockNode->addChild('data'); $data->addAttribute('table', $tbl); $columns = $db->MetaColumns($tbl); // remove columns we don't want unset($columns['bid']); $r = $db->Execute('select * from ' . $tbl . ' where bID = ?', array($this->bID)); while ($record = $r->FetchRow()) { $tableRecord = $data->addChild('record'); foreach ($record as $key => $value) { if (isset($columns[strtolower($key)])) { if (in_array($key, $this->btExportPageColumns)) { $tableRecord->addChild($key, ContentExporter::replacePageWithPlaceHolder($value)); } elseif (in_array($key, $this->btExportFileColumns)) { $tableRecord->addChild($key, ContentExporter::replaceFileWithPlaceHolder($value)); } elseif (in_array($key, $this->btExportPageTypeColumns)) { $tableRecord->addChild($key, ContentExporter::replacePageTypeWithPlaceHolder($value)); } elseif (in_array($key, $this->btExportPageFeedColumns)) { $tableRecord->addChild($key, ContentExporter::replacePageFeedWithPlaceHolder($value)); } else { $cnode = $tableRecord->addChild($key); $node = dom_import_simplexml($cnode); $no = $node->ownerDocument; $node->appendChild($no->createCDataSection($value)); } } } } } }
public function export(\SimpleXMLElement $node) { $node = $node->addChild('style'); $node->addChild('backgroundColor', $this->getBackgroundColor()); $fID = $this->backgroundImageFileID; if ($fID) { $node->addChild('backgroundImage', ContentExporter::replaceFileWithPlaceHolder($fID)); } $node->addChild('backgroundRepeat', $this->getBackgroundRepeat()); $node->addChild('borderWidth', $this->getBorderWidth()); $node->addChild('borderColor', $this->getBorderColor()); $node->addChild('borderStyle', $this->getBorderStyle()); $node->addChild('borderRadius', $this->getBorderRadius()); $node->addChild('baseFontSize', $this->getBaseFontSize()); $node->addChild('alignment', $this->getAlignment()); $node->addChild('textColor', $this->getTextColor()); $node->addChild('linkColor', $this->getLinkColor()); $node->addChild('paddingTop', $this->getPaddingTop()); $node->addChild('paddingBottom', $this->getPaddingBottom()); $node->addChild('paddingLeft', $this->getPaddingLeft()); $node->addChild('paddingRight', $this->getPaddingRight()); $node->addChild('marginTop', $this->getMarginTop()); $node->addChild('marginBottom', $this->getMarginBottom()); $node->addChild('marginLeft', $this->getMarginLeft()); $node->addChild('marginRight', $this->getMarginRight()); $node->addChild('rotate', $this->getRotate()); $node->addChild('boxShadowHorizontal', $this->getBoxShadowHorizontal()); $node->addChild('boxShadowVertical', $this->getBoxShadowVertical()); $node->addChild('boxShadowBlur', $this->getBoxShadowBlur()); $node->addChild('boxShadowSpread', $this->getBoxShadowSpread()); $node->addChild('boxShadowColor', $this->getBoxShadowColor()); $node->addChild('customClass', $this->getCustomClass()); $node->addChild('hideOnExtraSmallDevice', $this->getHideOnExtraSmallDevice()); $node->addChild('hideOnSmallDevice', $this->getHideOnSmallDevice()); $node->addChild('hideOnMediumDevice', $this->getHideOnMediumDevice()); $node->addChild('hideOnLargeDevice', $this->getHideOnLargeDevice()); }