Author: ornicar2
Date: 2010-02-08 16:09:35 +0100 (Mon, 08 Feb 2010)
New Revision: 27739

Modified:
   plugins/diemPlugin/trunk/dmCorePlugin/data/skeleton/config/dm/modules.yml
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/config/dmModuleManagerConfigHandler.php
Log:
[Diem]
- dmModuleManagerConfigHandler now supports both "Content" and "Project" 
keywords for content modules.
- renamed "Project" to "Content" in skeleton modules.yml

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/data/skeleton/config/dm/modules.yml
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/data/skeleton/config/dm/modules.yml   
2010-02-08 15:07:33 UTC (rev 27738)
+++ plugins/diemPlugin/trunk/dmCorePlugin/data/skeleton/config/dm/modules.yml   
2010-02-08 15:09:35 UTC (rev 27739)
@@ -1,4 +1,4 @@
-Project:
+Content:
 
   Global:
   

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/config/dmModuleManagerConfigHandler.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/config/dmModuleManagerConfigHandler.php
   2010-02-08 15:07:33 UTC (rev 27738)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/config/dmModuleManagerConfigHandler.php
   2010-02-08 15:09:35 UTC (rev 27739)
@@ -127,9 +127,9 @@
       $this->throwException('No main module');
     }
     
-    if (!isset($this->config['Project']))
+    if (!isset($this->config['Content']))
     {
-      $this->throwException('No Project module type');
+      $this->throwException('No Content module type');
     }
     
     foreach($this->modules as $key => $module)
@@ -298,7 +298,6 @@
     foreach($config as $typeName => $typeConfig)
     {
       $this->config[$typeName] = array();
-      $isInProject = $typeName === 'Project';
       
       foreach($typeConfig as $spaceName => $spaceConfig)
       {
@@ -306,7 +305,7 @@
         
         foreach((array) $spaceConfig as $moduleKey => $moduleConfig)
         {
-          $moduleConfig = $this->fixModuleConfig($moduleKey, $moduleConfig, 
$isInProject);
+          $moduleConfig = $this->fixModuleConfig($moduleKey, $moduleConfig, 
$typeName === 'Content');
 
           $this->modules[$moduleKey] = $moduleConfig;
           
@@ -321,7 +320,7 @@
     }
   }
   
-  protected function fixModuleConfig($moduleKey, $moduleConfig, $isInProject)
+  protected function fixModuleConfig($moduleKey, $moduleConfig, $isInContent)
   {
     /*
      * Extract plural from name
@@ -365,10 +364,10 @@
       'model' =>      $model,
       'credentials' => isset($moduleConfig['credentials']) ? 
trim($moduleConfig['credentials']) : null,
       'underscore'  => (string) dmString::underscore($moduleKey),
-      'is_project'  => (boolean) $isInProject || dmArray::get($moduleConfig, 
'page', false) || dmArray::get($moduleConfig, 'project', false),
+      'is_project'  => (boolean) $isInContent || dmArray::get($moduleConfig, 
'page', false) || count(dmArray::get($moduleConfig, 'components', array())),
       'plugin'      => $moduleConfig['plugin'],
       'overridden'  => dmArray::get($moduleConfig, 'overridden', false),
-      'has_admin'   => (boolean) dmArray::get($moduleConfig, 'admin', $model 
|| !$isInProject),
+      'has_admin'   => (boolean) dmArray::get($moduleConfig, 'admin', $model 
|| !$isInContent),
       'has_front'   => (boolean) dmArray::get($moduleConfig, 'front', true),
       'components'  => dmArray::get($moduleConfig, 'components', array())
     );
@@ -457,6 +456,13 @@
     {
       $values = self::parseYaml($configFile);
 
+      // BC 5.0_BETA6 "Content" was named "Project"
+      if(isset($values['Project']) && !isset($values['Content']))
+      {
+        $values['Content'] = $values['Project'];
+        unset($values['Project']);
+      }
+
       $pluginName = self::isProjectConfigFile($configFile) ? false : 
basename(str_replace('/config/dm/modules.yml', '', $configFile));
 
       foreach($values as $valuesTypeName => $valuesType)

-- 
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