Author: lombardot
Date: 2010-02-18 18:40:42 +0100 (Thu, 18 Feb 2010)
New Revision: 28112

Added:
   plugins/sfDatagridPlugin/web/img/pager-arrow-first.gif
   plugins/sfDatagridPlugin/web/img/pager-arrow-last.gif
Modified:
   plugins/sfDatagridPlugin/lib/sfDatagridFormatter.class.php
Log:
[lombardot] sfDatagridPlugin Add Last and first page buttons

Modified: plugins/sfDatagridPlugin/lib/sfDatagridFormatter.class.php
===================================================================
--- plugins/sfDatagridPlugin/lib/sfDatagridFormatter.class.php  2010-02-18 
16:46:32 UTC (rev 28111)
+++ plugins/sfDatagridPlugin/lib/sfDatagridFormatter.class.php  2010-02-18 
17:40:42 UTC (rev 28112)
@@ -107,7 +107,16 @@
                                
                                if($page != 1)
                                {
-                                       
+                                       if($page>2){
+                                               $pagerHtml.= 
self::link_to_remote(
+                                                       '<img src="' . 
sfDatagrid::getConfig('images_dir') . 'pager-arrow-first.gif" alt="" 
align="absmiddle" />',
+                                                       array(
+                                                               'url' => 
$moduleAction . '?' . $this->P_PAGE . '=' . $pager->getFirstPage() . '&' . 
$suffixWithSorting,
+                                                               'update' => 
$datagridName,
+                                                               'script' => 
true,
+                                'loading' => 'dg_hide_show(\'' . $datagridName 
. '\')'
+                                                               ));
+                                       }
                                        $pagerHtml.= self::link_to_remote(
                                                        '<img src="' . 
sfDatagrid::getConfig('images_dir') . 'pager-arrow-left.gif" alt="" 
align="absmiddle" />',
                                                        array(
@@ -116,6 +125,7 @@
                                                                'script' => 
true,
                                 'loading' => 'dg_hide_show(\'' . $datagridName 
. '\')'
                                                                ));
+                                       
                                }
                                
                                foreach($pager->getLinks() as $item)
@@ -156,6 +166,16 @@
                                                                'script' => 
true,
                                 'loading' => 'dg_hide_show(\'' . $datagridName 
. '\')'
                                                                ));
+                                       if($page+1!=$pager->getLastPage()){
+                                               $pagerHtml.= 
self::link_to_remote(
+                                                       '<img src="' . 
sfDatagrid::getConfig('images_dir') . 'pager-arrow-last.gif" alt="" 
align="absmiddle" />',
+                                                       array(
+                                                               'url' => 
$moduleAction . '?' . $this->P_PAGE . '=' . $pager->getLastPage() . '&' . 
$suffixWithSorting,
+                                                               'update' => 
$datagridName,
+                                                               'script' => 
true,
+                                'loading' => 'dg_hide_show(\'' . $datagridName 
. '\')'
+                                                               ));
+                                       }
                                }
                        }
                        else

Added: plugins/sfDatagridPlugin/web/img/pager-arrow-first.gif
===================================================================
(Binary files differ)


Property changes on: plugins/sfDatagridPlugin/web/img/pager-arrow-first.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: plugins/sfDatagridPlugin/web/img/pager-arrow-last.gif
===================================================================
(Binary files differ)


Property changes on: plugins/sfDatagridPlugin/web/img/pager-arrow-last.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

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