function wsconfig_get_list_tokens in Web Service Data 7
Gets the list of web service configurations with tokens
2 calls to wsconfig_get_list_tokens()
- wsfields_storage_edit_field_form in modules/
wsfields_storage/ wsfields_storage.admin.inc - WSField Storage Settings edit form
- wsfields_storage_edit_field_form_submit in modules/
wsfields_storage/ wsfields_storage.admin.inc - Save changes to the field
File
- modules/
wsconfig/ wsconfig.module, line 396 - Main module for wsconfig
Code
function wsconfig_get_list_tokens($wsconfig = "") {
// @todo add caching layer?
$query = db_select('wsconfig', 'w');
$query
->fields('w', array(
'name',
'data',
))
->orderBy('name', 'DESC');
if (!empty($wsconfig)) {
$query
->condition('name', $wsconfig);
}
$result = $query
->execute();
$list = array();
while ($record = $result
->fetchObject()) {
$data = unserialize($record->data);
$tokens = array();
foreach ($data as $calltitle => $call) {
$matches = array();
if (is_string($call)) {
preg_match_all("/%[a-zA-Z0-9_]+/", $call, $matches);
if (count($matches[0]) > 0) {
$calltitle = explode('_data_method', $calltitle);
$list[$record->name][$calltitle[0]] = $matches[0];
}
}
}
}
return $list;
}