Example #1
0
 public function buildContent()
 {
     $file = ToDoFile::inst();
     FORM_TodoForm::getInstance()->setHidden('mtime', $file->getMtime());
     FORM_TodoForm::getInstance()->setParam('text', $file->getContents());
     return $this->getFoldedEntity()->fetchTpl(array('file' => $file));
 }
Example #2
0
 /** @return ToDoFile */
 public static function inst()
 {
     if (!isset(self::$todo)) {
         PsDefines::assertProductionOff(__CLASS__);
         self::$todo = new ToDoFile();
     }
     return self::$todo;
 }
Example #3
0
 protected function processImpl(PostArrayAdapter $adapter, $button)
 {
     PsDefines::assertProductionOff(__CLASS__);
     $text = $adapter->str('text');
     if (!$text) {
         return array('text', 'required');
     }
     $mtime = $adapter->int('mtime');
     ToDoFile::inst()->save($text, $mtime);
     return new AjaxSuccess();
 }