/** * Generate a standard "line" of the body. * * It is important to note that the table has only 2 columns, so * the timelineFragment() method of each item must take that into * account. */ function bodyLine($item) { $doc = Pluf::factory($item->model_class, $item->model_id); $doc->public_dtime = $item->public_dtime; $item_day = Pluf_Template_dateFormat($item->creation_dtime, '%y-%m-%d'); $out = ''; if ($this->current_day == null or Pluf_Date::dayCompare($this->current_day, $item_day) != 0) { $day = Pluf_Template_dateFormat($item->creation_dtime); if ($item_day == Pluf_Template_timeFormat(time(), 'y-m-d')) { $day = __('Today'); } $out = '<tr><th colspan="2">' . $day . '</th></tr>' . "\n"; $this->current_day = $item_day; } return $out . $doc->timelineFragment($item->request); }
/** * Display the time in a "6 days, 23 hours ago" style. */ function Pluf_Template_timeAgo($date, $f = "withal") { Pluf::loadFunction('Pluf_Date_Easy'); $date = Pluf_Template_timeFormat($date); if ($f == 'withal') { return Pluf_Date_Easy($date, null, 2, __('now')); } else { return Pluf_Date_Easy($date, null, 2, __('now'), false); } }