/** * Gets the headline (Usually just formatting the log date) * * @param string Filename * @return string Formatted Date */ protected function headline($file) { if (!$file) { return 'Welcome to Console!'; } else { $path = pathinfo($file); list($year, $month) = explode('/', $path['dirname']); $day = $path['filename']; return sprintf('%s %s, %s', Console::get_month($month), $day, $year); } }
<div class="directory"> <?php foreach ($dir as $year => $months) { ?> <h2><?php echo $year; ?> </h2> <div class="year"> <?php foreach ($months as $month => $days) { ?> <div class="month"> <h3><?php echo Console::get_month($month); ?> </h3> <ul class="files"> <?php foreach ($days as $day => $file) { $li = ''; $li .= $active && $year . '/' . $month == $active['dirname'] && $day == $active['filename'] ? '<li class="active">' : '<li>'; $uri = Request::instance()->uri(array('file' => $file)); $li .= HTML::anchor($uri, $day) . '</li>'; echo "\t{$li}\n"; } ?> </ul> </div> <?php }