function theme_freelinking_page_form in Freelinking 5
Same name and namespace in other branches
- 6 freelinking.module \theme_freelinking_page_form()
- 6.2 freelinking.module \theme_freelinking_page_form()
File
- ./
freelinking.module, line 104
Code
function theme_freelinking_page_form($form) {
if (isset($form['options']) && is_array($form['options'])) {
// Only admins see the options form and the tableselect checkbox
$output .= drupal_render($form['options']);
$header = array(
theme('table_select_header_cell'),
array(
'data' => t('Phrase'),
'field' => 'phrase',
'sort' => 'asc',
),
array(
'data' => t('Target'),
'field' => 'path',
),
);
}
else {
$header = array(
array(
'data' => t('Phrase'),
'field' => 'phrase',
'sort' => 'asc',
),
array(
'data' => t('Target'),
'field' => 'path',
),
);
}
if (isset($form['phrase']) && is_array($form['phrase'])) {
foreach (element_children($form['phrase']) as $key) {
$row = array();
if (isset($form['links'][$key])) {
// Only admins see the checkbox
$row[] = drupal_render($form['links'][$key]);
}
$row[] = drupal_render($form['phrase'][$key]);
$row[] = drupal_render($form['target'][$key]);
$rows[] = $row;
}
}
else {
$rows[] = array(
array(
'data' => t('No freelinks available.'),
'colspan' => user_access("administer freelinking") ? '3' : '2',
),
);
}
$output .= theme('table', $header, $rows);
if ($form['pager']['#value']) {
$output .= drupal_render($form['pager']);
}
$output .= drupal_render($form);
return $output;
}