Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
payment_gateway_utransact_edit_fns.inc
1 <?php
18 require_once dirname(__FILE__).'/../../payment_gateway/payment_gateway_edit_fns.inc';
19 
29 {
30 
31 
42  function paintBodycopyInfo(&$asset, &$o, $prefix)
43  {
44  $bodycopy_asset = $asset->getBodycopy('display_format');
45 
46  $o->openRaw();
47  echo '<div style="padding:1ex;">';
48  echo get_asset_tag_line($bodycopy_asset->id, 'contents');
49  echo '</div>';
50  $o->closeRaw();
51 
52  }//end paintBodycopyInfo()
53 
54 
65  function paintBodycopy(&$asset, &$o, $prefix)
66  {
67  $write_access = $asset->writeAccess('menu');
68 
69  $bodycopy = $asset->getBodycopy('display_format');
70  $bodycopy_edit_fns = $bodycopy->getEditFns();
71 
72  $o->openRaw();
73  $bodycopy_edit_fns->paintBodycopy($bodycopy, $o, $bodycopy->getPrefix());
74  $o->closeRaw();
75 
76  return $write_access;
77 
78  }//end paintBodycopy()
79 
80 
91  function processBodycopy(&$asset, &$o, $prefix)
92  {
93  if (!$asset->writeAccess('menu')) return FALSE;
94 
95  $bodycopy = $asset->getBodycopy('display_format');
96  $bodycopy_edit_fns = $bodycopy->getEditFns();
97 
98  $status = $bodycopy_edit_fns->processBodycopy($bodycopy, $o, $bodycopy->getPrefix());
99 
100  return $status;
101 
102  }//end processBodycopy()
103 
104 
115  function paintAccountPassword(&$asset, &$o, $prefix)
116  {
117  if ($asset->writeAccess('attributes')) {
118  password_box($prefix.'_password', '', 20);
119  } else {
120  echo "Password not shown";
121  }
122 
123  return TRUE;
124 
125  }//end paintAccountPassword()
126 
127 
138  function processAccountPassword(&$asset, &$o, $prefix)
139  {
140  if (!isset($_POST[$prefix.'_password'])) {
141  return FALSE;
142  }
143 
144  if (!$GLOBALS['SQ_SYSTEM']->am->acquireLock($asset->id, 'attributes')) {
145  return FALSE;
146  }
147 
148  $success = FALSE;
149 
150  // Set the attribute
151  $val = isset($_POST[$prefix.'_password']) ? $_POST[$prefix.'_password'] : '';
152 
153  if ($val && $asset->setAttrValue('password', $val)) {
154  $success = $asset->saveAttributes();
155  }
156 
157  return $success;
158 
159  }//end processAccountPassword()
160 
161 
162 }//end class
163 
164 ?>