Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented #16873: specify the name of offset to use in google.tpl, in order to have more than one navigator one a page #143

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
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
9 changes: 5 additions & 4 deletions design/admin/templates/navigator/google.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default page_uri_suffix=false()
left_max=7
right_max=6}
right_max=6
offset_name=offset}
{default name=ViewParameter
page_uri_suffix=false()
left_max=$left_max
right_max=$right_max}

{let page_count=int( ceil( div( $item_count,$item_limit ) ) )
current_page=min($:page_count,
int( ceil( div( first_set( $view_parameters.offset, 0),
int( ceil( div( first_set( $view_parameters[$offset_name], 0 ),
$item_limit ) ) ) )
item_previous=sub( mul( $:current_page, $item_limit ),
$item_limit )
Expand All @@ -19,10 +20,10 @@
left_length=min($ViewParameter:current_page,$:left_max)
right_length=max(min(sub($ViewParameter:page_count,$ViewParameter:current_page,1),$:right_max),0)
view_parameter_text=""
offset_text=eq( ezini( 'ControlSettings', 'AllowUserVariables', 'template.ini' ), 'true' )|choose( '/offset/', '/(offset)/' )}
offset_text=eq( ezini( 'ControlSettings', 'AllowUserVariables', 'template.ini' ), 'true' )|choose( concat('/', $offset_name, '/'), concat('/(', $offset_name, ')/') )}
{* Create view parameter text with the exception of offset *}
{section loop=$view_parameters}
{section-exclude match=$:key|eq('offset')}
{section-exclude match=$:key|eq($offset_name)}
{section-exclude match=$:item|eq('')}
{set view_parameter_text=concat($:view_parameter_text,'/(',$:key,')/',$:item)}
{/section}
Expand Down
9 changes: 5 additions & 4 deletions design/admin2/templates/navigator/google.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default page_uri_suffix=false()
left_max=7
right_max=6}
right_max=6
offset_name=offset}
{default name=ViewParameter
page_uri_suffix=false()
left_max=$left_max
right_max=$right_max}

{let page_count=int( ceil( div( $item_count,$item_limit ) ) )
current_page=min($:page_count,
int( ceil( div( first_set( $view_parameters.offset, 0),
int( ceil( div( first_set( $view_parameters[$offset_name], 0 ),
$item_limit ) ) ) )
item_previous=sub( mul( $:current_page, $item_limit ),
$item_limit )
Expand All @@ -19,10 +20,10 @@
left_length=min($ViewParameter:current_page,$:left_max)
right_length=max(min(sub($ViewParameter:page_count,$ViewParameter:current_page,1),$:right_max),0)
view_parameter_text=""
offset_text=eq( ezini( 'ControlSettings', 'AllowUserVariables', 'template.ini' ), 'true' )|choose( '/offset/', '/(offset)/' )}
offset_text=eq( ezini( 'ControlSettings', 'AllowUserVariables', 'template.ini' ), 'true' )|choose( concat('/', $offset_name, '/'), concat('/(', $offset_name, ')/') )}
{* Create view parameter text with the exception of offset *}
{section loop=$view_parameters}
{section-exclude match=$:key|eq('offset')}
{section-exclude match=$:key|eq($offset_name)}
{section-exclude match=$:item|eq('')}
{set view_parameter_text=concat($:view_parameter_text,'/(',$:key,')/',$:item)}
{/section}
Expand Down
9 changes: 5 additions & 4 deletions design/standard/templates/navigator/google.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default page_uri_suffix=false()
left_max=7
right_max=6}
right_max=6
offset_name=offset}
{default name=ViewParameter
page_uri_suffix=false()
left_max=$left_max
right_max=$right_max}

{let page_count=int( ceil( div( $item_count,$item_limit ) ) )
current_page=min($:page_count,
int( ceil( div( first_set( $view_parameters.offset, 0 ),
int( ceil( div( first_set( $view_parameters[$offset_name], 0 ),
$item_limit ) ) ) )
item_previous=sub( mul( $:current_page, $item_limit ),
$item_limit )
Expand All @@ -19,10 +20,10 @@
left_length=min($ViewParameter:current_page,$:left_max)
right_length=max(min(sub($ViewParameter:page_count,$ViewParameter:current_page,1),$:right_max),0)
view_parameter_text=""
offset_text=eq( ezini( 'ControlSettings', 'AllowUserVariables', 'template.ini' ), 'true' )|choose( '/offset/', '/(offset)/' )}
offset_text=eq( ezini( 'ControlSettings', 'AllowUserVariables', 'template.ini' ), 'true' )|choose( concat('/', $offset_name, '/'), concat('/(', $offset_name, ')/') )}
{* Create view parameter text with the exception of offset *}
{section loop=$view_parameters}
{section-exclude match=$:key|eq('offset')}
{section-exclude match=$:key|eq($offset_name)}
{section-exclude match=$:item|eq('')}
{set view_parameter_text=concat($:view_parameter_text,'/(',$:key,')/',$:item)}
{/section}
Expand Down