Exemplo n.º 1
0
 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")));
 }
Exemplo n.º 2
0
 public function update($id, $values, $form = null)
 {
     if (empty($values["password"])) {
         unset($values["password"]);
     }
     parent::update($id, $values, $form);
 }
Exemplo n.º 3
0
 public function __construct($em)
 {
     parent::__construct($em, __NAMESPACE__ . "\\Gallery");
 }
Exemplo n.º 4
0
	public function __construct($em)
	{
		parent::__construct($em, __NAMESPACE__ . "\Photo");
	}
Exemplo n.º 5
0
	public function __construct($em)
	{
		parent::__construct($em, __NAMESPACE__ . "\Gallery");
		$this->photoService = new PhotoService($em);
	}
Exemplo n.º 6
0
 public function __construct($em, $repository)
 {
     parent::__construct($em, __NAMESPACE__ . "\\Photo");
     $this->repository = $repository;
 }
Exemplo n.º 7
0
 public function __construct($em)
 {
     parent::__construct($em, __NAMESPACE__ . "\\Comment");
 }
Exemplo n.º 8
0
 public function __construct($em, $class)
 {
     parent::__construct($em, $class);
 }