예제 #1
0
 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.";
 }
예제 #2
0
파일: CodeGen.php 프로젝트: JUkhan/jwt_php
 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));
 }