Пример #1
0
 public static function exportList(\SimpleXMLElement $node)
 {
     $child = $node->addChild('pagefeeds');
     $list = static::getList();
     foreach ($list as $feed) {
         $feedNode = $child->addChild('feed');
         if ($feed->getParentID()) {
             $feedNode->addChild('parent', ContentExporter::replacePageWithPlaceHolder($feed->getParentID()));
         }
         $feedNode->addChild('title', $feed->getTitle());
         $feedNode->addChild('description', $feed->getDescription());
         $feedNode->addChild('handle', $feed->getHandle());
         if ($feed->getIncludeAllDescendents()) {
             $feedNode->addChild('descendents', 1);
         }
         if ($feed->getDisplayAliases()) {
             $feedNode->addChild('aliases', 1);
         }
         if ($feed->getDisplayFeaturedOnly()) {
             $feedNode->addChild('featured', 1);
         }
         if ($feed->getPageTypeID()) {
             $feedNode->addChild('pagetype', ContentExporter::replacePageTypeWithPlaceHolder($feed->getPageTypeID()));
         }
         if ($feed->getTypeOfContentToDisplay() == 'S') {
             $type = $feedNode->addChild('contenttype');
             $type->addAttribute('type', 'description');
         } else {
             $area = $feedNode->addChild('contenttype');
             $area->addAttribute('type', 'area');
             $area->addAttribute('handle', $feed->getAreaHandleToDisplay());
         }
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 public function export(\SimpleXMLElement $blockNode)
 {
     $outputControl = PageTypeComposerOutputControl::getByID($this->ptComposerOutputControlID);
     if (is_object($outputControl)) {
         $fsc = PageTypeComposerFormLayoutSetControl::getByID($outputControl->getPageTypeComposerFormLayoutSetControlID());
         if (is_object($fsc)) {
             $cnode = $blockNode->addChild('control');
             $cnode->addAttribute('output-control-id', ContentExporter::getPageTypeComposerOutputControlTemporaryID($fsc));
         }
     }
 }
Пример #4
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));
                     }
                 }
             }
         }
     }
 }
Пример #5
0
 public function export($fxml)
 {
     $node = $fxml->addChild('control');
     $node->addAttribute('custom-template', $this->getPageTypeComposerFormLayoutSetControlCustomTemplate());
     if ($this->isPageTypeComposerFormLayoutSetControlRequired()) {
         $node->addAttribute('required', true);
     }
     $node->addAttribute('custom-label', $this->getPageTypeComposerFormLayoutSetControlCustomLabel());
     $node->addAttribute('description', $this->getPageTypeComposerFormLayoutSetControlDescription());
     $db = Loader::db();
     $cnt = $db->GetOne('select count(*) from PageTypeComposerOutputControls where ptComposerFormLayoutSetControlID = ?', array($this->ptComposerFormLayoutSetControlID));
     if ($cnt > 0) {
         $ptComposerControlTemporaryID = Loader::helper('validation/identifier')->getString(8);
         ContentExporter::addPageTypeComposerOutputControlID($this, $ptComposerControlTemporaryID);
         $node->addAttribute('output-control-id', $ptComposerControlTemporaryID);
     }
     $typeo = $this->getPageTypeComposerControlTypeObject();
     $node->addAttribute('type', $typeo->getPageTypeComposerControlTypeHandle());
     $to = $this->getPageTypeComposerControlObject();
     $to->export($node);
 }
Пример #6
0
 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());
 }
Пример #7
0
 public function export($node, $exportType = 'full')
 {
     if (!$this->isAliasOfMasterCollection()) {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('type', $this->getBlockTypeHandle());
         $blockNode->addAttribute('name', $this->getBlockName());
         if ($this->getBlockFilename() != '') {
             $blockNode->addAttribute('custom-template', $this->getBlockFilename());
         }
         if (is_object($this->c) && $this->c->isMasterCollection()) {
             $mcBlockID = Loader::helper('validation/identifier')->getString(8);
             ContentExporter::addMasterCollectionBlockID($this, $mcBlockID);
             $blockNode->addAttribute('mc-block-id', $mcBlockID);
         }
         if ($exportType == 'full') {
             $style = $this->getCustomStyle();
             if (is_object($style)) {
                 $set = $style->getStyleSet();
                 $set->export($blockNode);
             }
             if ($this->overrideBlockTypeCacheSettings()) {
                 $settings = $this->getBlockCacheSettingsObject();
                 $blockNode['cache-output'] = $settings->cacheBlockOutput();
                 $blockNode['cache-output-lifetime'] = $settings->getBlockOutputCacheLifetime();
                 $blockNode['cache-output-on-post'] = $settings->cacheBlockOutputOnPost();
                 $blockNode['cache-output-for-registered-users'] = $settings->cacheBlockOutputForRegisteredUsers();
             }
             $bc = $this->getInstance();
             $bc->export($blockNode);
         }
     } else {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('mc-block-id', ContentExporter::getMasterCollectionTemporaryBlockID($this));
     }
 }
Пример #8
0
 public function export($node, $exportType = 'full')
 {
     if (!$this->isAliasOfMasterCollection()) {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('type', $this->getBlockTypeHandle());
         $blockNode->addAttribute('name', $this->getBlockName());
         if ($this->getBlockFilename() != '') {
             $blockNode->addAttribute('custom-template', $this->getBlockFilename());
         }
         if (is_object($this->c) && $this->c->isMasterCollection()) {
             $mcBlockID = Loader::helper('validation/identifier')->getString(8);
             ContentExporter::addMasterCollectionBlockID($this, $mcBlockID);
             $blockNode->addAttribute('mc-block-id', $mcBlockID);
         }
         if ($exportType == 'full') {
             $style = $this->getCustomStyle();
             if (is_object($style)) {
                 $set = $style->getStyleSet();
                 $set->export($blockNode);
             }
             $bc = $this->getInstance();
             $bc->export($blockNode);
         }
     } else {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('mc-block-id', ContentExporter::getMasterCollectionTemporaryBlockID($this));
     }
 }
 public function export($fxml)
 {
     $node = $fxml->addChild('control');
     $node->addAttribute('custom-template', $this->getPageTypeComposerFormLayoutSetControlCustomTemplate());
     if ($this->isPageTypeComposerFormLayoutSetControlRequired()) {
         $node->addAttribute('required', true);
     }
     $node->addAttribute('custom-label', $this->getPageTypeComposerFormLayoutSetControlCustomLabel());
     $node->addAttribute('description', $this->getPageTypeComposerFormLayoutSetControlDescription());
     $app = Application::getFacadeApplication();
     $db = $app->make('database')->connection();
     $cnt = $db->fetchColumn('select count(*) from PageTypeComposerOutputControls where ptComposerFormLayoutSetControlID = ?', [$this->ptComposerFormLayoutSetControlID]);
     if ($cnt > 0) {
         $ptComposerControlTemporaryID = $app->make('helper/validation/identifier')->getString(8);
         ContentExporter::addPageTypeComposerOutputControlID($this, $ptComposerControlTemporaryID);
         $node->addAttribute('output-control-id', $ptComposerControlTemporaryID);
     }
     $typeo = $this->getPageTypeComposerControlTypeObject();
     $node->addAttribute('type', $typeo->getPageTypeComposerControlTypeHandle());
     $to = $this->getPageTypeComposerControlObject();
     $to->export($node);
 }