* Nastavenie slider-u * @param array $nastavenie * @return \App\FrontModule\Components\Slider\SliderControl */ public function setNastavenie($nastavenie) { $this->nastavenie = $nastavenie; return $this; } /** * Pre vyhodnotenie zobrazenia * @param mix $z zobrazenie polozky * @param string $p nazov presentera * @param int $i id pre zobrazenie * @return boolean */ private function _zisti($z, $p, $i) { return $z == NULL ? TRUE : ($z == 0 && $p == 'Homepage' ? TRUE : ($z > 0 && $z == $i ? TRUE : FALSE)); } /** Render */ public function render() { $this->template->setFile(__DIR__ . '/Slider_' . $this->nastavenie["varianta"] . '.latte'); $p_name = explode(":", $this->presenter->name); if ($this->nastavenie["varianta"] > 0) { $slider = $this->slider->getSlider(); $slider_zobrazenie = $slider->fetchPairs("id", "zobrazenie"); $id_pre_zobrazenie = $p_name[1] == "Clanky" ? isset($this->presenter->params['id']) ? $this->presenter->params['id'] : 0 : 0; $vysa = []; foreach ($slider_zobrazenie as $k => $v) { $vy[$k] = strpos($v, " ") !== FALSE ? explode(" ", $v) : $v; $vysledok = FALSE; if (is_array($vy[$k])) { foreach ($vy[$k] as $ke => $z) { $vysledok = $this->_zisti($z, $p_name[1], $id_pre_zobrazenie) == TRUE ? TRUE : $vysledok;
public $slider; /** @var array Nastavenie slider-u */ private $slider_i; /** @var Forms\Slider\EditSliderFormFactory @inject*/ public $editSliderForm;