Example #1
0
 public function importValue(\SimpleXMLElement $akv)
 {
     if (isset($akv->value->fID)) {
         $fIDVal = (string) $akv->value->fID;
         $fID = ContentImporter::getValue($fIDVal);
         if ($fID) {
             return File::getByID($fID);
         }
     }
 }
Example #2
0
 protected function importAdditionalData($b, $blockNode)
 {
     if (isset($blockNode->data)) {
         foreach ($blockNode->data as $data) {
             if (strtoupper($data['table']) != strtoupper($this->getBlockTypeDatabaseTable())) {
                 $table = (string) $data['table'];
                 if (isset($data->record)) {
                     foreach ($data->record as $record) {
                         $aar = new \Concrete\Core\Legacy\BlockRecord($table);
                         $aar->bID = $b->getBlockID();
                         foreach ($record->children() as $node) {
                             $nodeName = $node->getName();
                             $aar->{$nodeName} = ContentImporter::getValue((string) $node);
                         }
                         $aar->Save();
                     }
                 }
             }
         }
     }
 }
Example #3
0
 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;
 }