Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
trim_connector_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 paintTestConnection(&$asset, &$o, $prefix)
57  {
58  $wa = $asset->writeAccess('attributes');
59  $o->openField('Connection Status');
60  require_once SQ_PACKAGES_PATH.'/trim/lib/trim_common.inc';
61  $connection = Array (
62  'wsdl' => $asset->attr('wsdl'),
63  'authentication' => Array (
64  'login' => $asset->attr('username'),
65  'password' => $asset->attr('password'),
66  'trace' => TRUE,
67  'exception' => TRUE,
68  ),
69  );
70 
71  // add proxy
72  $proxy = $asset->getProxy();
73  $connection['authentication'] = array_merge($connection['authentication'], $proxy);
74 
75 
76  $valid = FALSE;
77  if (!empty($connection['wsdl'])) {
78  $valid = TRIM_Common::test_trim_connection($connection);
79  }//end if
80 
81  if ($valid) {
82  echo '<span style="color:green;font-weight:bold">Connected</span>';
83  } else {
84  echo '<span style="color:red;font-weight:bold">Not Connected</span>';
85  }//end if
86  $o->closeField();
87 
88  return $wa;
89  }//end paintTestConnection()
90 
91 
102  function processTestConnection(&$asset, &$o, $prefix)
103  {
104  return FALSE;
105  }//end processTestConnection()
106 
107 }//end class
108 ?>