Skip to content

Commit

Permalink
Merge pull request ezsystems#1118 from ezsystems/EZP-23478-website_to…
Browse files Browse the repository at this point in the history
…olbar_redirection

EZP-23478: added redirection form fields in content/edit.tpl
  • Loading branch information
bdunogier committed Nov 27, 2014
2 parents 61cee82 + 3176065 commit c0b6023
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions design/standard/templates/content/edit.tpl
Expand Up @@ -33,6 +33,7 @@
{include uri="design:content/edit_right_menu.tpl"}
<!-- Right part end -->

{include uri='design:content/edit_redirection.tpl'}
</td>
</tr>
</table>
Expand Down
23 changes: 23 additions & 0 deletions design/standard/templates/content/edit_redirection.tpl
@@ -0,0 +1,23 @@
{* Redirection hidden inputs, based on session variables, themselves based on POST data *}
{if ezhttp_hasvariable( 'RedirectURIAfterPublish', 'session' )}
{def $redirect_uri_after_publish=ezhttp( 'RedirectURIAfterPublish', 'session' )}
{else}
{if ezhttp_hasvariable( 'LastAccessesURI', 'session' )}
{def $redirect_uri_after_publish=ezhttp( 'LastAccessesURI', 'session' )}
{/if}
{/if}

{if ezhttp_hasvariable( 'RedirectIfDiscarded', 'session' )}
{def $redirect_if_discarded=ezhttp( 'RedirectIfDiscarded', 'session' )}
{else}
{if ezhttp_hasvariable( 'LastAccessesURI', 'session' )}
{def $redirect_if_discarded=ezhttp( 'LastAccessesURI', 'session' )}
{/if}
{/if}

{if is_set( $redirect_uri_after_publish) }
<input type="hidden" name="RedirectURIAfterPublish" value="{$redirect_uri_after_publish}" />
{/if}
{if is_set( $redirect_if_discarded ) }
<input type="hidden" name="RedirectIfDiscarded" value="{$redirect_if_discarded}" />
{/if}

0 comments on commit c0b6023

Please sign in to comment.