theme('indentation', $form['old_items'][$key]['depth']['#value']) .
drupal_render($form['old_items'][$key]['id']) .
drupal_render($form['old_items'][$key]['property']) .
drupal_render($form['old_items'][$key]['wildcard']) .
drupal_render($form['old_items'][$key]['operator']) .
drupal_render($form['old_items'][$key]['value']),
'class' => 'themekey-properties-row');
$elements[] = array('data' =>
drupal_render($form['old_items'][$key]['theme']));
$elements[] = array('data' =>
drupal_render($form['old_items'][$key]['enabled']));
$elements[] = array('data' =>
drupal_render($form['old_items'][$key]['delete']));
$elements[] = array('data' =>
drupal_render($form['old_items'][$key]['parent']));
$elements[] = array('data' =>
drupal_render($form['old_items'][$key]['weight']));
$elements[] = array('data' =>
'' .
theme('themekey_page_cache_icon', $attributes[$form['old_items'][$key]['property']['#default_value']]['page cache']) .
'
');
$row['class'] = !empty($row['class']) ? $row['class'] .' draggable' : 'draggable';
if (!$form['old_items'][$key]['enabled']['#value']) {
$row['class'] .= ' themekey-fade-out';
}
if (!$form['old_items'][$key]['parent']['#value']) {
$row['class'] .= ' themekey-top-level';
}
$row['id'] = 'themekey-properties-row-' . $key;
$row['data'] = $elements;
$rows[] = $row;
}
}
}
if (!empty($rows)) {
if (empty($form['pager']['#value'])) {
drupal_add_tabledrag('themekey-properties', 'match', 'parent', 'themekey-property-parent', 'themekey-property-parent', 'themekey-property-id', TRUE);
drupal_add_tabledrag('themekey-properties', 'order', 'sibling', 'themekey-property-weight');
}
$header = array(
array('data' => t('Theme Switching Rule Chain')),
array('data' => t('Theme')),
array('data' => t('Enabled')),
array('data' => t('Operation')),
array('data' => t('Parent')),
array('data' => t('Weight')),
array('data' => t('Page
Cache')),
);
$output .= theme('table', $header, $rows, array('id' => 'themekey-properties'));
foreach ($num_childs as $parent => $num) {
$output .= '';
}
}
$rows = array();
if (!empty($form['new_item'])) {
if (isset($form['new_item']['property'])) {
$row = (isset($form['new_item']['#attributes']) && is_array($form['new_item']['#attributes'])) ? $form['new_item']['#attributes'] : array();
// Add special classes to be used for themekey-properties.js.
$form['new_item']['property']['#attributes']['class'] = 'themekey-property-property';
$form['new_item']['wildcard']['#attributes']['class'] = 'themekey-property-wildcard';
if ('drupal:path:wildcard' != $form['new_item']['property']['#value']) {
$form['new_item']['wildcard']['#attributes']['style'] = 'display: none';
}
$elements = array();
$elements[] = t('New Rule:');
$elements[] = array('data' =>
drupal_render($form['new_item']['property']) .
drupal_render($form['new_item']['wildcard']) .
drupal_render($form['new_item']['operator']) .
drupal_render($form['new_item']['value']),
'class' => 'themekey-properties-row');
$elements[] = array('data' => drupal_render($form['new_item']['theme']));
$elements[] = array('data' => drupal_render($form['new_item']['enabled']));
$row['data'] = $elements;
$rows[] = $row;
}
}
if (!empty($rows)) {
$header = array(
'',
array('data' => t('Theme Switching Rule')),
array('data' => t('Theme')),
array('data' => t('Enabled')),
);
$output .= '