plugins/calendar plugins/libcalendaring
Thomas Brüderli
bruederli at kolabsys.com
Thu Jul 31 19:26:03 CEST 2014
plugins/calendar/lib/calendar_ui.php | 17 -------------
plugins/libcalendaring/lib/libcalendaring_itip.php | 27 +++++++++++++++++++++
2 files changed, 28 insertions(+), 16 deletions(-)
New commits:
commit b0eeafcc3e8e155eb812c1ea227edea480a9ecd5
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Thu Jul 31 19:25:40 2014 +0200
Move another common function to libcalendaring
diff --git a/plugins/calendar/lib/calendar_ui.php b/plugins/calendar/lib/calendar_ui.php
index df15957..1ddb884 100644
--- a/plugins/calendar/lib/calendar_ui.php
+++ b/plugins/calendar/lib/calendar_ui.php
@@ -874,22 +874,7 @@ class calendar_ui
function event_rsvp_buttons($attrib = array())
{
- $attrib += array('type' => 'button');
- foreach (array('accepted','tentative','declined') as $method) {
- $buttons .= html::tag('input', array(
- 'type' => $attrib['type'],
- 'name' => $attrib['iname'],
- 'class' => 'button',
- 'rel' => $method,
- 'value' => $this->cal->itip->gettext('itip' . $method),
- ));
- }
-
- $buttons .= html::div('itip-reply-controls', $this->cal->itip->itip_rsvp_options_ui($attrib['id']));
-
- return html::div($attrib,
- html::div('label', $this->cal->itip->gettext('acceptinvitation')) .
- html::div('rsvp-buttons', $buttons));
+ return $this->cal->itip->itip_rsvp_buttons($attrib, array('accepted','tentative','declined'));
}
}
diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php
index 93bdfee..748aa43 100644
--- a/plugins/libcalendaring/lib/libcalendaring_itip.php
+++ b/plugins/libcalendaring/lib/libcalendaring_itip.php
@@ -527,6 +527,33 @@ class libcalendaring_itip
}
/**
+ * Render an RSVP UI widget with buttons to respond on iTip invitations
+ */
+ function itip_rsvp_buttons($attrib = array(), $actions = null)
+ {
+ $attrib += array('type' => 'button');
+
+ if (!$actions)
+ $actions = $this->rsvp_actions;
+
+ foreach ($actions as $method) {
+ $buttons .= html::tag('input', array(
+ 'type' => $attrib['type'],
+ 'name' => $attrib['iname'],
+ 'class' => 'button',
+ 'rel' => $method,
+ 'value' => $this->gettext('itip' . $method),
+ ));
+ }
+
+ $buttons .= html::div('itip-reply-controls', $this->itip_rsvp_options_ui($attrib['id']));
+
+ return html::div($attrib,
+ html::div('label', $this->gettext('acceptinvitation')) .
+ html::div('rsvp-buttons', $buttons));
+ }
+
+ /**
* Render UI elements to control iTip reply message sending
*/
public function itip_rsvp_options_ui($dom_id)
More information about the commits
mailing list