ソースを参照

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';