Author: Jonathan.Wage
Date: 2010-02-10 23:07:01 +0100 (Wed, 10 Feb 2010)
New Revision: 27859
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/form/doctrine/PluginsfSympalMenuItemForm.class.php
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
Log:
[1.4][sfSympalPlugin][1.0] Making menu item form slug required and small
performance fix
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/form/doctrine/PluginsfSympalMenuItemForm.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/form/doctrine/PluginsfSympalMenuItemForm.class.php
2010-02-10 21:59:38 UTC (rev 27858)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/form/doctrine/PluginsfSympalMenuItemForm.class.php
2010-02-10 22:07:01 UTC (rev 27859)
@@ -79,6 +79,7 @@
$this['rgt'],
$this['level']
);
+ $this->validatorSchema['slug']->setOption('required', true);
}
public function updateParentIdColumn($parentId)
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
2010-02-10 21:59:38 UTC (rev 27858)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
2010-02-10 22:07:01 UTC (rev 27859)
@@ -3,6 +3,7 @@
class sfSympalMenuSiteManager
{
protected
+ $_currentUri = null,
$_menus = array(),
$_menuItems = array(),
$_rootSlugs = array(),
@@ -14,6 +15,7 @@
public function __construct()
{
+ $this->_currentUri = sfContext::getInstance()->getRequest()->getUri();
if ($cache = $this->_getCache())
{
$cachedRootSlugs = $cache->get('SYMPAL_MENU_ROOT_SLUGS');
@@ -48,8 +50,6 @@
public function findCurrentMenuItem($menu = null)
{
- $currentUri = sfContext::getInstance()->getRequest()->getUri();
-
if (is_null($menu))
{
foreach ($this->getMenus() as $menu)
@@ -60,7 +60,7 @@
}
}
} else {
- if ($menu->getUrl(array('absolute' => true)) === $currentUri)
+ if ($menu->getUrl(array('absolute' => true)) === $this->_currentUri)
{
return $menu->getDoctrineMenuItem();
}
--
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.