Ejemplo n.º 1
0
     if (create_trigger($s_triggerdefs) == TRUE) {
         $s_triggers[$s_triggerdefs['name']] = $s_triggerdefs;
         $s_triggers[$s_triggerdefs['name']]['display'] = 'open';
         $s_triggerdefs = array();
         $s_triggers_valid = FALSE;
     } else {
         $trigger_add_flag = TRUE;
     }
 }
 // the Modify button on the Triggers panel was pushed
 if (isset($_POST['acc_trigger_mod']) && $_POST['acc_trigger_mod_name'] != '') {
     $mname = $_POST['acc_trigger_mod_name'];
     $s_triggerdefs = $s_triggers[$mname];
     $s_triggerdefs['name'] = $mname;
     if (empty($s_triggers[$s_triggerdefs['name']]['source'])) {
         $s_triggers[$s_triggerdefs['name']]['source'] = get_trigger_source($s_triggerdefs['name']);
     }
     $s_triggerdefs['source'] = $s_triggers[$s_triggerdefs['name']]['source'] . "!!";
     $trigger_mod_flag = TRUE;
 }
 // modify the trigger ...
 if (isset($_POST['acc_trigger_mod_doit'])) {
     $oldname = $s_triggerdefs['name'];
     save_triggerdefs();
     if (modify_trigger($oldname, $s_triggerdefs) == TRUE) {
         unset($s_triggers[$oldname]);
         $s_triggers[$s_triggerdefs['name']] = $s_triggerdefs;
         $s_triggers[$s_triggerdefs['name']]['display'] = 'open';
         $s_triggerdefs = array();
         $s_triggers_valid = FALSE;
     } else {
Ejemplo n.º 2
0
function toggle_all_triggers($triggers, $status)
{
    foreach (array_keys($triggers) as $name) {
        $triggers[$name]['display'] = $status;
        if ($status == 'open' && empty($triggers[$name]['source'])) {
            $triggers[$name]['source'] = get_trigger_source($name);
        }
    }
    return $triggers;
}
function detail_view($type, $name, $title)
{
    $url = fold_detail_url($type, 'open', $name, $title);
    $comment_url = "javascript:requestCommentArea('" . $type . "', '" . $name . "');";
    $comment_div = detail_div_prefix($type) . 'c_' . $name;
    switch ($type) {
        case 'table':
            if ($GLOBALS['s_tables_def'] == TRUE) {
                $GLOBALS['s_fields'] = get_table_defaults_sources($name, $GLOBALS['s_fields']);
            }
            $html = get_opened_table($name, $title, $url, $comment_url, $comment_div);
            $GLOBALS['s_tables'][$name]['status'] = 'open';
            break;
        case 'view':
            include '../inc/views.inc.php';
            $html = get_opened_view($name, $title, $url);
            $GLOBALS['s_tables'][$name]['status'] = 'open';
            break;
        case 'trigger':
            include '../inc/triggers.inc.php';
            if (empty($GLOBALS['s_triggers'][$name]['source'])) {
                $GLOBALS['s_triggers'][$name]['source'] = get_trigger_source($name);
            }
            $html = get_opened_trigger($name, $GLOBALS['s_triggers'][$name], $url);
            $GLOBALS['s_triggers'][$name]['display'] = 'open';
            break;
        case 'procedure':
            include '../inc/procedures.inc.php';
            include '../inc/firebird.inc.php';
            if (empty($GLOBALS['s_procedures'][$name]['source'])) {
                $GLOBALS['s_procedures'][$name]['source'] = get_procedure_source($name);
                list($in, $out) = get_procedure_parameters($name);
                $GLOBALS['s_procedures'][$name]['in'] = $in;
                $GLOBALS['s_procedures'][$name]['out'] = $out;
            }
            $html = get_opened_procedure($name, $GLOBALS['s_procedures'][$name], $url);
            $GLOBALS['s_procedures'][$name]['status'] = 'open';
            break;
    }
    header('Content-Type: text/html;charset=' . $GLOBALS['charset']);
    echo $html;
}