- if (x($_REQUEST, 'nofinish')) {$orig_event['nofinish'] = $_REQUEST['nofinish'];}
- if (x($_REQUEST, 'adjust')) {$orig_event['adjust'] = $_REQUEST['adjust'];}
- if (x($_REQUEST, 'summary')) {$orig_event['summary'] = $_REQUEST['summary'];}
- if (x($_REQUEST, 'description')) {$orig_event['description'] = $_REQUEST['description'];}
- if (x($_REQUEST, 'location')) {$orig_event['location'] = $_REQUEST['location'];}
- if (x($_REQUEST, 'start')) {$orig_event['start'] = $_REQUEST['start'];}
- if (x($_REQUEST, 'finish')) {$orig_event['finish'] = $_REQUEST['finish'];}
-
- $n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
- $a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
-
- $t_orig = ((x($orig_event)) ? $orig_event['summary'] : '');
- $d_orig = ((x($orig_event)) ? $orig_event['desc'] : '');
- $l_orig = ((x($orig_event)) ? $orig_event['location'] : '');
- $eid = ((x($orig_event)) ? $orig_event['id'] : 0);
- $cid = ((x($orig_event)) ? $orig_event['cid'] : 0);
- $uri = ((x($orig_event)) ? $orig_event['uri'] : '');
-
- if (! x($orig_event)) {
- $sh_checked = '';
- } else {
- $sh_checked = (($orig_event['allow_cid'] === '<' . local_user() . '>' && (! $orig_event['allow_gid']) && (! $orig_event['deny_cid']) && (! $orig_event['deny_gid'])) ? '' : ' checked="checked" ');
+ if (!empty($_REQUEST['nofinish'])) {$orig_event['nofinish'] = $_REQUEST['nofinish'];}
+ if (!empty($_REQUEST['adjust'])) {$orig_event['adjust'] = $_REQUEST['adjust'];}
+ if (!empty($_REQUEST['summary'])) {$orig_event['summary'] = $_REQUEST['summary'];}
+ if (!empty($_REQUEST['description'])) {$orig_event['description'] = $_REQUEST['description'];}
+ if (!empty($_REQUEST['location'])) {$orig_event['location'] = $_REQUEST['location'];}
+ if (!empty($_REQUEST['start'])) {$orig_event['start'] = $_REQUEST['start'];}
+ if (!empty($_REQUEST['finish'])) {$orig_event['finish'] = $_REQUEST['finish'];}
+
+ $n_checked = (!empty($orig_event['nofinish']) ? ' checked="checked" ' : '');
+ $a_checked = (!empty($orig_event['adjust']) ? ' checked="checked" ' : '');
+
+ $t_orig = !empty($orig_event) ? $orig_event['summary'] : '';
+ $d_orig = !empty($orig_event) ? $orig_event['desc'] : '';
+ $l_orig = !empty($orig_event) ? $orig_event['location'] : '';
+ $eid = !empty($orig_event) ? $orig_event['id'] : 0;
+ $cid = !empty($orig_event) ? $orig_event['cid'] : 0;
+ $uri = !empty($orig_event) ? $orig_event['uri'] : '';
+
+ $sh_disabled = '';
+ $sh_checked = '';
+
+ if (!empty($orig_event)
+ && ($orig_event['allow_cid'] !== '<' . local_user() . '>'
+ || $orig_event['allow_gid']
+ || $orig_event['deny_cid']
+ || $orig_event['deny_gid']))
+ {
+ $sh_checked = ' checked="checked" ';