Author: Jonathan.Wage
Date: 2010-03-26 04:35:06 +0100 (Fri, 26 Mar 2010)
New Revision: 28794

Modified:
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSite.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/theme/sfSympalThemeConfiguration.class.php
   plugins/sfSympalPlugin/trunk/lib/util/sfSympalToolkit.class.php
Log:
[sfSympalPlugin] Synchronizing git repository to Symfony Plugins SVN

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
      2010-03-26 03:25:19 UTC (rev 28793)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
      2010-03-26 03:35:06 UTC (rev 28794)
@@ -61,6 +61,7 @@
 
     if (sfSympalConfig::isI18nEnabled())
     {
+      $this->configuration->loadHelpers(array('Partial', 'I18N'));
       $changeLanguage = $menu->getChild('Change Language');
       $currentCulture = 
strtolower(sfContext::getInstance()->getUser()->getCulture());
       $codes = sfSympalConfig::getLanguageCodes();

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
 2010-03-26 03:25:19 UTC (rev 28793)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
 2010-03-26 03:35:06 UTC (rev 28794)
@@ -408,9 +408,12 @@
 
   public function __toString()
   {
-    try {
+    try
+    {
       return (string) $this->render();
-    } catch (Exception $e) {
+    }
+    catch (Exception $e)
+    {
       return $e->getMessage();
     }
   }
@@ -423,6 +426,7 @@
       $html = '<ul'.($this->_ulClass ? ' class="'.$this->_ulClass.'"' : 
null).' id="'.$id.'">';
       $html .= $this->renderChildren();
       $html .= '</ul>';
+
       return $html;
     }
   }
@@ -504,8 +508,24 @@
         $options['class'] = $class;
       }
       
-      $html = link_to($this->renderLabel(), $route, $options);
-    } else {
+      // proteted against an invalid url (e.g. myModule/myAction, which doesnt 
exist)
+      try
+      {
+        $html = link_to($this->renderLabel(), $route, $options);
+      }
+      catch (sfConfigurationException $e)
+      {
+        sfApplicationConfiguration::getActive()->getEventDispatcher()->notify(
+          new sfEvent($this, 'application.log', array(
+            sprintf('Cannot generate a menu url for "%s"', $this->getRoute())
+          ))
+        );
+        
+        $html = $this->renderLabel();
+      }
+    }
+    else
+    {
       $html = $this->renderLabel();
     }
     return $html;

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSite.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSite.class.php
     2010-03-26 03:25:19 UTC (rev 28793)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSite.class.php
     2010-03-26 03:35:06 UTC (rev 28794)
@@ -137,7 +137,9 @@
     if ($this->_contentRouteObject)
     {
       return $this->_contentRouteObject->getRoute();
-    } else {
+    }
+    else
+    {
       return parent::getRoute();
     }
   }

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/theme/sfSympalThemeConfiguration.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/theme/sfSympalThemeConfiguration.class.php
     2010-03-26 03:25:19 UTC (rev 28793)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/theme/sfSympalThemeConfiguration.class.php
     2010-03-26 03:35:06 UTC (rev 28794)
@@ -45,6 +45,14 @@
     return isset($this->_configuration['callables']) ? 
$this->_configuration['callables'] : array();
   }
 
+  /**
+   * Calculates the location of the layout, which could live in several 
locations.
+   * 
+   * Specifically, the layout file for a theme could live in any "templates"
+   * file found in the application dir or any enabled plugins
+   * 
+   * @param string $layout The optional layout to look for (defaults to this 
theme's name)
+   */
   protected function _findLayoutPath($layout = null)
   {
     if ($layout === null)
@@ -58,7 +66,7 @@
 
     if (!$path)
     {
-      throw new InvalidArgumentException(sprintf('Could not find layout path 
for theme "%s"', $layout));
+      throw new InvalidArgumentException(sprintf('Could not find layout "%s" 
in any "templates" directories. You may need to clear your cache.', $layout));
     }
 
     if (!sfToolkit::isPathAbsolute($path))

Modified: plugins/sfSympalPlugin/trunk/lib/util/sfSympalToolkit.class.php
===================================================================
--- plugins/sfSympalPlugin/trunk/lib/util/sfSympalToolkit.class.php     
2010-03-26 03:25:19 UTC (rev 28793)
+++ plugins/sfSympalPlugin/trunk/lib/util/sfSympalToolkit.class.php     
2010-03-26 03:35:06 UTC (rev 28794)
@@ -333,14 +333,20 @@
     type: object
     method: getContent
     allow_empty: true
-    requirements:
-      sf_culture:  (%s)
-      sf_format:   (%s)
-      sf_method:   [post, get]
+  requirements:
+    sf_culture:  (%s)
+    sf_format:   (%s)
+    sf_method:   [post, get]
 ';
 
       $routes = array();
       $siteSlug = sfConfig::get('sf_app');
+      
+      if (!sfContext::hasInstance())
+      {
+        $configuration = 
ProjectConfiguration::getApplicationConfiguration(sfConfig::get('sf_app'), 
'prod', false);
+        sfContext::createInstance($configuration);
+      }
 
       $contents = Doctrine::getTable('sfSympalContent')
         ->createQuery('c')
@@ -410,7 +416,13 @@
 
       $routes = implode("\n", $routes);
       file_put_contents($cachePath, $routes);
+
       return $routes;
-    } catch (Exception $e) {}
+    }
+    catch (Exception $e)
+    {
+      // for now, I'd like to not obfuscate the errors - rather reportthem
+      throw $e;
+    }
   }
 }
\ 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