function simplenews_scheduler_handler_newsletters in Simplenews Scheduler 2.0.x
Same name and namespace in other branches
- 8 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
- 5 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
- 6.2 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
- 7 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
1 string reference to 'simplenews_scheduler_handler_newsletters'
- simplenews_scheduler_views_tables in ./
simplenews_scheduler_views.inc - Implementation of hook_views_tables
File
- ./
simplenews_scheduler_views.inc, line 32 - simplenews_scheduler_views.inc Views support for simplenews
Code
function simplenews_scheduler_handler_newsletters() {
$list = array();
$result = \Drupal::database()
->query("SELECT ss.*,n.title FROM {simplenews_scheduler} ss JOIN {node} n ON n.nid = ss.snid GROUP BY snid");
while ($row = db_fetch_array($result)) {
$list[$row['snid']] = "Newsletter: " . $row['title'];
}
if (count($list) == 0) {
\Drupal::messenger()
->addMessage(t('No current newsletter found to filter against, you should create a simplenews newsletter first.'));
}
return $list;
}