mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
wiki features
This commit is contained in:
@ -43,7 +43,9 @@ class WikiController extends BaseController
|
||||
$section = $this->wikiSectionModel->where('slug', $slug)->first();
|
||||
$this->viewData['slug'] = $slug;
|
||||
$this->viewData['section'] = $section->withAll($this->locale);
|
||||
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Wiki.".$section->slug), 'route' => route_to('showWikiPage',$slug), 'active' => true],
|
||||
];
|
||||
return view('themes/vuexy/wiki/pages/render', $this->viewData);
|
||||
}
|
||||
public function get_section(int $section_id)
|
||||
@ -72,6 +74,24 @@ class WikiController extends BaseController
|
||||
]);
|
||||
return $this->response->setJSON(["data" => [], "message" => lang("App.global_alert_save_success")]);
|
||||
}
|
||||
public function store_publish_page(int $section_id)
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$wikiSectionPage = $this->wikiSectionModel->find($section_id)->page();
|
||||
if ($wikiSectionPage) {
|
||||
$wikiPageId = $wikiSectionPage->id;
|
||||
$this->wikiContentModel->update($wikiPageId,[
|
||||
"locale" => $this->locale,
|
||||
"page_id" => $wikiPageId,
|
||||
"editor_data" => json_encode($bodyData),
|
||||
"published_data" => json_encode($bodyData)
|
||||
]);
|
||||
$response = $this->response->setJSON(["data" => [], "message" => lang("App.global_alert_save_success")]);
|
||||
} else {
|
||||
$response = $this->response->setStatusCode(400)->setJSON(["data" => [], "error" => lang('Wiki.errors.publish_before_save')]);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
public function wiki_file_upload(int $section_id)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user