news_pretty_status (public)
news_pretty_status -publish_date publish_date \ -archive_date archive_date -status status
Defined in packages/news/tcl/news-procs.tcl
Given the publish status of a news items return a localization human readable sentence for the status.
- Switches:
- -publish_date (required)
- -archive_date (required)
- -status (required)
- Publish status short name. Valid values are returned by the plsql function news_status.
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- news_pretty_status
Source code: array set news_status_keys { unapproved news.Unapproved going_live_no_archive news.going_live_no_archive going_live_with_archive news.going_live_with_archive published_no_archive news.published_no_archive published_with_archive news.published_scheduled_for_archive archived news.Archived } set now_seconds [clock scan now] set n_days_until_archive {} if { $archive_date ne "" } { set archive_date_seconds [clock scan $archive_date] if { $archive_date_seconds > $now_seconds } { # Scheduled for archive set n_days_until_archive [expr {($archive_date_seconds - $now_seconds) / 86400}] } } if { $publish_date ne "" } { # The item has been published or is scheduled to be published set publish_date_seconds [clock scan $publish_date] if { $publish_date_seconds > $now_seconds } { # Will be published in the future set n_days_until_publish [expr {($publish_date_seconds - $now_seconds) / 86400}] } } # Message lookup may use vars n_days_until_archive and n_days_until_publish return [_ $news_status_keys($status)]Generic XQL file: packages/news/tcl/news-procs.xql
PostgreSQL XQL file: packages/news/tcl/news-procs-postgresql.xql
Oracle XQL file: packages/news/tcl/news-procs-oracle.xql