-/**
- * @brief Admin Inspect Queue Page
- *
- * Generates a page for the admin to have a look into the current queue of
- * postings that are not deliverable. Shown are the name and url of the
- * recipient, the delivery network and the dates when the posting was generated
- * and the last time tried to deliver the posting.
- *
- * The returned string holds the content of the page.
- *
- * @param App $a
- * @return string
- */
-function admin_page_queue(App $a)
-{
- // get content from the queue table
- $entries = DBA::p("SELECT `contact`.`name`, `contact`.`nurl`,
- `queue`.`id`, `queue`.`network`, `queue`.`created`, `queue`.`last`
- FROM `queue` INNER JOIN `contact` ON `contact`.`id` = `queue`.`cid`
- ORDER BY `queue`.`cid`, `queue`.`created`");
-
- $r = [];
- while ($entry = DBA::fetch($entries)) {
- $entry['created'] = DateTimeFormat::local($entry['created']);
- $entry['last'] = DateTimeFormat::local($entry['last']);
- $r[] = $entry;
- }
- DBA::close($entries);
-
- $t = Renderer::getMarkupTemplate('admin/queue.tpl');
- return Renderer::replaceMacros($t, [
- '$title' => L10n::t('Administration'),
- '$page' => L10n::t('Inspect Queue'),
- '$count' => count($r),
- 'id_header' => L10n::t('ID'),
- '$to_header' => L10n::t('Recipient Name'),
- '$url_header' => L10n::t('Recipient Profile'),
- '$network_header' => L10n::t('Network'),
- '$created_header' => L10n::t('Created'),
- '$last_header' => L10n::t('Last Tried'),
- '$info' => L10n::t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
- '$entries' => $r,
- ]);
-}
-