forked from gekosale/Gekosale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First approach to build layout page editor
- Loading branch information
1 parent
98c835d
commit fc6ccfe
Showing
17 changed files
with
719 additions
and
40 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
33 changes: 0 additions & 33 deletions
33
application/Gekosale/Plugin/HomePage/Controller/Frontend/FooterController.php
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
application/Gekosale/Plugin/HomePage/Event/HomePageEventSubscriber.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,38 @@ | ||
<?php | ||
/* | ||
* Gekosale Open-Source E-Commerce Platform | ||
* | ||
* This file is part of the Gekosale package. | ||
* | ||
* (c) Adam Piotrowski <adam@gekosale.com> | ||
* | ||
* For the full copyright and license information, | ||
* please view the LICENSE file that was distributed with this source code. | ||
*/ | ||
namespace Gekosale\Plugin\HomePage\Event; | ||
|
||
use Gekosale\Plugin\Layout\Event\LayoutPageFormEvent; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\EventDispatcher\GenericEvent; | ||
|
||
/** | ||
* Class HomePageEventSubscriber | ||
* | ||
* @package Gekosale\Plugin\HomePage\Event | ||
* @author Adam Piotrowski <adam@gekosale.com> | ||
*/ | ||
class HomePageEventSubscriber implements EventSubscriberInterface | ||
{ | ||
|
||
public function onLayoutPageTreeInitAction(GenericEvent $event) | ||
{ | ||
$event->setArgument('home_page', 'Home Page'); | ||
} | ||
|
||
public static function getSubscribedEvents() | ||
{ | ||
return array( | ||
LayoutPageFormEvent::TREE_INIT_EVENT => 'onLayoutPageTreeInitAction' | ||
); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
application/Gekosale/Plugin/HomePage/Extension/HomePageExtension.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,43 @@ | ||
<?php | ||
/* | ||
* Gekosale Open-Source E-Commerce Platform | ||
* | ||
* This file is part of the Gekosale package. | ||
* | ||
* (c) Adam Piotrowski <adam@gekosale.com> | ||
* | ||
* For the full copyright and license information, | ||
* please view the LICENSE file that was distributed with this source code. | ||
*/ | ||
namespace Gekosale\Plugin\HomePage\Extension; | ||
|
||
use Symfony\Component\HttpKernel\DependencyInjection\Extension, | ||
Symfony\Component\DependencyInjection\Loader\XmlFileLoader, | ||
Symfony\Component\Config\FileLocator, | ||
Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
/** | ||
* Class HomePageExtension | ||
* | ||
* @package Gekosale\Plugin\HomePage\Extension | ||
* @author Adam Piotrowski <adam@gekosale.com> | ||
*/ | ||
class HomePageExtension extends Extension | ||
{ | ||
|
||
public function load(array $config, ContainerBuilder $container) | ||
{ | ||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../config')); | ||
$loader->load('services.xml'); | ||
} | ||
|
||
public function getNamespace() | ||
{ | ||
return 'http://symfony.com/schema/dic/services'; | ||
} | ||
|
||
public function getAlias() | ||
{ | ||
return 'gekosale.plugin.home_page'; | ||
} | ||
} |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<service id="home_page.subscriber" class="Gekosale\Plugin\HomePage\Event\HomePageEventSubscriber"> | ||
<tag name="kernel.event_subscriber" /> | ||
</service> | ||
</services> | ||
</container> |
73 changes: 73 additions & 0 deletions
73
application/Gekosale/Plugin/Layout/Controller/Admin/LayoutPageController.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,73 @@ | ||
<?php | ||
/* | ||
* Gekosale Open-Source E-Commerce Platform | ||
* | ||
* This file is part of the Gekosale package. | ||
* | ||
* (c) Adam Piotrowski <adam@gekosale.com> | ||
* | ||
* For the full copyright and license information, | ||
* please view the LICENSE file that was distributed with this source code. | ||
*/ | ||
namespace Gekosale\Plugin\Layout\Controller\Admin; | ||
|
||
use Gekosale\Core\Controller\AdminController; | ||
|
||
/** | ||
* Class LayoutPageController | ||
* | ||
* @package Gekosale\Plugin\LayoutPage\Controller\Admin | ||
* @author Adam Piotrowski <adam@gekosale.com> | ||
*/ | ||
class LayoutPageController extends AdminController | ||
{ | ||
public function indexAction() | ||
{ | ||
$tree = $this->getTree()->init(); | ||
|
||
return Array( | ||
'tree' => $tree | ||
); | ||
} | ||
|
||
public function editAction($id) | ||
{ | ||
$tree = $this->getTree()->init(); | ||
|
||
return Array( | ||
'tree' => $tree | ||
); | ||
} | ||
|
||
/** | ||
* Get Tree | ||
*/ | ||
protected function getTree() | ||
{ | ||
return $this->get('layout_page.tree'); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getRepository() | ||
{ | ||
return $this->get('layout_page.repository'); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getForm() | ||
{ | ||
return $this->get('layout_page.form'); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getDefaultRoute() | ||
{ | ||
return 'admin.layout_page.index'; | ||
} | ||
} |
Oops, something went wrong.