Browse code

improved look of pronoun-table

Christian FraƟ authored on08/08/2016 22:04:51
Showing1 changed files
... ...
@@ -19,43 +19,76 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
19 19
 	$data = $data_pronouns["words"];
20 20
 	{
21 21
 		{
22
-			$data = sql_cross($data, $data_common["counts"]);
23
-			$data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);});
24
-			$data = sql_delete($data, ["count_id", "id"]);
25
-			$data = sql_rename($data, "name", "count_name");
22
+			if (false)
23
+			{
24
+				$data = sql_cross($data, $data_common["counts"]);
25
+				$data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);});
26
+				$data = sql_delete($data, ["count_id", "id"]);
27
+				$data = sql_rename($data, "name", "count_name");
28
+			}
29
+			else
30
+			{
31
+				$data = sql_rename($data, "count_id", "count_name");
32
+			}
26 33
 		}
27 34
 		{
28
-			$data = sql_cross($data, $data_common["persons"]);
29
-			$data = sql_select($data, function ($row) {return ($row["person_id"] == $row["id"]);});
30
-			$data = sql_delete($data, ["person_id", "id"]);
31
-			$data = sql_rename($data, "name", "person_name");
35
+			if (false)
36
+			{
37
+				$data = sql_cross($data, $data_common["persons"]);
38
+				$data = sql_select($data, function ($row) {return ($row["person_id"] == $row["id"]);});
39
+				$data = sql_delete($data, ["person_id", "id"]);
40
+				$data = sql_rename($data, "name", "person_name");
41
+			}
42
+			else
43
+			{
44
+				$data = sql_rename($data, "person_id", "person_name");
45
+			}
32 46
 		}
33 47
 		{
34
-			$data = sql_cross($data, $data_common["genders"]);
35
-			$data = sql_select($data, function ($row) {return ($row["gender_id"] == $row["id"]);});
36
-			$data = sql_delete($data, ["gender_id", "id"]);
37
-			$data = sql_rename($data, "name", "gender_name");
48
+			if (false)
49
+			{
50
+				$data = sql_cross($data, $data_common["genders"]);
51
+				$data = sql_select($data, function ($row) {return ($row["gender_id"] == $row["id"]);});
52
+				$data = sql_delete($data, ["gender_id", "id"]);
53
+				$data = sql_rename($data, "name", "gender_name");
54
+			}
55
+			else
56
+			{
57
+				$data = sql_rename($data, "gender_id", "gender_name");
58
+			}
38 59
 		}
39 60
 		{
40
-			$data = sql_cross($data, $data_pronouns["types"]);
41
-			/*
42
-			$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
43
-			$data = sql_delete($data, ["type_id", "id"]);
44
-			$data = sql_rename($data, "name", "type_name");
45
-			 */
46
-			$data = sql_rename($data, "type_id", "type_name");
61
+			if (false)
62
+			{
63
+				$data = sql_cross($data, $data_pronouns["types"]);
64
+				$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
65
+				$data = sql_delete($data, ["type_id", "id"]);
66
+				$data = sql_rename($data, "name", "type_name");
67
+			}
68
+			else
69
+			{
70
+				$data = sql_rename($data, "type_id", "type_name");
71
+			}
47 72
 		}
48 73
 		{
49
-			$data = sql_cross($data, $data_common["cases"]);
50
-			/*
51
-			$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
52
-			$data = sql_delete($data, ["case_id", "id"]);
53
-			$data = sql_rename($data, "name", "case_name");
54
-			 */
55
-			$data = sql_rename($data, "case_id", "case_name");
74
+			if (false)
75
+			{
76
+				$data = sql_cross($data, $data_common["cases"]);
77
+				$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
78
+				$data = sql_delete($data, ["case_id", "id"]);
79
+				$data = sql_rename($data, "name", "case_name");
80
+			}
81
+			else
82
+			{
83
+				$data = sql_rename($data, "case_id", "case_name");
84
+			}
56 85
 		}
57 86
 	}
58 87
 	
88
+	{
89
+		// $data = sql_select($data, function ($row) {return ($row["case_name"] != "pos");});
90
+	}
91
+	
59 92
 	$table = new class_table
60 93
 	(
61 94
 		[
... ...
@@ -97,7 +130,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
97 130
 			},
98 131
 			"data_formatter" => function ($value)
99 132
 			{
100
-				switch (-1)
133
+				switch (1)
101 134
 				{
102 135
 					case 0:
103 136
 					{