sheppardzwc
12-03-2009, 02:49 PM
Making a page for my modification in AdminCP. I've done all the forms, etc., now I just want to close it with the Submit/Reset buttons. I read the API and "print_submit_row()" should do the trick, but it's not outputting anything for me. Little help?
if($_REQUEST['do'] == 'modify' && $_REQUEST['id']) {
// construct page
echo('<center>You may modify the quote you selected below.<br /><br />');
print_table_start(false);
print_table_header(construct_phrase($vbphrase['quote_manager_tableheader_modify'], 'test'), 2);
print_form_header('quotes', 'update&id=' . $fetched_quote_id, false, false, 'editquote', '', '', false, 'POST', '');
print_input_row('Author:', 'quote_author', $fetched_quote_author, 'false', 35, '50', 'right');
print_textarea_row('Quote:', 'quote_text', $fetched_quote_text, 5, 50, false, true, 'right');
print_submit_row('update');
}
The HTML that is outputted is this: (omitted the cp header)
<center>You may modify the quote you selected below.<br /><br />
<table cellpadding="4" cellspacing="0" border="0" align="center" width="90%" style="border-collapse:separate" class="tborder">
<tr>
<td class="tcat" align="center" colspan="2"><b>Modify the Quote: "test"</b></td>
</tr>
<!-- form started:7 queries executed -->
<form action="quotes.php?do=update&id=2" method="POST" name="editquote" id="editquote">
<input type="hidden" name="do" value="update&id=2" />
<input type="hidden" name="adminhash" value="ee0389545d36fcce66896b36fd23154d" />
<input type="hidden" name="securitytoken" value="1259858902-85a74053c7902718053fc6676df886110b4955fc" />
<tr valign="top">
<td class="alt1">Author:</td>
<td class="alt1"><div id="ctrl_quote_author"><input type="text" class="bginput" name="quote_author" id="it_quote_author_1" value="Unknown" size="35" maxlength="50" dir="ltr" tabindex="1" title="name="quote_author"" /></div></td>
</tr>
<tr valign="top">
<td class="alt2">Quote:<p><input type="button" unselectable="on" value="Large Edit Box" class="button" style="font-weight:normal" onclick="window.open('textarea.php?dir=ltr&name=quote_text','textpopup','resizable=yes,scroll bars=yes,width=' + (screen.width - (screen.width/10)) + ',height=600');" /></p></td>
<td class="alt2"><div id="ctrl_quote_text"><textarea name="quote_text" id="ta_quote_text_2" rows="5" cols="50" wrap="virtual" dir="ltr" tabindex="1" title="name="quote_text"">I was standing in the park wondering why frisbees got bigger as they get closer. Then it hit me.</textarea><div class="smallfont"><a href="#" onclick="return resize_textarea(1, 'ta_quote_text_2')">Increase Size</a> <a href="#" onclick="return resize_textarea(-1, 'ta_quote_text_2')">Decrease Size</a></div></div></td>
</tr>
<p align="center"></p>
</form>
<!-- form ended: 7 queries executed -->
if($_REQUEST['do'] == 'modify' && $_REQUEST['id']) {
// construct page
echo('<center>You may modify the quote you selected below.<br /><br />');
print_table_start(false);
print_table_header(construct_phrase($vbphrase['quote_manager_tableheader_modify'], 'test'), 2);
print_form_header('quotes', 'update&id=' . $fetched_quote_id, false, false, 'editquote', '', '', false, 'POST', '');
print_input_row('Author:', 'quote_author', $fetched_quote_author, 'false', 35, '50', 'right');
print_textarea_row('Quote:', 'quote_text', $fetched_quote_text, 5, 50, false, true, 'right');
print_submit_row('update');
}
The HTML that is outputted is this: (omitted the cp header)
<center>You may modify the quote you selected below.<br /><br />
<table cellpadding="4" cellspacing="0" border="0" align="center" width="90%" style="border-collapse:separate" class="tborder">
<tr>
<td class="tcat" align="center" colspan="2"><b>Modify the Quote: "test"</b></td>
</tr>
<!-- form started:7 queries executed -->
<form action="quotes.php?do=update&id=2" method="POST" name="editquote" id="editquote">
<input type="hidden" name="do" value="update&id=2" />
<input type="hidden" name="adminhash" value="ee0389545d36fcce66896b36fd23154d" />
<input type="hidden" name="securitytoken" value="1259858902-85a74053c7902718053fc6676df886110b4955fc" />
<tr valign="top">
<td class="alt1">Author:</td>
<td class="alt1"><div id="ctrl_quote_author"><input type="text" class="bginput" name="quote_author" id="it_quote_author_1" value="Unknown" size="35" maxlength="50" dir="ltr" tabindex="1" title="name="quote_author"" /></div></td>
</tr>
<tr valign="top">
<td class="alt2">Quote:<p><input type="button" unselectable="on" value="Large Edit Box" class="button" style="font-weight:normal" onclick="window.open('textarea.php?dir=ltr&name=quote_text','textpopup','resizable=yes,scroll bars=yes,width=' + (screen.width - (screen.width/10)) + ',height=600');" /></p></td>
<td class="alt2"><div id="ctrl_quote_text"><textarea name="quote_text" id="ta_quote_text_2" rows="5" cols="50" wrap="virtual" dir="ltr" tabindex="1" title="name="quote_text"">I was standing in the park wondering why frisbees got bigger as they get closer. Then it hit me.</textarea><div class="smallfont"><a href="#" onclick="return resize_textarea(1, 'ta_quote_text_2')">Increase Size</a> <a href="#" onclick="return resize_textarea(-1, 'ta_quote_text_2')">Decrease Size</a></div></div></td>
</tr>
<p align="center"></p>
</form>
<!-- form ended: 7 queries executed -->