Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
authentication_ipb_edit_fns.inc
1 <?php
17 require_once SQ_CORE_PACKAGE_PATH.'/system/authentication/authentication/authentication_edit_fns.inc';
18 
31 {
32 
33 
39  {
40  $this->Authentication_Edit_Fns();
41  unset($this->static_screens['settings']);
42  unset($this->static_screens['preview']);
43  unset($this->static_screens['lookupValues']);
44  unset($this->static_screens['metadata']);
45  unset($this->static_screens['metadataSchemas']);
46  unset($this->static_screens['workflow']);
47  unset($this->static_screens['tagging']);
48  unset($this->static_screens['dependants']);
49  unset($this->static_screens['linking']);
50  unset($this->static_screens['roles']);
51  unset($this->static_screens['permissions']);
52  unset($this->static_screens['layouts']);
53 
54  }//end constructor
55 
56 
67  function paintAllowBannedList(&$asset, &$o, $prefix)
68  {
69  $write_access = $asset->writeAccess('attributes');
70  $allow_banned = $asset->attr('allow_banned');
71  if ($write_access) {
72  ?>
73  <script type="text/javascript">
74  <!--
75  function chooseOne(caller_id, target_id) {
76  caller_checkbox = document.getElementById(caller_id).checked = true;
77  target_checkbox = document.getElementById(target_id).checked = false;
78  }
79  -->
80  </script>
81  <?php
82  $o->openField(translate('allow_banned_user'));
83  echo 'Yes';
84  $onclick = 'chooseOne(\''.$prefix.'_allow_banned_user\', \''.$prefix.'_disallow_banned_user\')';
85  check_box($prefix.'_allow_banned_user', '1', $allow_banned, $onclick);
86  echo '&nbsp;No';
87  $onclick = 'chooseOne(\''.$prefix.'_disallow_banned_user\', \''.$prefix.'_allow_banned_user\' )';
88  check_box($prefix.'_disallow_banned_user', '1', !$allow_banned, $onclick);
89  $o->closeField();
90 
91  } else {
92  $o->openField(translate('allow_banned_user'));
93  if ($allow_banned) {
94  echo '<b>'.translate('yes').'</b>';
95  } else {
96  echo '<b>'.translate('no').'</b>';
97  }
98  $o->closeField();
99  }
100 
101  return TRUE;
102 
103  }//end paintAllowBannedList()
104 
105 
116  function processAllowBannedList(&$asset, &$o, $prefix)
117  {
118  if (!empty($_POST[$prefix.'_allow_banned_user'])) {
119  $asset->setAttrValue('allow_banned', TRUE);
120  }
121  if (!empty($_POST[$prefix.'_disallow_banned_user'])) {
122  $asset->setAttrValue('allow_banned', FALSE);
123  }
124  return TRUE;
125 
126  }//end processAllowBannedList()
127 
128 
129 }//end class
130 
131 ?>