-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding tree type and tree node type to export; import
- Loading branch information
Showing
26 changed files
with
932 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<table class="migration-table table table-bordered table-striped"> | ||
<thead> | ||
<tr> | ||
<th><?=t('Handle')?></th> | ||
<th width="1"><input type="checkbox" data-checkbox="toggle-all"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($collection->getTypes() as $type) { | ||
$validator = $type->getPublisherValidator(); | ||
?> | ||
<tr <?php if ($validator->skipItem()) { | ||
?>class="migration-item-skipped"<?php | ||
} | ||
?>> | ||
<td><?=$type->getHandle()?></td> | ||
<td><input data-checkbox="select-item" type="checkbox" name="item[thumbnail_type][]" value="<?=$type->getID()?>"></td> | ||
<?php | ||
} ?> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<table class="migration-table table table-bordered table-striped"> | ||
<thead> | ||
<tr> | ||
<th><?=t('Handle')?></th> | ||
<th width="1"><input type="checkbox" data-checkbox="toggle-all"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($collection->getTypes() as $type) { | ||
$validator = $type->getPublisherValidator(); | ||
?> | ||
<tr <?php if ($validator->skipItem()) { | ||
?>class="migration-item-skipped"<?php | ||
} | ||
?>> | ||
<td><?=$type->getHandle()?></td> | ||
<td><input data-checkbox="select-item" type="checkbox" name="item[thumbnail_type][]" value="<?=$type->getID()?>"></td> | ||
<?php | ||
} ?> | ||
</tbody> | ||
</table> |
12 changes: 12 additions & 0 deletions
12
...ndLabs/Concrete5/MigrationTool/Batch/Formatter/ObjectCollection/TreeNodeTypeFormatter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Batch\Formatter\ObjectCollection; | ||
|
||
defined('C5_EXECUTE') or die("Access Denied."); | ||
|
||
class TreeNodeTypeFormatter extends AbstractFormatter | ||
{ | ||
public function getPluralDisplayName() | ||
{ | ||
return t('Tree Node Types'); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...rtlandLabs/Concrete5/MigrationTool/Batch/Formatter/ObjectCollection/TreeTypeFormatter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Batch\Formatter\ObjectCollection; | ||
|
||
defined('C5_EXECUTE') or die("Access Denied."); | ||
|
||
class TreeTypeFormatter extends AbstractFormatter | ||
{ | ||
public function getPluralDisplayName() | ||
{ | ||
return t('Tree Types'); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/PortlandLabs/Concrete5/MigrationTool/Entity/Export/TreeNodeType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Entity\Export; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Entity | ||
*/ | ||
class TreeNodeType extends AbstractStandardExportItem | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
src/PortlandLabs/Concrete5/MigrationTool/Entity/Export/TreeType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Entity\Export; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Entity | ||
*/ | ||
class TreeType extends AbstractStandardExportItem | ||
{ | ||
} |
113 changes: 113 additions & 0 deletions
113
src/PortlandLabs/Concrete5/MigrationTool/Entity/Import/TreeNodeType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Entity\Import; | ||
|
||
use PortlandLabs\Concrete5\MigrationTool\Publisher\Logger\LoggableInterface; | ||
use PortlandLabs\Concrete5\MigrationTool\Publisher\PublishableInterface; | ||
use PortlandLabs\Concrete5\MigrationTool\Publisher\Validator\BlockTypeValidator; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use PortlandLabs\Concrete5\MigrationTool\Publisher\Validator\TreeNodeTypeValidator; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ORM\Table(name="MigrationImportTreeNodeTypes") | ||
*/ | ||
class TreeNodeType implements PublishableInterface, LoggableInterface | ||
{ | ||
/** | ||
* @ORM\Id @ORM\Column(type="integer") | ||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @ORM\ManyToOne(targetEntity="\PortlandLabs\Concrete5\MigrationTool\Entity\Import\TreeNodeTypeObjectCollection") | ||
**/ | ||
protected $collection; | ||
|
||
/** | ||
* @ORM\Column(type="string") | ||
*/ | ||
protected $handle; | ||
|
||
/** | ||
* @ORM\Column(type="string", nullable=true) | ||
*/ | ||
protected $package = null; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param mixed $id | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getCollection() | ||
{ | ||
return $this->collection; | ||
} | ||
|
||
/** | ||
* @param mixed $collection | ||
*/ | ||
public function setCollection($collection) | ||
{ | ||
$this->collection = $collection; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getHandle() | ||
{ | ||
return $this->handle; | ||
} | ||
|
||
/** | ||
* @param mixed $handle | ||
*/ | ||
public function setHandle($handle) | ||
{ | ||
$this->handle = $handle; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getPackage() | ||
{ | ||
return $this->package; | ||
} | ||
|
||
/** | ||
* @param mixed $package | ||
*/ | ||
public function setPackage($package) | ||
{ | ||
$this->package = $package; | ||
} | ||
|
||
public function getPublisherValidator() | ||
{ | ||
return new TreeNodeTypeValidator($this); | ||
} | ||
|
||
public function createPublisherLogObject($publishedObject = null) | ||
{ | ||
$type = new \PortlandLabs\Concrete5\MigrationTool\Entity\Publisher\Log\Object\BlockType(); | ||
$type->setHandle($this->getHandle()); | ||
return $type; | ||
} | ||
|
||
} |
61 changes: 61 additions & 0 deletions
61
src/PortlandLabs/Concrete5/MigrationTool/Entity/Import/TreeNodeTypeObjectCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Entity\Import; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use PortlandLabs\Concrete5\MigrationTool\Batch\BatchInterface; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use PortlandLabs\Concrete5\MigrationTool\Batch\Formatter\ObjectCollection\TreeNodeTypeFormatter; | ||
|
||
/** | ||
* @ORM\Entity | ||
*/ | ||
class TreeNodeTypeObjectCollection extends ObjectCollection | ||
{ | ||
/** | ||
* @ORM\OneToMany(targetEntity="\PortlandLabs\Concrete5\MigrationTool\Entity\Import\TreeNodeType", mappedBy="collection", cascade={"persist", "remove"}) | ||
**/ | ||
public $types; | ||
|
||
public function __construct() | ||
{ | ||
$this->types = new ArrayCollection(); | ||
} | ||
|
||
/** | ||
* @return ArrayCollection | ||
*/ | ||
public function getTypes() | ||
{ | ||
return $this->types; | ||
} | ||
|
||
public function getFormatter() | ||
{ | ||
return new TreeNodeTypeFormatter($this); | ||
} | ||
|
||
public function getType() | ||
{ | ||
return 'tree_node_type'; | ||
} | ||
|
||
public function hasRecords() | ||
{ | ||
return count($this->getTypes()); | ||
} | ||
|
||
public function getRecords() | ||
{ | ||
return $this->getTypes(); | ||
} | ||
|
||
public function getTreeFormatter() | ||
{ | ||
return false; | ||
} | ||
|
||
public function getRecordValidator(BatchInterface $batch) | ||
{ | ||
return false; | ||
} | ||
} |
112 changes: 112 additions & 0 deletions
112
src/PortlandLabs/Concrete5/MigrationTool/Entity/Import/TreeType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?php | ||
namespace PortlandLabs\Concrete5\MigrationTool\Entity\Import; | ||
|
||
use PortlandLabs\Concrete5\MigrationTool\Publisher\Logger\LoggableInterface; | ||
use PortlandLabs\Concrete5\MigrationTool\Publisher\PublishableInterface; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use PortlandLabs\Concrete5\MigrationTool\Publisher\Validator\TreeTypeValidator; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ORM\Table(name="MigrationImportTreeTypes") | ||
*/ | ||
class TreeType implements PublishableInterface, LoggableInterface | ||
{ | ||
/** | ||
* @ORM\Id @ORM\Column(type="integer") | ||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @ORM\ManyToOne(targetEntity="\PortlandLabs\Concrete5\MigrationTool\Entity\Import\TreeTypeObjectCollection") | ||
**/ | ||
protected $collection; | ||
|
||
/** | ||
* @ORM\Column(type="string") | ||
*/ | ||
protected $handle; | ||
|
||
/** | ||
* @ORM\Column(type="string", nullable=true) | ||
*/ | ||
protected $package = null; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param mixed $id | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getCollection() | ||
{ | ||
return $this->collection; | ||
} | ||
|
||
/** | ||
* @param mixed $collection | ||
*/ | ||
public function setCollection($collection) | ||
{ | ||
$this->collection = $collection; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getHandle() | ||
{ | ||
return $this->handle; | ||
} | ||
|
||
/** | ||
* @param mixed $handle | ||
*/ | ||
public function setHandle($handle) | ||
{ | ||
$this->handle = $handle; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getPackage() | ||
{ | ||
return $this->package; | ||
} | ||
|
||
/** | ||
* @param mixed $package | ||
*/ | ||
public function setPackage($package) | ||
{ | ||
$this->package = $package; | ||
} | ||
|
||
public function getPublisherValidator() | ||
{ | ||
return new TreeTypeValidator($this); | ||
} | ||
|
||
public function createPublisherLogObject($publishedObject = null) | ||
{ | ||
$type = new \PortlandLabs\Concrete5\MigrationTool\Entity\Publisher\Log\Object\TreeType(); | ||
$type->setHandle($this->getHandle()); | ||
return $type; | ||
} | ||
|
||
} |
Oops, something went wrong.