This file contains hidden or 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
<?php | |
namespace Webmanufaktur\MySite\Routing; | |
use eZ\Publish\API\Repository\Values\Content\Location; | |
use eZ\Publish\Core\MVC\ConfigResolverInterface; | |
use eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator; | |
use eZ\Publish\Core\SignalSlot\Repository; | |
use Symfony\Cmf\Component\Routing\ChainedRouterInterface; | |
use Symfony\Component\HttpFoundation\Request; |
This file contains hidden or 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
// JsonDate reflects the date format "yyyy-mm-dd" used in the API and the calendar component in the frontend. | |
type JsonDate time.Time | |
// UnmarshalJSON parses json dates | |
func (j *JsonDate) UnmarshalJSON(b []byte) error { | |
s := strings.Trim(string(b), "\"") | |
t, err := time.Parse("2006-01-02", s) | |
if err != nil { | |
return err | |
} |
This file contains hidden or 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
/** | |
* Dump Routes to YAML File. | |
*/ | |
public function dumpRoutes() | |
{ | |
/** @var $router \Symfony\Component\Routing\Router */ | |
$router = $this->container->get('router'); | |
$collection = $router->getRouteCollection(); | |
$allRoutes = $collection->all(); | |
array_multisort($allRoutes); |
This file contains hidden or 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
{% set uri = 'content/download/' ~ content.contentInfo.id ~ '/' ~ content.getField('parameter_file').id | |
~ '/version/' ~ content.contentInfo.currentVersionNo ~ "/file/" | |
~ content.getField('parameter_file').value.fileName|escape( 'url' ) %} | |
{% set uri = path( 'ez_legacy', {'module_uri': uri} ) %} |
This file contains hidden or 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
{# Embed File View | |
{{ ez_render_field( content, 'file') }} would be easier, but renders the file name instead of the object name | |
#} | |
<div class="content-view-embed"> | |
{% if content.fields['file'] is defined %} | |
{% set uri = 'content/download/' ~ content.contentInfo.id ~ '/' ~ content.getField('file').id | |
~ '/version/' ~ content.contentInfo.currentVersionNo ~ "/file/" | |
~ content.getField('file').value.fileName|escape( 'url' ) %} |
This file contains hidden or 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
{* File - List embed view *} | |
<div class="content-view-embed"> | |
<div class="class-file"> | |
{if $object.data_map.file.has_content} | |
{def $file = $object.data_map.file} | |
<div class="content-body attribute-{$file.content.mime_type_part}"> | |
<a href={concat("content/download/", $file.contentobject_id, "/", $file.id, "/file/", $file.content.original_filename)|ezurl}>{$object.name|wash("xhtml")}</a> {*$file.content.filesize|si(byte)*} | |
</div> | |
{undef $file} | |
{else} |
This file contains hidden or 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
# We explicitly prepend config for "ezpublish" namespace in service container extension, | |
# so no need to repeat it here | |
system: | |
drucknatuer_user: | |
location_view: | |
full: | |
full_ps_produkt: | |
template: WebmanufakturSiteDruckformBundle:full:ps_produkt.html.twig | |
match: | |
Identifier\ContentType: ps_produkt |
This file contains hidden or 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
imports: | |
- { resource: parameters.yml } | |
- { resource: security.yml } | |
framework: | |
esi: ~ | |
translator: { fallback: %locale_fallback% } | |
# The secret parameter is used to generate CSRF tokens | |
secret: %secret% | |
router: |
This file contains hidden or 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
/** | |
* Renders sub-items of the current location | |
* | |
* TODO: add content type filtering, and possibly more | |
* TODO: add template to be used for rendering | |
* | |
* @param int $locationId | |
* @return \Symfony\Component\HttpFoundation\Response | |
*/ | |
public function subItemsAction( $locationId ) |
NewerOlder