Author: ornicar2
Date: 2010-01-29 19:33:02 +0100 (Fri, 29 Jan 2010)
New Revision: 27310

Modified:
   
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionGenerator.php
   
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionTemplateGenerator.php
   
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontComponentGenerator.php
Log:
[Diem]
- fixed front code generation

Modified: 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionGenerator.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionGenerator.php 
    2010-01-29 18:25:37 UTC (rev 27309)
+++ 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionGenerator.php 
    2010-01-29 18:33:02 UTC (rev 27310)
@@ -46,15 +46,15 @@
     
     if ($this->module->hasModel())
     {
-      foreach($this->module->getActions() as $action)
+      foreach($this->module->getComponents() as $component)
       {
-        if ($action->getType() == 'form')
+        if ($component->getType() == 'form')
         {
-          $methodName = 
'execute'.dmString::camelize($action->getKey()).'Widget';
+          $methodName = 
'execute'.dmString::camelize($component->getKey()).'Widget';
           
           if (!$this->class->getMethod($methodName))
           {
-            $this->class->setMethod($this->buildFormMethod($methodName, 
$action));
+            $this->class->setMethod($this->buildFormMethod($methodName, 
$component));
           }
         }
       }

Modified: 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionTemplateGenerator.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionTemplateGenerator.php
     2010-01-29 18:25:37 UTC (rev 27309)
+++ 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontActionTemplateGenerator.php
     2010-01-29 18:33:02 UTC (rev 27310)
@@ -14,9 +14,9 @@
 
     $success = true;
 
-    foreach($this->module->getActions() as $action)
+    foreach($this->module->getComponents() as $component)
     {
-      $file = dmOs::join($dir, '_'.$action->getKey().'.php');
+      $file = dmOs::join($dir, '_'.$component->getKey().'.php');
 
       if(file_exists($file))
       {
@@ -25,7 +25,7 @@
 
       touch($file);
 
-      $code = $this->getActionTemplate($action);
+      $code = $this->getActionTemplate($component);
 
       $fileSuccess = (file_put_contents($file, $code) && 
$this->filesystem->chmod($file, 0777));    
       
@@ -40,14 +40,14 @@
     return $success;
   }
 
-  protected function getActionTemplate(dmModuleComponent $action)
+  protected function getActionTemplate(dmModuleComponent $component)
   {
-    switch($action->getType())
+    switch($component->getType())
     {
-      case 'list': return $this->getListActionTemplate($action); break;
-      case 'show': return $this->getShowActionTemplate($action); break;
-      case 'form': return $this->getFormActionTemplate($action); break;
-      default:     return $this->getUserActionTemplate($action); break;
+      case 'list': return $this->getListActionTemplate($component); break;
+      case 'show': return $this->getShowActionTemplate($component); break;
+      case 'form': return $this->getFormActionTemplate($component); break;
+      default:     return $this->getUserActionTemplate($component); break;
     }
   }
 

Modified: 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontComponentGenerator.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontComponentGenerator.php
  2010-01-29 18:25:37 UTC (rev 27309)
+++ 
plugins/diemPlugin/trunk/dmFrontPlugin/lib/generator/dmFrontComponentGenerator.php
  2010-01-29 18:33:02 UTC (rev 27310)
@@ -44,13 +44,13 @@
     
     $this->class->setIndentation($this->indentation);
     
-    foreach($this->module->getActions() as $action)
+    foreach($this->module->getComponents() as $component)
     {
-      $methodName = 'execute'.dmString::camelize($action->getKey());
+      $methodName = 'execute'.dmString::camelize($component->getKey());
       
       if (!$this->class->getMethod($methodName))
       {
-        $this->class->setMethod($this->buildActionMethod($methodName, 
$action));
+        $this->class->setMethod($this->buildActionMethod($methodName, 
$component));
       }
     }
 
@@ -116,9 +116,6 @@
       'name'        => $methodName,
       'visibility'  => 'public',
       'body'        => $body
-//      'docblock'    => new Zend_CodeGenerator_Php_Docblock(array(
-//        'shortDescription' => $action->getName()
-//      ))
     ));
   }
 }
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to