mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 17:32:18 +00:00
Move Phrasen API
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Phrasen extends FHC_Controller
|
||||
{
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @param string $module
|
||||
*/
|
||||
public function loadModule($module)
|
||||
{
|
||||
$this->load->library('PhrasesLib', [$module], 'pj');
|
||||
$this->outputJson([
|
||||
'data' => json_decode($this->pj->getJSON()),
|
||||
'meta' => [
|
||||
'status' => FHCAPI_Controller::STATUS_SUCCESS
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO(chris): depricated
|
||||
*/
|
||||
class Phrasen extends FHC_Controller
|
||||
{
|
||||
|
||||
@@ -24,10 +24,10 @@ const phrasen = {
|
||||
return Promise.all(category.map(cat => this.loadCategory(cat)));
|
||||
if (!loadingModules[category])
|
||||
loadingModules[category] = axios
|
||||
.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Phrasen/loadModule/' + category)
|
||||
.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/api/frontend/v1/phrasen/loadModule/' + category)
|
||||
.then(res => {
|
||||
if (res.data.retval)
|
||||
categories[category] = extractCategory(res.data.retval, category);
|
||||
if (res?.data?.data)
|
||||
categories[category] = extractCategory(res.data.data, category);
|
||||
else
|
||||
categories[category] = {};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user