diff --git a/Classes/Famelo/Demo/Admin/Controller/FormController.php b/Classes/Famelo/Demo/Admin/Controller/FormController.php new file mode 100644 index 0000000..3b697db --- /dev/null +++ b/Classes/Famelo/Demo/Admin/Controller/FormController.php @@ -0,0 +1,46 @@ +setString('Hello World'); + $this->view->assign('widget', $widget); + } + + /** + * Index action + * + * @return void + */ + public function saveAction() { + $objects = $this->request->getInternalArgument('__objects'); + return '
yea! i\'ve received an object :)
'; + } + +} + +?> \ No newline at end of file diff --git a/Classes/Famelo/Demo/Admin/Controller/TypoScriptController.php b/Classes/Famelo/Demo/Admin/Controller/TypoScriptController.php new file mode 100644 index 0000000..5b1a05c --- /dev/null +++ b/Classes/Famelo/Demo/Admin/Controller/TypoScriptController.php @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/Classes/Famelo/Demo/Admin/Domain/Model/Inline.php b/Classes/Famelo/Demo/Admin/Domain/Model/Inline.php index e8b8b6f..baa3b2c 100755 --- a/Classes/Famelo/Demo/Admin/Domain/Model/Inline.php +++ b/Classes/Famelo/Demo/Admin/Domain/Model/Inline.php @@ -37,32 +37,46 @@ class Inline { /** * @var \Famelo\Demo\Admin\Domain\Model\Address - * @ORM\ManyToOne(inversedBy="comments", cascade={"all"}) - * @Expose\Inline(variant="TYPO3.Expose:InlineStacked") + * @ORM\ManyToOne(inversedBy="inlineStacked", cascade={"all"}) + * @Expose\Inline(element="TYPO3.Expose:InlineStacked") */ protected $addressStacked; /** * @var \Famelo\Demo\Admin\Domain\Model\Address - * @ORM\ManyToOne(inversedBy="comments", cascade={"all"}) - * Expose\Inline(variant="TYPO3.Expose:InlineTabular") + * @ORM\ManyToOne(inversedBy="inlineTabular", cascade={"all"}) + * @Expose\Inline(element="TYPO3.Expose:InlineTabular") */ protected $addressTabular; + /** + * @var \Famelo\Demo\Admin\Domain\Model\Address + * @ORM\ManyToOne(inversedBy="inlineSeamless", cascade={"all"}) + * @Expose\Inline(element="TYPO3.Expose:InlineSeamless") + */ + protected $addressSeamless; + /** * @var \Doctrine\Common\Collections\Collection<\Famelo\Demo\Admin\Domain\Model\Address> - * @ORM\ManyToMany(inversedBy="widgets_manytomany", cascade={"all"}) - * @Expose\Inline(variant="TYPO3.Expose:InlineStacked") + * @ORM\ManyToMany(inversedBy="inlinesStacked", cascade={"all"}) + * @Expose\Inline(element="TYPO3.Expose:InlineStacked") */ protected $addressesStacked; /** * @var \Doctrine\Common\Collections\Collection<\Famelo\Demo\Admin\Domain\Model\Address> - * @ORM\ManyToMany(inversedBy="widgets_manytomany", cascade={"all"}) - * Expose\Inline + * @ORM\ManyToMany(inversedBy="inlinesTabular", cascade={"all"}) + * @Expose\Inline(element="TYPO3.Expose:InlineTabular") */ protected $addressesTabular; + /** + * @var \Doctrine\Common\Collections\Collection<\Famelo\Demo\Admin\Domain\Model\Address> + * @ORM\ManyToMany(inversedBy="inlinesSeamless", cascade={"all"}) + * @Expose\Inline(element="TYPO3.Expose:InlineSeamless") + */ + protected $addressesSeamless; + /** * @param $addressStacked */ @@ -118,6 +132,34 @@ public function setAddressesTabular($addressesTabular) { public function getAddressesTabular() { return $this->addressesTabular; } + + /** + * @param object $addressSeamless + */ + public function setAddressSeamless($addressSeamless) { + $this->addressSeamless = $addressSeamless; + } + + /** + * @return object + */ + public function getAddressSeamless() { + return $this->addressSeamless; + } + + /** + * @param array $addressesSeamless + */ + public function setAddressesSeamless($addressesSeamless) { + $this->addressesSeamless = $addressesSeamless; + } + + /** + * @return array + */ + public function getAddressesSeamless() { + return $this->addressesSeamless; + } } ?> \ No newline at end of file diff --git a/Classes/Famelo/Demo/Admin/Domain/Model/Widgets.php b/Classes/Famelo/Demo/Admin/Domain/Model/Widgets.php new file mode 100755 index 0000000..2e8968b --- /dev/null +++ b/Classes/Famelo/Demo/Admin/Domain/Model/Widgets.php @@ -0,0 +1,282 @@ + + * @ORM\ManyToMany(inversedBy="widgets_manytomany") + * Expose\Ignore("list") + */ + protected $addresses; + + /** + * @var \Doctrine\Common\Collections\Collection<\Famelo\Demo\Admin\Domain\Model\Address> + * @ORM\ManyToMany(inversedBy="widgets_manytomany") + * Expose\Ignore("list") + * ContentManagement\Element("Chosen") + */ + protected $addressesChosen; + + /** + * @var string + * @Expose\Element("TYPO3.Form:MultiLineText") + * @Expose\Label("Simple Textarea") + */ + protected $textarea; + + /** + * @var string + * @Expose\Element("TYPO3.Form:Password") + * @Expose\Label("Password input") + */ + protected $password; + + /** + * @var string + */ + #protected $fullrte; + + /** + * @var string + */ + #protected $markdown; + + public function __construct(){ + $this->date = new \DateTime(); + $this->time = new \DateTime(); + $this->datetime = new \DateTime(); + } + + public function __toString() { + return $this->string; + } + + /** + * @param $string + */ + public function setString($string) { + $this->string = $string; + } + + /** + * @return + */ + public function getString() { + return $this->string; + } + + /** + * @param $boolean + */ + public function setBoolean($boolean) { + $this->boolean = $boolean; + } + + /** + * @return + */ + public function getBoolean() { + return $this->boolean; + } + + /** + * @param $date + */ + public function setDate($date) { + $this->date = $date; + } + + /** + * @return + */ + public function getDate() { + return $this->date; + } + + /** + * @param $datetime + */ + public function setDatetime($datetime) { + $this->datetime = $datetime; + } + + /** + * @return + */ + public function getDatetime() { + return $this->datetime; + } + + /** + * @param $time + */ + public function setTime($time) { + $this->time = $time; + } + + /** + * @return + */ + public function getTime() { + return $this->time; + } + + /** + * @param $textarea + */ + public function setTextarea($textarea) { + $this->textarea = $textarea; + } + + /** + * @return + */ + public function getTextarea() { + return $this->textarea; + } + + /** + * @param $password + */ + public function setPassword($password) { + $this->password = $password; + } + + /** + * @return string + */ + public function getPassword() { + return $this->password; + } + + /** + * @param string $address + */ + public function setAddress($address) { + $this->address = $address; + } + + /** + * @return object + */ + public function getAddress() { + return $this->address; + } + + /** + * @param object $addresses + */ + public function setAddresses($addresses) { + $this->addresses = $addresses; + } + + /** + * @return object + */ + public function getAddresses() { + return $this->addresses; + } + + /** + * @param object $addressesChosen + */ + public function setAddressesChosen($addressesChosen) { + $this->addressesChosen = $addressesChosen; + } + + /** + * @return object + */ + public function getAddressesChosen() { + return $this->addressesChosen; + } +} + +?> \ No newline at end of file diff --git a/Classes/Famelo/Demo/Admin/Domain/Model/Widgets.php_ b/Classes/Famelo/Demo/Admin/Domain/Model/Widgets.php_ deleted file mode 100755 index a25bfe7..0000000 --- a/Classes/Famelo/Demo/Admin/Domain/Model/Widgets.php_ +++ /dev/null @@ -1,281 +0,0 @@ - - * @ORM\ManyToMany(inversedBy="widgets_manytomany") - * @Admin\Ignore("list") - */ -# protected $addresses; - - /** - * @var \Doctrine\Common\Collections\Collection<\Famelo\Demo\Admin\Domain\Model\Address> - * @ORM\ManyToMany(inversedBy="widgets_manytomany") - * @Admin\Ignore("list") - * ContentManagement\Element("Chosen") - */ - #protected $addressesChosen; - - /** - * @var string - * @Admin\Element("TYPO3.Form:MultiLineText") - */ - protected $textarea; - - /** - * @var string - * @Admin\Element("TYPO3.Form:Password") - */ - protected $password; - - /** - * @var string - */ - #protected $fullrte; - - /** - * @var string - */ - #protected $markdown; - - public function __construct(){ - $this->date = new \DateTime(); - $this->time = new \DateTime(); - $this->datetime = new \DateTime(); - } - - public function __toString() { - return $this->string; - } - - /** - * @param $string - */ - public function setString($string) { - $this->string = $string; - } - - /** - * @return - */ - public function getString() { - return $this->string; - } - - /** - * @param $boolean - */ - public function setBoolean($boolean) { - $this->boolean = $boolean; - } - - /** - * @return - */ - public function getBoolean() { - return $this->boolean; - } - - /** - * @param $date - */ - public function setDate($date) { - $this->date = $date; - } - - /** - * @return - */ - public function getDate() { - return $this->date; - } - - /** - * @param $datetime - */ - public function setDatetime($datetime) { - $this->datetime = $datetime; - } - - /** - * @return - */ - public function getDatetime() { - return $this->datetime; - } - - /** - * @param $time - */ - public function setTime($time) { - $this->time = $time; - } - - /** - * @return - */ - public function getTime() { - return $this->time; - } - - /** - * @param $textarea - */ - public function setTextarea($textarea) { - $this->textarea = $textarea; - } - - /** - * @return - */ - public function getTextarea() { - return $this->textarea; - } - - /** - * @param $password - */ - public function setPassword($password) { - $this->password = $password; - } - - /** - * @return string - */ - public function getPassword() { - return $this->password; - } - - /** - * @param string $address - */ - public function setAddress($address) { - $this->address = $address; - } - - /** - * @return object - */ - public function getAddress() { - return $this->address; - } - - /** - * @param object $addresses - */ - public function setAddresses($addresses) { - $this->addresses = $addresses; - } - - /** - * @return object - */ - public function getAddresses() { - return $this->addresses; - } - - /** - * @param object $addressesChosen - */ - public function setAddressesChosen($addressesChosen) { - $this->addressesChosen = $addressesChosen; - } - - /** - * @return object - */ - public function getAddressesChosen() { - return $this->addressesChosen; - } -} - -?> \ No newline at end of file diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index a410615..ca910c1 100755 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -7,11 +7,37 @@ Famelo: @controller: 'Standard' @package: 'Famelo.Demo.Admin' - catalog: - label: 'Package Catalog' + typoscript: + label: 'TypoScript' arguments: - @controller: 'Standard' - @package: 'TYPO3.PackageCatalog' + @controller: 'TypoScript' + @package: 'Famelo.Demo.Admin' + @typoScriptPath: 'body' + + create-form: + label: 'New Widget' + arguments: + @action: 'index' + @controller: 'Form' + @package: 'Famelo.Demo.Admin' + + edit-form: + label: 'Edit Widget' + arguments: + @action: 'edit' + @controller: 'Form' + @package: 'Famelo.Demo.Admin' + + widgets: + label: 'Widgets' + arguments: + @action: 'index' + @controller: 'Expose' + --exposeRuntime: + @action: 'index' + @controller: "SameTypeList" + @package: "TYPO3.Expose" + type: 'Famelo\Demo\Admin\Domain\Model\Widgets' inline: label: 'Inline' diff --git a/Migrations/MySQL/Version20121010021638.php b/Migrations/MySQL/Version20121010021638.php new file mode 100644 index 0000000..e2afd54 --- /dev/null +++ b/Migrations/MySQL/Version20121010021638.php @@ -0,0 +1,35 @@ +abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + + $this->addSql("CREATE TABLE famelo_demo_admin_domain_model_widgets (persistence_object_identifier VARCHAR(40) NOT NULL, string VARCHAR(255) NOT NULL, UNIQUE INDEX flow_identity_famelo_demo_admin_domain_model_widgets (string), PRIMARY KEY(persistence_object_identifier)) ENGINE = InnoDB"); + } + + /** + * @param Schema $schema + * @return void + */ + public function down(Schema $schema) { + // this down() migration is autogenerated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + + $this->addSql("DROP TABLE famelo_demo_admin_domain_model_widgets"); + } +} + +?> \ No newline at end of file diff --git a/Migrations/MySQL/Version20121015012248.php b/Migrations/MySQL/Version20121015012248.php new file mode 100644 index 0000000..833021b --- /dev/null +++ b/Migrations/MySQL/Version20121015012248.php @@ -0,0 +1,57 @@ +abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + + $this->addSql("CREATE TABLE famelo_demo_admin_domain_model_widgets_addresses_join (admin_widgets VARCHAR(40) NOT NULL, admin_address VARCHAR(40) NOT NULL, INDEX IDX_B9D82C5C59646648 (admin_widgets), INDEX IDX_B9D82C5CC972ED08 (admin_address), PRIMARY KEY(admin_widgets, admin_address)) ENGINE = InnoDB"); + $this->addSql("CREATE TABLE famelo_demo_admin_domain_model_widgets_addresseschosen_join (admin_widgets VARCHAR(40) NOT NULL, admin_address VARCHAR(40) NOT NULL, INDEX IDX_AFB1BEC759646648 (admin_widgets), INDEX IDX_AFB1BEC7C972ED08 (admin_address), PRIMARY KEY(admin_widgets, admin_address)) ENGINE = InnoDB"); + $this->addSql("CREATE TABLE famelo_demo_admin_domain_model_inline_addressesseamless_join (admin_inline VARCHAR(40) NOT NULL, admin_address VARCHAR(40) NOT NULL, INDEX IDX_63295D1C15A36C0E (admin_inline), INDEX IDX_63295D1CC972ED08 (admin_address), PRIMARY KEY(admin_inline, admin_address)) ENGINE = InnoDB"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets_addresses_join ADD CONSTRAINT FK_B9D82C5C59646648 FOREIGN KEY (admin_widgets) REFERENCES famelo_demo_admin_domain_model_widgets (persistence_object_identifier)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets_addresses_join ADD CONSTRAINT FK_B9D82C5CC972ED08 FOREIGN KEY (admin_address) REFERENCES famelo_demo_admin_domain_model_address (persistence_object_identifier)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets_addresseschosen_join ADD CONSTRAINT FK_AFB1BEC759646648 FOREIGN KEY (admin_widgets) REFERENCES famelo_demo_admin_domain_model_widgets (persistence_object_identifier)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets_addresseschosen_join ADD CONSTRAINT FK_AFB1BEC7C972ED08 FOREIGN KEY (admin_address) REFERENCES famelo_demo_admin_domain_model_address (persistence_object_identifier)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_inline_addressesseamless_join ADD CONSTRAINT FK_63295D1C15A36C0E FOREIGN KEY (admin_inline) REFERENCES famelo_demo_admin_domain_model_inline (persistence_object_identifier)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_inline_addressesseamless_join ADD CONSTRAINT FK_63295D1CC972ED08 FOREIGN KEY (admin_address) REFERENCES famelo_demo_admin_domain_model_address (persistence_object_identifier)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets ADD address VARCHAR(40) DEFAULT NULL, ADD `integer` INT DEFAULT NULL, ADD `float` DOUBLE PRECISION NOT NULL, ADD boolean TINYINT(1) NOT NULL, ADD date DATETIME NOT NULL, ADD time DATETIME NOT NULL, ADD datetime DATETIME NOT NULL, ADD textarea VARCHAR(255) NOT NULL, ADD password VARCHAR(255) NOT NULL, ADD fullrte VARCHAR(255) NOT NULL, ADD markdown VARCHAR(255) NOT NULL"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets ADD CONSTRAINT FK_B880E5C0D4E6F81 FOREIGN KEY (address) REFERENCES famelo_demo_admin_domain_model_address (persistence_object_identifier)"); + $this->addSql("CREATE INDEX IDX_B880E5C0D4E6F81 ON famelo_demo_admin_domain_model_widgets (address)"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_inline ADD addressseamless VARCHAR(40) DEFAULT NULL"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_inline ADD CONSTRAINT FK_FFB8FC45E126187D FOREIGN KEY (addressseamless) REFERENCES famelo_demo_admin_domain_model_address (persistence_object_identifier)"); + $this->addSql("CREATE INDEX IDX_FFB8FC45E126187D ON famelo_demo_admin_domain_model_inline (addressseamless)"); + } + + /** + * @param Schema $schema + * @return void + */ + public function down(Schema $schema) { + // this down() migration is autogenerated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); + + $this->addSql("DROP TABLE famelo_demo_admin_domain_model_widgets_addresses_join"); + $this->addSql("DROP TABLE famelo_demo_admin_domain_model_widgets_addresseschosen_join"); + $this->addSql("DROP TABLE famelo_demo_admin_domain_model_inline_addressesseamless_join"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_inline DROP FOREIGN KEY FK_FFB8FC45E126187D"); + $this->addSql("DROP INDEX IDX_FFB8FC45E126187D ON famelo_demo_admin_domain_model_inline"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_inline DROP addressseamless"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets DROP FOREIGN KEY FK_B880E5C0D4E6F81"); + $this->addSql("DROP INDEX IDX_B880E5C0D4E6F81 ON famelo_demo_admin_domain_model_widgets"); + $this->addSql("ALTER TABLE famelo_demo_admin_domain_model_widgets DROP address, DROP `integer`, DROP `float`, DROP boolean, DROP date, DROP time, DROP datetime, DROP textarea, DROP password, DROP fullrte, DROP markdown"); + } +} + +?> \ No newline at end of file diff --git a/Resources/Private/Partials/TypoScript/Body.html b/Resources/Private/Partials/TypoScript/Body.html new file mode 100644 index 0000000..97b260a --- /dev/null +++ b/Resources/Private/Partials/TypoScript/Body.html @@ -0,0 +1 @@ +I'm a little body \ No newline at end of file diff --git a/Resources/Private/Templates/Form/Edit.html b/Resources/Private/Templates/Form/Edit.html new file mode 100644 index 0000000..c287797 --- /dev/null +++ b/Resources/Private/Templates/Form/Edit.html @@ -0,0 +1,4 @@ +{namespace e=TYPO3\Expose\ViewHelpers} +
+ +
\ No newline at end of file diff --git a/Resources/Private/Templates/Form/Index.html b/Resources/Private/Templates/Form/Index.html new file mode 100644 index 0000000..ab84984 --- /dev/null +++ b/Resources/Private/Templates/Form/Index.html @@ -0,0 +1,4 @@ +{namespace e=TYPO3\Expose\ViewHelpers} +
+ +
\ No newline at end of file diff --git a/Resources/Private/Templates/Form/Save.html b/Resources/Private/Templates/Form/Save.html new file mode 100644 index 0000000..e69de29 diff --git a/Resources/Private/Templates/TypoScript/Index.html b/Resources/Private/Templates/TypoScript/Index.html new file mode 100644 index 0000000..13748c8 --- /dev/null +++ b/Resources/Private/Templates/TypoScript/Index.html @@ -0,0 +1,2 @@ +{namespace ts=TYPO3\TypoScript\ViewHelpers} +i'm wrapping this -> <- puny typoscript path \ No newline at end of file diff --git a/Resources/Private/TypoScripts/TypoScriptController.ts2 b/Resources/Private/TypoScripts/TypoScriptController.ts2 new file mode 100644 index 0000000..312fd49 --- /dev/null +++ b/Resources/Private/TypoScripts/TypoScriptController.ts2 @@ -0,0 +1,12 @@ +prototype(TYPO3.TypoScript:Template).@class = 'TYPO3\\TypoScript\\TypoScriptObjects\\TemplateImplementation' + +prototype(Famelo.Demo.Admin:BodyTemplate) < prototype(TYPO3.TypoScript:Template) { + templatePath = 'resource://Famelo.Demo.Admin/Private/Partials/TypoScript/Body.html' +} + +prototype(Famelo.Demo.Admin:PageTemplate) < prototype(TYPO3.TypoScript:Template) { + templatePath = 'resource://Famelo.Demo.Admin/Private/Templates/TypoScript/Index.html' + body = Famelo.Demo.Admin:BodyTemplate +} + +Famelo.Demo.Admin.TypoScriptController.index = Famelo.Demo.Admin:PageTemplate \ No newline at end of file