Projet

Général

Profil

Révision bc175c27

Ajouté par Assos Assos il y a plus de 5 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.theme.inc
2 2

  
3 3
/**
4 4
 * @file
5
 * theming functions for the LDAP authorization module.
5
 * Theming functions for the LDAP authorization module.
6 6
 */
7 7

  
8
/**
9
 *
10
 */
8 11
function theme_ldap_authorization_admin_index(&$variables) {
9 12
  $consumers = $variables['consumers'];
10 13

  
11 14
  $table = array(
12
    'header' =>  array(t('LDAP Server ID'), t('Description'), t('Module'), t('Consumer Type'), t('Enabled'), t('Operations')),
15
    'header' => array(t('LDAP Server ID'), t('Description'), t('Module'), t('Consumer Type'), t('Enabled'), t('Operations')),
13 16
    'attributes' => array('id' => 'ldap_consumer_confs', 'class' => 'data'),
14 17
    'colgroups' => array(),
15 18
    'sticky' => FALSE,
......
22 25

  
23 26
    if ($consumer->consumerConf->inDatabase) {
24 27
      $admin = new LdapAuthorizationConsumerConfAdmin($consumer);
25
      $actions =  join(' | ', $admin->getLdapAuthorizationConsumerActions());
28
      $actions = join(' | ', $admin->getLdapAuthorizationConsumerActions());
26 29
    }
27 30
    else {
28
      $actions =  l(t('add'), LDAP_SERVERS_MENU_BASE_PATH . '/authorization/add/' . $consumer->consumerType);
31
      $actions = l(t('add'), LDAP_SERVERS_MENU_BASE_PATH . '/authorization/add/' . $consumer->consumerType);
29 32
    }
30 33

  
31 34
    $table['rows'][] = array(
......
34 37
      $consumer->consumerModule,
35 38
      $consumer_type,
36 39
      ($consumer->consumerConf->status) ? t('Yes') : t('No'),
37
      $actions
40
      $actions,
38 41
    );
39 42
  }
40 43
  return theme('table', $table);
41 44

  
42 45
}
43 46

  
44

  
47
/**
48
 *
49
 */
45 50
function theme_ldap_authorization_test_results($variables) {
46 51

  
47 52
  $results = $variables['results'];
......
69 74
      foreach ($user_results as $consumer_type => $authorizations) {
70 75
        if (is_array($authorizations) && count($authorizations) > 0) {
71 76
          $authorizations = $consumer->convertToFriendlyAuthorizationIds($authorizations);
72
          $authorizations_text =  theme('item_list', array('items' => array_values($authorizations), 'title' => NULL, 'type' => 'ul', 'attributes' => array()));
77
          $authorizations_text = theme('item_list', array('items' => array_values($authorizations), 'title' => NULL, 'type' => 'ul', 'attributes' => array()));
73 78
        }
74 79
        else {
75 80
          $authorizations_text = "";
......
85 90
        }
86 91
        elseif (is_array($user_notifications) && count($user_notifications) > 0) {
87 92
          foreach ($user_notifications as $i => $notification) {
88
            $authorizations_text .=  ldap_authorization_map_errors($notification, $consumer_conf_link);
93
            $authorizations_text .= ldap_authorization_map_errors($notification, $consumer_conf_link);
89 94
          }
90 95
        }
91 96
        $row = array($username_link, $consumer->name, $authorizations_text, $consumer_conf_link, $server_link);
......
98 103

  
99 104
  return $output;
100 105

  
101
  }
106
}
102 107

  
108
/**
109
 *
110
 */
103 111
function ldap_authorization_map_errors($err_id, $consumer_conf_link) {
104 112

  
105 113
  $tokens = array('%consumer_conf_link' => $consumer_conf_link);
......
107 115

  
108 116
    case  LDAP_AUTHORIZATION_USER_LDAP_NOT_FOUND:
109 117
      $authorizations_text = t('LDAP entry for drupal user not found.', $tokens);
110
    break;
118
      break;
111 119

  
112 120
    case LDAP_AUTHORIZATION_USER_NOT_LDAP_AUTHENTICATED:
113 121
      $authorizations_text = t('LDAP Authorizations not applied because user is not
114 122
      authenticated via LDAP and configuration requires is (%consumer_conf_link).', $tokens);
115
    break;
123
      break;
116 124

  
117 125
    case LDAP_AUTHORIZATION_MAP_NOT_CONF_FOR_LOGON:
118 126
      $authorizations_text = t('LDAP Authorizations not configured to be executed on logon in  (%consumer_conf_link).', $tokens);
119
    break;
127
      break;
120 128

  
121 129
    case LDAP_AUTHORIZATION_NOT_APPLY_USER_1:
122 130
      $authorizations_text = t('LDAP Authorizations not applicable to user 1.', $tokens);
123
    break;
131
      break;
124 132

  
125 133
    case LDAP_AUTHORIZATION_SERVER_CONFIG_NOT_FOUND:
126 134
      $authorizations_text = t('Enabled LDAP server configuration not found for given ldap consumer type in (%consumer_conf_link).', $tokens);
127
    break;
135
      break;
128 136

  
129 137
    default:
130 138
      $authorizations_text = "Failed.";

Formats disponibles : Unified diff