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)); }
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(); }