printTrail('operator'); $misc->printTitle($lang['strproperties'],'pg.operator'); $misc->printMsg($msg); $oprdata = $data->getOperator($_REQUEST['operator_oid']); $oprdata->fields['oprcanhash'] = $data->phpBool($oprdata->fields['oprcanhash']); if ($oprdata->recordCount() > 0) { echo "
{$lang['strname']} | \n"; echo "", $misc->printVal($oprdata->fields['oprname']), " |
---|---|
{$lang['strleftarg']} | \n"; echo "", $misc->printVal($oprdata->fields['oprleftname']), " |
{$lang['strrightarg']} | \n"; echo "", $misc->printVal($oprdata->fields['oprrightname']), " |
{$lang['strcommutator']} | \n"; echo "", $misc->printVal($oprdata->fields['oprcom']), " |
{$lang['strnegator']} | \n"; echo "", $misc->printVal($oprdata->fields['oprnegate']), " |
{$lang['strjoin']} | \n"; echo "", $misc->printVal($oprdata->fields['oprjoin']), " |
{$lang['strhashes']} | \n"; echo "", ($oprdata->fields['oprcanhash']) ? $lang['stryes'] : $lang['strno'], " |
{$lang['strmerges']} | \n"; echo "", ($oprdata->fields['oprlsortop'] !== '0' && $oprdata->fields['oprrsortop'] !== '0') ? $lang['stryes'] : $lang['strno'], " |
{$lang['strrestrict']} | \n"; echo "", $misc->printVal($oprdata->fields['oprrest']), " |
{$lang['strleftsort']} | \n"; echo "", $misc->printVal($oprdata->fields['oprlsortop']), " |
{$lang['strrightsort']} | \n"; echo "", $misc->printVal($oprdata->fields['oprrsortop']), " |
{$lang['strlessthan']} | \n"; echo "", $misc->printVal($oprdata->fields['oprltcmpop']), " |
{$lang['strgreaterthan']} | \n"; echo "", $misc->printVal($oprdata->fields['oprgtcmpop']), " |
{$lang['strmerges']} | \n"; echo "", $data->phpBool($oprdata->fields['oprcanmerge']) ? $lang['stryes'] : $lang['strno'], " |
", sprintf($lang['strconfdropoperator'], $misc->printVal($_REQUEST['operator'])), "
\n"; echo "\n"; } else { $status = $data->dropOperator($_POST['operator_oid'], isset($_POST['cascade'])); if ($status == 0) doDefault($lang['stroperatordropped']); else doDefault($lang['stroperatordroppedbad']); } } /** * Show default list of operators in the database */ function doDefault($msg = '') { global $data, $conf, $misc; global $lang; $misc->printTrail('schema'); $misc->printTabs('schema','operators'); $misc->printMsg($msg); $operators = $data->getOperators(); $columns = array( 'operator' => array( 'title' => $lang['stroperator'], 'field' => field('oprname'), 'url' => "operators.php?action=properties&{$misc->href}&", 'vars' => array('operator' => 'oprname', 'operator_oid' => 'oid'), ), 'leftarg' => array( 'title' => $lang['strleftarg'], 'field' => field('oprleftname'), ), 'rightarg' => array( 'title' => $lang['strrightarg'], 'field' => field('oprrightname'), ), 'returns' => array( 'title' => $lang['strreturns'], 'field' => field('resultname'), ), 'actions' => array( 'title' => $lang['stractions'], ), 'comment' => array( 'title' => $lang['strcomment'], 'field' => field('oprcomment'), ), ); $actions = array( 'drop' => array( // 'title' => $lang['strdrop'], // 'url' => "operators.php?action=confirm_drop&{$misc->href}&", // 'vars' => array('operator' => 'oprname', 'operator_oid' => 'oid'), 'content' => $lang['strdrop'], 'attr'=> array ( 'href' => array ( 'url' => 'operators.php', 'urlvars' => array ( 'action' => 'confirm_drop', 'operator' => field('oprname'), 'operator_oid' => field('oid') ) ) ) ) ); $misc->printTable($operators, $columns, $actions, 'operators-operators', $lang['strnooperators']); // TODO operators.php action=create $lang['strcreateoperator'] } /** * Generate XML for the browser tree. */ function doTree() { global $misc, $data; $operators = $data->getOperators(); // Operator prototype: "type operator type" $proto = concat(field('oprleftname'), ' ', field('oprname'), ' ', field('oprrightname')); $reqvars = $misc->getRequestVars('operator'); $attrs = array( 'text' => $proto, 'icon' => 'Operator', 'toolTip'=> field('oprcomment'), 'action' => url('operators.php', $reqvars, array( 'action' => 'properties', 'operator' => $proto, 'operator_oid' => field('oid') ) ) ); $misc->printTree($operators, $attrs, 'operators'); exit; } if ($action == 'tree') doTree(); $misc->printHeader($lang['stroperators']); $misc->printBody(); switch ($action) { case 'save_create': if (isset($_POST['cancel'])) doDefault(); else doSaveCreate(); break; case 'create': doCreate(); break; case 'drop': if (isset($_POST['cancel'])) doDefault(); else doDrop(false); break; case 'confirm_drop': doDrop(true); break; case 'properties': doProperties(); break; default: doDefault(); break; } $misc->printFooter(); ?>