Alternc  latest
Alternc logiel libre pour l'hébergement
piwik_utils.php File Reference

Go to the source code of this file.

Functions

 piwik_right_widget ($name, $subname, $cred)
 
 piwik_select_element ($name, $credz='noaccess')
 

Variables

 $piwik_available_rights = array('noaccess', 'view', 'admin')
 

Function Documentation

◆ piwik_right_widget()

piwik_right_widget (   $name,
  $subname,
  $cred 
)

Definition at line 5 of file piwik_utils.php.

5  {
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 }
$piwik_available_rights
Definition: piwik_utils.php:3
$i

References $i, and $piwik_available_rights.

◆ piwik_select_element()

piwik_select_element (   $name,
  $credz = 'noaccess' 
)

Definition at line 17 of file piwik_utils.php.

17  {
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 }

Variable Documentation

◆ $piwik_available_rights

$piwik_available_rights = array('noaccess', 'view', 'admin')

Definition at line 3 of file piwik_utils.php.

Referenced by piwik_right_widget().