")."\n"; //form end
} //end eform popup
// classic edit form with vertical layout, not popup
else {
$eform .= Keep("\n
")."\n"; //form end
} //end eform classic
fxc_Display_Editform($pagename, $eform, $args, $auth);
} //}}}
//injection style css into page HTML head
//some essential for popedit to get fixed position!
function fxc_Set_Editform_Styles($args) {
global $HTMLStylesFmt, $FoxCSVConfig;
if (isset($args['popedit'])) {
$position = (!empty($args['popbottom']))? 'bottom:0' : 'top:0';
$HTMLStylesFmt['csveditpopessential'] =
"#csvedit { position:fixed; $position; left:0; width:99vw; z-index:20;
padding:.4em; margin:0;}
.ebuttons { float:right;}
#epoptable { width:100%; margin:0; padding:0;}
#etitle {font-size:1.2em; margin-left:.4em;}
.efield {vertical-align:top;} .elabel { text-align:left; }
.csvinput { width:100%; min-width:2em; max-width:100%; padding:0;}
";
SDV($HTMLStylesFmt['csvedit'],
" #csvedit {background-color:hsl(50 100 97); border:2px solid hsl(50 100 60); }
.ebuttons .inputbutton { background:hsl(40 100 90); border-radius:5px; }
.ebuttons .inputbutton:hover { background:hsl(40 100 80); cursor:pointer; }
"
);
}
else SDV($HTMLStylesFmt['csveditclassic'],
"#csvedit {width:97%; margin:.5em; padding:.4em; }
.ebuttons {float:right; margin-right:2em;}
td .ebuttons { float:left; margin-top:.25em;}
#eclassictable {width:80%; margin:0.5em;}
#eclassictable textarea { height:6em;}
#ecolLabel {width:15%;} #ecolInput {width:60%;}
#etitle {font-size:1.2em; margin-left:.4em; font-weight:600;}
.efield {vertical-align:top;}
.elabel {text-align:right; padding-right:.25em;}
.csvinput {width:100%; min-width:2em; max-width:100%; }
"
);
return;
} //}}}
//retrieve edit form from page or page section
function fxc_Get_Custom_Edit_Form($pagename, $formpage) {
if (empty($formpage)) return;
$eform = '';
if (substr($formpage,0,1)=='#') $formpage = $pagename.$formpage;
$formname = MakePagename($pagename, $formpage);
if (PageExists($formname)) {
$text = RetrieveAuthSection($formname, $formpage);
if(empty($text)) FoxAbort($pagename,"$[Error: cannot find edit template] $formpage");
$eform = "\n(:div11 class=csveditform:)\n".$text."\n(:div11end:)";
}
return $eform;
} //}}}
function fxc_Display_Editform($pagename, $eform, $args, $auth) {
global $FoxCSVConfig, $EditBase, $FmtV, $FoxEditForm, $PageStartFmt, $FoxPageEditFmt, $PageEndFmt;
//popedit adds text of base page (the calling page) after eform
if (!empty($args['popedit'])) {
$basepage = MakePagename($pagename, $EditBase);
if (PageExists($basepage))
$text = RetrieveAuthSection($basepage, $basepage);
$eform = '(:groupheader:)'.$eform.@$text.'(:groupfooter:)';
}
//all Markup to HTML and print to screen
$FmtV['$FoxEditFrm'] = MarkupToHTML($pagename, $eform)."";
$FoxPageEditFmt = '$FoxEditFrm';
$HandleEditFmt = array(&$PageStartFmt, $FoxPageEditFmt, &$PageEndFmt);
PrintFmt($pagename, $HandleEditFmt);
} //}}}
// row edit (:csv-edit
[] [