XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
form_users.php
Go to the documentation of this file.
1 <script type="text/javascript">
2 <!--
3  $("#XOOPS_TOKEN_REQUEST").val('<?php echo $token; ?>');
4  var baseurl = "<?php echo XOOPS_URL; ?>";
5 -->
6 </script>
7 <form name="<?php echo $field; ?>_users_form">
8 <?php $cols = $field_type=='radio' ? 5 : 3; ?>
9 <?php if ($field_type=='checkbox'): ?>
10 <div class="form_users_selected_list">
11  <div id="<?php echo $field; ?>-selected-title" class="form_users_selected_title">
12  <?php _e('Selected:','rmcommon'); ?> (<strong><span><?php echo count($selected); ?></span></strong>)
13  </div>
14  <ul id="<?php echo $field; ?>-selected-list">
15  <?php foreach($selecteds as $sel): ?>
16  <li class="user_<?php echo $sel['id'] ?>">
17  <label><input type="checkbox" name="s[]" value="<?php echo $sel['id']; ?>" checked="checked" onchange="usersField.remove_from_list(<?php echo $sel['id']; ?>);" />
18  <span id="user-<?php echo $field; ?>-caption-<?php echo $sel['id']; ?>"><?php echo $sel['name']; ?></span>
19  </label></li>
20  <?php endforeach; ?>
21  </ul>
22  <div align="center"><input type="button" value="<?php echo _e('Insert Users','rmcommon'); ?>" onclick="usersField.insert_users(<?php echo $type; ?>);" /></div>
23 </div>
24 <?php endif; ?>
25 <div<?php if ($field_type=='checkbox'): ?> style="margin-right: 160px;"<?php endif; ?>>
26 <table class="outer" cellspacing="0">
27  <tr>
28  <td colspan="<?php echo $cols; ?>" align="center" class="even">
29  <?php _e('Search:','rmcommon'); ?> <input type="text" id="<?php echo $field ?>-kw" size="8" value="<?php echo $kw; ?>" /> &nbsp;
30  <?php _e('Show:','rmcommon'); ?> <input type="text" id="<?php echo $field ?>-limit" size="5" value="<?php echo $limit; ?>" /> &nbsp;
31  <?php _e('Sort by:','rmcommon'); ?>
32  <select id="<?php echo $field ?>-ord">
33  <option value="2"<?php echo $ord==2 ? ' selected="selected"' : ''; ?>><?php _e('ID','rmcommon'); ?></option>
34  <option value="0"<?php echo $ord==0 ? ' selected="selected"' : ''; ?>><?php _e('Registered','rmcommon'); ?></option>
35  <option value="1"<?php echo $ord==1 ? ' selected="selected"' : ''; ?>><?php _e('Username','rmcommon'); ?></option>
36  </select>
37  <input type="button" value="<?php _e('Go!','rmcommon'); ?>" onclick="usersField.submit_search(<?php echo $type; ?>);" />
38  </td>
39  </tr>
40  <tr>
41  <th align="left" colspan="<?php echo $cols; ?>">
42  <div style="float: right; font-weight: normal; font-size: 0.9em;">
43  <?php echo $nav->get_showing(); ?>
44  </div>
45  <?php _e('Existing Users','system'); ?>
46  </th>
47  </tr>
48  <tr class="even form_users_list">
49  <?php
50  $i = 1; //Counter
51  foreach($users as $user):
52  ?>
53  <?php
54  if($i>$cols):
55  $i = 1;
56  ?>
57  </tr><tr class="<?php if (function_exists('cycle')): echo cycle("odd","even"); else: echo "even"; endif; ?>">
58  <?php endif; ?>
59  <td>
60  <label><input <?php if($type): ?>onchange="usersField.add_to_list(<?php echo $user['id']; ?>);"<?php else: ?>onclick="usersField.insert_users(<?php echo $type.','.$user['id']; ?>);"<?php endif; ?> type="<?php echo $field_type ?>" id="<?php echo $field; ?>-user-<?php echo $user['id']; ?>" name="users<?php echo $field_type=='checkbox' ? '[]' : ''; ?>" value="<?php echo $user['id']; ?>"<?php echo $user['check'] ? ' checked="checked"' : ''; ?> />
61  <span id="<?php echo $field; ?>-username-<?php echo $user['id']; ?>"><?php echo $user['name']; ?></span></label>
62  </td>
63  <?php
64  $i++;
65  endforeach;
66  ?>
67  </tr>
68  <tr class="foot">
69  <td colspan="<?php echo $cols; ?>"><?php $nav->display(); ?></td>
70  </tr>
71 </table>
72 </div>
73 <?php if(!$type): ?>
74 <input type="hidden" name="s" value="<?php echo $selected_string; ?>" id="s" />
75 <?php endif; ?>
76 </form>