Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
insert_div.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 type="text/javascript" language="javascript" src="<?php echo sq_web_path('lib')?>/js/general.js"></script>
34 <script type="text/javascript" src="<?php echo sq_web_path('fudge').'/var_serialise/var_serialise.js'?>" ></script>
35 <script language="JavaScript" type="text/javascript">
36 
37  function popup_init() {
38  var f = document.main_form;
39  }// end popup_init()
40 
41  function popup_save(f) {
42  var data = new Object();
43  data["identifier"] = owner.form_element_value(f.identifier);
44  data["layout_type"] = owner.form_element_value(f.layout_type);
45  data["css_class"] = owner.form_element_value(f.css_class);
46  data["content_type"] = owner.form_element_value(f.content_type);
47  owner.bodycopy_save_insert_div(data);
48  }
49 
50 </script>
51 <?php
52  require_once SQ_CORE_PACKAGE_PATH.'/content_type/content_type.inc';
53  $content_types = Content_Type::getAvailableContentTypes();
54  $default_content_type = $GLOBALS['SQ_SYSTEM']->getUserPrefs('bodycopy_container', 'SQ_DEFAULT_CONTENT_TYPE');
55  $default_pres_type = $GLOBALS['SQ_SYSTEM']->getUserPrefs('bodycopy_container', 'SQ_DEFAULT_PRESENTATION_TYPE');
56  $possible_types = Array(
57  'div' => translate('block-level'),
58  'span' => translate('inline'),
59  'none' => translate('raw_html'),
60  );
61 ?>
62 <div class="title" style="text-align: right;"><?php echo translate('insert_div'); ?></div>
63 <form name="main_form">
64 <input type="hidden" name="bodycopy_name" value="">
65 <input type="hidden" name="divid" value="">
66 <table width="100%" border="0">
67  <tr>
68  <td>
69  <fieldset>
70  <legend><b><?php echo translate('identification'); ?></b></legend>
71  <table style="width:100%">
72  <tr>
73  <td class="label"><?php echo translate('name'); ?>:</td>
74  <td><input type="text" name="identifier" value="" size="15"></td>
75  </tr>
76  </table>
77  </fieldset>
78  <fieldset>
79  <legend><b><?php echo translate('style_information'); ?></b></legend>
80  <table style="width:100%">
81  <tr>
82  <td class="bodycopy-popup-heading"><?php echo translate('presentation'); ?>:</td>
83  <td>
84  <?php combo_box('layout_type', $possible_types, FALSE, $default_pres_type); ?>
85  </td>
86  </tr>
87  <tr>
88  <td class="label"><?php echo translate('class'); ?>:</td>
89  <td><input type="text" name="css_class" value="" size="15"></td>
90  </tr>
91  </table>
92  </fieldset>
93  <fieldset>
94  <legend><b><?php echo translate('content_type'); ?></b></legend>
95  <table style="width:100%">
96  <tr>
97  <td class="bodycopy-popup-heading"><?php echo translate('content_type'); ?>:</td>
98  <td>
99  <select name="content_type" id="content_type">
100  <?php
101  foreach ($content_types as $type_code => $data) {
102  $selected_text = '';
103  if ($type_code == $default_content_type) {
104  $selected_text = 'SELECTED';
105  }
106  ?>
107  <option value="<?php echo $type_code; ?>" <?php echo $selected_text; ?>><?php echo str_replace(' Content Type', '', $data['name']); ?></option>
108  <?php
109  }
110  ?>
111  </select>
112  </td>
113  </tr>
114  </table>
115  </fieldset>
116  </tr>
117  <tr>
118  <td>
119  <div style="text-align: right;">
120  <button type="button" name="ok" onClick="javascript: popup_save(this.form)"><?php echo translate('ok'); ?></button>
121  &nbsp;
122  <button type="button" name="cancel" onClick="javascript: popup_close();"><?php echo translate('cancel'); ?></button>
123  </div>
124  </td>
125  </tr>
126 </table>
127 </form>
128 
129 <?php include(dirname(__FILE__).'/footer.php'); ?>