Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
insert_acronym.php
1 <?php
25 require_once dirname(__FILE__).'/../../../../core/include/init.inc';
26 require_once SQ_LIB_PATH.'/html_form/html_form.inc';
27 require_once SQ_FUDGE_PATH.'/var_serialise/var_serialise.inc';
28 
29 if (empty($GLOBALS['SQ_SYSTEM']->user) || !($GLOBALS['SQ_SYSTEM']->user->canAccessBackend() || $GLOBALS['SQ_SYSTEM']->user->type() == 'simple_edit_user')){
30  exit;
31 }
32 
33 if (!isset($_GET['title'])) $_GET['title'] = "";
34 
35 ?>
36 
37 <html style="width: 400px; height: 200px;">
38  <head>
39  <title>Insert Acronym</title>
40 
41  <?php
42  //add required js translation files, as we are using asset finder
43  $include_list = Array(sq_web_path('lib').'/js/translation.js');
44 
45  $locales = $GLOBALS['SQ_SYSTEM']->lm->getCumulativeLocaleParts($GLOBALS['SQ_SYSTEM']->lm->getCurrentLocale());
46 
47  foreach($locales as $locale) {
48  if (file_exists(SQ_DATA_PATH.'/public/system/core/js_strings.'.$locale.'.js')) {
49  $include_list[] = sq_web_path('data').'/system/core/js_strings.'.$locale.'.js';
50  }
51  }
52 
53  foreach($include_list as $link) {
54  ?><script type="text/javascript" src="<?php echo $link; ?>"></script>
55  <?php
56  }
57  ?>
58  <script type="text/javascript" src="../../core/popup.js"></script>
59  <script type="text/javascript" src="<?php echo sq_web_path('fudge').'/var_serialise/var_serialise.js' ?>"></script>
60  <script type="text/javascript" src="<?php echo sq_web_path('lib').'/html_form/html_form.js' ?>"></script>
61  <script type="text/javascript" src="<?php echo sq_web_path('lib').'/js/general.js' ?>"></script>
62 
63  <script type="text/javascript">
64 
65  function getFocus() {
66  setTimeout('self.focus()',100);
67  };
68 
69  function Init() {
70  __dlg_init("matrixInsertAcronym");
71  setTimeout('self.focus()',100);
72  };
73 
74  function onOK() {
75  // pass data back to the calling window
76  var fields = ["title"];
77  var param = new Object();
78  var f = document.main_form;
79 
80  param["title"] = form_element_value(f.title);
81  param["acronym"] = form_element_value(f.acronym);
82 
83  __dlg_close("matrixInsertAcronym", param);
84  return false;
85  };
86 
87  function onCancel() {
88  __dlg_close("matrixInsertAcronym", null);
89  return false;
90  };
91 
92  </script>
93 
94  <style type="text/css">
95  html, body {
96  background: #FCFCFC;
97  color: #000000;
98  font: 11px Tahoma,Verdana,sans-serif;
99  margin: 0px;
100  padding: 0px;
101  padding: 5px;
102  }
103 
104  table {
105  font: 11px Tahoma,Verdana,sans-serif;
106  }
107 
108  /* main popup title */
109  .title {
110  background: #402F48;
111  color: #FFFFFF;
112  font-weight: bold;
113  font-size: 120%;
114  padding: 3px 10px;
115  margin-bottom: 10px;
116  border-bottom: 1px solid black;
117  letter-spacing: 4px;
118  }
119 
120  /* fieldset styles */
121  fieldset {
122  padding: 0px 10px 5px 5px;
123  border-color: #725B7D;
124  }
125 
126  .fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
127  .fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
128 
129  /* form and form fields */
130  form { padding: 0px; margin: 0px; }
131 
132  select, input, button {
133  font: 11px Tahoma,Verdana,sans-serif;
134  }
135 
136  button {
137  width: 70px;
138  }
139 
140  /* colour picker button styles */
141  .buttonColor, .buttonColor-hilite {
142  cursor: default;
143  border: 1px solid;
144  border-color: #9E86AA #725B7D #725B7D #9E86AA;
145  }
146 
147  .buttonColor-hilite {
148  border-color: #402F48;
149  }
150 
151  .buttonColor-chooser, .buttonColor-nocolor, .buttonColor-nocolor-hilite {
152  height: 0.6em;
153  border: 1px solid;
154  padding: 0px 1em;
155  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
156  }
157 
158  .buttonColor-nocolor, .buttonColor-nocolor-hilite { padding: 0px; }
159  .buttonColor-nocolor-hilite { background: #402F48; color: #FFFFFF; }
160  </style>
161  </head>
162 
163  <body onload="Javascript: Init();">
164  <div class="title"><?php echo translate('insert_acronym'); ?></div>
165  <form action="" method="get" name="main_form">
166  <table width="100%">
167  <tr>
168  <td valign="top" width="100%">
169  <fieldset>
170  <legend><b><?php echo translate('general'); ?></b></legend>
171  <table style="width:100%">
172  <tr>
173  <td class="label">Acronym:</td>
174  <td colspan="3"><?php text_box('acronym', trim($_GET['acronym']), 40, 0);?>
175  </td>
176  </tr>
177  <tr>
178  <td class="label">Definition:</td>
179  <td colspan="3"><?php text_box('title',trim($_GET['title']), 40, 0);?>
180  </td>
181  </tr>
182  </table>
183  </fieldset>
184  </td>
185  </tr>
186  </table>
187 
188  <div style="margin-top: 5px; margin-right: 5px; text-align: right;">
189  <hr />
190  <button type="button" name="ok" onclick="return onOK();"><?php echo translate('ok'); ?></button>
191  <button type="button" name="cancel" onclick="return onCancel();"><?php echo translate('cancel'); ?></button>
192  </div>
193  </form>
194  </body>
195 </html>