XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
rmc_blocks.php
Go to the documentation of this file.
1 <h1 class="rmc_titles"><?php _e('Blocks Administration','rmcommon'); ?></h1>
2 <?php $from = rmc_server_var($_REQUEST,'from', '')=='positions'?true:false; ?>
3 <div class="rmc_blocks_options">
4  <div id="blocks-modpos"<?php echo $from ? ' style="display: none;"' : ''; ?>>
5  <form name="frmModpos" method="get" action="blocks.php">
6  <select name="mid" onchange="submit();">
7  <option value=""<?php echo $mid==0?' selected="selected"' : ''; ?>><?php _e('All modules','rmcommon'); ?></option>
8  <?php foreach($modules as $mod): ?>
9  <option value="<?php echo $mod['mid']; ?>"<?php echo $mid==$mod['mid']?' selected="selected"' : ''; ?>><?php echo $mod['name']; ?></option>
10  <?php endforeach; ?>
11  </select>
12  <select name="pos" onchange="submit();">
13  <option value="0"<?php echo $pid==0?' selected="selected"':''; ?>><?php _e('All positions','rmcommon'); ?></option>
14  <?php foreach($positions as $pos): ?>
15  <option value="<?php echo $pos['id']; ?>"<?php echo $pid==$pos['id']?' selected="selected"':''; ?>><?php echo $pos['name']; ?></option>
16  <?php endforeach; ?>
17  </select>
18 
19  <select name="visible" onchange="submit();">
20  <option value="-1"<?php echo $visible==-1?' selected="selected"':''; ?>><?php _e('All blocks...','rmcommon'); ?></option>
21  <option value="0"<?php echo $visible==0?' selected="selected"':''; ?>><?php _e('Hidden blocks...','rmcommon'); ?></option>
22  <option value="1"<?php echo $visible==1?' selected="selected"':''; ?>><?php _e('Visible blocks...','rmcommon'); ?></option>
23  </select>
24  </form>
25  </div>
26 
27  <a href="#" id="newban" class="rmc_menus"><?php _e('Add New Block','rmcommon'); ?></a>
28  <div id="megamenu1" class="megamenu">
29  <div class="menucont">
30  <?php $i = 0; ?>
31  <?php foreach($blocks as $dir => $block): ?>
32  <?php if(empty($block['blocks'])) continue; ?>
33  <?php $i++; ?>
34  <div class="column">
35  <h3><?php echo $block['name']; ?></h3>
36  <ul>
37  <?php foreach($block['blocks'] as $id => $bk): ?>
38  <li><a href="#" id="block-<?php echo $dir; ?>-<?php echo $bk['id']; ?>"><?php echo $bk['name']; ?></a></li>
39  <?php endforeach; ?>
40  </ul>
41  </div>
42  <?php endforeach; ?>
43  </div>
44  </div>
45  <a href="#" id="newpos" class="rmc_menus"><?php _e('Show Positions','rmcommon'); ?></a>
46 </div>
47 <div id="bk-messages" style="display: none;">
48  <span class="msg-close"></span>
49  <span class="msg"></span>
50 </div>
51 
52 <div id="bks-and-pos">
53 <div id="form-pos" class="bkbk_forms"<?php echo $from ? ' style="display: block;"' : ''; ?>>
54  <div class="formposcontainer">
55  <h3>Add Position</h3>
56  <form name="frmaddpos" id="frm-add-pos" method="post" action="blocks.php" />
57  <label><?php _e('Name','rmcommon'); ?></label>
58  <input type="text" name="posname" value="" />
59  <span class="desc"><?php _e('Input a name to identify this position (<em>eg. Left blocks</em>)','rmcommon'); ?></span>
60  <label><?php _e('Tag Name','rmcommon'); ?></label>
61  <input type="text" name="postag" value="" />
62  <span class="desc"><?php _e('Specify a name for the smarty tag to use in templates (eg. left_blocks). This tag will be used as Smarty tag (eg. &lt;{$left_blocks}&gt).','rmcommon'); ?></span>
63  <input type="submit" name="bk_add_pos" id="add-position" value="<?php _e('Add Position','rmcommon'); ?>" />
64  <input type="hidden" name="action" value="save_position" />
65  <?php echo $xoopsSecurity->getTokenHTML(); ?>
66  </form>
67  <h4><?php _e('How to implement blocks','rmcommon'); ?></h4>
68  <div class="code">
69  <code>&lt;{foreach item="block" from=$xoBlocks.<em>tag</em>}&gt;<br 7>
70  &nbsp;&nbsp;&nbsp;&nbsp;&lt;{$block.title}&gt;<br />
71  &nbsp;&nbsp;&nbsp;&nbsp;&lt;{$block.content}&gt;<br />
72  &lt;{/foreach}&gt;</code>
73  </div>
74  </div>
75 </div>
76 
77 <div style="overflow: hidden;<?php echo $from ? ' display: none;' : ''; ?>" id="blocks-list">
78  <form name="frmblocks" id="frm-blocks" method="post" action="blocks.php">
79 
80  <div class="rmc_bulkactions">
81  <select name="action" id="bulk-top">
82  <option value=""><?php _e('Bulk actions...','rmcommon'); ?></option>
83  <option value="visible"><?php _e('Visible','rmcommon'); ?></option>
84  <option value="hidden"><?php _e('Hidden','rmcommon'); ?></option>
85  <option value="delete"><?php _e('Delete','rmcommon'); ?></option>
86  </select>
87  <input type="button" id="the-op-top" value="<?php _e('Apply','bxpress'); ?>" onclick="before_submit('frm-blocks');" />
88  &nbsp; &nbsp; &nbsp;
89  <?php if($the_position!=''): ?><a href="#" class="sort_blocks"><?php _e('Sort Blocks','rmcommon'); ?></a><?php endif; ?>
90  </div>
91 
92 <div id="table-blocks-container">
93  <table class="outer" border="0" id="table-blocks">
94  <thead>
95  <tr>
96  <th width="30"><input type="checkbox" id="checkall" onclick="$('#frm-blocks').toggleCheckboxes(':not(#checkall)');" /></th>
97  <th align="left"><?php _e('Block','rmcommon'); ?></th>
98  <th width="100"><?php _e('Module','rmcommon'); ?></th>
99  <th align="center"><?php _e('Position','rmcommon'); ?></th>
100  <th align="center"><?php _e('Active','rmcommon'); ?></th>
101  <th align="center" width="20"><?php _e('Order','rmcommon'); ?></th>
102  </tr>
103  </thead>
104  <tfoot>
105  <tr>
106  <th width="30"><input type="checkbox" id="checkallb" onclick="$('#frm-blocks').toggleCheckboxes(':not(#checkallb)');" /></th>
107  <th align="left"><?php _e('Block','rmcommon'); ?></th>
108  <th><?php _e('Module','rmcommon'); ?></th>
109  <th align="center"><?php _e('Position','rmcommon'); ?></th>
110  <th align="center"><?php _e('Active','rmcommon'); ?></th>
111  <th align="center" width="20"><?php _e('Order','rmcommon'); ?></th>
112  </tr>
113  </tfoot>
114  <tbody>
115  <?php if(empty($used_blocks)): ?>
116  <tr class="even" align="center" id="tr-empty">
117  <td colspan="5"><?php _e('There are not blocks configured with these options.','rmcommon'); ?></td>
118  </tr>
119  <?php endif; ?>
120  <?php foreach($used_blocks as $block): ?>
121  <tr valign="top" class="<?php echo tpl_cycle("even,odd"); ?>" id="tr-<?php echo $block['id']; ?>">
122  <td align="center"><input type="checkbox" name="ids[]" id="item-<?php echo $block['id']; ?>" value="<?php echo $block['id']; ?>" /></td>
123  <td>
124  <strong><?php echo $block['title']; ?></strong>
125  <span class="description"><?php echo $block['description']; ?></span>
126  <span class="rmc_options">
127  <a class="bk_edit" href="#" id="edit-<?php echo $block['id']; ?>"><?php _e('Settings','rmcommon'); ?></a> |
128  <a href="#" onclick="select_option(<?php echo $block['id']; ?>,'delete','frm-blocks');"><?php _e('Delete','rmcommon'); ?></a>
129  </span>
130  </td>
131  <td align="center"><?php echo $block['module']['name']; ?></td>
132  <td align="center"><?php echo $block['canvas']['name']; ?></td>
133  <td align="center"><img src="images/<?php echo $block['visible']?'done.png':'closeb.png'; ?>" alt="" /></td>
134  <td align="center"><?php echo $block['weight']; ?></td>
135  </tr>
136  <?php endforeach; ?>
137  </tbody>
138  </table>
139 </div>
140  <div class="rmc_bulkactions">
141  <select name="actionb" id="bulk-bottom">
142  <option value=""><?php _e('Bulk actions...','rmcommon'); ?></option>
143  <option value="visible"><?php _e('Visible','rmcommon'); ?></option>
144  <option value="hidden"><?php _e('Hidden','rmcommon'); ?></option>
145  <option value="delete"><?php _e('Delete','rmcommon'); ?></option>
146  </select>
147  <input type="button" id="the-op-bottom" value="<?php _e('Apply','bxpress'); ?>" onclick="before_submit('frm-blocks');" />
148  </div>
149  <?php echo $xoopsSecurity->getTokenHTML(); ?>
150  </form>
151 </div>
152 
153 <!-- Positions -->
154 <div id="blocks-positions" style="overflow: hidden;<?php echo $from ? ' display: block;' : 'display: none;'; ?>">
155  <form name="formPos" id="frm-positions" method="post" action="blocks.php">
156  <div class="rmc_bulkactions">
157  <select name="action" id="bulk-topp">
158  <option value=""><?php _e('Bulk actions...','rmcommon'); ?></option>
159  <option value="visiblepos"><?php _e('Visible','rmcommon'); ?></option>
160  <option value="hiddenpos"><?php _e('Hidden','rmcommon'); ?></option>
161  <option value="deletepos"><?php _e('Delete','rmcommon'); ?></option>
162  </select>
163  <input type="button" id="the-op-topp" value="<?php _e('Apply','bxpress'); ?>" onclick="before_submit('frm-positions');" />
164  </div>
165  <table class="outer" border="0" id="table-positions">
166  <thead>
167  <tr>
168  <th width="30"><input type="checkbox" id="checkallp" onclick="$('#frm-positions').toggleCheckboxes(':not(#checkallp)');" /></th>
169  <th width="30" align="left"><?php _e('ID','rmcommon'); ?></th>
170  <th align="left"><?php _e('Name','rmcommon'); ?></th>
171  <th><?php _e('Smarty Tag','rmcommon'); ?></th>
172  <th><?php _e('Active','rmcommon'); ?></th>
173  </tr>
174  <thead>
175  <tfoot>
176  <tr>
177  <th width="30"><input type="checkbox" id="checkallpb" onclick="$('#frm-positions').toggleCheckboxes(':not(#checkallpb)');" /></th>
178  <th width="50" align="left"><?php _e('ID','rmcommon'); ?></th>
179  <th align="left"><?php _e('Name','rmcommon'); ?></th>
180  <th><?php _e('Smarty Tag','rmcommon'); ?></th>
181  <th><?php _e('Active','rmcommon'); ?></th>
182  </tr>
183  <tfoot>
184  <tbody>
185  <?php foreach($positions as $pos): ?>
186  <tr class="<?php echo tpl_cycle('even,odd'); ?>" id="ptr-<?php echo $pos['id']; ?>" valign="top">
187  <td align="center"><input type="checkbox" name="ids[]" id="itemp-<?php echo $pos['id']; ?>" value="<?php echo $pos['id']; ?>" /></td>
188  <td align="left"><strong><?php echo $pos['id']; ?></strong></td>
189  <td>
190  <span class="name"><?php echo $pos['name']; ?></span>
191  <span class="rmc_options">
192  <a href="#" onclick="select_option(<?php echo $pos['id']; ?>, 'delete', 'frm-positions')"><?php _e('Delete','rmcommon'); ?></a> |
193  <a href="#" class="edit_position"><?php _e('Edit','rmcommon'); ?></a>
194  </span>
195  <span class="pos_data">
196  <span class="name"><?php echo $pos['name']; ?></span>
197  <span class="ptag"><?php echo $pos['tag']; ?></span>
198  <span class="active"><?php echo $pos['active']; ?></span>
199  </span>
200  </td>
201  <td align="center">&lt;{$xoBlocks.<span class="ptag"><?php echo $pos['tag']; ?></span>}&gt;</td>
202  <td align="center"><img class="active" src="images/<?php echo $pos['active'] ? 'done.png' : 'closeb.png'; ?>" alt="" /></td>
203  </tr>
204  <?php endforeach; ?>
205  </tbody>
206  </table>
207  <div class="rmc_bulkactions">
208  <select name="actionb" id="bulk-bottomp">
209  <option value=""><?php _e('Bulk actions...','rmcommon'); ?></option>
210  <option value="visiblepos"><?php _e('Visible','rmcommon'); ?></option>
211  <option value="hiddenpos"><?php _e('Hidden','rmcommon'); ?></option>
212  <option value="deletepos"><?php _e('Delete','rmcommon'); ?></option>
213  </select>
214  <input type="button" id="the-op-bottomp" value="<?php _e('Apply','bxpress'); ?>" onclick="before_submit('frm-positions');" />
215  </div>
216  </form>
217 </div>
218 </div>
219 <!--/ Positions -->
220 
221 <!-- Sort -->
222 <?php if($the_position!=0): ?>
223 <div id="bk-sorts">
224  <a href="#" class="save-order"><?php _e('Save Order','rmcommon'); ?></a>
225  <span class="bk_waiting"><img src="images/wait.gif" alt="" /> <?php _e('Saving...','rmcommon'); ?></span>
226  <a href="#" class="cancel-order"><?php _e('Cancel','rmcommon'); ?></a>
227  <ol class="bk-sort">
228  <?php foreach($used_blocks as $block): ?>
229  <li id="item_<?php echo $block['id']; ?>"><div><?php echo $block['title']; ?></div></li>
230  <?php endforeach; ?>
231  </ol>
232  <a href="#" class="save-order"><?php _e('Save Order','rmcommon'); ?></a>
233  <span class="bk_waiting"><img src="images/wait.gif" alt="" /> <?php _e('Saving...','rmcommon'); ?></span>
234  <a href="#" class="cancel-order"><?php _e('Cancel','rmcommon'); ?></a>
235 </div>
236 <?php endif; ?>
237 <!--// Sort -->
238 
239 <div id="blocker"></div>
240 <div id="loading"><img src="images/loadinga.gif" width="16" height="16" alt="<?php _e('Loading','rmcomon'); ?>" /><?php _e('Loading data...','rmcommon'); ?></div>
241 <div id="form-window">
242 
243 </div>