summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-06 15:35:54 +0200
committeremkael <emkael@tlen.pl>2016-05-06 15:35:54 +0200
commit5bfe174b5907440a4f08bd45fd9c384ab5c58037 (patch)
tree892497280128fa06b373b0c8a608e5624b26ec53
parent2e9216dcf303917764d4af622dcd212ec1491889 (diff)
* common super-class for template controls using a facade
-rw-r--r--app/php/controls/CalendarScaffold.php12
-rw-r--r--app/php/controls/PasswordChange.php4
-rw-r--r--app/php/controls/RegistrationForm.php4
-rw-r--r--app/php/controls/TimezoneSelect.php4
-rw-r--r--app/php/controls/UpcomingEvents.php12
-rw-r--r--app/php/controls/UrlBasedCalendarControl.php12
-rw-r--r--app/php/controls/UserSelection.php12
-rw-r--r--app/php/web/FacadeTemplateControl.php18
8 files changed, 32 insertions, 46 deletions
diff --git a/app/php/controls/CalendarScaffold.php b/app/php/controls/CalendarScaffold.php
index 87ffdb0..b12f6aa 100644
--- a/app/php/controls/CalendarScaffold.php
+++ b/app/php/controls/CalendarScaffold.php
@@ -1,6 +1,6 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('System.Web.UI.ActiveControls.TActiveDataGrid');
Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
@@ -8,15 +8,7 @@ Prado::using('Application.components.SafeActiveFileUpload');
Prado::using('Application.facades.CalendarFacade');
-class CalendarScaffold extends TemplateControl {
-
- public function setFacade(Facade $facade) {
- $this->setViewState('Facade', $facade);
- }
-
- public function getFacade() {
- return $this->getViewState('Facade');
- }
+class CalendarScaffold extends FacadeTemplateControl {
public function onPreRender($param) {
parent::onPreRender($param);
diff --git a/app/php/controls/PasswordChange.php b/app/php/controls/PasswordChange.php
index 5653ef3..7c177a6 100644
--- a/app/php/controls/PasswordChange.php
+++ b/app/php/controls/PasswordChange.php
@@ -1,10 +1,10 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.user.DbUser');
-class PasswordChange extends TemplateControl {
+class PasswordChange extends FacadeTemplateControl {
public function getUserToChange() {
return $this->getControlState('user');
diff --git a/app/php/controls/RegistrationForm.php b/app/php/controls/RegistrationForm.php
index 0f24cea..d88fb95 100644
--- a/app/php/controls/RegistrationForm.php
+++ b/app/php/controls/RegistrationForm.php
@@ -1,10 +1,10 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.model.User');
-class RegistrationForm extends TemplateControl {
+class RegistrationForm extends FacadeTemplateControl {
public function checkUsername($sender, $param) {
$param->IsValid = !User::finder()->countByLogin($this->Login->SafeText);
diff --git a/app/php/controls/TimezoneSelect.php b/app/php/controls/TimezoneSelect.php
index d0357e4..31ba15d 100644
--- a/app/php/controls/TimezoneSelect.php
+++ b/app/php/controls/TimezoneSelect.php
@@ -1,11 +1,11 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.user.DbUser');
Prado::using('Application.dto.TimezoneDTO');
-class TimezoneSelect extends TemplateControl {
+class TimezoneSelect extends FacadeTemplateControl {
public function getUserToChange() {
return $this->getControlState('user');
diff --git a/app/php/controls/UpcomingEvents.php b/app/php/controls/UpcomingEvents.php
index 1ba5600..ac0271b 100644
--- a/app/php/controls/UpcomingEvents.php
+++ b/app/php/controls/UpcomingEvents.php
@@ -1,18 +1,10 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.facades.EventFacade');
-class UpcomingEvents extends TemplateControl {
-
- public function setFacade(Facade $facade) {
- $this->setViewState('Facade', $facade);
- }
-
- public function getFacade() {
- return $this->getViewState('Facade');
- }
+class UpcomingEvents extends FacadeTemplateControl {
public function getUserToDisplay() {
return $this->getControlState('user');
diff --git a/app/php/controls/UrlBasedCalendarControl.php b/app/php/controls/UrlBasedCalendarControl.php
index 89d05a1..1f737e8 100644
--- a/app/php/controls/UrlBasedCalendarControl.php
+++ b/app/php/controls/UrlBasedCalendarControl.php
@@ -1,17 +1,9 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.facades.CalendarFacade');
-class UrlBasedCalendarControl extends TemplateControl {
-
- public function setFacade(Facade $facade) {
- $this->setViewState('Facade', $facade);
- }
-
- public function getFacade() {
- return $this->getViewState('Facade');
- }
+class UrlBasedCalendarControl extends FacadeTemplateControl {
public function setCalendarUrl($url) {
if ($url) {
diff --git a/app/php/controls/UserSelection.php b/app/php/controls/UserSelection.php
index 83c7bae..d215d7b 100644
--- a/app/php/controls/UserSelection.php
+++ b/app/php/controls/UserSelection.php
@@ -1,18 +1,10 @@
<?php
-Prado::using('Application.web.TemplateControl');
+Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.facades.CalendarFacade');
-class UserSelection extends TemplateControl {
-
- public function setFacade(Facade $facade) {
- $this->setViewState('Facade', $facade);
- }
-
- public function getFacade() {
- return $this->getViewState('Facade');
- }
+class UserSelection extends FacadeTemplateControl {
public function getUserToDisplay() {
return $this->getControlState('user');
diff --git a/app/php/web/FacadeTemplateControl.php b/app/php/web/FacadeTemplateControl.php
new file mode 100644
index 0000000..b713f49
--- /dev/null
+++ b/app/php/web/FacadeTemplateControl.php
@@ -0,0 +1,18 @@
+<?php
+
+Prado::using('Application.facades.Facade');
+Prado::using('Application.web.TemplateControl');
+
+class FacadeTemplateControl extends TemplateControl {
+
+ public function setFacade(Facade $facade) {
+ $this->setControlState('Facade', $facade);
+ }
+
+ public function getFacade() {
+ return $this->getControlState('Facade');
+ }
+
+}
+
+?>