コード例 #1
0
ファイル: Macros.php プロジェクト: chomenko/cemvin
 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);
     }
 }
コード例 #2
0
ファイル: HomepagePresenter.php プロジェクト: chomenko/cemvin
 public function handleRemoveText($name)
 {
     $this->textManager->remove($name);
     $this->redirect('this');
 }
コード例 #3
0
ファイル: EditTextFactory.php プロジェクト: chomenko/cemvin
 public function formSucceeded(Form $form, $values)
 {
     $this->textManager->editText($this->text->name, $this->text->page, $values->text);
 }