mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-27 22:46:04 +00:00
Route: possibility to replace routes in modules
This commit is contained in:
@@ -112,17 +112,27 @@ class Route
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unify routes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function unify()
|
||||
{
|
||||
$data = array();
|
||||
|
||||
$data = $this->getAddData($data, $this->paths['customPath']);
|
||||
// for custom
|
||||
$data = $this->getAddData([], $this->paths['customPath']);
|
||||
|
||||
// for module
|
||||
$moduleData = [];
|
||||
foreach ($this->getMetadata()->getModuleList() as $moduleName) {
|
||||
$modulePath = str_replace('{*}', $moduleName, $this->paths['modulePath']);
|
||||
$data = $this->getAddData($data, $modulePath);
|
||||
foreach ($this->getAddData([], $modulePath) as $row) {
|
||||
$moduleData[$row['method'].$row['route']] = $row;
|
||||
}
|
||||
}
|
||||
$data = array_merge($data, array_values($moduleData));
|
||||
|
||||
// for core
|
||||
$data = $this->getAddData($data, $this->paths['corePath']);
|
||||
|
||||
return $data;
|
||||
|
||||
Reference in New Issue
Block a user