function theme_js_injector_admin_form in JS injector 6
Same name and namespace in other branches
- 6.2 js_injector.admin.inc \theme_js_injector_admin_form()
- 7 js_injector.admin.inc \theme_js_injector_admin_form()
Theme function for the js Injector admin overview form.
File
- ./
js_injector.admin.inc, line 54
Code
function theme_js_injector_admin_form($form) {
$headers = array(
t('Title'),
t('File path'),
t('Actions'),
);
$rows = array();
if (!empty($form['rules'])) {
foreach (element_children($form['rules']) as $crid) {
$row = array();
$rule = $form['rules'][$crid]['#rule'];
$row[] = check_plain($rule['title']);
$row[] = check_plain($rule['file_path']);
$row[] = drupal_render($form['rules'][$crid]);
$rows[] = $row;
}
}
$link = l(t('Create a new rule'), 'admin/settings/js_injector/add');
$row = array();
if (empty($rows)) {
$row[] = array(
'data' => t('No js injection rules have been set up yet. !url.', array(
'!url' => $link,
)),
'colspan' => 3,
);
}
else {
$row[] = array(
'data' => t('!url.', array(
'!url' => $link,
)),
'colspan' => 3,
);
}
$rows[] = $row;
$output .= theme('table', $headers, $rows);
$output .= drupal_render($form);
return $output;
}