18 require_once SQ_CORE_PACKAGE_PATH.
'/page/page_edit_fns.inc';
41 parent::__construct();
58 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
60 $write_access = $asset->writeAccess(
'attributes');
61 $am = $GLOBALS[
'SQ_SYSTEM']->am;
62 $list_api = $am->getChildren($asset->id,
'soap_api', FALSE);
64 $known_api = $asset->attr(
'list_api');
66 if (empty($list_api)) {
67 echo
'No APIs installed';
72 <table
class=
"sq-backend-table">
74 <td
class=
"sq-backend-table-header" width=
"66%"><?php echo translate(
'api_name'); ?></td>
75 <td
class=
"sq-backend-table-header" width=
"33%"><?php echo translate(
'enable'); ?></td>
78 foreach ($list_api as $api_id => $api_value) {
81 $current_value = FALSE;
83 if (isset($known_api[$api_id])) $current_value = TRUE;
87 <td
class=
"sq-backend-table-cell">
89 echo get_asset_tag_line($api_id);
92 <td
class=
"sq-backend-table-cell">
95 check_box($prefix.
'_enable['.$api_id.
']', $api_value[0][
'type_code'], $current_value);
98 <img src=
"<?php echo sq_web_path('lib'); ?>/web/images/<?php echo ($current_value) ? 'tick' : 'cross'; ?>.gif" width=
"15" height=
"15" />
107 $am->forgetAsset($api_asset);
118 $o->openField(
'Regenerate WSDL');
119 check_box($prefix.
'_regenerate_wsdl',
'1', 1);
120 $o->note(
'Select to regenerate the WSDL file to reflect your new changes');
142 $write_access = $asset->writeAccess(
'attributes');
143 $prefix = $asset->getPrefix();
147 if (isset($_POST[$prefix.
'_regenerate_wsdl'])) {
150 if (isset($_POST[$prefix.
'_enable']) && !empty($_POST[$prefix.
'_enable'])) {
151 $save_api_list = Array();
152 foreach ($_POST[$prefix.
'_enable'] as $assetid => $enabled) {
153 if (empty($assetid))
continue;
156 $save_api_list[$assetid] = $enabled;
159 if (!empty($save_api_list)) {
161 $GLOBALS[
'SQ_SYSTEM']->setRunLevel(SQ_RUN_LEVEL_FORCED);
162 $asset->setAttrValue(
'list_api', $save_api_list);
163 $asset->saveAttributes();
164 $GLOBALS[
'SQ_SYSTEM']->restoreRunLevel();
168 $empty_api_list = Array();
170 $asset->setAttrValue(
'list_api', $empty_api_list);
171 $asset->saveAttributes();
176 $asset->generateWSDL();