/[drupal]/contributions/modules/ldap_integration/ldapauth.theme.inc
ViewVC logotype

Contents of /contributions/modules/ldap_integration/ldapauth.theme.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Tue Oct 27 14:29:17 2009 UTC (4 weeks, 4 days ago) by miglius
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-BETA2, HEAD
Changes since 1.1: +2 -2 lines
File MIME type: text/x-php
ldap_integration: fixed database table indexes, #612956 by lkeller
1 <?php
2 // $Id: ldapauth.theme.inc,v 1.1 2009/03/23 17:58:25 miglius Exp $
3
4 /**
5 * @file
6 * Themes for ldapauth module.
7 */
8
9 //////////////////////////////////////////////////////////////////////////////
10 // Theme callbacks
11
12 /**
13 * Theme function for the admin list form.
14 */
15 function theme_ldapauth_admin_list($form) {
16 drupal_add_tabledrag('ldapauth-list-table', 'order', 'sibling', 'server-weight');
17
18 $header = array(
19 '',
20 t('Server'),
21 array('data' => t('Operations'), 'colspan' => 3),
22 t('Weight'),
23 );
24
25 $rows = array();
26 foreach ($form['list'] as $sid => $element) {
27 if (is_numeric($sid)) {
28 $row = array('');
29 $row[] = check_plain($element['name']['#value']);
30 $row[] = l(t('edit'), 'admin/settings/ldap/ldapauth/edit/'. $sid);
31 $row[] = l($element['status']['#value'] ? t('de-activate') : t('activate'), 'admin/settings/ldap/ldapauth/'. ($element['status']['#value'] ? 'deactivate' : 'activate') .'/'. $sid);
32 $row[] = l(t('delete'), 'admin/settings/ldap/ldapauth/delete/'. $sid);
33 $element['weight']['#attributes']['class'] = "server-weight";
34 $row[] = drupal_render($element['weight']);
35 $rows[] = array('data' => $row, 'class' => 'draggable'. ($element['status']['#value'] ? ' menu-enabled' : ' menu-disabled'));
36 unset($form['list'][$sid]);
37 }
38 }
39
40 if (empty($rows)) {
41 $rows[] = array(array('data' => t('No servers defined.'), 'colspan' => 5));
42 array_pop($header);
43 unset($form['submit']);
44 }
45
46 $form['list']['table'] = array('#value' => theme('table', $header, $rows, array('id' => 'ldapauth-list-table')));
47 return drupal_render($form);
48 }
49

  ViewVC Help
Powered by ViewVC 1.1.2