protected function createComponentGrid($name) { $grid = new Grid($this, $name); $grid->setModel($this->service->getFinder()->getGriditoModel()); // columns $grid->addColumn("id", "ID")->setSortable(true); $grid->addColumn("name", "Název")->setSortable(true); $grid->addColumn("url", "URL")->setSortable(true); $grid->addColumn("description", "Popis")->setSortable(true); $grid->addColumn("allowed", "Samostatný")->setSortable(true); // buttons $presenter = $this; $service = $this->service; $grid->addButton("edit", "Upravit", array("icon" => "ui-icon-pencil", "link" => function ($page) use($presenter) { return $presenter->link("edit", array("id" => $page->id)); }, "showText" => false)); $grid->addButton("delete", "Smazat", array("icon" => "ui-icon-closethick", "handler" => function ($entity) use($service, $presenter) { $service->delete($entity); $presenter->flashMessage("Stránka byla úspěšně smazána."); $presenter->redirect("default"); }, "confirmationQuestion" => function ($page) { return "Opravdu chcete smazat stránku '{$page->name}'?"; }, "showText" => false)); // toolbar $grid->addToolbarButton("new", "Nová stránka", array("icon" => "ui-icon-plusthick", "link" => $this->link("add"))); }
public function update($id, $values, $form = null) { if (empty($values["password"])) { unset($values["password"]); } parent::update($id, $values, $form); }
public function __construct($em) { parent::__construct($em, __NAMESPACE__ . "\\Gallery"); }
public function __construct($em) { parent::__construct($em, __NAMESPACE__ . "\Photo"); }
public function __construct($em) { parent::__construct($em, __NAMESPACE__ . "\Gallery"); $this->photoService = new PhotoService($em); }
public function __construct($em, $repository) { parent::__construct($em, __NAMESPACE__ . "\\Photo"); $this->repository = $repository; }
public function __construct($em) { parent::__construct($em, __NAMESPACE__ . "\\Comment"); }
public function __construct($em, $class) { parent::__construct($em, $class); }