Skip to content

Commit

Permalink
- Formatting twig templates, following coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocamposviana committed Dec 27, 2013
1 parent 4693c07 commit 97d6506
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Classes/Components/Banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function render()
return $this->controller->render(
'TuteiBaseBundle:parts:page_banners.html.twig', array(
'banners' => $blocks,
'relationList' => $relationList
'relation_list' => $relationList
), $response
);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Components/Blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function render()
return $this->controller->render(
'TuteiBaseBundle:parts:page_blocks.html.twig', array(
'blocks' => $blocks,
'relationList' => $relationList
'relation_list' => $relationList
), $response
);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Components/Breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function render()

return $this->controller->render(
'TuteiBaseBundle:parts:breadcrumb.html.twig', array(
'locationList' => $path
'location_list' => $path
), $response
);
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Components/ExtraInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function render()

if (isset($content->valueObject->fields['source'][$language]->destinationContentId)) {
$srcId = $content->valueObject->fields['source'][$language]->destinationContentId;
$source = $contentService->loadContent($objId);
$source = $contentService->loadContent($srcId);
$query = new Query();

$query->criterion = new LogicalAnd(
Expand All @@ -96,8 +96,8 @@ public function render()
return $this->controller->render(
'TuteiBaseBundle:parts:extra_info.html.twig', array(
'list' => $list,
'relationList' => $relationList,
'sourceItems' => $sourceItems
'relation_list' => $relationList,
'source_items' => $sourceItems
), $response
);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Components/TopMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function render()
'TuteiBaseBundle:parts:top_menu.html.twig', array(
'list' => $list,
'locations' => $locations,
'locationChildren' => $locationChildren,
'location_children' => $locationChildren,
), $response
);
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/content/default/block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% set link = '' %}

{% if not ez_is_field_empty( content, "link_object" ) %}
{% set link = path(relationList[content.fields.link_object[language].destinationContentId]) %}
{% set link = path(relation_list[content.fields.link_object[language].destinationContentId]) %}
{% elseif not ez_is_field_empty( content, "link_external" ) %}
{% set link = content.fields.link_external[language].link %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions Resources/views/content/default/box.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% set link = '' %}

{% if not ez_is_field_empty( content, "link_object" ) %}
{% set link = path(relationList[content.fields.link_object[language].destinationContentId]) %}
{% set link = path(relation_list[content.fields.link_object[language].destinationContentId]) %}
{% elseif not ez_is_field_empty( content, "link_external" ) %}
{% set link = content.fields.link_external[language].link %}
{% endif %}
Expand Down Expand Up @@ -44,8 +44,8 @@
{% endif %}


{% if sourceItems[content.fields.source[language].destinationContentId] is defined %}
{% set items = sourceItems[content.fields.source[language].destinationContentId] %}
{% if source_items[content.fields.source[language].destinationContentId] is defined %}
{% set items = source_items[content.fields.source[language].destinationContentId] %}
<ul>
{% for item in items.searchHits %}
<li>{{ render(
Expand Down
16 changes: 8 additions & 8 deletions Resources/views/content/default/menu_item.html.twig
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{% set language = siteaccess[ezpublish.siteaccess.name].language %}

{% if content.versionInfo.names[language] is defined %}
{% set contentName = content.versionInfo.names[language] %}
{% set content_name = content.versionInfo.names[language] %}
{% else %}
{% set contentName = location.contentInfo.name %}
{% set content_name = location.contentInfo.name %}
{% endif %}

{% set cssClasses = 'menu-link' %}
{% set extraAttributes = '' %}
{% set css_classes = 'menu-link' %}
{% set extra_attributes = '' %}

{% set dropdown = dropdown|default(false) %}

{% if dropdown == true %}
{#
{% set extraAttributes =
extraAttributes ~ ' data-toggle="dropdown"' %}
{% set extra_attributes =
extra_attributes ~ ' data-toggle="dropdown"' %}
#}

{% set cssClasses = cssClasses ~ ' dropdown-toggle disabled' %}
{% set css_classes = css_classes ~ ' dropdown-toggle disabled' %}
{% endif %}

<a href="{{ path( location ) }}" class="{{ cssClasses }}" title="{{ contentName }}"{{ extraAttributes|raw }}>{{ contentName }}{% if dropdown == true %} <span class="caret"></span>{% endif %}</a>
<a href="{{ path( location ) }}" class="{{ css_classes }}" title="{{ content_name }}"{{ extra_attributes|raw }}>{{ content_name }}{% if dropdown == true %} <span class="caret"></span>{% endif %}</a>
2 changes: 1 addition & 1 deletion Resources/views/parts/breadcrumb.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ol class="breadcrumb" itemprop="breadcrumb">
{% for item in locationList %}
{% for item in location_list %}

<li{% if loop.index == loop.length %} class="active"{% endif %}>
{% if loop.index < loop.length %}
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/parts/extra_info.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
'locationId': item.valueObject.versionInfo.contentInfo.mainLocationId,
'viewType': 'box',
'params':{'relationList':relationList,
'sourceItems': sourceItems}
'params':{'relation_list':relation_list,
'source_items': source_items}
}
)
) }}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/parts/page_banners.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% set link = '' %}

{% if not ez_is_field_empty( item.valueObject, "link_object" ) %}
{% set link = path(relationList[item.valueObject.fields.link_object[language].destinationContentId]) %}
{% set link = path(relation_list[item.valueObject.fields.link_object[language].destinationContentId]) %}
{% elseif not ez_is_field_empty( item.valueObject, "link_external" ) %}
{% set link = item.valueObject.fields.link_external[language].link %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/parts/page_blocks.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{
'locationId': item.valueObject.versionInfo.contentInfo.mainLocationId,
'viewType': 'block',
'params':{'relationList':relationList}
'params':{'relation_list':relation_list}
}
)
) }}
Expand Down
16 changes: 8 additions & 8 deletions Resources/views/parts/top_menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
{% endif %}

{% set dropdown = false %}
{% set cssClasses = 'topmenu-item' %}
{% set extraAttributes = '' %}
{% set css_classes = 'topmenu-item' %}
{% set extra_attributes = '' %}

{% if locationChildren[locationdId] is defined %}
{% if location_children[locationdId] is defined %}

{% set dropdown = true %}

{% set cssClasses = cssClasses ~ ' dropdown' %}
{% set css_classes = css_classes ~ ' dropdown' %}
{% endif %}

{% if active %}
{% set cssClasses = cssClasses ~ ' active' %}
{% set css_classes = css_classes ~ ' active' %}
{% endif %}





<li class="{{ cssClasses }}"{{ extraAttributes|raw }}>{{ render(
<li class="{{ css_classes }}"{{ extra_attributes|raw }}>{{ render(
controller(
'ez_content:viewLocation',
{
Expand All @@ -39,9 +39,9 @@
}
)
) }}
{% if locationChildren[locationdId] is defined %}
{% if location_children[locationdId] is defined %}
<ul class="dropdown-menu">
{% for subitem in locationChildren[locationdId].searchHits %}
{% for subitem in location_children[locationdId].searchHits %}
<li>
{{ render(
controller(
Expand Down

0 comments on commit 97d6506

Please sign in to comment.