Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
edit_table_cell_props.php
1 <?php
27 header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
28 header('Pragma: no-cache');
29 header('Expires: '.gmdate('D, d M Y H:i:s',time()-3600).' GMT');
30 
31 include(dirname(__FILE__).'/header.php');
32 ?>
33 <script language="JavaScript" type="text/javascript">
34 
35  function popup_init() {
36 
37  var data = owner.bodycopy_current_edit["data"]["attributes"];
38  available_types = owner.bodycopy_current_edit["data"]["available_types"];
39 
40  var f = document.main_form;
41  f.width.value = (data['width'] == null) ? "" : data['width'];
42  f.height.value = (data['height'] == null) ? "" : data['height'];
43  f.colspan.value = (data['colspan'] == null) ? "" : data['colspan'];
44  f.dir.value = (data['dir'] == null) ? "" : data['dir'];
45  f.bgcolor.value = (data['bgcolor'] == null) ? "" : data['bgcolor'];
46 
47  owner.highlight_combo_value(f.align, data['align']);
48  owner.highlight_combo_value(f.valign, data['valign']);
49  owner.highlight_combo_value(f.nowrap, data['nowrap']);
50 
51  // remove the existing values
52  for(var i = f.type.options.length - 1; i >= 0; i--) {
53  f.type.options[i] = null;
54  }
55  var i = 0;
56  for(var key in available_types) {
57  if (available_types[key] == null) continue;
58  if(available_types[key]["name"] != null) {
59  f.type.options[i] = new Option(available_types[key]["name"], key);
60  i++;
61  }
62  }
63 
64  owner.highlight_combo_value(f.type, data["content_type"]);
65 
66  }// end popup_init()
67 
68  function save_props(f) {
69 
70  var data = new Object();
71  data["width"] = owner.form_element_value(f.width);
72  data["height"] = owner.form_element_value(f.height);
73  data["colspan"] = owner.form_element_value(f.colspan);
74  data["dir"] = owner.form_element_value(f.dir);
75  data["bgcolor"] = owner.form_element_value(f.bgcolor);
76  data["align"] = owner.form_element_value(f.align);
77  data["valign"] = owner.form_element_value(f.valign);
78  data["nowrap"] = owner.form_element_value(f.nowrap);
79  data["type"] = owner.form_element_value(f.type);
80  owner.bodycopy_save_table_cell_properties(data);
81  }
82 </script>
83 
84 <div class="title">Table Cell Properties</div>
85 
86 <form name="main_form">
87 <table width="100%" border="0">
88  <tr>
89  <td>
90  <table width="100%" cellspacing="0" cellpadding="0">
91  <tr>
92  <td valign="top" width="50%">
93  <fieldset>
94  <legend><b><?php echo translate('layout'); ?></b></legend>
95  <table style="width:100%">
96  <tr>
97  <td class="label"><?php echo translate('width'); ?>:</td>
98  <td><input type="text" name="width" value="" size="5"></td>
99  </tr>
100  <tr>
101  <td class="label"><?php echo translate('height'); ?>:</td>
102  <td><input type="text" name="height" value="" size="5"></td>
103  </tr>
104  <tr>
105  <td class="label"><?php echo translate('colspan'); ?>:</td>
106  <td><input type="text" name="colspan" value="" size="5"></td>
107  </tr>
108  </table>
109  </fieldset>
110  </td>
111  <td>&nbsp;</td>
112  <td valign="top" width="50%">
113  <fieldset>
114  <legend><b><?php echo translate('alignment'); ?></b></legend>
115  <table style="width:100%">
116  <tr>
117  <td class="label"><?php echo translate('horizontal'); ?>:</td>
118  <td>
119  <select name="align">
120  <option value="">
121  <option value="left" ><?php echo translate('left'); ?>
122  <option value="center"><?php echo translate('centre'); ?>
123  <option value="right" ><?php echo translate('right');?>
124  </select>
125  </td>
126  </tr>
127  <tr>
128  <td class="label"><?php echo translate('vertical'); ?>:</td>
129  <td>
130  <select name="valign">
131  <option value="">
132  <option value="middle" ><?php echo translate('middle'); ?>
133  <option value="top" ><?php echo translate('top'); ?>
134  <option value="bottom" ><?php echo translate('bottom'); ?>
135  </select>
136  </td>
137  </tr>
138  </table>
139  </fieldset>
140  </td>
141  </tr>
142  </table>
143  </td>
144  </tr>
145  <tr>
146  <td>
147  <fieldset>
148  <legend><b><?php echo translate('text_direction'); ?></b></legend>
149  <table style="width:100%">
150  <tr>
151  <td class="label"><?php echo translate('bodycopy_direction'); ?></td>
152  <td>
153  <select name="dir">
154  <option value=""><?php echo translate('content_type_no_change'); ?></option>
155  <option value="ltr"><?php echo translate('bodycopy_left_to_right'); ?></option>
156  <option value="rtl"><?php echo translate('bodycopy_right_to_left'); ?></option>
157  </select>
158  </td>
159  </tr>
160  </table>
161  </fieldset>
162  </td>
163  </tr>
164  <tr>
165  <td>
166  <fieldset>
167  <legend><b><?php echo translate('cell_styles-colours'); ?></b></legend>
168  <table style="width:100%">
169  <tr>
170  <td class="label"><?php echo translate('background_colour'); ?>:</td>
171  <td><?php colour_box('bgcolor', '', TRUE, '*',TRUE, FALSE, FALSE);?></td>
172  </tr>
173  <tr>
174  <td class="label"><?php echo translate('no_text_wrap'); ?>:</td>
175  <td>
176  <select name="nowrap">
177  <option value=""><?php echo translate('off'); ?>
178  <option value="on"><?php echo translate('on'); ?>
179  </select>
180  </td>
181  </tr>
182  </table>
183  </fieldset>
184  </td>
185  </tr>
186  <tr>
187  <td>
188  <fieldset>
189  <legend><b><?php echo translate('cell_type'); ?></b></legend>
190  <table style="width:100%">
191  <tr>
192  <td class="label"><?php echo translate('cell_type'); ?>:</td>
193  <td>
194  <select name="type">
195  <option value="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
196  <option value="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
197  <option value="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
198  </select>
199  </td>
200  </tr>
201  </table>
202  </fieldset>
203  </td>
204  </tr>
205  <tr>
206  <td>
207  <div style="text-align: right;">
208  <button type="button" name="ok" onClick="javascript: save_props(this.form)"><?php echo translate('ok'); ?></button>
209  &nbsp;
210  <button type="button" name="cancel" onClick="javascript: popup_close();"><?php echo translate('cancel'); ?></button>
211  </div>
212  </td>
213  </tr>
214 </table>
215 </form>
216 
217 <?php include(dirname(__FILE__).'/footer.php'); ?>