Index: /home/metskem/workspace/JSPWiki-2.8/src/com/ecyrd/jspwiki/plugin/IndexPlugin.java
===================================================================
--- /home/metskem/workspace/JSPWiki-2.8/src/com/ecyrd/jspwiki/plugin/IndexPlugin.java	(revision 728114)
+++ /home/metskem/workspace/JSPWiki-2.8/src/com/ecyrd/jspwiki/plugin/IndexPlugin.java	(working copy)
@@ -40,6 +40,7 @@
  *  <ul>
  *    <li><b>include</b> - A regexp pattern for marking which pages should be included.</li>
  *    <li><b>exclude</b> - A regexp pattern for marking which pages should be excluded.</li>
+ *    <li><b>showAttachments</b> - Indicates if attachments should also be shown, the default is true.</li>
  *  </ul>
  */
 public class IndexPlugin  extends AbstractReferralPlugin implements WikiPlugin
@@ -46,6 +47,9 @@
 {
     private static Logger log = Logger.getLogger( IndexPlugin.class );
     
+    /** The parameter name for setting the showAttachment.  Value is <tt>{@value}</tt>. */
+    public static final String PARAM_SHOW_ATTACHMENTS = "showAttachments";
+    
     /**
      *  {@inheritDoc}
      */
@@ -53,6 +57,12 @@
     {
         String include = (String)params.get( PARAM_INCLUDE );
         String exclude = (String)params.get( PARAM_EXCLUDE );
+        String showAttachmentsString = (String) params.get( PARAM_SHOW_ATTACHMENTS );
+        boolean showAttachments = true;
+        if( "false".equals( showAttachmentsString ) )
+        {
+            showAttachments = false;
+        }
         
         List<String> pages;
         div masterDiv = new div();
@@ -64,7 +74,7 @@
         indexDiv.setClass( "header" );
         try
         {
-            pages = listPages( context, include, exclude );
+            pages = listPages( context, include, exclude, showAttachments );
             Collections.sort( pages );
             
             char initialChar = ' ';
@@ -130,7 +140,7 @@
      * @return A list containing page names which matched the filters.
      * @throws ProviderException
      */
-    private List<String> listPages( WikiContext context, String include, String exclude )
+    private List<String> listPages( WikiContext context, String include, String exclude, boolean showAttachments )
         throws ProviderException
     {
         Pattern includePtrn = include != null ? Pattern.compile( include ) : Pattern.compile(".*");
@@ -147,7 +157,17 @@
             if( excludePtrn.matcher( pageName ).matches() ) continue;
             if( includePtrn.matcher( pageName ).matches() )
             {
-                result.add( pageName );
+                if( showAttachments )
+                {
+                    result.add( pageName );
+                }
+                else
+                {
+                    if( !pageName.contains( "/" ) )
+                    {
+                        result.add( pageName );
+                    }
+                }
             }
         }
         

