diff options
author | emkael <emkael@tlen.pl> | 2016-05-09 10:38:23 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-09 12:38:03 +0200 |
commit | ad11c511f7d2516a3e2f04da4e5cd1eaf89e4d0b (patch) | |
tree | 0367b80e26ffaaa951079b45ad030a2f6e38c837 /app/php/controls | |
parent | bd9ca1eea24cfa98c0bcbea1ee546d131d5c10c1 (diff) |
* calendar label for user selection list
Diffstat (limited to 'app/php/controls')
-rw-r--r-- | app/php/controls/CalendarLabel.php | 13 | ||||
-rw-r--r-- | app/php/controls/CalendarLabel.tpl | 12 | ||||
-rw-r--r-- | app/php/controls/scripts/CalendarLabel.js | 11 |
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(); + } + }); +}); |