aboutsummaryrefslogtreecommitdiffstats
path: root/mod/events.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/events.php')
-rwxr-xr-xmod/events.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/mod/events.php b/mod/events.php
index 2a6fb692e..4a6d3f100 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -57,12 +57,13 @@ function events_post(&$a) {
if(strcmp($finish,$start) < 0)
$finish = $start;
+ $summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));
$location = escape_tags(trim($_POST['location']));
$type = 'event';
- if((! $desc) || (! $start)) {
- notice( t('Event description and start time are required.') . EOL);
+ if((! $summary) || (! $start)) {
+ notice( t('Event title and start time are required.') . EOL);
goaway($a->get_baseurl() . '/events/new');
}
@@ -107,6 +108,7 @@ function events_post(&$a) {
$datarray = array();
$datarray['start'] = $start;
$datarray['finish'] = $finish;
+ $datarray['summary'] = $summary;
$datarray['desc'] = $desc;
$datarray['location'] = $location;
$datarray['type'] = $type;
@@ -278,9 +280,11 @@ function events_content(&$a) {
$last_date = $d;
$edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null);
-
- list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
- $title = strip_tags($title);
+ $title = strip_tags(bbcode($rr['summary']));
+ if(! $title) {
+ list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
+ $title = strip_tags($title);
+ }
$html = format_event_html($rr);
$rr['desc'] = bbcode($rr['desc']);
$rr['location'] = bbcode($rr['location']);
@@ -351,6 +355,7 @@ function events_content(&$a) {
$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);
@@ -405,10 +410,11 @@ function events_content(&$a) {
'$eid' => $eid,
'$cid' => $cid,
'$uri' => $uri,
+
'$title' => t('Event details'),
- '$desc' => sprintf( t('Format is %s %s. Starting date and Description are required.'),$dateformat,$timeformat),
+ '$desc' => sprintf( t('Format is %s %s. Starting date and Title are required.'),$dateformat,$timeformat),
- '$s_text' => t('Event Starts:') . ' <span class="required">*</span> ',
+ '$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>',
'$s_dsel' => datesel($f,'start',$syear+5,$syear,false,$syear,$smonth,$sday),
'$s_tsel' => timesel('start',$shour,$sminute),
'$n_text' => t('Finish date/time is not known or not relevant'),
@@ -418,10 +424,12 @@ function events_content(&$a) {
'$f_tsel' => timesel('finish',$fhour,$fminute),
'$a_text' => t('Adjust for viewer timezone'),
'$a_checked' => $a_checked,
- '$d_text' => t('Description:') . ' <span class="required">*</span>',
+ '$d_text' => t('Description:'),
'$d_orig' => $d_orig,
'$l_text' => t('Location:'),
'$l_orig' => $l_orig,
+ '$t_text' => t('Title:') . ' <span class="required" title="' . t('Required') . '">*</span>',
+ '$t_orig' => $t_orig,
'$sh_text' => t('Share this event'),
'$sh_checked' => $sh_checked,
'$acl' => (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user),false)),