Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
condition_in_user_group_edit_fns.inc
1 <?php
17 require_once SQ_CORE_PACKAGE_PATH.'/system/conditions/condition/condition_edit_fns.inc';
18 
32 {
33 
34 
40  function __construct()
41  {
42  parent::__construct();
43 
44  }//end constructor
45 
46 
58  public static function paintEditInterface(Array $condition_data, Backend_Outputter $o, $prefix, $write_access)
59  {
60  ?>
61  <table class="no-borders">
62  <tr>
63  <td valign="top"><strong><?php echo translate('user_groups'); ?></strong>&nbsp;</td>
64  <td valign="top">
65  <?php
66  if ($write_access) {
67  multiple_asset_finder($prefix.'[groupids]', array_get_index($condition_data, 'groupids', Array()), Array('user_group' => 'D'));
68  } else {
69  if (empty($condition_data['groupids'])) {
70  echo translate('no_user_groups_selected');
71  } else {
72  $names = $GLOBALS['SQ_SYSTEM']->am->getAssetInfo($condition_data['groupids'], 'user_group', FALSE, 'name');
73  ?>
74  <ul>
75  <?php
76  foreach ($condition_data['groupids'] as $id) {
77  ?>
78  <li><?php echo get_asset_tag_line($id); ?></li>
79  <?php
80  }
81  ?>
82  </ul>
83  <?php
84  }
85  }
86  ?>
87  </td>
88  </tr>
89  </table>
90  <?php
91 
92  }//end paintEditInterface()
93 
94 
104  public static function processEditInterface(Backend_Outputter $o, $prefix)
105  {
106  if (empty($_POST[$prefix])) return Array();
107 
108  $groupids = Array();
109  foreach ($_POST[$prefix]['groupids'] as $data) {
110  if (empty($data['assetid'])) continue;
111  $groupids[] = $data['assetid'];
112  }
113 
114  return Array('groupids' => $groupids);
115 
116  }//end processEditInterface()
117 
118 
119 }//end class
120 ?>