]> git.andy128k.dev Git - ipf.git/commitdiff
fix components response
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 4 Jan 2015 16:06:18 +0000 (18:06 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 4 Jan 2015 16:06:18 +0000 (18:06 +0200)
ipf/admin/controllers/components.php

index b4a49a942440bc8b1bb39fe774a89e5b158e3a71..29b55d27e75fa78be55cf511a24bad26fd3c7b16 100644 (file)
@@ -24,6 +24,8 @@ class IPF_Admin_Controller extends IPF_Admin_Base_Controller
     {
         $component = $this->getComponent(array('view'));
         $context = $component->listItems();
+        if ($context instanceof IPF_HTTP_Response)
+            return $context;
         return $this->render($component->listTemplate(), $context);
     }
 
@@ -31,6 +33,8 @@ class IPF_Admin_Controller extends IPF_Admin_Base_Controller
     {
         $component = $this->getComponent(array('view', 'add'));
         $context = $component->addItem();
+        if ($context instanceof IPF_HTTP_Response)
+            return $context;
         return $this->render($component->addTemplate(), $context);
     }
 
@@ -38,6 +42,8 @@ class IPF_Admin_Controller extends IPF_Admin_Base_Controller
     {
         $component = $this->getComponent(array('view', 'change'));
         $context = $component->editItem($this->params[3]);
+        if ($context instanceof IPF_HTTP_Response)
+            return $context;
         return $this->render($component->editTemplate(), $context);
     }
 
@@ -45,6 +51,8 @@ class IPF_Admin_Controller extends IPF_Admin_Base_Controller
     {
         $component = $this->getComponent(array('view', 'delete'));
         $context = $component->deleteItem($this->params[3]);
+        if ($context instanceof IPF_HTTP_Response)
+            return $context;
         return $this->render($component->deleteTemplate(), $context);
     }