Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
paypal_business_account_edit_fns.inc
1 <?php
18 require_once SQ_INCLUDE_PATH.'/asset_edit/asset_edit_fns.inc';
19 
32 {
33 
34 
39  function __construct()
40  {
41  parent::__construct();
42  $this->static_screens['details']['force_unlock'] = FALSE;
43 
44  }//end constructor
45 
46 
57  function paintPublicCertPath(&$asset, &$o, $prefix)
58  {
59  $this->_paintPath($asset, $prefix, 'public_cert_path', 'Public Certificate Path');
60 
61  return TRUE;
62 
63  }//end paintPublicCertPath()
64 
65 
76  function processPublicCertPath(&$asset, &$o, $prefix)
77  {
78  return $this->_processPath($asset, $prefix, 'public_cert_path');
79 
80  }//end processPublicCertPath()
81 
82 
93  function paintPrivateKeyPath(&$asset, &$o, $prefix)
94  {
95  $this->_paintPath($asset, $prefix, 'private_key_path', 'Private Key Path');
96 
97  return TRUE;
98 
99  }//end paintPrivateKeyPath()
100 
101 
112  function processPrivateKeyPath(&$asset, &$o, $prefix)
113  {
114  return $this->_processPath($asset, $prefix, 'private_key_path');
115 
116  }//end processPrivateKeyPath()
117 
118 
129  function paintPaypalCertPath(&$asset, &$o, $prefix)
130  {
131  $this->_paintPath($asset, $prefix, 'paypal_cert_path', 'Paypal Certificate Path');
132 
133  return TRUE;
134 
135  }//end paintPaypalCertPath()
136 
137 
148  function processPaypalCertPath(&$asset, &$o, $prefix)
149  {
150  return $this->_processPath($asset, $prefix, 'paypal_cert_path');
151 
152  }//end processPaypalCertPath()
153 
154 
166  private function _paintPath(&$asset, $prefix, $attr_name, $full_name)
167  {
168  $current_path = $asset->attr($attr_name);
169 
170  if ($asset->writeAccess('attributes')) {
171  text_box($prefix.'_'.$attr_name, $current_path, 80);
172  } else {
173  if (trim($current_path) == '') {
174  echo '<b>[Empty]</b>';
175  } else {
176  echo '<b>'.$current_path.'</b>';
177  }
178  }
179 
180  if (!is_file($current_path)) {
181  ?><br /><span class="sq-backend-warning"><?php echo translate('path_to_not_valid', $full_name); ?></span><?php
182  }//end if
183 
184  }//end _paintPath()
185 
186 
197  private function _processPath(&$asset, $prefix, $attr_name)
198  {
199  if (!$asset->writeAccess('attributes')) return FALSE;
200  if (!isset($_POST[$prefix.'_'.$attr_name])) return FALSE;
201 
202  return $asset->setAttrValue($attr_name, trim($_POST[$prefix.'_'.$attr_name]));
203 
204  }//end _processPath()
205 
206 
207 }//end class
208 ?>