From: <vb...@us...> - 2002-09-06 17:03:44
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv1513 Modified Files: .cvsignore admin.php admin_view_queue.php Added Files: action.php admin_pending.php Removed Files: css_inc.php Log Message: - Some items were moved from the ROADMAP to webnotes.sf.net/mantis - Added action.php page to allow executing actions through links. - Added link_api.php to easily construct the links to trigger such actions. - Implemented admin_pending.php to allow the moderator to view all notes (grouped by page), and be able to accept/reject in any order. - Change the admin.php to link to admin_pending.php, this is much better for accepting / rejecting, but this causes the loss of the edit functionality (for now). - Moved css_inc.php to core/ - Added some strings to English language - Modified .cvsignore files to ignore PHPEdit temporary files. --- NEW FILE: action.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2002 Victor Boctor - vb...@us... # 2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: action.php,v 1.1 2002/09/06 17:03:35 vboctor Exp $ # -------------------------------------------------------- require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); login_cookie_check(); if ( !isset( $f_action ) ) { echo 'f_action not defined<br />'; exit; } if ( !isset( $f_url ) ) { echo 'f_url not defined<br />'; exit; } else { $c_url = urldecode( $f_url ); } # @@@@ add handling for confirm? if ( !isset( $f_note_id )) { echo 'f_note_id not defined<br />'; exit; } if ( 'accept' === $f_action ) { note_accept( $f_note_id ); } else if ( 'reject' === $f_action ) { note_decline( $f_note_id ); } else if ( 'archive' === $f_action ) { note_archive( $f_note_id ); } else if ( 'delete' === $f_action ) { note_delete( $f_note_id ); } if ( isset( $f_wait ) ) { print_html_top(); print_head_top(); print_title( $g_window_title ); print_css( $g_css_inc_file ); print_head_bottom(); print_body_top(); print_header( $g_page_title ); print_top_page( $g_top_page_inc ); print_admin_menu(); echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"$c_url\">[ Click here to proceed ]</a></div><br />"; print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); print_body_bottom(); print_html_bottom(); } else { util_header_redirect( $c_url ); } ?> --- NEW FILE: admin_pending.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2002 Victor Boctor - vb...@us... # 2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: admin_pending.php,v 1.1 2002/09/06 17:03:35 vboctor Exp $ # -------------------------------------------------------- require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); login_cookie_check(); print_html_top(); print_head_top(); print_title( $g_window_title ); print_css( $g_css_inc_file ); print_head_bottom(); print_body_top(); print_header( $g_page_title ); print_top_page( $g_top_page_inc ); print_admin_menu(); $result = note_queue( false ); echo '<br />'; $t_last_page = ''; $t_count = 0; while( $row = db_fetch_array( $result ) ) { extract( $row, EXTR_PREFIX_ALL, 'v' ); if ( $t_last_page != $v_page ) { if ( $t_count > 0 ) { echo '</table><br />'; $t_count = 0; } echo '<table width="100%" border="0" cellspacing="0">'; echo "<tr><td colspan=\"2\" bgcolor=\"$g_header_color\"><br /><strong>$v_page</strong><br /><br /></td></tr>"; $t_last_page = $v_page; } $t_color = util_alternate_colors( $t_count ); $v_note = db_unprepare_string( $v_note ); $v_note = nl2br( string_preserve_spaces( $v_note ) ); $t_accept = link_note_action( $v_note_id, 'accept', $PHP_SELF ); $t_reject = link_note_action( $v_note_id, 'reject', $PHP_SELF ); $t_edit = link_note_action( $v_note_id, 'edit', $PHP_SELF ); $t_archive = link_note_action( $v_note_id, 'archive', $PHP_SELF ); echo "<tr valign=\"top\" bgcolor=\"$t_color\"><td width=\"70%\"><em><a href=\"mailto:$v_email\">$v_email</a></em><br /><pre>$v_note</pre></td><td width=\"30%\" align=\"right\">$t_accept $t_reject $t_edit $t_archive</td></tr>"; $t_count++; }; if ( $t_count > 0 ) { echo '</table>'; } echo '</div>'; echo '<br />'; print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); print_body_bottom(); print_html_bottom(); ?> Index: .cvsignore =================================================================== RCS file: /cvsroot/webnotes/webnotes/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 2 Sep 2002 22:55:46 -0000 1.2 +++ .cvsignore 6 Sep 2002 17:03:35 -0000 1.3 @@ -0,0 +1 @@ +*.PHPEdit* \ No newline at end of file Index: admin.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- admin.php 5 Sep 2002 06:25:19 -0000 1.12 +++ admin.php 6 Sep 2002 17:03:35 -0000 1.13 @@ -34,7 +34,7 @@ </tr> <tr bgcolor="$g_primary_light_color" align="center" valign="middle" height="50"> <td width="33%"><a href="$g_admin_index_files">$s_index_files</a></td> - <td width="34%"><a href="$g_admin_view_queue">$s_view_queue</a> [$queue_count]</td> + <td width="34%"><a href="$g_admin_pending">$s_view_queue</a> [$queue_count]</td> <td width="33%"><a href="$g_admin_change_password">$s_change_password</a></td> </tr> </table> Index: admin_view_queue.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_view_queue.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- admin_view_queue.php 5 Sep 2002 14:12:58 -0000 1.12 +++ admin_view_queue.php 6 Sep 2002 17:03:35 -0000 1.13 @@ -25,7 +25,8 @@ note_decline( $f_id ); } - $row = select_queued_notes_arr(); + $result = note_queue(); + $row = db_fetch_array( $result ); if ( $row ) { extract( $row, EXTR_PREFIX_ALL, "v" ); $v_note = string_edit( $v_note ); --- css_inc.php DELETED --- |