-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
444 additions
and
17 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 |
---|---|---|
@@ -1 +1 @@ | ||
docker compose exec --workdir /var/www/vendor/oxid-esales/module-template php composer static | ||
docker compose exec -T --workdir /var/www/vendor/oxid-esales/module-template php composer static |
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
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
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
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
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
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 @@ | ||
<?xml version="1.0" encoding="ISO-8859-15"?> | ||
<OX> | ||
<OXMENU id="NAVIGATION_ESHOPADMIN"> | ||
<MAINMENU id="mxuadmin"> | ||
<SUBMENU id="mxusers"> | ||
<TAB id="tbcluser_greetings" cl="oemt_admin_greeting" /> | ||
</SUBMENU> | ||
</MAINMENU> | ||
</OXMENU> | ||
</OX> |
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
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
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,32 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\ModuleTemplate\Greeting\Controller\Admin; | ||
|
||
use OxidEsales\ModuleTemplate\Core\Module as ModuleCore; | ||
use OxidEsales\Eshop\Application\Controller\Admin\AdminController; | ||
use OxidEsales\ModuleTemplate\Extension\Model\User as TemplateModelUser; | ||
use OxidEsales\ModuleTemplate\Greeting\Service\UserServiceInterface; | ||
|
||
class GreetingAdminController extends AdminController | ||
{ | ||
protected $_sThisTemplate = '@oe_moduletemplate/admin/user_greetings'; | ||
|
||
public function render() | ||
{ | ||
$userService = $this->getService(UserServiceInterface::class); | ||
if ($this->getEditObjectId()) { | ||
/** @var TemplateModelUser $oUser */ | ||
$oUser = $userService->getUserById($this->getEditObjectId()); | ||
$this->addTplParam(ModuleCore::OEMT_ADMIN_GREETING_TEMPLATE_VARNAME, $oUser->getPersonalGreeting()); | ||
} | ||
|
||
return parent::render(); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\ModuleTemplate\Greeting\Infrastructure; | ||
|
||
use OxidEsales\Eshop\Application\Model\User; | ||
|
||
class UserModelFactory implements UserModelFactoryInterface | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function create(): User | ||
{ | ||
return oxNew(User::class); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
namespace OxidEsales\ModuleTemplate\Greeting\Infrastructure; | ||
|
||
use OxidEsales\Eshop\Application\Model\User; | ||
|
||
interface UserModelFactoryInterface | ||
{ | ||
/** | ||
* @return User | ||
*/ | ||
public function create(): User; | ||
} |
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 | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\ModuleTemplate\Greeting\Service; | ||
|
||
use OxidEsales\Eshop\Application\Model\User as EshopModelUser; | ||
use OxidEsales\ModuleTemplate\Greeting\Infrastructure\UserModelFactoryInterface; | ||
|
||
/** | ||
* @extendable-class | ||
*/ | ||
class UserService implements UserServiceInterface | ||
{ | ||
/** | ||
* @var UserModelFactoryInterface | ||
*/ | ||
private $userModelFactory; | ||
|
||
public function __construct( | ||
UserModelFactoryInterface $userModelFactory | ||
) { | ||
$this->userModelFactory = $userModelFactory; | ||
} | ||
|
||
public function getUserById(string $userId): EshopModelUser | ||
{ | ||
$userModel = $this->userModelFactory->create(); | ||
$userModel->load($userId); | ||
|
||
return $userModel; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\ModuleTemplate\Greeting\Service; | ||
|
||
use OxidEsales\Eshop\Application\Model\User as EshopModelUser; | ||
|
||
interface UserServiceInterface | ||
{ | ||
public function getUserById(string $userId): EshopModelUser; | ||
} |
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
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
Oops, something went wrong.