Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{def $remove_comments_allowed = fetch(user, has_access_to, hash(module, comment, function, removecomments))}
{def $edit_allowed = fetch(user, has_access_to, hash(module, comment, function, edit))}
{def $lang_codes = ezini('RegionalSettings', 'SiteLanguageList', 'site.ini')}
{def $lang_names = ezini('RegionalSettings', 'TranslationSA', 'site.ini')}
{def $ind = ''}

{def $comment_fetch_array = hash(offset, $view_parameters.offset, length, 10)}
{def $comment_count_array = array()}

{if is_set($view_parameters.lang)}
{set $comment_fetch_array = $comment_fetch_array|merge( hash(language_code, $view_parameters.lang) )}
{foreach $lang_list as $language}
{if $view_parameters.lang|eq($language.locale)}
{set $comment_count_array = $comment_count_array|merge( hash(language_id, $language.id) )}
{/if}
{/foreach}
{else}
{foreach $lang_list as $language}
{if ezini('RegionalSettings', 'Locale', 'site.ini')|eq($language.locale)}
{set $comment_count_array = $comment_count_array|merge( hash(language_id, $language.id) )}
{/if}
{/foreach}
{/if}

<form action={'comment/list'|ezurl} method="post" name="commentlist">
<div class="context-block comment-list">
Expand All @@ -9,6 +30,17 @@
</div>

<div class="box-content">
<div class="context-information">
<p class="left modified">{'Choose the language of the comments: '|i18n( 'ezcomments/comment/list' )}</p>
<p class="right translation">
{foreach $lang_codes as $code}
{set $ind = $code|extract_left(3)}
<a href={concat('comment/list/(lang)/', $code)|ezurl}>{$lang_names.$ind}</a>&nbsp;<img src="{$code|flag_icon}" width="18" height="12" alt="{$code}" style="vertical-align: middle;" />
{/foreach}
</p>
<div class="break"></div>
</div>
{undef $lang_codes $lang_names $ind}
<table class="list" cellspacing="0">
<tbody>
<tr>
Expand All @@ -20,8 +52,8 @@
{if $edit_allowed}<th class="tight">&nbsp;</th>{/if}
</tr>

{def $comments_count = fetch(comment, comment_count)}
{def $comments = fetch(comment, comment_list_by_content_list, hash(offset, $view_parameters.offset, length, 10))}
{def $comments_count = fetch(comment, comment_count, $comment_count_array)}
{def $comments = fetch(comment, comment_list_by_content_list, $comment_fetch_array)}

{foreach $comments as $comment sequence array('bglight', 'bgdark') as $sequence}
<tr class="{$sequence}">
Expand All @@ -37,12 +69,12 @@
</table>

<div class="context-toolbar">
{include name=navigator
uri='design:navigator/google.tpl'
page_uri='comment/list'
item_count=$comments_count
view_parameters=$view_parameters
item_limit=10}
{include name=navigator
uri='design:navigator/google.tpl'
page_uri='comment/list'
item_count=$comments_count
view_parameters=$view_parameters
item_limit=10}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@

if ( isset( $Params['Offset'] ) ) $offset = (int) $Params['Offset'];
$viewParameters = array( 'offset' => $offset );

if ( isset( $Params['UserParameters'] ) )
{
$UserParameters = $Params['UserParameters'];
}
else
{
$UserParameters = array();
}

$viewParameters = array_merge( $viewParameters, $UserParameters );

$langList = eZContentLanguage::fetchList();
$tpl->setVariable( 'lang_list', $langList );

$tpl->setVariable( 'view_parameters', $viewParameters );

$Result = array();
Expand Down