Author: pmacadden
Date: 2010-03-09 18:38:05 +0100 (Tue, 09 Mar 2010)
New Revision: 28439

Added:
   plugins/dcSwishPlugin/trunk/README
   plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/_flashes.php
Modified:
   plugins/dcSwishPlugin/trunk/modules/dc_swish/actions/actions.class.php
   plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/indexSuccess.php
Log:
README added, pager fix

Added: plugins/dcSwishPlugin/trunk/README
===================================================================
--- plugins/dcSwishPlugin/trunk/README                          (rev 0)
+++ plugins/dcSwishPlugin/trunk/README  2010-03-09 17:38:05 UTC (rev 28439)
@@ -0,0 +1,20 @@
+dcSwishPlugin
+=============
+
+This plugin allows you to index files on the filesystem of the server and
+search by keywords. This can be done using a module provided by the plugin.
+
+Installation
+------------
+
+  * Install the plugin
+
+      $ ./symfony plugin:install dcSwishPlugin
+
+  * Create the swish.config file in $SF_ROOT_DIR/config/swish.config (a sample 
is provided in $SF_PLUGINS_DIR/config/swish.config.sample)
+
+  * Build the index
+
+      $ ./symfony swish:build
+
+  * 

Modified: plugins/dcSwishPlugin/trunk/modules/dc_swish/actions/actions.class.php
===================================================================
--- plugins/dcSwishPlugin/trunk/modules/dc_swish/actions/actions.class.php      
2010-03-09 17:09:25 UTC (rev 28438)
+++ plugins/dcSwishPlugin/trunk/modules/dc_swish/actions/actions.class.php      
2010-03-09 17:38:05 UTC (rev 28439)
@@ -70,7 +70,15 @@
     $pager->setQuery($this->getQuery());
     $pager->setPage($this->getPage());
     $pager->setSort($this->getSort());
-    $pager->init();
+    try
+    {
+      $pager->init();
+    }
+    catch (Exception $e)
+    {
+      $this->getUser()->setFlash("error", "All search words too common to be 
useful");
+      $this->setQuery(array());
+    }
     return $pager;
   }
 
@@ -115,5 +123,4 @@
   {
     return $this->getUser()->getAttribute('swish.query', array(), 
'swish_plugin');
   }
-
 }

Added: plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/_flashes.php
===================================================================
--- plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/_flashes.php         
                (rev 0)
+++ plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/_flashes.php 
2010-03-09 17:38:05 UTC (rev 28439)
@@ -0,0 +1,7 @@
+<?php use_helper("I18N") ?>
+
+<?php if ($sf_user->hasFlash("error")): ?>
+  <div class="error">
+    <?php echo __("%error%", array("%error%" => $sf_user->getFlash("error"))) 
?>
+  </div>
+<?php endif ?>

Modified: 
plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/indexSuccess.php
===================================================================
--- plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/indexSuccess.php     
2010-03-09 17:09:25 UTC (rev 28438)
+++ plugins/dcSwishPlugin/trunk/modules/dc_swish/templates/indexSuccess.php     
2010-03-09 17:38:05 UTC (rev 28439)
@@ -1,4 +1,7 @@
 <?php use_helper('I18N', 'Date') ?>
+
+<?php include_partial("dc_swish/flashes") ?>
+
 <form action="<?php echo url_for('@dc_swish_search') ?>" method="POST">
   <table>
     <?php echo $swish_form ?>

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