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