From: <vb...@us...> - 2002-09-04 07:11:28
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv26505/core Modified Files: api.php Log Message: Used heredoc format rather than a lot of PRINT commands Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- api.php 3 Sep 2002 22:30:06 -0000 1.9 +++ api.php 4 Sep 2002 07:11:24 -0000 1.10 @@ -21,8 +21,8 @@ } } - $t_path_main = dirname( dirname( __FILE__ ) ) . '/'; # DIRECTORY_SEPARATOR; - $t_path_core = $t_path_main . 'core' . '/'; # DIRECTORY_SEPARATOR; + $t_path_main = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR; + $t_path_core = $t_path_main . 'core' . DIRECTORY_SEPARATOR; # The $g_ext can not be used before the custom config is included. require_once( $t_path_core . 'php_api.php' ); @@ -138,70 +138,62 @@ $result = db_query( $query ); $num_notes = db_num_rows( $result ); - for ($i=0;$i<$num_notes;$i++) { + for ( $i = 0; $i < $num_notes; $i++ ) { $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v" ); $v_note = string_edit( $v_note ); - PRINT "<form method=\"post\" action=\"$g_admin_manage_notes\">"; - PRINT "<input type=\"hidden\" name=\"f_action\" value=\"update\" />"; - PRINT "<input type=\"hidden\" name=\"f_id\" value=\"$v_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_page_id\" value=\"$p_page_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_url\" value=\"$p_url\" />"; - PRINT "<tr bgcolor=\"$g_white_color\" height=\"4\">"; - PRINT "<td colspan=\"2\">"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_light_color\">"; - PRINT "<td>"; - PRINT "$s_date"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "$v_date_submitted"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td>"; - PRINT "$s_email"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "<input type=text name=f_email size=64 maxlength=64 value=\"$v_email\" />"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_light_color\">"; - PRINT "<td>"; - PRINT "$s_ip"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "$v_ip"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td>"; - PRINT "$s_note"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "<textarea name=\"f_note\" cols=\"72\" rows=\"16\">$v_note</textarea>"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_white_color\">"; - PRINT "<td colspan=\"2\">"; - PRINT "<table width=\"100%\"><tr><td>"; - PRINT "<td width=\"50%\" align=\"center\">"; - PRINT "<input type=\"submit\" value=\"$s_update_button\" />"; - PRINT "</td>"; - PRINT "</form>"; - PRINT "<form method=\"post\" action=\"$g_admin_manage_notes\">"; - PRINT "<input type=\"hidden\" name=\"f_action\" value=\"delete\" />"; - PRINT "<input type=\"hidden\" name=\"f_id\" value=\"$v_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_page_id\" value=\"$p_page_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_url\" value=\"$p_url\" />"; - PRINT "<td width=\"50%\" align=\"center\">"; - PRINT "<input type=\"submit\" value=\"$s_delete_button\" />"; - PRINT "</td></tr></table>"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "</form>"; + # @@@@ The HTML below has some problems... revise later + echo <<<EOT + <form method="post" action="$g_admin_manage_notes"> + <input type="hidden" name="f_action" value="update" /> + <input type="hidden" name="f_id" value="$v_id" /> + <input type="hidden" name="f_page_id" value="$p_page_id" /> + <input type="hidden" name="f_url" value="$p_url" /> + <tr bgcolor="$g_white_color" height="4"> + <td colspan="2"></td> + </tr> + <tr bgcolor="$g_primary_light_color"> + <td>$s_date</td> + <td>$v_date_submitted</td> + </tr> + <tr bgcolor="$g_primary_dark_color"> + <td>$s_email</td> + <td><input type="text" name="f_email" size="64" maxlength="64" value="$v_email" /></td> + </tr> + <tr bgcolor="$g_primary_light_color"> + <td>$s_ip</td> + <td>$v_ip</td> + </tr> + <tr bgcolor="$g_primary_dark_color"> + <td>$s_note</td> + <td><textarea name="f_note" cols="72" rows="16">$v_note</textarea></td> + </tr> + <tr bgcolor="$g_white_color"> + <td colspan="2"> + <table width="100%"> + <tr> + <td> + <td width="50%" align="center"> + <input type="submit" value="$s_update_button" /> + </td> + </form> + <form method="post" action="$g_admin_manage_notes"> + <input type="hidden" name="f_action" value="delete" /> + <input type="hidden" name="f_id" value="$v_id" /> + <input type="hidden" name="f_page_id" value="$p_page_id" /> + <input type="hidden" name="f_url" value="$p_url" /> + <td width="50%" align="center" + <input type="submit" value="$s_delete_button" /> + </form> + </td> + </tr> + </table> + </td> + </tr> + + +EOT; } } ### -------------------- |