Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
payment_gateway_esec_management.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/asset_management.inc';
18 
30 {
31 
32 
38  {
39  $this->Asset_Management($pm);
40  $this->vars = Array(
41  'merchant_id' => Array(
42  'added' => '0.1',
43  'type' => 'text',
44  'default' => '',
45  'description' => 'Gateway Merchant ID for the e-commerce transaction',
46  ),
47  'test_mode' => Array(
48  'added' => '0.1',
49  'type' => 'boolean',
50  'default' => FALSE,
51  'description' => 'Turn this ON for test mode',
52  'parameters' => Array(
53  'allow_empty' => FALSE,
54  ),
55  ),
56  'message' => Array(
57  'added' => '0.1',
58  'type' => 'wysiwyg',
59  'default' => '',
60  'is_contextable' => TRUE,
61  ),
62  'display_ccv' => Array(
63  'added' => '0.2',
64  'type' => 'boolean',
65  'default' => FALSE,
66  'description' => 'Enables CCV field in the form',
67  'parameters' => Array(
68  'allow_empty' => FALSE,
69  ),
70  ),
71  'submit_text' => Array(
72  'added' => '0.3',
73  'type' => 'text',
74  'default' => ' Pay ',
75  'description' => 'Submit button text',
76  'is_contextable' => TRUE,
77  ),
78  'reset_text' => Array(
79  'added' => '0.3',
80  'type' => 'text',
81  'default' => 'Reset',
82  'description' => 'Reset button text',
83  'is_contextable' => TRUE,
84  ),
85  'cancel_text' => Array(
86  'added' => '0.3',
87  'type' => 'text',
88  'default' => 'Cancel',
89  'description' => 'Cancel button text',
90  'is_contextable' => TRUE,
91  ),
92  );
93 
94  }//end constructor
95 
96 
105  function _upgrade($current_version)
106  {
107  // first do things as normal
108  $res = parent::_upgrade($current_version);
109 
110  if (version_compare($current_version, '0.3', '<')) {
111  pre_echo('UPGRADING TO v0.3');
112  $assetid_list = $GLOBALS['SQ_SYSTEM']->am->getTypeAssetids('payment_gateway_esec', FALSE);
113  $default_content = translate('default_bodycopy_content');
114  foreach ($assetid_list as $assetid) {
115  $asset =& $GLOBALS['SQ_SYSTEM']->am->getAsset($assetid);
116  $content = $default_content;
117  $message = $asset->attr('message');
118  if (!empty($message)) {
119  $content = '<div>'.$message.'</div>'.$content;
120  }
121 
122  if (!$asset->_createBodycopy($content)) {
123  trigger_error('Error creating bodycopy for Gateway #'.$assetid, E_USER_WARNING);
124  }
125 
126  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
127  }
128  pre_echo(count($assetid_list).' UPDATED');
129  }
130 
131 
132  return $res;
133 
134  }//end _upgrade()
135 
136 
143  function _getFileList()
144  {
145  return Array(
146  'files/loader.js',
147  'files/loader.gif',
148  );
149 
150  }//end _getFileList()
151 
152 
159  function getEventList()
160  {
161  return Array(
162  Array(
163  'event_name' => 'requestKeywords',
164  'broadcast_type_code' => 'content_type',
165  'broadcast_strict_type_code' => FALSE,
166  'options' => Array(
167  'side_of_link' => 'major',
168  'indirect' => TRUE,
169  'is_exclusive' => NULL,
170  'is_dependant' => 1,
171  'value' => '',
172  'link_type' => SQ_LINK_TYPE_2,
173  ),
174  ),
175  );
176 
177  }//end getEventList()
178 
179 
180 }//end class
181 
182 ?>