Esempio n. 1
0
 public function getText($params, \Nette\Application\UI\Presenter $presenter, $default_text = null)
 {
     if (!isset($params[0])) {
         throw new \Exception("gettext macro must define 1 parameter {getText 'textName'}");
     }
     $name = $params[0];
     $default_text = htmlspecialchars_decode($default_text);
     $text = $this->textManager->getText($name);
     $texy = new \Texy\Texy();
     if (!$text) {
         $this->textManager->addText($name, $presenter->name . ':' . $presenter->getAction(), $default_text);
         return $texy->process($default_text);
     } else {
         return $texy->process($text->text);
     }
 }
Esempio n. 2
0
 public function handleRemoveText($name)
 {
     $this->textManager->remove($name);
     $this->redirect('this');
 }
Esempio n. 3
0
 public function formSucceeded(Form $form, $values)
 {
     $this->textManager->editText($this->text->name, $this->text->page, $values->text);
 }