26 require_once dirname(__FILE__).
'/../../../../core/include/init.inc';
27 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
28 require_once SQ_FUDGE_PATH.
'/var_serialise/var_serialise.inc';
30 if (empty($GLOBALS[
'SQ_SYSTEM']->user) || !($GLOBALS[
'SQ_SYSTEM']->user->canAccessBackend() || $GLOBALS[
'SQ_SYSTEM']->user->type() ==
'simple_edit_user')){
34 if (!isset($_GET[
'title'])) $_GET[
'title'] =
"";
36 $_GET[
'title'] = preg_replace(
'/[\'"\(\);\[\]{}<>=]+/',
'', $_GET[
'title']);
37 $_GET[
'dfn'] = preg_replace(
'/[\'"\(\);\[\]{}<>=]+/',
'', $_GET[
'dfn']);
40 <html style=
"width: 400px; height: 250px;">
42 <title>Insert Definition</title>
46 $include_list = Array(sq_web_path(
'lib').
'/js/translation.js');
48 $locales = $GLOBALS[
'SQ_SYSTEM']->lm->getCumulativeLocaleParts($GLOBALS[
'SQ_SYSTEM']->lm->getCurrentLocale());
50 foreach($locales as $locale) {
51 if (file_exists(SQ_DATA_PATH.
'/public/system/core/js_strings.'.$locale.
'.js')) {
52 $include_list[] = sq_web_path(
'data').
'/system/core/js_strings.'.$locale.
'.js';
56 foreach($include_list as $link) {
57 ?><script type=
"text/javascript" src=
"<?php echo $link; ?>"></script>
61 <script type=
"text/javascript" src=
"../../core/popup.js"></script>
62 <script type=
"text/javascript" src=
"<?php echo sq_web_path('fudge').'/var_serialise/var_serialise.js' ?>"></script>
63 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/html_form/html_form.js' ?>"></script>
64 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/js/general.js' ?>"></script>
66 <script type=
"text/javascript">
69 setTimeout(
'self.focus()',100);
73 __dlg_init(
"matrixInsertDfn");
74 setTimeout(
'self.focus()',100);
79 var fields = [
"title"];
80 var param =
new Object();
81 var f = document.main_form;
83 param[
"title"] = form_element_value(f.title);
84 param[
"dfn"] = form_element_value(f.dfn);
86 __dlg_close(
"matrixInsertDfn", param);
91 __dlg_close(
"matrixInsertDfn", null);
95 function buildForm() {
96 document.write(
'<tr>');
97 document.write(
'<td class="label"><?php echo translate('definition
'); ?>:</td>');
98 document.write(
'<td colspan="3"><?php text_box('dfn
', trim($_GET['dfn
']), 40, 0);?></td>');
99 document.write(
'</tr>');
100 document.write(
'<tr>');
101 document.write(
' <td class="label"><?php echo translate('title
'); ?>:</td>');
102 document.write(
' <td colspan="3"><?php text_box('title
', trim($_GET['title
']), 40, 0);?></td>');
103 document.write(
'</tr>');
108 <style type=
"text/css">
112 font: 11px Tahoma,Verdana,sans-serif;
119 font: 11px Tahoma,Verdana,sans-serif;
130 border-bottom: 1px solid black;
136 padding: 0px 10px 5px 5px;
137 border-color: #725B7D;
140 .fl { width: 9em;
float: left; padding: 2px 5px; text-align: right; }
141 .fr { width: 7em;
float: left; padding: 2px 5px; text-align: right; }
144 form { padding: 0px; margin: 0px; }
146 select, input, button {
147 font: 11px Tahoma,Verdana,sans-serif;
155 .buttonColor, .buttonColor-hilite {
158 border-color: #9E86AA #725B7D #725B7D #9E86AA;
161 .buttonColor-hilite {
162 border-color: #402F48;
165 .buttonColor-chooser, .buttonColor-nocolor, .buttonColor-nocolor-hilite {
169 border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
172 .buttonColor-nocolor, .buttonColor-nocolor-hilite { padding: 0px; }
173 .buttonColor-nocolor-hilite { background: #402F48; color: #FFFFFF; }
177 <body onload=
"Javascript: Init();">
178 <div
class=
"title"><?php echo translate(
'insert_definition'); ?></div>
179 <form action=
"" method=
"get" name=
"main_form">
180 <table width=
"100%" >
182 <td valign=
"top" width=
"100%">
184 <legend><b><?php echo translate(
'general'); ?></b></legend>
185 <table style=
"width:100%">
186 <script type=
"text/javascript">
195 <div style=
"margin-top: 5px; margin-right: 5px; text-align: right;">
197 <script type=
"text/javascript" language=
"javascript">
198 document.write(
'<button type="button" name="ok" onclick="return onOK();"><?php echo translate('ok
'); ?></button>');
200 <button type=
"button" name=
"cancel" onclick=
"return onCancel();"><?php echo translate(
'cancel'); ?></button>