Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/user/views_handler_field_user_permissions.inc | ||
---|---|---|
11 | 11 |
* @ingroup views_field_handlers |
12 | 12 |
*/ |
13 | 13 |
class views_handler_field_user_permissions extends views_handler_field_prerender_list { |
14 |
function construct() { |
|
14 |
|
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function construct() { |
|
15 | 19 |
parent::construct(); |
16 | 20 |
$this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid'); |
17 | 21 |
} |
18 | 22 |
|
19 |
function query() { |
|
23 |
/** |
|
24 |
* {@inheritdoc} |
|
25 |
*/ |
|
26 |
public function query() { |
|
20 | 27 |
$this->add_additional_fields(); |
21 | 28 |
$this->field_alias = $this->aliases['uid']; |
22 | 29 |
} |
23 | 30 |
|
24 |
function pre_render(&$values) { |
|
31 |
/** |
|
32 |
* {@inheritdoc} |
|
33 |
*/ |
|
34 |
public function pre_render(&$values) { |
|
25 | 35 |
$uids = array(); |
26 | 36 |
$this->items = array(); |
27 | 37 |
|
... | ... | |
30 | 40 |
} |
31 | 41 |
|
32 | 42 |
if ($uids) { |
33 |
// Get a list of all the modules implementing a hook_permission() and sort by
|
|
34 |
// display name. |
|
43 |
// Get a list of all the modules implementing a hook_permission() and |
|
44 |
// sort by display name.
|
|
35 | 45 |
$module_info = system_get_info('module'); |
36 | 46 |
$modules = array(); |
37 | 47 |
foreach (module_implements('permission') as $module) { |
... | ... | |
50 | 60 |
} |
51 | 61 |
} |
52 | 62 |
|
53 |
function render_item($count, $item) { |
|
63 |
/** |
|
64 |
* {@inheritdoc} |
|
65 |
*/ |
|
66 |
public function render_item($count, $item) { |
|
54 | 67 |
return $item['permission']; |
55 | 68 |
} |
56 | 69 |
|
57 |
/* |
|
58 |
function document_self_tokens(&$tokens) { |
|
59 |
$tokens['[' . $this->options['id'] . '-role' . ']'] = t('The name of the role.'); |
|
60 |
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.'); |
|
61 |
} |
|
70 |
/** |
|
71 |
* |
|
72 |
*/ |
|
73 |
// function document_self_tokens(&$tokens) { |
|
74 |
// $tokens['[' . $this->options['id'] . '-role' . ']'] = t('The name of the role.'); |
|
75 |
// $tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.'); |
|
76 |
// } |
|
77 |
|
|
78 |
/** |
|
79 |
* |
|
80 |
*/ |
|
81 |
// function add_self_tokens(&$tokens, $item) { |
|
82 |
// $tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role']; |
|
83 |
// $tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid']; |
|
84 |
// } |
|
62 | 85 |
|
63 |
function add_self_tokens(&$tokens, $item) { |
|
64 |
$tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role']; |
|
65 |
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid']; |
|
66 |
} |
|
67 |
*/ |
|
68 | 86 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules