{* $Id$ *} {title help="Custom Route" admpage="sefurl" url="tiki-admin_routes.php"}{tr}Custom Route{/tr}{/title}
{if isset($route.id)} {button href="?add=1" class="btn btn-primary" _text="{tr}Add a new Custom Route{/tr}"} {/if}
{tabset name='tabs_admin_custom_routes'} {* ---------------------- tab with list -------------------- *} {if $routes|count > 0} {tab name="{tr}Custom Routes{/tr}"}
{* Use css menus as fallback for item dropdown action menu if javascript is not being used *} {section name=route loop=$routes} {/section}
{tr}From{/tr} {tr}Description{/tr} {tr}Type{/tr} {tr}Short URL{/tr} {tr}Active{/tr}
{$routes[route].from|escape} {$routes[route].description|escape} {$routes[route].type|escape} {icon name="{if $routes[route].short_url}check{else}close{/if}" alt="$routes[route].short_url"} {icon name="{if $routes[route].active}check{else}close{/if}" alt="$routes[route].active"} {actions} {strip} {icon name="edit" _menu_text='y' _menu_icon='y' alt="{tr}Edit{/tr}"} {icon name="remove" _menu_text='y' _menu_icon='y' alt="{tr}Remove{/tr}"} {/strip} {/actions}
{/tab} {/if} {* ---------------------- tab with form -------------------- *} {if isset($route.id) && $route.id} {$add_edit_route_tablabel = "{tr}Edit route{/tr}"} {$schedulename = "{$route.name|escape}"} {else} {$add_edit_route_tablabel = "{tr}Add a new route{/tr}"} {$schedulename = ""} {/if} {tab name="{$add_edit_route_tablabel} {$schedulename}"}

{ticket} {remarksbox type="note" title="{tr}Information{/tr}"} {tr}If you select router type "To tracker item by field value", you must use a regular expression in the From field value.{/tr} {tr}The users will get redirected to the tracker item that has a field that matches the value found in the URL.{/tr}
{tr}Example:{/tr}
{tr}|^page(\d+)$| will redirect /page10 to the tracker item where the selected value is 10.{/tr} {/remarksbox}
{foreach from=$routerTypes key=className item=itemName} {router_params name=$className params=$route.params} {/foreach}
{tr}Check this option to set route as a Short URL.{/tr}
{if isset($route.id) && $route.id} {else} {/if}
{/tab} {/tabset} {jq} var selectedRouterType = $('select[name="router_type"]').val(); $('div [data-task-name="'+selectedRouterType+'"]').show(); $('select[name="router_type"]').on('change', function() { var taskName = this.value; $('div [data-task-name]:not([data-task-name="'+taskName+'"])').hide(); $('div [data-task-name="'+taskName+'"]').show(); }); $('select[name="tikiobject_type"]').on('change', function() { $('input[name="load_options"]').val(1); $(this).parents('form').submit(); }); $('select[name="trackerfield_tracker"]').on('change', function() { $('input[name="load_options"]').val(1); $(this).parents('form').submit(); }); {/jq}