summaryrefslogtreecommitdiff
path: root/app/php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php')
-rw-r--r--app/php/controls/CalendarLabel.php13
-rw-r--r--app/php/controls/CalendarLabel.tpl12
-rw-r--r--app/php/controls/scripts/CalendarLabel.js11
3 files changed, 36 insertions, 0 deletions
diff --git a/app/php/controls/CalendarLabel.php b/app/php/controls/CalendarLabel.php
new file mode 100644
index 0000000..667e847
--- /dev/null
+++ b/app/php/controls/CalendarLabel.php
@@ -0,0 +1,13 @@
+<?php
+
+Prado::using('Application.controls.UrlBasedCalendarControl');
+
+class CalendarLabel extends UrlBasedCalendarControl {
+
+ public function getPradoScriptDependencies() {
+ return ['jquery'];
+ }
+
+}
+
+?>
diff --git a/app/php/controls/CalendarLabel.tpl b/app/php/controls/CalendarLabel.tpl
new file mode 100644
index 0000000..69e0147
--- /dev/null
+++ b/app/php/controls/CalendarLabel.tpl
@@ -0,0 +1,12 @@
+<com:TPanel CssClass="calendar">
+ <prop:Attributes.data-group><%= $this->Calendar->GroupID %></prop:Attributes.data-group>
+ <com:THyperLink>
+ <prop:NavigateUrl><%= $this->Service->constructUrl('Calendar', ['calendar' => $this->Calendar->Url]) %></prop:NavigateUrl>
+ <prop:Text><%= $this->Calendar->Name %></prop:Text>
+ </com:THyperLink>
+ <com:AddToFilter>
+ <prop:Facade><%= $this->Facade %></prop:Facade>
+ <prop:CalendarUrl><%= $this->Calendar->Url %></prop:CalendarUrl>
+ <prop:UserToManage><%= $this->User %></prop:UserToManage>
+ </com:AddToFilter>
+</com:TPanel>
diff --git a/app/php/controls/scripts/CalendarLabel.js b/app/php/controls/scripts/CalendarLabel.js
new file mode 100644
index 0000000..8193e56
--- /dev/null
+++ b/app/php/controls/scripts/CalendarLabel.js
@@ -0,0 +1,11 @@
+$(document).on('Application.calendarGroupFilterChanged', function(event, args) {
+ var selectedGroups = args.groups || [];
+ $('.calendar').each(function() {
+ var label = $(this);
+ if (selectedGroups.indexOf(label.attr('data-group')) >= 0) {
+ label.show();
+ } else {
+ label.hide();
+ }
+ });
+});