source: branches/unified_backend/plugins/Linker/backend.php @ 123

Last change on this file since 123 was 123, checked in by yermol, 15 years ago

missed including plugins/Linker/backend.php.

File size: 2.7 KB
Line 
1<?php
2
3/**
4* Unified backend for Linker
5*
6* Linker was originally developed by:
7*  James Sleeman http://www.gogo.co.nz, Gogo Internet Services
8*
9* Unified backend sponsored by DTLink Software, http://www.dtlink.com
10* Implementation by Yermo Lamers, http://www.formvista.com/contact.html
11*
12* (c) DTLink, LLC 2005.
13* Distributed under the same terms as HTMLArea itself.
14* This notice MUST stay intact for use (see license.txt).
15*
16* backend.php expects at least two URL variable parameters:
17*
18* __plugin=Linker   for future expansion; identify the plugin being requested.
19* __function=scan  function being called.
20*
21* Having a single entry point that strictly adheres to a defined interface will
22* make the backend code much easier to maintain and expand. It will make it easier
23* on integrators, not to mention it'll make it easier to have separate
24* implementations of the backend in different languages (Perl, Python, ASP, etc.)
25*/
26
27/**
28* master configuration file.
29*
30* we assume our current working directory is xinha/plugins/Linker
31*/
32
33require_once('../../backends/backend_conf.php');
34
35/**
36* debug message library
37*/
38
39include_once( XINHA_INSTALL_ROOT . "/ddt/ddt.php" );
40
41// uncomment to turn on debugging
42// _ddtOn();
43
44// ---------------------------------------------------------------
45
46/**
47* Liner backend callback
48*
49* After including this file, the unified backend.php script
50* will call this function
51*/
52
53function linker_callback( $formVars )
54{
55
56_ddt( __FILE__, __LINE__, "backend.php: top with query '" . $_SERVER["PHP_SELF"] . "' string '" . $_SERVER["QUERY_STRING"] . "'" );
57
58// make sure the request is for us (this gives us the ability to eventually organize
59// a backend event handler system) For an include file the return doesn't make alot of
60// sense but eventually we'll want to reorganize this.
61
62if ( @$formVars[ "__plugin" ] != "Linker" )
63        {
64        // not for us.
65
66        _ddt( __FILE__, __LINE__, "request was not for us" );
67
68        return true;
69        }
70
71// so we don't have to re-engineer the entire thing right now, since it's probably
72// going to get rewritten anyway, we just include the correct file based on the
73// function request.
74
75_ddt( __FILE__, __LINE__, "backend.php(): handling function '" . @$formVars[ "__function" ] . "'" );
76
77switch ( @$formVars[ "__function" ] )
78        {
79
80        case "scan":
81
82                include_once( XINHA_INSTALL_ROOT . "/plugins/Linker/scan.php" );
83                exit();
84               
85                break;
86
87        case "dialog":
88
89                include_once( XINHA_INSTALL_ROOT . "/plugins/Linker/dialog.html" );
90                exit();
91               
92                break;
93
94        default:
95
96                _ddt( __FILE__, __LINE__, "function request not supported" );
97                _error( __FILE__, __LINE__, "function request not supported" );
98
99                break;
100
101        }       // end of switch.
102
103return false ;
104
105}       // end of linker_callback
106
107// END
108
109?>
Note: See TracBrowser for help on using the repository browser.