Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
paypal_configuration_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 
43  }//end constructor
44 
45 
56  function paintEncryptionLibPath(&$asset, &$o, $prefix)
57  {
58  $current_path = $asset->attr('encryption_lib_path');
59 
60  if ($asset->writeAccess('attributes')) {
61  text_box($prefix.'_encryption_lib_path', $current_path, 80);
62  } else {
63  if (trim($current_path) == '') {
64  echo '<b>[Empty]</b>';
65  } else {
66  echo '<b>'.$current_path.'</b>';
67  }
68  }
69 
70  if (!is_file($current_path)) {
71  ?><br /><span class="sq-backend-warning"><?php echo translate('path_to_not_valid', 'Paypal Encryption Library'); ?></span><?php
72  } else {
73  include_once $current_path;
74  if (!class_exists('PPCrypto')) {
75  ?><br /><span class="sq-backend-warning"><?php echo translate('paypal_configuration_encryption_lib_no_required_class'); ?></span><?php
76  } else {
77  if (!method_exists('PPCrypto', 'signAndEncrypt')) {
78  ?><br /><span class="sq-backend-warning"><?php echo translate('paypal_configuration_encryption_lib_no_required_method'); ?></span><?php
79  }
80  }
81  }//end if
82 
83  return TRUE;
84 
85  }//end paintEncryptionLibPath()
86 
87 
98  function processEncryptionLibPath(&$asset, &$o, $prefix)
99  {
100  if (!$asset->writeAccess('attributes')) return FALSE;
101  if (!isset($_POST[$prefix.'_encryption_lib_path'])) return FALSE;
102 
103  return $asset->setAttrValue('encryption_lib_path', trim($_POST[$prefix.'_encryption_lib_path']));
104 
105  }//end processEncryptionLibPath()
106 
107 
108 }//end class
109 ?>