12
Hi,
i am playing around with the xoopsformloader and need help with drop down menue and delete Buttons.
e.g. in the core module MyDownloads, Function modCat there is a drop down menu with the structure of main and sub categorys and a delete (and cancel) button:
function modCat()
{
global $xoopsDB, $HTTP_POST_VARS, $myts, $eh, $mytree;
$cid = $HTTP_POST_VARS["cid"];
xoops_cp_header();
echo "<h4>"._MD_DLCONF."</h4>";
echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
."<tr class="odd"><td>";
echo "<h4>"._MD_MODCAT."</h4><br />";
$result=$xoopsDB->query("SELECT pid, title, imgurl FROM ".$xoopsDB->prefix("mydownloads_cat")." WHERE cid=$cid");
list($pid,$title,$imgurl) = $xoopsDB->fetchRow($result);
$title = $myts->makeTboxData4Edit($title);
$imgurl = $myts->makeTboxData4Edit($imgurl);
echo "<form action=index.php method=post>"._MD_TITLEC."<input type=text name=title value="$title" size=51 maxlength=50><br /><br />"._MD_IMGURLMAIN."<br /><input type=text name=imgurl value="$imgurl" size=100 maxlength=150><br />
<br />"._MD_PARENT." ";
$mytree->makeMySelBox("title", "title", $pid, 1, "pid");
echo "<input type='hidden' name='cid' value='$cid'>
<input type=hidden name=op value=modCatS><br />
<input type=submit value=""._MD_SAVE."">
<input type=button value="._MD_DELETE." onClick="location='index.php?pid=$pid&cid=$cid&op=delCat'">";
echo " <input type=button value="._MD_CANCEL." onclick="javascript:history.go(-1)" />";
echo "</form>";
echo"</td></tr></table>";
xoops_cp_footer();
}
What would be the correct usage of xoopsformselect and xoopsformbutton to have the same functionality?
Maybe someone could "translate" the above function so that a php/xoops newb like me could see the difference?
Thanks