Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
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 (   $name,
  $subname,
  $cred 
)

Definition at line 5 of file piwik_utils.php.

References $i, and $piwik_available_rights.

{
$elem = '';
$i = 1;
foreach ($piwik_available_rights AS $piwik_right) {
$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 ' : ''));
$elem .= sprintf('<label for="%s-%d">%s</label>', $name . $subname, $i++, _($piwik_right));
}
return $elem;
}
piwik_select_element (   $name,
  $credz = 'noaccess' 
)

Definition at line 17 of file piwik_utils.php.

{
$elem = '<select name="' . $name . '">';
foreach (array('noaccess', 'view', 'admin') AS $cred)
$elem .= "\t" . '<option value="' . $cred . '"' . (($cred === $credz) ? ' selected ' : '') . '>' . $cred . '</option>' . "\n";
$elem .= '</select>';
return $elem;
}

Variable Documentation

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

Definition at line 3 of file piwik_utils.php.

Referenced by piwik_right_widget().