コード例 #1
0
ファイル: event.php プロジェクト: rair/yacs
 /**
  * a compact list of dates at some anchor
  *
  * @param string the anchor to consider (e.g., 'section:123')
  * @param int maximum number of items
  * @return array of ($prefix, $label, $suffix, $type, $icon, $hover)
  */
 function render_list_for_anchor($anchor, $count = 7)
 {
     global $context;
     // we will build a list of dates
     include_once $context['path_to_root'] . 'dates/dates.php';
     // list past dates as well
     if (preg_match('/\\bwith_past_dates\\b/i', $this->attributes['overlay_parameters'])) {
         $items = Dates::list_for_anchor($anchor, 0, $count, 'compact');
     } else {
         $items = Dates::list_future_for_anchor($anchor, 0, $count, 'compact');
     }
     // we return an array
     return $items;
 }