Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoriesInput.php |
— | — | @@ -43,6 +43,11 @@ |
44 | 44 | return null; |
45 | 45 | } |
46 | 46 | $hideroot = array_key_exists( 'hideroot', $other_args ); |
| 47 | + if ( array_key_exists( 'depth', $other_args ) ) { |
| 48 | + $depth = $other_args['depth']; |
| 49 | + } else { |
| 50 | + $depth = '10'; |
| 51 | + } |
47 | 52 | if ( array_key_exists( 'height', $other_args ) ) { |
48 | 53 | $height = $other_args['height']; |
49 | 54 | } else { |
— | — | @@ -60,7 +65,7 @@ |
61 | 66 | $top_category, array( |
62 | 67 | 'mode' => 'categories', |
63 | 68 | 'namespaces' => array( NS_CATEGORY ), |
64 | | - 'depth' => 10, |
| 69 | + 'depth' => $depth, |
65 | 70 | 'hideroot' => $hideroot, |
66 | 71 | ) |
67 | 72 | ); |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoryInput.php |
— | — | @@ -35,6 +35,11 @@ |
36 | 36 | return null; |
37 | 37 | } |
38 | 38 | $hideroot = array_key_exists( 'hideroot', $other_args ); |
| 39 | + if ( array_key_exists( 'depth', $other_args ) ) { |
| 40 | + $depth = $other_args['depth']; |
| 41 | + } else { |
| 42 | + $depth = '10'; |
| 43 | + } |
39 | 44 | if ( array_key_exists( 'height', $other_args ) ) { |
40 | 45 | $height = $other_args['height']; |
41 | 46 | } else { |
— | — | @@ -67,7 +72,7 @@ |
68 | 73 | array( |
69 | 74 | 'mode' => 'categories', |
70 | 75 | 'namespaces' => array( NS_CATEGORY ), |
71 | | - 'depth' => 10, |
| 76 | + 'depth' => $depth, |
72 | 77 | 'hideroot' => $hideroot, |
73 | 78 | ) |
74 | 79 | ); |
— | — | @@ -124,6 +129,11 @@ |
125 | 130 | 'description' => wfMsg( 'sf_forminputs_hideroot' ) |
126 | 131 | ); |
127 | 132 | $params[] = array( |
| 133 | + 'name' => 'depth', |
| 134 | + 'type' => 'int', |
| 135 | + 'description' => wfMsg( 'sf_forminputs_depth' ) |
| 136 | + ); |
| 137 | + $params[] = array( |
128 | 138 | 'name' => 'height', |
129 | 139 | 'type' => 'int', |
130 | 140 | 'description' => wfMsg( 'sf_forminputs_height' ) |
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php |
— | — | @@ -73,6 +73,7 @@ |
74 | 74 | 'sf_forminputs_includetimezone' => 'Include an input for the time zone', |
75 | 75 | 'sf_forminputs_topcategory' => 'The parent category of this set of categories (required)', |
76 | 76 | 'sf_forminputs_hideroot' => 'Hide the parent category', |
| 77 | + 'sf_forminputs_depth' => 'The number of levels of categories to show initially', |
77 | 78 | 'sf_forminputs_height' => 'The height of this input, in pixels', |
78 | 79 | 'sf_forminputs_width' => 'The width of this input, in pixels', |
79 | 80 | 'createform' => 'Create a form', |