Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/10.6' into 11.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	bundles/AdminBundle/src/Controller/Admin/SettingsController.php
#	bundles/CoreBundle/src/DependencyInjection/Configuration.php
#	bundles/CoreBundle/src/DependencyInjection/PimcoreCoreExtension.php
#	bundles/CoreBundle/src/Migrations/Version20230307135459.php
#	bundles/EcommerceFrameworkBundle/src/PriceSystem/CachingPriceSystem.php
#	bundles/SeoBundle/src/Redirect/RedirectHandler.php
#	composer.json
#	doc/18_Tools_and_Features/02_Custom_Icons.md
#	doc/20_Extending_Pimcore/11_Event_API_and_Event_Manager.md
#	doc/20_Extending_Pimcore/13_Bundle_Developers_Guide/13_Loading_Admin_UI_Assets.md
#	doc/26_Best_Practice/60_Modifying_Permissions_based_on_Object_Data.md
#	doc/Development_Documentation/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
#	lib/Config/Config.php
#	lib/DataObject/ClassBuilder/FieldCollectionClassBuilder.php
#	lib/DataObject/ClassBuilder/ObjectBrickClassBuilder.php
#	lib/Event/Admin/ElementAdminStyleEvent.php
#	lib/Event/Admin/IndexActionSettingsEvent.php
#	lib/Event/Admin/Login/LoginCredentialsEvent.php
#	lib/Event/Admin/Login/LoginFailedEvent.php
#	lib/Event/Admin/Login/LoginRedirectEvent.php
#	lib/Event/Admin/Login/LogoutEvent.php
#	lib/Event/Admin/Login/LostPasswordEvent.php
#	lib/Event/AdminEvents.php
#	lib/Event/Model/ElementDeleteInfoEventInterface.php
#	lib/Event/Traits/ElementDeleteInfoEventTrait.php
#	lib/Extension/Bundle/AbstractPimcoreBundle.php
#	models/DataObject/ClassDefinition/Dao.php
#	models/DataObject/ClassDefinition/Data/Block.php
#	models/DataObject/ClassDefinition/Data/Input.php
#	models/DataObject/ClassDefinition/Data/Localizedfields.php
#	models/Document/Service.php
#	phpstan-baseline.neon
  • Loading branch information
dvesh3 committed Mar 24, 2023
2 parents 1e1c100 + 532d0a6 commit b085b0a
Show file tree
Hide file tree
Showing 44 changed files with 1,419 additions and 876 deletions.
554 changes: 554 additions & 0 deletions bundles/AdminBundle/Event/AdminEvents.php

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions bundles/AdminBundle/Event/ElementAdminStyleEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?php

declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\AdminBundle\Event;

use Pimcore\Model\Element\AdminStyle;
use Pimcore\Model\Element\ElementInterface;
use Symfony\Contracts\EventDispatcher\Event;

class ElementAdminStyleEvent extends Event
{
/**
* Style needed for tree
*/
const CONTEXT_TREE = 1;

/**
* Style needed for element editor
*/
const CONTEXT_EDITOR = 2;

/**
* Style needed for quicksearch
*/
const CONTEXT_SEARCH = 3;

/**
* @var int
*/
protected $context;

/**
* @var ElementInterface
*/
protected $element;

/**
* @var AdminStyle
*/
protected $adminStyle;

/**
* ElementAdminStyleEvent constructor.
*
* @param ElementInterface $element
* @param AdminStyle $adminStyle
* @param null|int $context
*/
public function __construct(ElementInterface $element, AdminStyle $adminStyle, $context = null)
{
$this->element = $element;
$this->adminStyle = $adminStyle;
$this->context = $context;
}

/**
* @return ElementInterface
*/
public function getElement(): ElementInterface
{
return $this->element;
}

/**
* @param ElementInterface $element
*/
public function setElement(ElementInterface $element): void
{
$this->element = $element;
}

/**
* @return AdminStyle
*/
public function getAdminStyle(): AdminStyle
{
return $this->adminStyle;
}

/**
* @param AdminStyle $adminStyle
*/
public function setAdminStyle(AdminStyle $adminStyle): void
{
$this->adminStyle = $adminStyle;
}

/**
* Returns the context. e.g. CONTEXT_TREE or CONTEXT_EDITOR.
*
* @return null|int
*/
public function getContext()
{
return $this->context;
}

/**
* @param null|int $context
*/
public function setContext($context): void
{
$this->context = $context;
}
}
52 changes: 52 additions & 0 deletions bundles/AdminBundle/Event/IndexActionSettingsEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\AdminBundle\Event;

use Symfony\Contracts\EventDispatcher\Event;

class IndexActionSettingsEvent extends Event
{
/**
* @var array
*/
private $settings;

public function __construct(array $settings)
{
$this->settings = $settings;
}

public function getSettings(): array
{
return $this->settings;
}

public function setSettings(array $settings)
{
$this->settings = $settings;
}

/**
* @param string $key
* @param mixed $value
*/
public function addSetting(string $key, $value)
{
$this->settings[$key] = $value;
}
}
56 changes: 56 additions & 0 deletions bundles/AdminBundle/Event/Login/LoginCredentialsEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\AdminBundle\Event\Login;

use Pimcore\Event\Traits\RequestAwareTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Contracts\EventDispatcher\Event;

class LoginCredentialsEvent extends Event
{
use RequestAwareTrait;

/**
* @var array
*/
protected $credentials;

/**
* @param Request $request
* @param array $credentials
*/
public function __construct(Request $request, array $credentials)
{
$this->request = $request;
$this->credentials = $credentials;
}

/**
* @return array
*/
public function getCredentials()
{
return $this->credentials;
}

/**
* @param array $credentials
*/
public function setCredentials(array $credentials)
{
$this->credentials = $credentials;
}
}
91 changes: 91 additions & 0 deletions bundles/AdminBundle/Event/Login/LoginFailedEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\AdminBundle\Event\Login;

use Pimcore\Model\User;
use Symfony\Contracts\EventDispatcher\Event;

class LoginFailedEvent extends Event
{
/**
* @var array
*/
protected $credentials;

/**
* @var User
*/
protected $user;

/**
* @param array $credentials
*/
public function __construct(array $credentials)
{
$this->credentials = $credentials;
}

/**
* @return array
*/
public function getCredentials()
{
return $this->credentials;
}

/**
* @param string $name
* @param mixed $default
*
* @return mixed
*/
public function getCredential($name, $default = null)
{
if (isset($this->credentials[$name])) {
return $this->credentials[$name];
}

return $default;
}

/**
* @return User
*/
public function getUser()
{
return $this->user;
}

/**
* @param User $user
*
* @return $this
*/
public function setUser(User $user)
{
$this->user = $user;

return $this;
}

/**
* @return bool
*/
public function hasUser()
{
return null !== $this->user;
}
}
73 changes: 73 additions & 0 deletions bundles/AdminBundle/Event/Login/LoginRedirectEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\AdminBundle\Event\Login;

use Symfony\Contracts\EventDispatcher\Event;

class LoginRedirectEvent extends Event
{
/**
* @var string
*/
protected $routeName;

/**
* @var array
*/
protected $routeParams;

/**
* @param string $routeName
* @param array $routeParams
*/
public function __construct(string $routeName, array $routeParams = [])
{
$this->routeName = $routeName;
$this->routeParams = $routeParams;
}

/**
* @return string
*/
public function getRouteName(): string
{
return $this->routeName;
}

/**
* @param string $routeName
*/
public function setRouteName(string $routeName): void
{
$this->routeName = $routeName;
}

/**
* @return array
*/
public function getRouteParams(): array
{
return $this->routeParams;
}

/**
* @param array $routeParams
*/
public function setRouteParams(array $routeParams): void
{
$this->routeParams = $routeParams;
}
}
Loading

0 comments on commit b085b0a

Please sign in to comment.