protected function edit(\Base $f3, $params) { if (isset($params[2])) { $params = $this->parametric($params[2]); } if (empty($params['story'])) { // Select story form $this->buffer(\View\AdminCP::searchStoryForm()); return TRUE; } else { $storyInfo = $this->model->loadStoryInfo((int) $params['story']); if ($storyInfo and isset($params['chapter'])) { $this->buffer($this->editChapter($params, $storyInfo)); } elseif ($storyInfo) { $chapterList = $this->model->loadChapterList($storyInfo['sid']); $prePopulate = $this->model->storyEditPrePop($storyInfo); $this->buffer(\View\AdminCP::storyMetaEdit($storyInfo, $chapterList, $prePopulate)); } else { $this->buffer("__Error"); } } }