From f6bfb9996424e83c7c900a6842157a8e5893be70 Mon Sep 17 00:00:00 2001 From: skeeter Date: Mon, 11 Jun 2001 01:54:11 +0000 Subject: [PATCH] More condensed way of displaying the response choices. --- calendar/inc/class.calendar.inc.php | 52 +++++++++-------------------- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/calendar/inc/class.calendar.inc.php b/calendar/inc/class.calendar.inc.php index 7b17d5bc62..7c0763a090 100755 --- a/calendar/inc/class.calendar.inc.php +++ b/calendar/inc/class.calendar.inc.php @@ -1798,44 +1798,24 @@ class calendar extends calendar_ ); $p->set_file($templates); - $var = Array( - 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.ACCEPTED), - 'action_text_button' => ' '.lang('Accept').' ', - 'action_confirm_button' => '', - 'action_extra_field' => '' + $response_choices = Array( + ACCEPTED => lang('Accept'), + REJECTED => lang('Reject'), + TENTATIVE => lang('Tentative'), + NO_RESPONSE => lang('No Response') ); - $p->set_var($var); - $str .= ''.$p->fp('out','form_button').''."\n"; - - $var = Array( - 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.REJECTED), - 'action_text_button' => ' '.lang('Reject').' ', - 'action_confirm_button' => '', - 'action_extra_field' => '' - ); - $p->set_var($var); - $str .= ''.$p->fp('out','form_button').''."\n"; - - $var = Array( - 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.TENTATIVE), - 'action_text_button' => ' '.lang('Tentative').' ', - 'action_confirm_button' => '', - 'action_extra_field' => '' - ); - $p->set_var($var); - $str .= ''.$p->fp('out','form_button').''."\n"; - - $var = Array( - 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.NO_RESPONSE), - 'action_text_button' => ' '.lang('No Response').' ', - 'action_confirm_button' => '', - 'action_extra_field' => '' - ); - $p->set_var($var); - $str .= ''.$p->fp('out','form_button').''."\n"; - + while(list($param,$text) = each($response_choices)) + { + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.$param), + 'action_text_button' => ' '.$text.' ', + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); + $str .= ''.$p->fp('out','form_button').''."\n"; + } $str .= ''; - return $str; }