1
phillipd
Has anyone had trouble with admin scripts and smarty?
  • 2004/11/12 2:28

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I'm doing an "admin" script and trying to use smarty. The script works ok the first pass through, it sets up my form and display's everything properly, but then when I put a hidden op and button in the form and press the button, the op is never passed and I can't pass control to another part of the script with the typical if ($op == 'whatever') .

Has anyone else seen this behavior? It's as though it's ignoring the hidden op:


$op_submit = new XoopsFormHidden("op""submit");
    
$submit_button = new XoopsFormButton("""""Set as Default""submit");

    
$form = new XoopsThemeForm("""layerform""setlayers.php");

    
$form->addElement($tray_defaults);
    
$form->addElement($submit_button);
    
$form->addElement($op_submit);

    
$form->assign($xoopsTpl);
    
$xoopsTpl->display('db:'.$xoopsOption['template_main']);


Thanks

Doug P

2
Dave_L
Re: Has anyone had trouble with admin scripts and smarty?
  • 2004/11/12 3:06

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Does the hidden field show up if you view the source to the generated web page?

Can you access the value of the field with $_POST['op']? For example,

$op = @$_POST['op'];
if (
$op == 'whatever') {

3
phillipd
Re: Has anyone had trouble with admin scripts and smarty?
  • 2004/11/12 3:18

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I'm really sorry, I had a if in the template with no else:

<{if $element.hidden != true}>

and forgot to put:

<{else}>
                <{
$element.body}>
            <{/if}>

It's working fine now. (Sheepish grin)

Thanks

Doug P

Login

Who's Online

354 user(s) are online (241 user(s) are browsing Support Forums)


Members: 0


Guests: 354


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits