Beispiel #1
0
         // total count of versions
         $box['bar'] += array('_count' => sprintf(i18n::ns('%d version', '%d versions', $stats['count']), $stats['count']));
         // navigation commands
         $home = 'versions/list.php';
         if ($context['with_friendly_urls'] == 'Y') {
             $prefix = $home . '/' . str_replace(':', '/', $anchor->get_reference());
         } elseif ($context['with_friendly_urls'] == 'R') {
             $prefix = $home . '/' . str_replace(':', '/', $anchor->get_reference());
         } else {
             $prefix = $home . '?id=' . $anchor->get_reference() . '&page=';
         }
         $box['bar'] += Skin::navigate($home, $prefix, $stats['count'], VERSIONS_PER_PAGE, $page);
     }
     // query the database and layout that stuff
     $offset = ($page - 1) * VERSIONS_PER_PAGE;
     if ($items = Versions::list_by_date_for_anchor($anchor->get_reference(), $offset, VERSIONS_PER_PAGE, 'full')) {
         // we have an array to format
         if (@count($items)) {
             $items = array_merge(array('_' => sprintf(i18n::s('edited by %s %s'), ucfirst($anchor->get_value('edit_name')), Skin::build_date($anchor->get_value('edit_date')))), $items);
             $box['text'] .= Skin::build_list($items, 'decorated');
         }
         // layout everything in a box
         if (count($box['bar'])) {
             $box['text'] = Skin::build_list($box['bar'], 'menu_bar') . "\n" . $box['text'];
         }
         $text =& Skin::build_box($box['title'], $box['text']);
     }
     // cache this to speed subsequent queries
     Cache::put($cache_id, $text, 'versions');
 }
 $context['text'] .= $text;