From 6eeca4efc2994d4d62d18ee3a5f48c5ef684ae83 Mon Sep 17 00:00:00 2001 From: "Aleksander Machniak (Kolab Systems)" Date: Tue, 28 Jun 2011 13:05:58 +0200 Subject: [PATCH] Set classes on calendar list items according to data from driver --- plugins/calendar/lib/calendar_ui.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/calendar/lib/calendar_ui.php b/plugins/calendar/lib/calendar_ui.php index 8d7e01f4..cca4470b 100644 --- a/plugins/calendar/lib/calendar_ui.php +++ b/plugins/calendar/lib/calendar_ui.php @@ -140,15 +140,22 @@ class calendar_ui $prop['attendees'] = $this->calendar->driver->attendees; $prop['attachments'] = $this->calendar->driver->attachments; $jsenv[$id] = $prop; - + $html_id = html_identifier($id); - $li .= html::tag('li', array('id' => 'rcmlical' . $html_id, 'class' =>'cal-' . asciiwords($id, true)), + $class = 'cal-' . asciiwords($id, true); + + if ($prop['readonly']) + $class .= ' readonly'; + if ($prop['class_name']) + $class .= ' '.$prop['class_name']; + + $li .= html::tag('li', array('id' => 'rcmlical' . $html_id, 'class' => $class), html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => !in_array($id, $hidden)), '') . html::span(null, Q($prop['name']))); } $this->rc->output->set_env('calendars', $jsenv); $this->rc->output->add_gui_object('folderlist', $attrib['id']); - + unset($attrib['name']); return html::tag('ul', $attrib, $li); }