You are here

protected function StatsPro::set_fields in Statistics Pro 6.2

Same name and namespace in other branches
  1. 6 statspro.inc \statspro::set_fields()

Set all available data field to member variable.

1 call to StatsPro::set_fields()
StatsPro::__construct in ./statspro.inc

File

./statspro.inc, line 57
statspro class for Statistics Pro module.

Class

StatsPro
Manages the data saving and retrieval according to the user defined parameters.

Code

protected function set_fields() {
  $this->fields = array(
    'nuser' => user_access('administer users') ? l(t('User registrations'), 'admin/user/user') : t('User registrations'),
    'auser' => t('User online'),
    'nnode' => user_access('administer nodes') ? l(t('New nodes'), 'admin/content/node') : t('New nodes'),
    'cnode' => user_access('administer nodes') ? l(t('Changed nodes'), 'admin/content/node') : t('Changed nodes'),
    'comment' => user_access('administer comments') ? l(t('Comments'), 'admin/content/comment') : t('Comments'),
  );
  if (module_exists('statistics')) {
    $this->fields += array(
      'pi' => l(t('Page impressions'), 'admin/reports/hits'),
      'upi' => l(t('Page impressions for authenticated users'), 'admin/reports/hits'),
    );
  }
  $this->fields += array(
    'error' => user_access('access site reports') ? l(t('Errors'), 'admin/reports/dblog') : t('Errors'),
    'uerror' => user_access('access site reports') ? l(t('Errors for authenticated users'), 'admin/reports/dblog') : t('Errors for authenticated users'),
    'warning' => user_access('access site reports') ? l(t('Warnings'), 'admin/reports/dblog') : t('Warnings'),
    'uwarning' => user_access('access site reports') ? l(t('Warnings for authenticated users'), 'admin/reports/dblog') : t('Warnings for authenticated users'),
    'emergency' => user_access('access site reports') ? l(t('Emergencies'), 'admin/reports/dblog') : t('Emergencies'),
    'uemergency' => user_access('access site reports') ? l(t('Emergencies for authenticated users'), 'admin/reports/dblog') : t('Emergencies for authenticated users'),
    'alert' => user_access('access site reports') ? l(t('Alerts'), 'admin/reports/dblog') : t('Alerts'),
    'ualert' => user_access('access site reports') ? l(t('Alerts for authenticated users'), 'admin/reports/dblog') : t('Alerts for authenticated users'),
    'critical' => user_access('access site reports') ? l(t('Critical conditions'), 'admin/reports/dblog') : t('Critical conditions'),
    'ucritical' => user_access('access site reports') ? l(t('Critical conditions for authenticated users'), 'admin/reports/dblog') : t('Critical conditions for authenticated users'),
  );
}