18 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
41 parent::__construct();
42 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
59 $this->_paintPath($asset, $prefix,
'public_cert_path',
'Public Certificate Path');
78 return $this->_processPath($asset, $prefix,
'public_cert_path');
95 $this->_paintPath($asset, $prefix,
'private_key_path',
'Private Key Path');
114 return $this->_processPath($asset, $prefix,
'private_key_path');
131 $this->_paintPath($asset, $prefix,
'paypal_cert_path',
'Paypal Certificate Path');
150 return $this->_processPath($asset, $prefix,
'paypal_cert_path');
166 private function _paintPath(&$asset, $prefix, $attr_name, $full_name)
168 $current_path = $asset->attr($attr_name);
170 if ($asset->writeAccess(
'attributes')) {
171 text_box($prefix.
'_'.$attr_name, $current_path, 80);
173 if (trim($current_path) ==
'') {
174 echo
'<b>[Empty]</b>';
176 echo
'<b>'.$current_path.
'</b>';
180 if (!is_file($current_path)) {
181 ?><br /><span
class=
"sq-backend-warning"><?php echo translate(
'path_to_not_valid', $full_name); ?></span><?php
197 private function _processPath(&$asset, $prefix, $attr_name)
199 if (!$asset->writeAccess(
'attributes'))
return FALSE;
200 if (!isset($_POST[$prefix.
'_'.$attr_name]))
return FALSE;
202 return $asset->setAttrValue($attr_name, trim($_POST[$prefix.
'_'.$attr_name]));