public static function import(\SimpleXMLElement $node) { $o = new self(); $o->setBackgroundColor((string) $node->backgroundColor); $filename = (string) $node['backgroundImage']; if ($filename) { $fID = ContentImporter::getValue($filename); if ($fID) { $o->setBackgroundImageFileID($fID); } } $o->setBackgroundRepeat((string) $node->backgroundRepeat); $o->setBorderWidth((string) $node->borderWidth); $o->setBorderColor((string) $node->borderColor); $o->setBorderStyle((string) $node->borderStyle); $o->setBorderRadius((string) $node->borderRadius); $o->setBaseFontSize((string) $node->baseFontSize); $o->setAlignment((string) $node->alignment); $o->setTextColor((string) $node->textColor); $o->setLinkColor((string) $node->linkColor); $o->setPaddingTop((string) $node->paddingTop); $o->setPaddingBottom((string) $node->paddingBottom); $o->setPaddingLeft((string) $node->paddingLeft); $o->setPaddingRight((string) $node->paddingRight); $o->setMarginTop((string) $node->marginTop); $o->setMarginBottom((string) $node->marginBottom); $o->setMarginLeft((string) $node->marginLeft); $o->setMarginRight((string) $node->marginRight); $o->setRotate((string) $node->rotate); $o->setBoxShadowHorizontal((string) $node->boxShadowHorizontal); $o->setBoxShadowVertical((string) $node->boxShadowVertical); $o->setBoxShadowSpread((string) $node->boxShadowSpread); $o->setBoxShadowBlur((string) $node->boxShadowBlur); $o->setBoxShadowColor((string) $node->boxShadowColor); $o->setCustomClass((string) $node->customClass); $o->save(); return $o; }
public static function import(\SimpleXMLElement $node) { $o = new self(); $o->setBackgroundColor((string) $node->backgroundColor); $filename = (string) $node->backgroundImage; if ($filename) { $inspector = \Core::make('import/value_inspector'); $result = $inspector->inspect($filename); $fID = $result->getReplacedValue(); if ($fID) { $o->setBackgroundImageFileID($fID); } } $o->setBackgroundRepeat((string) $node->backgroundRepeat); $o->setBackgroundSize((string) $node->backgroundSize); $o->setBackgroundPosition((string) $node->backgroundPosition); $o->setBorderWidth((string) $node->borderWidth); $o->setBorderColor((string) $node->borderColor); $o->setBorderStyle((string) $node->borderStyle); $o->setBorderRadius((string) $node->borderRadius); $o->setBaseFontSize((string) $node->baseFontSize); $o->setAlignment((string) $node->alignment); $o->setTextColor((string) $node->textColor); $o->setLinkColor((string) $node->linkColor); $o->setPaddingTop((string) $node->paddingTop); $o->setPaddingBottom((string) $node->paddingBottom); $o->setPaddingLeft((string) $node->paddingLeft); $o->setPaddingRight((string) $node->paddingRight); $o->setMarginTop((string) $node->marginTop); $o->setMarginBottom((string) $node->marginBottom); $o->setMarginLeft((string) $node->marginLeft); $o->setMarginRight((string) $node->marginRight); $o->setRotate((string) $node->rotate); $o->setBoxShadowHorizontal((string) $node->boxShadowHorizontal); $o->setBoxShadowVertical((string) $node->boxShadowVertical); $o->setBoxShadowSpread((string) $node->boxShadowSpread); $o->setBoxShadowBlur((string) $node->boxShadowBlur); $o->setBoxShadowColor((string) $node->boxShadowColor); $o->setCustomClass((string) $node->customClass); $o->save(); return $o; }