error.tpl 4.44 KB
Newer Older
1
{strip}
2
{if isset($close_window) and $close_window eq 'y'}
3
{jq}
4
close();
5
{/jq}
6
{/if}
7
{* 402: need login
8
 * 401, 403: perm
9
 * 404: page does not exist
10
 * no_redirect_login: error antibot, system...
11
 * login: error login
12
 * Usually available variables : $errortitle, $msg, $errortype
13
 * If $commenttype is 'note' and $msg is set, the $msg will be shown in a nicer non-treatening remarksbox
14
 *}
15
{if !isset($errortype)}{assign var='errortype' value=''}{/if}
16
{capture assign=mid_data}
17

18
	{if ($errortype eq "402")}
19
		{include file='tiki-login.tpl'}
20
	{elseif ($errortype eq 401 or $errortype eq 403) and !empty($prefs.permission_denied_url) and $prefs.permission_denied_login_box ne 'y'}
21
		{redirect url=$prefs.permission_denied_url}
22
	{else}
23

24
		{if ($errortype eq 401 || $errortype eq 403) && empty($user) and $prefs.permission_denied_login_box eq 'y'} {* permission denied *}
25
			{assign var='errortitle' value="{tr}Please log in{/tr}"}
26
		{else}
27
			{assign var='errortitle' value="{tr}Error{/tr}"}
28
		{/if}
29

30 31 32 33 34 35
		{if $errortype eq "404" and isset($file_error)}
			{remarksbox type='errors' title="{tr}File error{/tr}"}
				{$file_error}
			{/remarksbox}
		{elseif $errortype eq "404" and isset($page)}
			{remarksbox type='errors' title=$errortitle}
36
				{tr}Page not found{/tr}<br>{$page|escape}
37 38 39 40 41 42 43 44 45 46
			{/remarksbox}
			{if $prefs.feature_likePages eq 'y'}
				{if $likepages}
					<p>{tr}Perhaps you are looking for:{/tr}</p>
					<ul>
						{section name=back loop=$likepages}
						<li><a href="tiki-index.php?page={$likepages[back]|escape:"url"}" class="wiki">{$likepages[back]|escape}</a></li>
						{/section}
					</ul>
				{else}
47
					{remarksbox type="tip" title="{tr}Information{/tr}"}
48 49
						{tr}There are no wiki pages similar to '{$page|escape}'{/tr}
					{/remarksbox}
50
				{/if}
51
			{/if}
52

53
			{if ($prefs.feature_search eq 'y' or $prefs.feature_search_fulltext eq 'y') && $tiki_p_search eq 'y'}
54 55 56
				{if $prefs.feature_search_fulltext eq 'y'}
					{include file='tiki-searchresults.tpl' searchNoResults="false" searchStyle="menu" searchOrientation="horiz" words="$page"}
				{else}
57
					{include file='tiki-searchindex_form.tpl' searchNoResults="true" searchStyle="menu" searchOrientation="horiz" words="$page" filter=$filter}
58
				{/if}
59
			{/if}
60 61 62 63
		{elseif $commenttype eq "note" and isset($msg)}
			{remarksbox type='note' title=$title}
				{$msg}
			{/remarksbox}
64 65 66 67 68
		{else}
			{if isset($token_error)}
				{remarksbox type='errors' title="{tr}Token Error{/tr}"}
					{$token_error}
				{/remarksbox}
69
			{elseif ($errortype eq 401 || $errortype eq 403) && empty($user) and $prefs.permission_denied_login_box eq 'y'} {* permission denied *}
70 71 72 73
				{remarksbox type='errors' title=$errortitle}
					{tr}Permission denied{/tr}
				{/remarksbox}
				{include file='tiki-login.tpl'}
74
			{elseif !isset($user) and $errortype != 'no_redirect_login' and $errortype != 'login' and empty($msg)}
75 76 77 78 79 80 81
				{remarksbox type='errors' title=$errortitle}
					{tr}You are not logged in.{/tr} <a href="tiki-login_scr.php">{tr}Go to Log in Page{/tr}</a>
				{/remarksbox}
			{else}
				{remarksbox type='errors' title=$errortitle}
					{$msg}
					{if !empty($required_preferences)}
82 83
						{remarksbox type='note' title="{tr}Settings{/tr}" close="n"}
						<form method="post" action="tiki-admin.php" role="form" class="form">
84
							{ticket}
85 86 87
							{foreach from=$required_preferences item=pref}
								{preference name=$pref}
							{/foreach}
88 89 90
							<div class="text-center">
								<input type="submit" class="btn btn-primary btn-sm" value="{tr}Apply{/tr}">
							</div>
91 92 93 94 95 96 97 98 99 100 101 102 103 104
						</form>
						{/remarksbox}
					{/if}
				{/remarksbox}
			{/if}
		{/if}

		{if isset($extraButton)}
			{remarksbox type='errors' title=$errortitle}
			{$extraButton.comment}
			{button href=$extraButton.href _text=$extraButton.text}
			{/remarksbox}
		{/if}

lindonb's avatar
lindonb committed
105
		{if isset($page) and $page and $create eq 'y' and ($tiki_p_admin eq 'y' or $tiki_p_admin_wiki eq 'y' or $tiki_p_edit eq 'y')}
106
			{button href="tiki-editpage.php?page=$page" _text="{tr}Create this page{/tr}"} {tr}(page will be orphaned){/tr}
107
			<br><br>
108 109
		{/if}

110 111 112
		{* Hide the error navigation on the homepage *}
		{if !isset($page) or $prefs.site_wikiHomePage neq $page}
			{if $prefs.javascript_enabled eq 'y'}
113
				{button _type="link" _icon_name="arrow-left" _onclick="javascript:history.back();return false;" _text="{tr}Go back{/tr}" _ajax="n"}
114 115
				<br><br>
			{/if}
116

117
			{button href=$prefs.tikiIndex _type="link" _icon_name="home" _text="{tr}Return to home page{/tr}"}
118
		{/if}
119
	{/if}
120
{/capture}
121

122
{include file='tiki.tpl'}
123
{/strip}