function shorten_cs_services_table in Shorten URLs 6
Same name and namespace in other branches
- 7.2 shorten_cs.admin.inc \shorten_cs_services_table()
- 7 shorten_cs.admin.inc \shorten_cs_services_table()
Displays the table of existing custom services.
1 call to shorten_cs_services_table()
- theme_shorten_cs_admin in ./
shorten_cs.admin.inc - Themes the configuration page.
File
- ./
shorten_cs.admin.inc, line 18 - Provides the configuration page for Shorten URLs Custom Services.
Code
function shorten_cs_services_table() {
$header = array(
t('Name'),
t('URL'),
t('Type'),
t('XML/JSON tag'),
t('Actions'),
);
$rows = array();
$result = db_query("SELECT * FROM {shorten_cs} ORDER BY name ASC");
while ($service = db_fetch_array($result)) {
$service = array(
'sid' => $service['sid'],
'name' => check_plain($service['name']),
'url' => check_plain($service['url']),
'type' => $service['type'],
'tag' => check_plain($service['tag']),
);
$service['actions'] = l(t('edit'), 'admin/settings/shorten/custom/edit/' . $service['sid']) . ' ' . l(t('delete'), 'admin/settings/shorten/custom/delete/' . $service['sid']);
unset($service['sid']);
$rows[] = $service;
}
if (!empty($rows)) {
return theme('table', $header, $rows);
}
return '';
}