Overrides \Drupal\block\BlockBase::access().
Overrides BlockBase::access
public function access() {
if (user_access('access content')) {
$daytop = $this->configuration['top_day_num'];
if (!$daytop || !($result = statistics_title_list('daycount', $daytop)) || !($this->day_list = node_title_list($result, t("Today's:")))) {
return FALSE;
}
$alltimetop = $this->configuration['top_all_num'];
if (!$alltimetop || !($result = statistics_title_list('totalcount', $alltimetop)) || !($this->all_time_list = node_title_list($result, t('All time:')))) {
return FALSE;
}
$lasttop = $this->configuration['top_last_num'];
if (!$lasttop || !($result = statistics_title_list('timestamp', $lasttop)) || !($this->last_list = node_title_list($result, t('Last viewed:')))) {
return FALSE;
}
return TRUE;
}
return FALSE;
}