[limb-svn] r6747 - in 3.x/trunk/limb/web_app: src/controller tests/cases/plain/controller

svn at limb-project.com svn at limb-project.com
Fri Jan 25 10:35:18 MSK 2008


Author: serega
Date: 2008-01-25 10:35:18 +0300 (Fri, 25 Jan 2008)
New Revision: 6747
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6747

Modified:
   3.x/trunk/limb/web_app/src/controller/FallbackToViewController.class.php
   3.x/trunk/limb/web_app/src/controller/NotFoundController.class.php
   3.x/trunk/limb/web_app/src/controller/lmbController.class.php
   3.x/trunk/limb/web_app/tests/cases/plain/controller/FallbackToViewControllerTest.class.php
Log:
-- lmbController :: _findTemplateByAlias() -> findTemplateByAlias and now is a public method
-- lmbController :: _findTemplateForAction() -> findTemplateForAction() and now is a public method

Modified: 3.x/trunk/limb/web_app/src/controller/FallbackToViewController.class.php
===================================================================
--- 3.x/trunk/limb/web_app/src/controller/FallbackToViewController.class.php	2008-01-24 16:47:30 UTC (rev 6746)
+++ 3.x/trunk/limb/web_app/src/controller/FallbackToViewController.class.php	2008-01-25 07:35:18 UTC (rev 6747)
@@ -25,7 +25,7 @@
   function performAction()
   {
     $path = trim($this->request->getUriPath(), '/');
-    if($template_path = $this->_findTemplateByAlias($path))
+    if($template_path = $this->findTemplateByAlias($path))
     {      
       $view = $this->toolkit->createViewByTemplate($template_path);
       $this->toolkit->setView($view);

Modified: 3.x/trunk/limb/web_app/src/controller/NotFoundController.class.php
===================================================================
--- 3.x/trunk/limb/web_app/src/controller/NotFoundController.class.php	2008-01-24 16:47:30 UTC (rev 6746)
+++ 3.x/trunk/limb/web_app/src/controller/NotFoundController.class.php	2008-01-25 07:35:18 UTC (rev 6747)
@@ -20,7 +20,7 @@
   function doDisplay()
   {
     $this->response->header('HTTP/1.x 404 Not Found');
-    $this->setTemplate($this->_findTemplateByAlias('not_found'));
+    $this->setTemplate($this->findTemplateByAlias('not_found'));
   }
 }
 

Modified: 3.x/trunk/limb/web_app/src/controller/lmbController.class.php
===================================================================
--- 3.x/trunk/limb/web_app/src/controller/lmbController.class.php	2008-01-24 16:47:30 UTC (rev 6746)
+++ 3.x/trunk/limb/web_app/src/controller/lmbController.class.php	2008-01-25 07:35:18 UTC (rev 6747)
@@ -142,7 +142,7 @@
     if(method_exists($this, $this->_mapActionToMethod($action)))
       return true;
 
-    if($this->_findTemplateForAction($action))
+    if($this->findTemplateForAction($action))
       return true;
 
     return false;
@@ -152,7 +152,7 @@
   {
     if(method_exists($this, $this->_mapCurrentActionToMethod()))
     {
-      if($template_path = $this->_findTemplateForAction($this->current_action))
+      if($template_path = $this->findTemplateForAction($this->current_action))
       {
         $this->setTemplate($template_path);
       }
@@ -170,7 +170,7 @@
 
       return $res;
     }
-    elseif($template_path = $this->_findTemplateForAction($this->current_action))
+    elseif($template_path = $this->findTemplateForAction($this->current_action))
     {
       $this->setTemplate($template_path);
       $this->_passLocalAttributesToView();
@@ -337,14 +337,14 @@
       return $this->$name;
   }
 
-  protected function _findTemplateForAction($action)
+  function findTemplateForAction($action)
   {
     if(isset($this->action_template_map[$this->name]) && isset($this->action_template_map[$this->name][$action]))
       return $this->action_template_map[$this->name][$action];
 
     $template_format = $this->getName() . '/' . $action;
     
-    if($template_path = $this->_findTemplateByAlias($template_format));
+    if($template_path = $this->findTemplateByAlias($template_format));
     {
       $this->map_changed = true;
       $this->action_template_map[$this->name][$action] = $template_path;
@@ -354,7 +354,7 @@
     $this->action_template_map[$this->name][$action] = false;
   }
   
-  protected function _findTemplateByAlias($template_format)
+  function findTemplateByAlias($template_format)
   {
     foreach($this->toolkit->getSupportedViewExtensions() as $ext)
     {

Modified: 3.x/trunk/limb/web_app/tests/cases/plain/controller/FallbackToViewControllerTest.class.php
===================================================================
--- 3.x/trunk/limb/web_app/tests/cases/plain/controller/FallbackToViewControllerTest.class.php	2008-01-24 16:47:30 UTC (rev 6746)
+++ 3.x/trunk/limb/web_app/tests/cases/plain/controller/FallbackToViewControllerTest.class.php	2008-01-25 07:35:18 UTC (rev 6747)
@@ -47,7 +47,7 @@
     $this->toolkit->setView($view);
     $controller = new FallbackToViewController();
     $controller->performAction();
-    $this->assertEqual($this->toolkit->getView()->getTemplate(), 'not_found.html');//too fragile check
+    $this->assertEqual($this->toolkit->getView()->getTemplate(), $controller->findTemplateByAlias('not_found'));
   }
 }
 



More information about the limb-svn mailing list