vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   print_submit_row() (https://vborg.vbsupport.ru/showthread.php?t=229443)

sheppardzwc 12-03-2009 02:49 PM

print_submit_row()
 
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?

PHP Code:

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_idfalsefalse'editquote'''''false'POST''');
    
print_input_row('Author:''quote_author'$fetched_quote_author'false'35'50''right');
    
print_textarea_row('Quote:''quote_text'$fetched_quote_text550falsetrue'right');
    
print_submit_row('update');



The HTML that is outputted is this: (omitted the cp header)

HTML Code:

<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&amp;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=&quot;quote_author&quot;" /></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,scrollbars=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=&quot;quote_text&quot;">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 -->


kh99 12-03-2009 03:17 PM

Looking at adminfunctions.php, print_submit_row calls print_table_footer, which looks like it only prints out the table tags if the global "$tableadded" is true.

ETA:.. and it looks like print_form_header either calls print_table_start or else sets $tableadded to false (and you're passing "false" for the 4th parameter, so $tableadded is getting set to false).

Maybe you can just move the print_table_start after the print_form_header?

sheppardzwc 12-03-2009 04:19 PM

Quote:

Originally Posted by kh99 (Post 1924774)
Looking at adminfunctions.php, print_submit_row calls print_table_footer, which looks like it only prints out the table tags if the global "$tableadded" is true.

ETA:.. and it looks like print_form_header either calls print_table_start or else sets $tableadded to false (and you're passing "false" for the 4th parameter, so $tableadded is getting set to false).

Maybe you can just move the print_table_start after the print_form_header?

Yep, did that, and it works perfectly now. Thanks. :)


All times are GMT. The time now is 03:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00961 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete