56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
class ProductgroupController extends mfBaseController {
|
|
|
|
protected function init() {
|
|
$this->needlogin=true;
|
|
$me = new User();
|
|
$me->loadMe();
|
|
$this->me = $me;
|
|
$this->layout()->set("me",$me);
|
|
|
|
if(!$me->isAdmin()) {
|
|
$this->redirect("Dashboard");
|
|
}
|
|
}
|
|
|
|
protected function indexAction() {
|
|
$this->layout()->setTemplate("Productgroup/Index");
|
|
|
|
$filter = [];
|
|
if(is_array($this->request->filter)) {
|
|
$filter = $this->request->filter;
|
|
}
|
|
|
|
$this->layout->set("filter", $filter);
|
|
|
|
if($filter) {
|
|
$filter = $this->getPreparedFilter($filter);
|
|
}
|
|
|
|
// pagination defaults
|
|
$pagination = [];
|
|
$pagination['start'] = 0;
|
|
$pagination['count'] = 20;
|
|
$pagination['maxItems'] = 0;
|
|
|
|
if(is_numeric($this->request->s)) {
|
|
$pagination['start'] = intval($this->request->s);
|
|
}
|
|
|
|
$pagination['maxItems'] = ProductgroupModel::count($filter);
|
|
$this->layout()->set("pagination", $pagination);
|
|
$productgroups = ProductgroupModel::search($filter, $pagination);
|
|
$this->layout()->set("productgroups", $productgroups);
|
|
}
|
|
|
|
protected function addAction() {
|
|
|
|
}
|
|
|
|
protected function editAction() {
|
|
|
|
}
|
|
|
|
|
|
} |