选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
setFunction($_POST['function_oid'], $_POST['original_function'], $_POST['formFunction'], $_POST['original_arguments'], $_POST['original_returns'], $def, $_POST['original_lang'], $_POST['formProperties'], isset($_POST['original_setof']), $_POST['formComment']); if ($status == 0) doProperties($lang['strfunctionupdated']); else doEdit($lang['strfunctionupdatedbad']); } /** * Function to allow editing of a Function */ function doEdit($msg = '') { global $data, $misc; global $PHP_SELF, $lang; $misc->printTrail('function'); $misc->printTitle($lang['stralter'],'pg.function.alter'); $misc->printMsg($msg); $fndata = $data->getFunction($_REQUEST['function_oid']); if ($fndata->recordCount() > 0) { $fndata->f['proretset'] = $data->phpBool($fndata->f['proretset']); // Initialise variables if (!isset($_POST['formDefinition'])) $_POST['formDefinition'] = $fndata->f['prosrc']; if (!isset($_POST['formProperties'])) $_POST['formProperties'] = $data->getFunctionProperties($fndata->f); if (!isset($_POST['formFunction'])) $_POST['formFunction'] = $fndata->f['proname']; if (!isset($_POST['formComment'])) $_POST['formComment'] = $fndata->f['procomment']; if (!isset($_POST['formObjectFile'])) $_POST['formObjectFile'] = $fndata->f['probin']; if (!isset($_POST['formLinkSymbol'])) $_POST['formLinkSymbol'] = $fndata->f['prosrc']; // Deal with named parameters if ($data->hasNamedParams()) { $args_arr = explode(', ', $fndata->f['proarguments']); $names_arr = $data->phpArray($fndata->f['proargnames']); $args = ''; $i = 0; for ($i = 0; $i < sizeof($args_arr); $i++) { if ($i != 0) $args .= ', '; if (isset($names_arr[$i]) && $names_arr[$i] != '') { $data->fieldClean($names_arr[$i]); $args .= '"' . $names_arr[$i] . '" '; } $args .= $args_arr[$i]; } } else { $args = $fndata->f['proarguments']; } $func_full = $fndata->f['proname'] . "(". $fndata->f['proarguments'] .")"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $fnlang = strtolower($fndata->f['prolanguage']); if ($fnlang == 'c') { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else if ($fnlang == 'internal') { echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } // Display function comment echo "\n"; echo "\n"; // Display function properies if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) { echo "\n"; echo "\n"; } echo "
{$lang['strfunction']}{$lang['strarguments']}{$lang['strreturns']}{$lang['strproglanguage']}
"; echo "f['proname']),"\" />\n"; echo "_maxNameLen}\" value=\"", htmlspecialchars($_POST['formFunction']), "\" />"; echo "", $misc->printVal($args), "\n"; echo "\n"; echo ""; if ($fndata->f['proretset']) echo "setof "; echo $misc->printVal($fndata->f['proresult']), "\n"; echo "f['proresult']), "\" />\n"; if ($fndata->f['proretset']) echo "\n"; echo "", $misc->printVal($fndata->f['prolanguage']), "\n"; echo "f['prolanguage']), "\" />\n"; echo "
{$lang['strobjectfile']}{$lang['strlinksymbol']}
{$lang['strlinksymbol']}
{$lang['strdefinition']}
{$lang['strcomment']}
{$lang['strproperties']}
\n"; $i = 0; foreach ($data->funcprops as $k => $v) { echo "
\n"; $i++; } echo "
\n"; echo "

\n"; echo "\n"; echo "\n"; echo $misc->form; echo "\n"; echo "

\n"; echo "
\n"; } else echo "

{$lang['strnodata']}

\n"; } /** * Show read only properties of a function */ function doProperties($msg = '') { global $data, $misc; global $PHP_SELF, $lang; $misc->printTrail('function'); $misc->printTitle($lang['strproperties'],'pg.function'); $misc->printMsg($msg); $funcdata = $data->getFunction($_REQUEST['function_oid']); if ($funcdata->recordCount() > 0) { // Deal with named parameters if ($data->hasNamedParams()) { $args_arr = explode(', ', $funcdata->f['proarguments']); $names_arr = $data->phpArray($funcdata->f['proargnames']); $args = ''; $i = 0; for ($i = 0; $i < sizeof($args_arr); $i++) { if ($i != 0) $args .= ', '; if (isset($names_arr[$i]) && $names_arr[$i] != '') { $data->fieldClean($names_arr[$i]); $args .= '"' . $names_arr[$i] . '" '; } $args .= $args_arr[$i]; } } else { $args = $funcdata->f['proarguments']; } // Show comment if any if ($funcdata->f['procomment'] !== null) echo "

", $misc->printVal($funcdata->f['procomment']), "

\n"; $funcdata->f['proretset'] = $data->phpBool($funcdata->f['proretset']); $func_full = $funcdata->f['proname'] . "(". $funcdata->f['proarguments'] .")"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $fnlang = strtolower($funcdata->f['prolanguage']); if ($fnlang == 'c') { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else if ($fnlang == 'internal') { echo "\n"; echo "\n"; } else { include_once('./libraries/highlight.php'); echo "\n"; // Check to see if we have syntax highlighting for this language if (isset($data->langmap[$funcdata->f['prolanguage']])) { $temp = syntax_highlight(htmlspecialchars($funcdata->f['prosrc']), $data->langmap[$funcdata->f['prolanguage']]); $tag = 'prenoescape'; } else { $temp = $funcdata->f['prosrc']; $tag = 'pre'; } echo "\n"; } // Show flags if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) { // Fetch an array of the function properties $funcprops = $data->getFunctionProperties($funcdata->f); echo "\n"; echo "\n"; } echo "
{$lang['strfunction']}{$lang['strarguments']}{$lang['strreturns']}{$lang['strproglanguage']}
", $misc->printVal($funcdata->f['proname']), "", $misc->printVal($args), ""; if ($funcdata->f['proretset']) echo "setof "; echo $misc->printVal($funcdata->f['proresult']), "", $misc->printVal($funcdata->f['prolanguage']), "
{$lang['strobjectfile']}{$lang['strlinksymbol']}
", $misc->printVal($funcdata->f['probin']), "", $misc->printVal($funcdata->f['prosrc']), "
{$lang['strlinksymbol']}
", $misc->printVal($funcdata->f['prosrc']), "
{$lang['strdefinition']}
", $misc->printVal($temp, $tag, array('lineno' => true, 'class' => 'data1')), "
{$lang['strproperties']}
\n"; foreach ($funcprops as $v) { echo $misc->printVal($v), "
\n"; } echo "
\n"; } else echo "

{$lang['strnodata']}

\n"; echo "

href}\">{$lang['strshowallfunctions']} |\n"; echo "href}&function=", urlencode($_REQUEST['function']), "&function_oid=", urlencode($_REQUEST['function_oid']), "\">{$lang['stralter']} |\n"; echo "href}&function=", urlencode($func_full), "&function_oid=", $_REQUEST['function_oid'], "\">{$lang['strdrop']}\n"; } /** * Show confirmation of drop and perform actual drop */ function doDrop($confirm) { global $data, $misc; global $PHP_SELF, $lang; if ($confirm) { $misc->printTrail('schema'); $misc->printTitle($lang['strdrop'],'pg.function.drop'); echo "

", sprintf($lang['strconfdropfunction'], $misc->printVal($_REQUEST['function'])), "

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo $misc->form; // Show cascade drop option if supportd if ($data->hasDropBehavior()) { echo "

\n"; } echo "\n"; echo "\n"; echo "
\n"; } else { $status = $data->dropFunction($_POST['function_oid'], isset($_POST['cascade'])); if ($status == 0) doDefault($lang['strfunctiondropped']); else doDefault($lang['strfunctiondroppedbad']); } } /** * Displays a screen where they can enter a new function */ function doCreate($msg = '',$szJS="") { global $data, $misc; global $PHP_SELF, $lang; $misc->printTrail('schema'); if (!isset($_POST['formFunction'])) $_POST['formFunction'] = ''; if (!isset($_POST['formArguments'])) $_POST['formArguments'] = ''; if (!isset($_POST['formReturns'])) $_POST['formReturns'] = ''; if (!isset($_POST['formLanguage'])) $_POST['formLanguage'] = isset($_REQUEST['language']) ? $_REQUEST['language'] : 'sql'; if (!isset($_POST['formDefinition'])) $_POST['formDefinition'] = ''; if (!isset($_POST['formObjectFile'])) $_POST['formObjectFile'] = ''; if (!isset($_POST['formLinkSymbol'])) $_POST['formLinkSymbol'] = ''; if (!isset($_POST['formProperties'])) $_POST['formProperties'] = $data->defaultprops; if (!isset($_POST['formSetOf'])) $_POST['formSetOf'] = ''; if (!isset($_POST['formArray'])) $_POST['formArray'] = ''; $types = $data->getTypes(true, true, true); $langs = $data->getLanguages(true); $fnlang = strtolower($_POST['formLanguage']); switch ($fnlang) { case 'c': $misc->printTitle($lang['strcreatecfunction'],'pg.function.create.c'); break; case 'internal': $misc->printTitle($lang['strcreateinternalfunction'],'pg.function.create.internal'); break; default: $misc->printTitle($lang['strcreateplfunction'],'pg.function.create.pl'); break; } $misc->printMsg($msg); // Create string for return type list $szTypes = ""; while (!$types->EOF) { $szSelected = ""; if($types->f['typname'] == $_POST['formReturns']) { $szSelected = " selected=\"selected\""; } $szTypes .= ""; $types->moveNext(); } $szFunctionName = "_maxNameLen}\" value=\"". htmlspecialchars($_POST['formFunction']) ."\" />"; $szArguments = ""; $szSetOfSelected = ""; $szNotSetOfSelected = ""; if($_POST['formSetOf'] == '') { $szNotSetOfSelected = " selected=\"selected\""; } else if($_POST['formSetOf'] == 'SETOF') { $szSetOfSelected = " selected=\"selected\""; } $szReturns = ""; $szReturns .= ""; $szReturns .= ""; // Create string array type selector $szArraySelected = ""; $szNotArraySelected = ""; if($_POST['formArray'] == '') { $szNotArraySelected = " selected=\"selected\""; } else if($_POST['formArray'] == '[]') { $szArraySelected = " selected=\"selected\""; } $szReturns .= "\n"; // Create string for language $szLanguage = ""; if ($fnlang == 'c' || $fnlang == 'internal') { $szLanguage .= $_POST['formLanguage'] . "\n"; $szLanguage .= "\n"; } else { $szLanguage .= "\n"; } $szLanguage .= ""; $szJSArguments = "{$lang['strarguments']}"; $arrayModes = array("IN","OUT","INOUT"); $szModes = ""; $szArgReturns = ""; if(!empty($conf['theme'])) { $szImgPath = "images/themes/{$conf['theme']}"; } else { $szImgPath = "images/themes/default"; } if(empty($msg)) { $szJSTRArg = "\n"; } else { $szJSTRArg = ""; } $szJSAddTR = "
\"Add{$lang['strargadd']}
"; echo " "; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "{$szFunctionName}\n"; echo "{$szReturns}\n"; echo "{$szLanguage}\n"; echo "\n"; echo "{$szJSArguments}\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "{$szJSAddTR}\n"; echo $szJSTRArg; if ($fnlang == 'c') { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else if ($fnlang == 'internal') { echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } // Display function properies if (is_array($data->funcprops) && sizeof($data->funcprops) > 0) { echo "\n"; echo "\n"; } echo "
{$lang['strname']}{$lang['strreturns']}{$lang['strproglanguage']}
{$lang['strargmode']}{$lang['strargname']}{$lang['strargtype']}
{$lang['strobjectfile']}{$lang['strlinksymbol']}
{$lang['strlinksymbol']}
{$lang['strdefinition']}
{$lang['strproperties']}
\n"; $i = 0; foreach ($data->funcprops as $k => $v) { echo "
\n"; $i++; } echo "
\n"; echo "

\n"; echo $misc->form; echo "\n"; echo "

\n"; echo "
\n"; echo $szJS; } /** * Actually creates the new function in the database */ function doSaveCreate() { global $data, $lang; $fnlang = strtolower($_POST['formLanguage']); if ($fnlang == 'c') { $def = array($_POST['formObjectFile'], $_POST['formLinkSymbol']); } else if ($fnlang == 'internal'){ $def = $_POST['formLinkSymbol']; } else { $def = $_POST['formDefinition']; } $szJS = ""; echo ""; echo ""; if(!empty($_POST["formArgName"])) { $szJS = buildJSRows(buildFunctionArguments($_POST)); } else { $szJS = ""; } // Check that they've given a name and a definition if ($_POST['formFunction'] == '') doCreate($lang['strfunctionneedsname'],$szJS); elseif ($fnlang != 'internal' && !$def) doCreate($lang['strfunctionneedsdef'],$szJS); else { // Append array symbol to type if chosen $status = $data->createFunction($_POST['formFunction'], empty($_POST["nojs"]) ? buildFunctionArguments($_POST) : $_POST["formArguments"], $_POST['formReturns'] . $_POST['formArray'] , $def , $_POST['formLanguage'], $_POST['formProperties'], $_POST['formSetOf'] == 'SETOF', false); if ($status == 0) doDefault($lang['strfunctioncreated']); else { doCreate($lang['strfunctioncreatedbad'],$szJS); } } } /** * Build out the function arguments string */ function buildFunctionArguments($arrayVars) { $arrayArgs = array(); foreach($arrayVars["formArgName"] as $pK => $pV) { $arrayArgs[] = $arrayVars["formArgModes"][$pK]." ". trim($pV) ." ". trim($arrayVars["formArgType"][$pK]) . $arrayVars["formArgArray"][$pK]; } return implode(",",$arrayArgs); } /** * Build out JS to re-create table rows for arguments */ function buildJSRows($szArgs) { $arrayModes = array("IN","OUT","INOUT"); $arrayArgs = explode(",",$szArgs); $arrayProperArgs = array(); $nC = 0; $szReturn = ""; foreach($arrayArgs as $pV) { $arrayWords = explode(" ",$pV); if(in_array($arrayWords[0],$arrayModes)===true) { $szMode = $arrayWords[0]; array_shift($arrayWords); } $szArgName = array_shift($arrayWords); if(strpos($arrayWords[count($arrayWords)-1],"[]")===false) { $szArgType = implode(" ",$arrayWords); $bArgIsArray = "false"; } else { $szArgType = str_replace("[]","",implode(" ",$arrayWords)); $bArgIsArray = "true"; } $arrayProperArgs[] = array($szMode,$szArgName,$szArgType,$bArgIsArray); $szReturn .= ""; $nC++; } return $szReturn; } function buildJSData() { global $data; $arrayModes = array("IN","OUT","INOUT"); $arrayTypes = $data->getTypes(true, true, true); $arrayPTypes = array(); $arrayPModes = array(); $szTypes = ""; foreach($arrayTypes as $pK => $pV) { $arrayPTypes[] = "'{$pV['typname']}'"; } foreach($arrayModes as $pV) { $arrayPModes[] = "'{$pV}'"; } $szTypes = "g_main_types = new Array(".implode(",",$arrayPTypes).");"; $szModes = "g_main_modes = new Array(".implode(",",$arrayPModes).");"; return $szTypes.$szModes; } /** * Show default list of functions in the database */ function doDefault($msg = '') { global $data, $conf, $misc, $func; global $PHP_SELF, $lang; $misc->printTrail('schema'); $misc->printTabs('schema','functions'); $misc->printMsg($msg); $funcs = $data->getFunctions(); $columns = array( 'function' => array( 'title' => $lang['strfunction'], 'field' => 'proproto', 'type' => 'verbatim', ), 'returns' => array( 'title' => $lang['strreturns'], 'field' => 'proreturns', 'type' => 'verbatim', ), 'owner' => array( 'title' => $lang['strowner'], 'field' => 'proowner', ), 'proglanguage' => array( 'title' => $lang['strproglanguage'], 'field' => 'prolanguage', ), 'actions' => array( 'title' => $lang['stractions'], ), 'comment' => array( 'title' => $lang['strcomment'], 'field' => 'procomment', ), ); $actions = array( 'properties' => array( 'title' => $lang['strproperties'], 'url' => "redirect.php?subject=function&action=properties&{$misc->href}&", 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'), ), 'alter' => array( 'title' => $lang['stralter'], 'url' => "{$PHP_SELF}?action=edit&{$misc->href}&", 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'), ), 'drop' => array( 'title' => $lang['strdrop'], 'url' => "{$PHP_SELF}?action=confirm_drop&{$misc->href}&", 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'), ), 'privileges' => array( 'title' => $lang['strprivileges'], 'url' => "privileges.php?{$misc->href}&subject=function&", 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'), ), ); if ( !$data->hasFuncPrivs() ) { unset($actions['privileges']); } $misc->printTable($funcs, $columns, $actions, $lang['strnofunctions']); echo "

href}\">{$lang['strcreateplfunction']} | "; echo "href}\">{$lang['strcreateinternalfunction']} | "; echo "href}\">{$lang['strcreatecfunction']}

\n"; } /** * Generate XML for the browser tree. */ function doTree() { global $misc, $data; $funcs = $data->getFunctions(); $proto = concat(field('proname'),' (',field('proarguments'),')'); $reqvars = $misc->getRequestVars('function'); $attrs = array( 'text' => $proto, 'icon' => 'Function', 'toolTip' => field('procomment'), 'action' => url('redirect.php', $reqvars, array( 'action' => 'properties', 'function' => $proto, 'function_oid' => field('prooid') ) ) ); $misc->printTreeXML($funcs, $attrs); exit; } if ($action == 'tree') doTree(); $misc->printHeader($lang['strfunctions']); $misc->printBody(); switch ($action) { case 'save_create': if (isset($_POST['cancel'])) doDefault(); else doSaveCreate(); break; case 'create': doCreate(); break; case 'drop': if (isset($_POST['drop'])) doDrop(false); else doDefault(); break; case 'confirm_drop': doDrop(true); break; case 'save_edit': if (isset($_POST['cancel'])) doDefault(); else doSaveEdit(); break; case 'edit': doEdit(); break; case 'properties': doProperties(); break; default: doDefault(); break; } $misc->printFooter(); ?>