Author: Jonathan.Wage
Date: 2010-02-13 04:32:59 +0100 (Sat, 13 Feb 2010)
New Revision: 28002

Modified:
   
plugins/sfSympalPlugin/trunk/lib/doctrine/sfSympalDoctrineCollection.class.php
   
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContent.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/replacer/sfSympalContentSyntaxAssetReplacer.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalDataGridPlugin/lib/sfSympalDataGrid.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/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/replacer/sfSympalContentSyntaxLinkReplacer.class.php
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalSearchPlugin/modules/sympal_search/templates/indexSuccess.php
   plugins/sfSympalPlugin/trunk/templates/sympal.php
Log:
[1.4][sfSympalPlugin][1.0] Misc. bug fixes encounted while upgrading sympal 
website


Modified: 
plugins/sfSympalPlugin/trunk/lib/doctrine/sfSympalDoctrineCollection.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/doctrine/sfSympalDoctrineCollection.class.php  
    2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/doctrine/sfSympalDoctrineCollection.class.php  
    2010-02-13 03:32:59 UTC (rev 28002)
@@ -20,7 +20,7 @@
     $all = array();
     foreach ($this as $key => $value)
     {
-      $all[] = $value->get($field);
+      $all[] = $value->get($fieldName);
     }
     return $all;
   }

Modified: 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContent.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContent.class.php 
    2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContent.class.php 
    2010-02-13 03:32:59 UTC (rev 28002)
@@ -13,7 +13,8 @@
     $_mainMenuItem,
     $_editableSlotsExistOnPage = false,
     $_slotsByName = null,
-    $_contentRouteObject = null;
+    $_contentRouteObject = null,
+    $_updateSearchIndex = true;
   
   /**
    * Initializes a new sfSympalContent for the given type
@@ -746,19 +747,34 @@
     return $this->_get('ContentGroups');
   }
 
+  public function disableSearchIndexUpdateForSave()
+  {
+    $this->_updateSearchIndex = false;
+  }
+
   public function save(Doctrine_Connection $conn = null)
   {
     $result = parent::save($conn);
-    sfSympalSearch::getInstance()->updateSearchIndex($this);
+
+    if ($this->_updateSearchIndex)
+    {
+      sfSympalSearch::getInstance()->updateSearchIndex($this);
+    }
+
+    $this->_updateSearchIndex = true;
+
     return $result;
   }
 
   public function delete(Doctrine_Connection $conn = null)
   {
-    $index = sfSympalSearch::getInstance()->getIndex();
-    foreach ($index->find('pk:'.$this->getId()) as $hit)
+    if ($this->_updateSearchIndex)
     {
-      $index->delete($hit->id);
+      $index = sfSympalSearch::getInstance()->getIndex();
+      foreach ($index->find('pk:'.$this->getId()) as $hit)
+      {
+        $index->delete($hit->id);
+      }
     }
     return parent::delete($conn);
   }

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
      2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
      2010-02-13 03:32:59 UTC (rev 28002)
@@ -135,6 +135,7 @@
   public function loadConfigForm(sfEvent $event)
   {
     $form = $event->getSubject();
+    $form->addSetting(null, 'rows_per_page', 'Rows Per Page');
 
     if (sfSympalConfig::isI18nEnabled())
     {
@@ -167,8 +168,6 @@
       $form->addSetting(null, 'default_culture', 'Default Culture', 
$widgetSchema['language'], $validatorSchema['language']);
     }
 
-    $form->addSetting(null, 'rows_per_page', 'Rows Per Page');
-
     $array = sfSympalFormToolkit::getThemeWidgetAndValidator();
     $form->addSetting(null, 'default_theme', 'Default Theme', 
$array['widget'], $array['validator']);
 

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/replacer/sfSympalContentSyntaxAssetReplacer.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/replacer/sfSympalContentSyntaxAssetReplacer.class.php
     2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/replacer/sfSympalContentSyntaxAssetReplacer.class.php
     2010-02-13 03:32:59 UTC (rev 28002)
@@ -55,7 +55,7 @@
         {
           $sympalContent->Assets[] = $assetObject;
         }
-        
+        $sympalContent->disableSearchIndexUpdateForSave();
         $sympalContent->save();
       }
 

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalDataGridPlugin/lib/sfSympalDataGrid.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalDataGridPlugin/lib/sfSympalDataGrid.class.php
      2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalDataGridPlugin/lib/sfSympalDataGrid.class.php
      2010-02-13 03:32:59 UTC (rev 28002)
@@ -387,7 +387,6 @@
     }
 
     $this->_query->getSqlQuery(array(), false);
-    $this->_pager->init();
 
     if (!$this->_columns)
     {
@@ -398,6 +397,8 @@
 
     $this->_initializeSortingAndPaging();
 
+    $this->_pager->init();
+
     $this->_initialized = true;
 
     return $this;

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
 2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenu.class.php
 2010-02-13 03:32:59 UTC (rev 28002)
@@ -461,26 +461,30 @@
 
   public function renderLink()
   {
-    $options = $this->getOptions();
-    $currentAncestor = $this->isCurrentAncestor();
-    if  ($this->isCurrent() || $currentAncestor)
+    if ($route = $this->getRoute())
     {
-      if (!isset($options['class']))
+      $options = $this->getOptions();
+      $currentAncestor = $this->isCurrentAncestor();
+      if  ($this->isCurrent() || $currentAncestor)
       {
-        $class = '';
-      } else {
-        $class = $options['class'];
+        if (!isset($options['class']))
+        {
+          $class = '';
+        } else {
+          $class = $options['class'];
+        }
+        $class .= ' current';
+        if ($currentAncestor)
+        {
+          $class .= ' current_ancestor';
+        }
+        $options['class'] = $class;
       }
-      $class .= ' current';
-      if ($currentAncestor)
-      {
-        $class .= ' current_ancestor';
-      }
-      $options['class'] = $class;
+      
+      $html = link_to($this->renderLabel(), $route, $options);
+    } else {
+      $html = $this->renderLabel();
     }
-
-    $html = link_to($this->renderLabel(), $this->getRoute(), $options);
-
     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-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSite.class.php
     2010-02-13 03:32:59 UTC (rev 28002)
@@ -4,7 +4,7 @@
 {
   protected 
     $_contentRouteObject = null,
-    $_menuItem = null,
+    $_menuItemArray = null,
     $_cacheKey = null;
 
   public function setCacheKey($cacheKey)
@@ -27,7 +27,7 @@
 
   public function findMenuItem($menuItem)
   {
-    if ($this->_menuItem['id'] == $menuItem['id'])
+    if ($this->_menuItemArray['id'] == $menuItem['id'])
     {
       return $this;
     }
@@ -41,9 +41,9 @@
     return false;
   }
 
-  public function getMenuItem()
+  public function getMenuItemArray()
   {
-    return $this->_menuItem;
+    return $this->_menuItemArray;
   }
 
   public function getBreadcrumbsArray($subItem = null)
@@ -53,7 +53,7 @@
 
     if ($subItem)
     {
-      if ($subItem instanceof sfSympalContent && 
$this->_menuItem['content_id'] == $subItem->id)
+      if ($subItem instanceof sfSympalContent && 
$this->_menuItemArray['content_id'] == $subItem->id)
       {
         $subItem = array();
       }
@@ -111,18 +111,18 @@
     if (sfSympalConfig::isI18nEnabled('sfSympalMenuItem'))
     {
       $culture = sfContext::getInstance()->getUser()->getCulture();
-      if (isset($this->_menuItem['Translation'][$culture]['label']))
+      if (isset($this->_menuItemArray['Translation'][$culture]['label']))
       {
-        $label = $this->_menuItem['Translation'][$culture]['label'];
+        $label = $this->_menuItemArray['Translation'][$culture]['label'];
       }
-      if (!$label && 
isset($this->_menuItem['Translation'][sfConfig::get('sf_default_culture')]['label']))
+      if (!$label && 
isset($this->_menuItemArray['Translation'][sfConfig::get('sf_default_culture')]['label']))
       {
-        $label = 
$this->_menuItem['Translation'][sfConfig::get('sf_default_culture')]['label'];
+        $label = 
$this->_menuItemArray['Translation'][sfConfig::get('sf_default_culture')]['label'];
       }
     } else {
-      if (isset($this->_menuItem['label']))
+      if (isset($this->_menuItemArray['label']))
       {
-        $label = $this->_menuItem['label'];
+        $label = $this->_menuItemArray['label'];
       }
     }
     if (!$label)
@@ -148,21 +148,21 @@
     {
       $this->_contentRouteObject = $content->getContentRouteObject();
     }
-    $this->_menuItem = $this->_prepareMenuItem($menuItem);
-    $this->setRoute($this->_menuItem['item_route']);
-    $this->requiresAuth($this->_menuItem['requires_auth']);
-    $this->requiresNoAuth($this->_menuItem['requires_no_auth']);
-    $this->setCredentials($this->_menuItem['all_permissions']);
-    $this->setOptions($this->_menuItem['html_attributes']);
+    $this->_menuItemArray = $this->_prepareMenuItem($menuItem);
+    $this->setRoute($this->_menuItemArray['item_route']);
+    $this->requiresAuth($this->_menuItemArray['requires_auth']);
+    $this->requiresNoAuth($this->_menuItemArray['requires_no_auth']);
+    $this->setCredentials($this->_menuItemArray['all_permissions']);
+    $this->setOptions($this->_menuItemArray['html_attributes']);
 
     // If not published yet then you must have certain credentials
-    $datePublished = strtotime($this->_menuItem['date_published']);
+    $datePublished = strtotime($this->_menuItemArray['date_published']);
     if (!$datePublished || $datePublished > time())
     {
       $this->setCredentials(array('ManageContent'));
     }
 
-    $this->setLevel($this->_menuItem['level']);
+    $this->setLevel($this->_menuItemArray['level']);
   }
 
   public function getTopLevelParent()
@@ -183,7 +183,7 @@
   {
     foreach ($this->_children as $child)
     {
-      if ($child->_menuItem['id'] == $menuItem['id'] && $child->getChildren())
+      if ($child->_menuItemArray['id'] == $menuItem['id'] && 
$child->getChildren())
       {
         $result = $child;
       } else if ($n = $child->getMenuItemSubMenu($menuItem)) {
@@ -194,7 +194,6 @@
       {
         $class = $result->getParent() ? 
get_class($result->getParent()):get_class($result);
         $instance = new $class($child->getName());
-        $instance->setMenuItem($menuItem);
         $instance->setChildren($result->getChildren());
 
         return $instance;
@@ -208,7 +207,7 @@
 
     if ($currentMenuItem && $currentMenuItem->exists())
     {
-      return $this->_menuItem['id'] == $currentMenuItem['id'];
+      return $this->_menuItemArray['id'] == $currentMenuItem['id'];
     } else {
       return false;
     }
@@ -217,7 +216,7 @@
   public function isCurrentAncestor()
   {
     $menuItem = sfSympalContext::getInstance()->getCurrentMenuItem();
-    if ($menuItem && $this->_menuItem)
+    if ($menuItem && $this->_menuItemArray)
     {
       $this->_currentObject = $this->findMenuItem($menuItem);
       return parent::isCurrentAncestor();
@@ -226,8 +225,8 @@
     return false;
   }
 
-  public function getDoctrineMenuItem()
+  public function getMenuItem()
   {
-    return 
Doctrine_Core::getTable('sfSympalMenuItem')->find($this->_menuItem['id']);
+    return 
Doctrine_Core::getTable('sfSympalMenuItem')->find($this->_menuItemArray['id']);
   }
 }
\ No newline at end of file

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-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
      2010-02-13 03:32:59 UTC (rev 28002)
@@ -62,7 +62,7 @@
     } else {
       if ($menu->getUrl(array('absolute' => true)) === $this->_currentUri)
       {
-        return $menu->getDoctrineMenuItem();
+        return $menu->getMenuItem();
       }
       foreach ($menu->getChildren() as $child)
       {

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/replacer/sfSympalContentSyntaxLinkReplacer.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/replacer/sfSympalContentSyntaxLinkReplacer.class.php
   2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalRenderingPlugin/lib/replacer/sfSympalContentSyntaxLinkReplacer.class.php
   2010-02-13 03:32:59 UTC (rev 28002)
@@ -69,7 +69,7 @@
         {
           $sympalContent->Links[] = $contentObject;
         }
-        
+        $sympalContent->disableSearchIndexUpdateForSave();
         $sympalContent->save();
       }
 

Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalSearchPlugin/modules/sympal_search/templates/indexSuccess.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalSearchPlugin/modules/sympal_search/templates/indexSuccess.php
      2010-02-13 02:21:39 UTC (rev 28001)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalSearchPlugin/modules/sympal_search/templates/indexSuccess.php
      2010-02-13 03:32:59 UTC (rev 28002)
@@ -23,7 +23,7 @@
   <?php echo $dataGrid->getPagerHeader() ?>
 
   <?php if ($dataGrid->count()): ?>
-    <?php echo 
$dataGrid->getPagerNavigation(url_for('@'.$sf_context->getRouting()->getCurrentRouteName()))
 ?>
+    <?php echo 
$dataGrid->getPagerNavigation(url_for('@'.$sf_context->getRouting()->getCurrentRouteName().'?q='.$sf_request->getParameter('q')))
 ?>
 
     <div id="sf_admin_container">
       <div id="sf_admin_content">

Modified: plugins/sfSympalPlugin/trunk/templates/sympal.php
===================================================================
--- plugins/sfSympalPlugin/trunk/templates/sympal.php   2010-02-13 02:21:39 UTC 
(rev 28001)
+++ plugins/sfSympalPlugin/trunk/templates/sympal.php   2010-02-13 03:32:59 UTC 
(rev 28002)
@@ -56,27 +56,28 @@
   </div>
   <!-- end left column -->
 
-  <?php if (has_slot('sympal_right_sidebar') || $subMenu): ?>
-    <!-- right column -->
-    <div id="column_right">
-     <br />
-     <div class="roundedbox">
-      <div class="roundedbox_head"><div></div></div>
-      <div class="roundedbox_body">
-        <?php if (has_slot('sympal_right_sidebar')): ?>
-          <?php echo get_slot('sympal_right_sidebar') ?>
-        <?php endif; ?>
+  <!-- right column -->
+  <div id="column_right">
+   <br />
+   <div class="roundedbox">
+    <div class="roundedbox_head"><div></div></div>
+    <div class="roundedbox_body">
+      <h2>Search</h2>
+      <?php echo get_partial('sympal_search/form') ?>
 
-        <?php if ($subMenu): ?>
-          <div id="sympal_sub_menu">
-            <?php echo $subMenu ?>
-          </div>
-        <?php endif; ?>
-      </div>
-     </div>
+      <?php if (has_slot('sympal_right_sidebar')): ?>
+        <?php echo get_slot('sympal_right_sidebar') ?>
+      <?php endif; ?>
+
+      <?php if ($subMenu): ?>
+        <div id="sympal_sub_menu">
+          <?php echo $subMenu ?>
+        </div>
+      <?php endif; ?>
     </div>
-    <!-- end right column -->
-  <?php endif; ?>
+   </div>
+  </div>
+  <!-- end right column -->
 
   <br style="clear: both;" />
 

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