Skip to content

Commit

Permalink
more hooks. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Praesidiarius committed Feb 8, 2020
1 parent 82ed252 commit f7268ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "oneplace/oneplace-core",
"description": "onePlace Core Application",
"type": "project",
"version": "1.0.14",
"version": "1.0.15",
"license": "BSD-3-Clause",
"keywords": [
"laminas",
Expand Down
9 changes: 7 additions & 2 deletions module/Application/src/Controller/CoreEntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ public function generateIndexView($sKey) {
]);
}

protected function generateAddView($sKey,$sSingleForm = '') {
protected function generateAddView($sKey,$sSingleForm = '',$sRoute = '',$sRouteAction = 'view',$iRouteID = 0,$aExtraViewData = []) {
# Set Layout based on users theme
$this->setThemeBasedLayout($sKey);

$sRoute = ($sRoute == '') ? $sKey : $sRoute;

# Add Links for Breadcrumb
$this->layout()->aNavLinks = [
(object)['label'=>ucfirst($sKey.'s'),'href'=>'/'.$sKey],
Expand Down Expand Up @@ -155,6 +157,7 @@ protected function generateAddView($sKey,$sSingleForm = '') {
];

$aViewData = array_merge($aViewData,$aViewExtraData);
$aViewData = array_merge($aViewData,$aExtraViewData);

return new ViewModel($aViewData);
}
Expand Down Expand Up @@ -193,13 +196,15 @@ protected function generateAddView($sKey,$sSingleForm = '') {
}
}

$iRouteID = ($iRouteID == 0) ? $iSkeletonID : $iRouteID;

# Log Performance in DB
$aMeasureEnd = getrusage();
$this->logPerfomance($sKey.'-save',$this->rutime($aMeasureEnd,CoreController::$aPerfomanceLogStart,"utime"),$this->rutime($aMeasureEnd,CoreController::$aPerfomanceLogStart,"stime"));

# Display Success Message and View New Skeleton
$this->flashMessenger()->addSuccessMessage('Skeleton successfully created');
return $this->redirect()->toRoute($sKey,['action'=>'view','id'=>$iSkeletonID]);
return $this->redirect()->toRoute($sRoute,['action'=>$sRouteAction,'id'=>$iRouteID]);
}

public function generateViewView($sKey,$sSingleForm = '') {
Expand Down
4 changes: 2 additions & 2 deletions module/Application/src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Module {
/**
* Module Version
*
* @since 1.0.14
* @since 1.0.0
*/
const VERSION = '1.0.14';
const VERSION = '1.0.15';

public function getConfig() : array {
return include __DIR__ . '/../config/module.config.php';
Expand Down

0 comments on commit f7268ed

Please sign in to comment.