public function updateNavigation($navigation) { $this->deserialize(); $key = -1; $temp = $this->array_find($this->jwtApp->Navigations, $navigation->_id, $key); if ($temp == null) { return "{$navigation->NavigationName} not exist."; } if (!JwtUtil::IsNullOrEmptyString($navigation->WidgetName) && $navigation->WidgetName != $temp['WidgetName']) { JwtUtil::rename($this->rootPath . "Scripts/Components/", $navigation->WidgetName, $temp['WidgetName']); } $this->updateRelatedNavigation($temp['WidgetName'], $navigation->WidgetName); $temp['NavigationName'] = $navigation->NavigationName; $temp['WidgetName'] = $navigation->WidgetName; $temp['ParamName'] = $navigation->ParamName; $temp['Views'] = $navigation->Views; $temp['HasLayout'] = $navigation->HasLayout; $this->jwtApp->Navigations[$key] = $temp; $this->serialize(); $this->generateConfig(); return "Successfully Updted."; }
private function getNavigationStateName($navigation) { $nameList = array(); $nameList[] = $navigation['NavigationName']; $layout = null; if (!JwtUtil::IsNullOrEmptyString($navigation['HasLayout'])) { $layout = $this->array_find($this->app->Layouts, 'LayoutName', $navigation['HasLayout']); if (isset($layout)) { $nameList[] = $layout['LayoutName']; while (!JwtUtil::IsNullOrEmptyString($layout['Extend'])) { $layout = $this->array_find($this->app->Layouts, 'LayoutName', $layout['Extend']); if (isset($layout)) { $nameList[] = $layout['LayoutName']; } } } } return implode(".", array_reverse($nameList)); }