@@ -32,6 +32,11 @@ $object_user = (
32
32
!is_null ( $ object_user_id ) ? new User ( $ object_user_id ) : null
33
33
);
34
34
35
+ if ( !$ object instanceof Event ) {
36
+ $ title = 'Event Not Found ' ;
37
+ $ description = 'The event you tried to access could not be found. ' ;
38
+ }
39
+
35
40
$ tpl_user = (
36
41
is_null ( $ object_user ) ? '<em>(null)</em> ' :
37
42
'<a href=" ' . $ object_user ->getURI () . '"><img class="avatar" src=" ' .
@@ -49,7 +54,7 @@ $tpl_metadata = (
49
54
50
55
$ tpl_referer = getenv ( 'HTTP_REFERER ' );
51
56
if ( !empty ( $ tpl_referer )) {
52
- $ tpl_referer = '<hr/>< a href=" ' . filter_var (
57
+ $ tpl_referer = '<a href=" ' . filter_var (
53
58
$ tpl_referer , FILTER_SANITIZE_FULL_SPECIAL_CHARS
54
59
) . '"><< Back to Previous</a> ' ;
55
60
}
@@ -64,11 +69,19 @@ $this->additional_css[] = '/a/forms.css';
64
69
require ('./header.inc.phtml ' );
65
70
?>
66
71
<article>
67
- <?php if (!$ this ->getContext ()->acl_allowed ) { ?>
72
+ <?php if ( !$ this ->getContext ()->acl_allowed ) { ?>
68
73
<header class="red"><?php echo $ title ; ?> </header>
69
74
<section class="red">
70
75
<p>You are not authorized to view this page.</p>
71
76
</section>
77
+ <?php } else if ( is_null ( $ object )) { $ title = 'Event Not Found ' ?>
78
+ <header class="red"><?php echo $ title ; ?> </header>
79
+ <section class="red">
80
+ <p><?php echo $ description ; ?> </p>
81
+ <?php if ( !empty ( $ tpl_referer )) { ?>
82
+ <p><?php echo $ tpl_referer ; ?> </p>
83
+ <?php } ?>
84
+ </section>
72
85
<?php } else { ?>
73
86
<header><?php echo $ title ; ?> </header>
74
87
<section>
@@ -81,7 +94,10 @@ require('./header.inc.phtml');
81
94
<tr><th class="right">User Account</th><td><?php echo $ tpl_user ; ?> </td></tr>
82
95
<tr><th class="right" style="vertical-align:top;">Metadata</th><td><?php echo $ tpl_metadata ; ?> </td></tr>
83
96
</tbody>
84
- </table><?php echo $ tpl_referer ; ?>
97
+ </table>
98
+ <?php if ( !empty ( $ tpl_referer )) { ?>
99
+ <hr/><p><?php echo $ tpl_referer ; ?> </p>
100
+ <?php } ?>
85
101
</section>
86
102
</article>
87
103
<?php } ?>
0 commit comments