소스 검색

Example : fix install

idleman 3 년 전
부모
커밋
87dd723f48
1개의 변경된 파일12개의 추가작업 그리고 6개의 파일을 삭제
  1. 12 6
      plugin/example/example.plugin.php

+ 12 - 6
plugin/example/example.plugin.php

@@ -52,15 +52,21 @@ function example_install($id){
 				$item->parent = $dictionnary->id;
 				$item->state = Dictionnary::ACTIVE;
 				$item->save();
+
+
+				if($key == 'dacia'){
+					$subitem = new Dictionnary();
+				    $subitem->slug = 'example_contact_vehicle_dacia_logan';
+				    $subitem->label = 'Logan';
+				    $subitem->parent = $item->id;
+				    $subitem->state = Dictionnary::ACTIVE;
+				    $subitem->save();
+				}
+
 			}
 	    }
 
-	$subitem = new Dictionnary();
-    $subitem->slug = 'example_contact_vehicle_dacia_logan';
-    $subitem->label = 'Logan';
-    $subitem->parent = $item->id;
-    $subitem->state = Dictionnary::ACTIVE;
-    $subitem->save();
+	
     
     $dictionnary = new Dictionnary();
 	$dictionnary->slug = 'example_contact_handicap';