Update of /cvsroot/webnotes/webnotes/themes/phpnet
In directory usw-pr-cvs1:/tmp/cvs-serv26969/themes/phpnet
Modified Files:
theme_api.php
Log Message:
- Added prev_id and next_id to the pages table.
- Handled prev/next from theme
- Auto setting prev/next if specific in the call to webnotes.
- Added XHTML example, to demonstrate the prev / prev-next / next.
There is still a problem with pages that have no notes.
Index: theme_api.php
===================================================================
RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- theme_api.php 19 Sep 2002 21:51:02 -0000 1.15
+++ theme_api.php 19 Sep 2002 22:50:39 -0000 1.16
@@ -149,7 +149,32 @@
$help_picture = $t_images_base . 'notes_about.gif';
$prev_picture = $t_images_base . 'caret_left.gif';
$next_picture = $t_images_base . 'caret_right.gif';
-
+
+ # @@@@ Should move outside the theme
+ $t_page = page_get_info( page_where_id_equals( $t_page_id ) );
+ $t_prev_page = page_get_info( page_where_id_equals( $t_page['prev_id'] ) );
+ $t_next_page = page_get_info( page_where_id_equals( $t_page['next_id'] ) );
+
+ if ( false === $t_prev_page ) {
+ $t_prev_text = '';
+ } else {
+ $t_prev_text = "<img src=\"$prev_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $t_prev_page['page'] . "\" />" .
+ link_create( $t_prev_page['url'], $t_prev_page['page'], true, '', '' );
+ }
+
+ if ( false === $t_next_page ) {
+ $t_next_text = '';
+ } else {
+ $t_next_text = link_create( $t_next_page['url'], $t_next_page['page'], true, '', '' ) .
+ "<img src=\"$next_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $t_next_page['page'] . "\" />";
+ }
+
+ if ( empty( $t_prev_text ) && empty( $t_next_text ) ) {
+ $t_navigation_row = '';
+ } else {
+ $t_navigation_row = "<tr><td>$t_prev_text</td><td align=\"right\">$t_next_text</td></tr>";
+ }
+
if ( !$p_preview ) {
$t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">";
$t_link_end = '</a>';
@@ -166,8 +191,7 @@
</tr>
</table>
<table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4">
- <tr><td><img src="$prev_picture" border="0" width="11" height="7" alt="Previous" />Previous</td>
- <td align="right">Next<img src="$next_picture" border="0" width="11" height="7" alt="Next" /></td></tr>
+ $t_navigation_row
<tr bgcolor="#cccccc"><td colspan="2"></td></tr>
<tr><td align="right" colspan="2"><small>Last updated: Tue, 17 Sep 2002</small></td></tr>
</table>
@@ -190,6 +214,7 @@
</tr>
</table>
EOT;
+ theme_notes_end( $p_page, $p_url );
}
# This function is called if the current page was not indexed
|