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
105
106
|
<?php /** * SPAW Editor v.2 Standard dialog window * * Standard dialog window * @package spaw2 * @subpackage Dialogs * @author Alan Mendelevich <alan@solmetra.lt> * @copyright UAB Solmetra */ session_start(); if (!isset($_SESSION['ulogged']) || $_SESSION['ulogged'] != 1 || !isset($_SESSION['uname']) || !isset($_SESSION['uid'])) { unset($_SESSION['ulogged']); unset($_SESSION['uname']); unset($_SESSION['uid']); header('location:/index.php'); exit(); } error_reporting(E_ALL); include_once("../spaw.inc.php"); $module = SpawVars::getGetVar("module"); if (strpos($module, '/') || strpos($module, "\\")) die("illegal module name"); $dialog = SpawVars::getGetVar("dialog"); if (strpos($dialog, '/') || strpos($dialog, "\\")) die("illegal dialog name"); $lang = new SpawLang(SpawVars::getGetVar("lang")); $charset = $lang->getCharset(); if (SpawVars::getGetVar('charset') != '') { $charset = SpawVars::getGetVar('charset'); $lang->setOutputCharset($charset); }
if (SpawVars::getGetVar("scid") != '') session_start(); $config = new SpawConfig(); $config->restoreSecureConfig(SpawVars::getGetVar("scid"));
$theme = SpawTheme::getTheme(SpawVars::getGetVar("theme")); $htpl = $theme->getTemplateDialogHeader(); $htpl = str_replace('{SPAW DIALOG TITLE}', $lang->m('title', $dialog, $module), $htpl); $htpl = str_replace('{SPAW DIR}', SpawConfig::getStaticConfigValue('SPAW_DIR'), $htpl); $ftpl = $theme->getTemplateDialogFooter(); $ftpl = str_replace('{SPAW DIR}', SpawConfig::getStaticConfigValue('SPAW_DIR'), $ftpl);
ob_start(); ?> <html> <head> <title><?php echo $lang->m('title', $dialog, $module) ?></title> <meta http-equiv="content-type" content="text/html;charset=<?php echo $charset ?>" /> <script type="text/javascript" src="../js/spaw.js.php"></script> <script type="text/javascript"> <!-- SpawEngine.spaw_dir = "<?php echo SpawConfig::getStaticConfigValue('SPAW_DIR') ?>";
function SpawDialog() { } SpawDialog.resizeDialogToContent = function() { if (window.sizeToContent) { // gecko window.sizeToContent(); } else { // resize window so there are no scrollbars visible window.resizeTo(600, 500); var dw = 600 - document.body.clientWidth; var hw = 500 - document.body.clientHeight; window.resizeTo(50, 40); window.resizeTo(document.body.scrollWidth + dw, document.body.scrollHeight + hw); } }
var spawArgs; var spawEditor; var spawArguments;
SpawDialog.dialogInit = function() { SpawDialog.resizeDialogToContent(); if (window.opener) { spawArgs = window.opener.dialogArguments; if (spawArgs == null) window.close(); spawEditor = spawArgs.editor; spawArguments = spawArgs.arguments; } } //--> </script> </head> <body onload="SpawDialog.dialogInit();"> <?php echo $htpl ?> <?php include(SpawConfig::getStaticConfigValue('SPAW_ROOT').'plugins/'.$module.'/dialogs/'.$dialog.'.inc.php'); ?> <?php echo $ftpl ?> </body> </html> <?php ob_end_flush(); ?>
|