/**
  * Sets variable for view of "Default" page
  */
 public function renderDefault()
 {
     //sets Pagination
     $vp = new \VisualPaginator($this, 'vp');
     $vp->setTemplate('template-schoolyear.phtml');
     $vp->short = FALSE;
     //output the whole list
     $paginator = $vp->getPaginator();
     //get the data to paginate
     $params = $this->context->parameters;
     $folders = scandir($params['wwwDir'] . $params['hlasinekStorage']);
     $base = mb_substr($folders['2'], 0, 4);
     //starting folder, skipping "." & ".."
     //configuration
     $paginator->setBase($base);
     $paginator->setItemCount(count($folders) - 2);
     //substracts "." & ".."
     $paginator->setItemsPerPage(1);
     //default case
     $dir = end($folders);
     $page = $vp->page ? $vp->page : mb_substr($dir, 0, 4);
     $paginator->setPage($page);
     $template = $this->template;
     $template->title = "Hlásínek";
     $template->dir = $page . ((int) $page + 1);
 }
 /**
  * Sets variables for view of "Default" page
  */
 public function renderDefault()
 {
     $template = $this->template;
     $template->title = "Kronika";
     $vp = new \VisualPaginator($this, 'vp');
     $vp->short = FALSE;
     //output the whole list
     $vp->setTemplate('template-schoolyear.phtml');
     $paginator = $vp->getPaginator();
     $year = idate("m") < 8 ? idate("Y") - 1 : idate("Y");
     //school year start in August
     $paginator->setBase($this->context->parameters['baseChronicleYear']);
     $page = $vp->page ? $vp->page : $year;
     $paginator->setItemCount($year - $paginator->getBase() + 1);
     $paginator->setItemsPerPage(1);
     $paginator->setPage($page);
     $template->chronicles = $this->events->getEventsForChronicle($page);
 }
 /**
  * Overview of all chronicles
  *
  * @Privilege("default")
  */
 public function renderDefault()
 {
     $vp = new \VisualPaginator($this, 'vp');
     $vp->short = FALSE;
     //display full list
     $vp->setTemplate('template-schoolyear.phtml');
     $paginator = $vp->getPaginator();
     $year = idate("m") < 8 ? idate("Y") - 1 : idate("Y");
     $paginator->setBase($this->context->parameters["baseChronicleYear"]);
     $page = $vp->page ? $vp->page : $year;
     $paginator->setItemCount($year - $paginator->getBase() + 1);
     $paginator->setItemsPerPage(1);
     $paginator->setPage($page);
     $template = $this->template;
     $template->events = $this->events->getOrderedEventsFromYear($page);
 }
예제 #4
0
 /**
  * Calendar and Event invitation overview
  *
  * @Privilege("default")
  */
 public function renderDefault()
 {
     $vp = new \VisualPaginator($this, 'vp');
     $vp->short = FALSE;
     $vp->setTemplate('template-schoolyear.phtml');
     $paginator = $vp->getPaginator();
     $year = idate("m") < 8 ? idate("Y") - 1 : idate("Y");
     //school year starts in August
     $paginator->setBase($this->context->parameters['baseEventYear']);
     $page = $vp->page ? $vp->page : $year;
     $paginator->setItemCount($year - $paginator->getBase() + 1);
     $paginator->setItemsPerPage(1);
     $paginator->setPage($page);
     $template = $this->template;
     $template->events = $this->events->getMajorEventsFromYear($page)->order('dateend ASC');
     $template->calendars = $this->calendars->descendingOrder();
 }