[ansel] [patch] Add next/back links to the screen view

Brian Keifer brian at valinor.net
Mon Oct 27 19:51:15 PST 2003


Here's a patch to add 'next' and 'back' links to the screen view to navigate
between images without having to go back to the gallery view.

-Brian

--
Most look at me as though I'd just asked them if they refloozle their
hossenblobbets with tinklewickets.
--Scott Granneman, SecurityFocus - "Joe Average User Is In Trouble"
-------------- next part --------------
Index: templates/view/description-image.inc
===================================================================
RCS file: /repository/ansel/templates/view/description-image.inc,v
retrieving revision 1.13
diff -u -r1.13 description-image.inc
--- templates/view/description-image.inc	20 Oct 2003 03:27:28 -0000	1.13
+++ templates/view/description-image.inc	28 Oct 2003 02:29:08 -0000
@@ -7,13 +7,29 @@
 <div align="center">
 <table border="0" cellpadding="2" cellspacing="0">
 <tr>
-  <td align="center">
+  <td colspan=3 align="center">
     <?php echo Horde::img($image_url, '', 'style="border: 1px solid black;"', ''); ?>
   </td>
 </tr>
 <tr>
-  <td class="light" align="center">
+  <td width="10%" class="light" align="left">
+    <?php if ($image_id > 1): ?>
+      <?php $back_url = Util::addParameter('view.php', 'gallery', $galleryId) ?>
+      <?php $back_url = Util::addParameter($back_url, 'image', $image_id - 1) ?>
+      <?php $back_url = Util::addParameter($back_url, 'actionID', 'viewimage') ?>
+      <?php echo Horde::link(Horde::applicationUrl($back_url), _("Back"), "", "", "", _("Back")) . _("Back") ?> </a>
+    <?php endif; ?>
+  </td>
+  <td width="80%" class="light" align="center">
     <?php echo nl2br(Text::linkUrls(Text::htmlSpaces($caption), false, 'fixed')) ?>
+  </td>
+  <td width="10%" class="light" align="right">
+    <?php if ($image_id < count($gallery->listImages())): ?>
+      <?php $next_url = Util::addParameter('view.php', 'gallery', $galleryId) ?>
+      <?php $next_url = Util::addParameter($next_url, 'image', $image_id + 1) ?>
+      <?php $next_url = Util::addParameter($next_url, 'actionID', 'viewimage') ?>
+      <?php echo Horde::link(Horde::applicationUrl($next_url), _("Next"), "", "", "", _("Next")) . _("Next") ?> </a>
+    <?php endif; ?>
   </td>
 </tr>
 </table>


More information about the ansel mailing list