diff --git a/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Batch/Formatter/Page/TreeJsonFormatter.php b/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Batch/Formatter/Page/TreeJsonFormatter.php index b67a04e..f7db26c 100644 --- a/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Batch/Formatter/Page/TreeJsonFormatter.php +++ b/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Batch/Formatter/Page/TreeJsonFormatter.php @@ -19,11 +19,20 @@ public function jsonSerialize() $node->lazy = true; $node->nodetype = 'page'; $node->extraClasses = 'migration-node-main'; + + $publisherValidator = $page->getPublisherValidator(); + $skipItem = $publisherValidator->skipItem(); + if ($skipItem) { + $node->extraClasses .= ' migration-item-skipped'; + } + $node->id = $page->getId(); $node->pagePath = '' . $page->getBatchPath() . ''; $node->pageType = $page->getType(); $node->pageTemplate = $page->getTemplate(); - $node->statusClass = $formatter->getCollectionStatusIconClass(); + if (!$skipItem) { + $node->statusClass = $formatter->getCollectionStatusIconClass(); + } $response[] = $node; } diff --git a/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Validator/PageValidator.php b/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Validator/PageValidator.php index 4800d3d..8110e41 100644 --- a/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Validator/PageValidator.php +++ b/packages/migration_tool/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Validator/PageValidator.php @@ -1,10 +1,47 @@ getEntityManager(); + $page = $this->object; + /** + * @var $page Page + */ + $r = $em->getRepository('\PortlandLabs\Concrete5\MigrationTool\Entity\Import\Batch'); + $collection = $page->getCollection(); + $batch = $r->findFromCollection($collection); + + // This code checks to see if the page type for the current page is being ignored globally. + // If it is, then we ignore this page. + $mappers = \Core::make('migration/manager/mapping'); + $mapper = $mappers->driver('page_type'); + $list = $mappers->createTargetItemList($batch, $mapper); + $item = new Item($page->getType()); + $targetItem = $list->getSelectedTargetItem($item); + + if ($targetItem instanceof IgnoredTargetItem) { + $this->skip = true; + } + + } + public function skipItem() { - return false; + return $this->skip; } }