File: detail_request.php

package info (click to toggle)
ibwebadmin 0.98-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,892 kB
  • ctags: 1,965
  • sloc: php: 12,454; makefile: 7
file content (104 lines) | stat: -rw-r--r-- 3,390 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
// File           jsrs/detail_request.php / ibWebAdmin
// Purpose        answer to the requests send by a 'toggle detail' link for views, tables, ...
// Author         Lutz Brueckner <irie@gmx.de>
// Copyright      (c) 2000, 2001, 2002, 2003, 2004 by Lutz Brueckner,
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
// Created        <14/01/03 23:01:18 lb>
//
// $Id: detail_request.php,v 1.12 2004/03/31 20:02:53 lbrueckner Exp $

require('../inc/configuration.inc.php');
require('../inc/session.inc.php');

session_start();
localize_session_vars();

require('../lang/' . (isset($s_cust) ? $s_cust['language'] : LANGUAGE) . '.inc.php');
require('../inc/functions.inc.php');
require('../inc/panel_elements.inc.php');
require('./jsrsServer.php.inc');

if (DEBUG === TRUE) {
    include('../inc/debug_funcs.inc.php');
}

$dbhandle = db_connect();

// guess the server
list($family, $version) = server_info($s_login['server']);
define('SERVER_FAMILY', $family);
define('SERVER_VERSION', $version);


$icon_path = DATAPATH . (BG_TRANSPARENT == TRUE ? 'transparent/' : 'opaque/') . strtolower(ICON_SIZE) . '/';
$red_triangle_icon   = $icon_path.'red_triangle.png';


// answer to the request with the result of get_fk_values()
jsrsDispatch('get_detail');


// build the answer for the jsrs request
function get_detail($type, $name, $title) {

    switch ($type) {
        case 'table':
            $url  = fold_detail_url('table', 'open', $name, $title);
            $html = get_opened_table($name, $title, $url);
            $id = 't_'.$name;

            $GLOBALS['s_tables'][$name]['status'] = 'open';
            break;

        case 'view':
            include('../inc/views.inc.php');

            $url  = fold_detail_url('view', 'open', $name, $title);
            $html = get_opened_view($name, $title, $url);
            $id = 'v_'.$name;

            $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);
            }

            $url  = fold_detail_url('trigger', 'open', $name, $title);
            $html = get_opened_trigger($name, $GLOBALS['s_triggers'][$name], $url);
            $id = 'r_'.$name;

            $GLOBALS['s_triggers'][$name]['display'] = 'open';
            break;

        case 'procedure':
            include('../inc/procedures.inc.php');
            include('../inc/interbase.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;
            }

            $url  = fold_detail_url('procedure', 'open', $name, $title);
            $html = get_opened_procedure($name, $GLOBALS['s_procedures'][$name], $url);
            $id = 'p_'.$name;

            $GLOBALS['s_procedures'][$name]['status'] = 'open';
            break;
    }

    globalize_session_vars();

    return jsrsArrayToString(array($id, $html), $delim='~');
}

?>