• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/node/views_handler_argument_dates_various.inc

Go to the documentation of this file.
00001 <?php
00011 class views_handler_argument_node_created_fulldate extends views_handler_argument_date {
00015   function construct() {
00016     parent::construct();
00017     $this->format = 'F j, Y';
00018     $this->arg_format = 'Ymd';
00019     $this->formula = views_date_sql_format($this->arg_format, "***table***.$this->real_field");
00020   }
00021 
00025   function summary_name($data) {
00026     $created = $data->{$this->name_alias};
00027     return format_date(strtotime($created . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00028   }
00029 
00033   function title() {
00034     return format_date(strtotime($this->argument . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00035   }
00036 }
00037 
00041 class views_handler_argument_node_created_year extends views_handler_argument_date {
00045   function construct() {
00046     parent::construct();
00047     $this->arg_format = 'Y';
00048     $this->formula = views_date_sql_extract('YEAR', "***table***.$this->real_field");
00049   }
00050 }
00051 
00055 class views_handler_argument_node_created_year_month extends views_handler_argument_date {
00059   function construct() {
00060     parent::construct();
00061     $this->format = 'F Y';
00062     $this->arg_format = 'Ym';
00063     $this->formula = views_date_sql_format($this->arg_format, "***table***.$this->real_field");
00064   }
00065 
00069   function summary_name($data) {
00070     $created = $data->{$this->name_alias};
00071     return format_date(strtotime($created . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00072   }
00073 
00077   function title() {
00078     return format_date(strtotime($this->argument . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00079   }
00080 }
00081 
00085 class views_handler_argument_node_created_month extends views_handler_argument_date {
00089   function construct() {
00090     parent::construct();
00091     $this->formula = views_date_sql_extract('MONTH', "***table***.$this->real_field");
00092     $this->format = 'F';
00093     $this->arg_format = 'm';
00094   }
00095 
00099   function summary_name($data) {
00100     $month = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
00101     return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC" ), 'custom', $this->format, 'UTC');
00102   }
00103 
00107   function title() {
00108     $month = str_pad($this->argument, 2, '0', STR_PAD_LEFT);
00109     return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00110   }
00111 
00112   function summary_argument($data) {
00113     // Make sure the argument contains leading zeroes.
00114     return str_pad($data->{$this->base_alias}, 2, '0', STR_PAD_LEFT);
00115   }
00116 }
00117 
00121 class views_handler_argument_node_created_day extends views_handler_argument_date {
00125   function construct() {
00126     parent::construct();
00127     $this->formula = views_date_sql_extract('DAY', "***table***.$this->real_field");
00128     $this->format = 'j';
00129     $this->arg_format = 'd';
00130   }
00131 
00135   function summary_name($data) {
00136     $day = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
00137     // strtotime respects server timezone, so we need to set the time fixed as utc time
00138     return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00139   }
00140 
00144   function title() {
00145     $day = str_pad($this->argument, 2, '0', STR_PAD_LEFT);
00146     return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
00147   }
00148 
00149   function summary_argument($data) {
00150     // Make sure the argument contains leading zeroes.
00151     return str_pad($data->{$this->base_alias}, 2, '0', STR_PAD_LEFT);
00152   }
00153 }
00154 
00158 class views_handler_argument_node_created_week extends views_handler_argument_date {
00162   function construct() {
00163     parent::construct();
00164     $this->arg_format = 'w';
00165     $this->formula = views_date_sql_extract('WEEK', "***table***.$this->real_field");
00166   }
00167 
00171   function summary_name($data) {
00172     $created = $data->{$this->name_alias};
00173     return t('Week @week', array('@week' => $created));
00174   }
00175 }
00176 

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1