Skip to content

Commit

Permalink
IBX-1998: Rebranded routes in ibexa/core repository (#56)
Browse files Browse the repository at this point in the history
* IBX-1998: Rebranded routes in ibexa/core repository

* IBX-1998: Rebranded routes in ibexa/core repository

* IBX-1998: Rebranded routes in ibexa/core repository
  • Loading branch information
Nattfarinn authored Jan 24, 2022
1 parent fcdcaec commit abab257
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class ContentDownloadRouteReferenceListener implements EventSubscriberInterface
{
public const ROUTE_NAME = 'ez_content_download';
public const ROUTE_NAME = 'ibexa.content.download';
public const OPT_FIELD_IDENTIFIER = 'fieldIdentifier';
public const OPT_CONTENT = 'content';
public const OPT_CONTENT_ID = 'contentId';
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Core/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
ezpublish.default_router.non_siteaccess_aware_routes: ['_assetic_', '_wdt', '_profiler', '_configurator_', '_ez_user_hash']
ezpublish.default_router.non_siteaccess_aware_routes: ['_assetic_', '_wdt', '_profiler', '_configurator_', 'ibexa.user_hash']
# characters that may require encoding in the urlalias generator
ezpublish.urlalias_generator.charmap:
"\"" : "%22"
Expand Down
14 changes: 7 additions & 7 deletions src/bundle/Core/Resources/config/routing/internal.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_ez_content_translation_view:
ibexa.content.translation.view:
path: /view/content/{contentId}/{viewType}/{layout}/translation/{languageCode}/{locationId}
defaults:
_controller: ibexa_content:viewAction
Expand All @@ -8,7 +8,7 @@ _ez_content_translation_view:
options:
expose: true

_ez_content_view:
ibexa.content.view:
path: /view/content/{contentId}/{viewType}/{layout}/{locationId}
defaults:
_controller: ibexa_content:viewAction
Expand All @@ -18,23 +18,23 @@ _ez_content_view:
options:
expose: true

_ezpublishPreviewContent:
ibexa.version.preview:
path: /content/versionview/{contentId}/{versionNo}/{language}/site_access/{siteAccessName}
defaults: { _controller: ibexa.controller.content.preview:previewContentAction }
methods: [GET]

_ezpublishPreviewContentDefaultSa:
ibexa.content.preview.default:
path: /content/versionview/{contentId}/{versionNo}/{language}
defaults: { _controller: ibexa.controller.content.preview:previewContentAction }
methods: [GET]

_ez_user_hash:
ibexa.user_hash:
path: /_fos_user_context_hash

ez_content_download:
ibexa.content.download:
path: /content/download/{contentId}/{fieldIdentifier}/{filename}
defaults: { _controller: Ibexa\Core\MVC\Symfony\Controller\Content\DownloadController:downloadBinaryFileAction }

ez_content_download_field_id:
ibexa.content.download.field_id:
path: /content/download/{contentId}/{fieldId}
defaults: { _controller: Ibexa\Core\MVC\Symfony\Controller\Content\DownloadRedirectionController:redirectToContentDownloadAction }
4 changes: 2 additions & 2 deletions src/bundle/Core/Resources/views/content_fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
{% block ezbinaryfile_field %}
{% apply spaceless %}
{% if not ibexa_field_is_empty( content, field ) %}
{% set route_reference = ibexa_route( 'ez_content_download', {
{% set route_reference = ibexa_route( 'ibexa.content.download', {
'content': content,
'fieldIdentifier': field.fieldDefIdentifier,
'inLanguage': content.prioritizedFieldLanguageCode,
Expand All @@ -219,7 +219,7 @@
{% apply spaceless %}
{% set type = fieldSettings.mediaType %}
{% set value = field.value %}
{% set route_reference = ibexa_route( 'ez_content_download', {
{% set route_reference = ibexa_route( 'ibexa.content.download', {
'content': content,
'fieldIdentifier': field.fieldDefIdentifier,
'version': versionInfo.versionNo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function redirectToContentDownloadAction($contentId, $fieldId, Request $r
}

$downloadRouteRef = $this->routeReferenceGenerator->generate(
'ez_content_download',
'ibexa.content.download',
$params
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class PreviewController
{
public const PREVIEW_PARAMETER_NAME = 'isPreview';
public const CONTENT_VIEW_ROUTE = '_ez_content_view';
public const CONTENT_VIEW_ROUTE = 'ibexa.content.view';

/** @var \Ibexa\Contracts\Core\Repository\ContentService */
private $contentService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ContentDownloadUrlGenerator extends PathGenerator implements RouteAwarePat
private $router;

/** @var string */
private $route = 'ez_content_download_field_id';
private $route = 'ibexa.content.download.field_id';

public function __construct(RouterInterface $router)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class UrlAliasGenerator extends Generator
{
public const INTERNAL_CONTENT_VIEW_ROUTE = '_ez_content_view';
public const INTERNAL_CONTENT_VIEW_ROUTE = 'ibexa.content.view';

/** @var \Ibexa\Core\Repository\Repository */
private $repository;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MVC/Symfony/Templating/GlobalHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getSystemUriString()
if ($request->attributes->get('_route') === UrlAliasRouter::URL_ALIAS_ROUTE_NAME) {
return $this->router
->generate(
'_ez_content_view',
'ibexa.content.view',
[
'contentId' => $request->attributes->get('contentId'),
'locationId' => $request->attributes->get('locationId'),
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/MVC/Symfony/Templating/GlobalHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function testGetSystemUriString()
$this->router
->expects($this->once())
->method('generate')
->with('_ez_content_view', [
->with('ibexa.content.view', [
'contentId' => $contentId,
'locationId' => $locationId,
'viewType' => $viewType,
Expand Down

0 comments on commit abab257

Please sign in to comment.