Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
piwik_utils.php
Go to the documentation of this file.
1 <?php
2 
3 $piwik_available_rights = array('noaccess', 'view', 'admin');
4 
5 function piwik_right_widget($name, $subname, $cred) {
7  $elem = '';
8  $i = 1;
9  foreach ($piwik_available_rights AS $piwik_right) {
10  $elem .= sprintf('<input type="radio" id="%s-%d" name="%s[%s]" value="%s" %s/>', $name . $subname, $i, $name, $subname, $piwik_right, (($cred === $piwik_right) ? ' checked ' : ''));
11  $elem .= sprintf('<label for="%s-%d">%s</label>', $name . $subname, $i++, _($piwik_right));
12  }
13  return $elem;
14 }
15 
16 
17 function piwik_select_element($name, $credz = 'noaccess') {
18  $elem = '<select name="' . $name . '">';
19  foreach (array('noaccess', 'view', 'admin') AS $cred)
20  $elem .= "\t" . '<option value="' . $cred . '"' . (($cred === $credz) ? ' selected ' : '') . '>' . $cred . '</option>' . "\n";
21  $elem .= '</select>';
22 
23  return $elem;
24 }