/[drupal]/contributions/modules/password_policy/password_policy.theme.inc
ViewVC logotype

Contents of /contributions/modules/password_policy/password_policy.theme.inc

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


Revision 1.3 - (show annotations) (download) (as text)
Thu Nov 6 10:50:39 2008 UTC (12 months, 3 weeks ago) by miglius
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA2, HEAD
Changes since 1.2: +9 -9 lines
File MIME type: text/x-php
password_policy: fixing policy lists, #327516
1 <?php
2 // $Id: password_policy.theme.inc,v 1.2 2008/07/13 23:16:45 miglius Exp $
3 /**
4 * @file
5 * Theme callback file for the password_policy module.
6 */
7
8 //////////////////////////////////////////////////////////////////////////////
9 // Password policy admin themes
10
11 /**
12 * Custom theme for rendering a radio list of defined policies.
13 * This layout is based on a similar layout found in the "filter" module.
14 *
15 * @ingroup themeable
16 */
17 function theme_password_policy_admin_list($form) {
18 $rows = array();
19 foreach ($form as $pid => $element) {
20 if (isset($element['edit']) && is_array($element['edit'])) {
21 $rows[] = array(
22 drupal_render($form['default'][$pid]),
23 check_plain($form[$pid]['name']['#value']),
24 drupal_render($form[$pid]['created']),
25 drupal_render($form[$pid]['view']),
26 drupal_render($form[$pid]['edit']),
27 drupal_render($form[$pid]['delete'])
28 );
29 unset($form[$pid]);
30 }
31 }
32 if (empty($rows)) {
33 $rows[] = array(array('data' => t('No policies defined.'), 'colspan' => 5));
34 unset($form['submit']);
35 unset($form['clear']);
36 }
37 $header = array(t('Default'), array('data' => t('Name'), 'field' => 'name', 'sort' => 'asc'), t('Enabled'), array('data' => t('Operations'), 'colspan' => 3));
38 $output = theme('table', $header, $rows);
39 $output .= drupal_render($form);
40
41 return $output;
42 }
43

  ViewVC Help
Powered by ViewVC 1.1.2