function theme_om_maximenu_links_order in OM Maximenu 8
Same name and namespace in other branches
- 6 inc/om_maximenu.admin.inc \theme_om_maximenu_links_order()
- 7 inc/om_maximenu.admin.inc \theme_om_maximenu_links_order()
Implementation of theme_hook()
- View in table format
1 theme call to theme_om_maximenu_links_order()
- _om_maximenu_admin in inc/
om_maximenu.admin.inc - Admin Form
File
- inc/
om_maximenu.admin.inc, line 962 - OM Maximenu Admin Configuration
Code
function theme_om_maximenu_links_order($form) {
//dsm($form['form']);
$form = $form['form'];
$menu_key = $form['menu_key']['#value'];
$output = '';
//dsm($form['layout']);
$rows = array();
foreach ($form as $key => $prop) {
if (is_numeric($key)) {
$row = array();
// Strips labels
unset($prop['weight']['#title']);
unset($prop['weight']['#description']);
unset($prop['link_delete']['#title']);
unset($form[$key]['#description']);
unset($form[$key]['weight']);
unset($form[$key]['link_delete']);
$row[] = array(
'class' => 'col-link',
'data' => drupal_render($form[$key]),
);
$row[] = array(
'class' => 'col-attached',
'data' => $prop['#description'],
);
$row[] = array(
'class' => 'col-weight',
'data' => drupal_render($prop['weight']),
);
$row[] = array(
'class' => 'col-delete',
'data' => drupal_render($prop['link_delete']),
);
$rows[] = array(
'data' => $row,
'id' => 'om-row-' . $menu_key . '-' . $key,
'class' => array(
'draggable row-' . $key,
'tabledrag-leaf',
),
);
}
}
$header = array(
t('Link'),
t('Attached Blocks'),
t('Weight'),
t('Delete'),
);
//, 'Update'
// Header
$form['form']['#children'] = theme('table', array(
'header' => $header,
'rows' => $rows,
'attributes' => array(
'id' => 'om-maximenu-links-' . $menu_key,
),
));
//drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgroup = NULL, $source = NULL, $hidden = TRUE, $limit = 0);
drupal_add_tabledrag('om-maximenu-links-' . $menu_key, 'order', 'group', 'om-weight');
$output .= drupal_render_children($form);
return $output;
}