Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.php |
— | — | @@ -1463,6 +1463,7 @@ |
1464 | 1464 | // escape - we can't do anything |
1465 | 1465 | return null; |
1466 | 1466 | } |
| 1467 | + $hideroot = array_key_exists( 'hideroot', $other_args ); |
1467 | 1468 | if ( array_key_exists( 'height', $other_args ) ) { |
1468 | 1469 | $height = $other_args['height']; |
1469 | 1470 | } else { |
— | — | @@ -1491,7 +1492,7 @@ |
1492 | 1493 | |
1493 | 1494 | global $wgCategoryTreeMaxDepth; |
1494 | 1495 | $wgCategoryTreeMaxDepth = 10; |
1495 | | - $tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10 ) ); |
| 1496 | + $tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10, 'hideroot' => $hideroot ) ); |
1496 | 1497 | |
1497 | 1498 | // Capitalize the first letter, if first letters always get |
1498 | 1499 | // capitalized. |
— | — | @@ -1519,6 +1520,7 @@ |
1520 | 1521 | public static function getParameters() { |
1521 | 1522 | $params = parent::getParameters(); |
1522 | 1523 | $params[] = array( 'name' => 'top category', 'type' => 'string', 'description' => wfMsg( 'sf_forminputs_topcategory' ) ); |
| 1524 | + $params[] = array( 'name' => 'hideroot', 'type' => 'boolean', 'description' => wfMsg( 'sf_forminputs_hideroot' ) ); |
1523 | 1525 | $params[] = array( 'name' => 'height', 'type' => 'int', 'description' => wfMsg( 'sf_forminputs_height' ) ); |
1524 | 1526 | $params[] = array( 'name' => 'width', 'type' => 'int', 'description' => wfMsg( 'sf_forminputs_width' ) ); |
1525 | 1527 | return $params; |
— | — | @@ -1562,6 +1564,7 @@ |
1563 | 1565 | // escape - we can't do anything |
1564 | 1566 | return null; |
1565 | 1567 | } |
| 1568 | + $hideroot = array_key_exists( 'hideroot', $other_args ); |
1566 | 1569 | if ( array_key_exists( 'height', $other_args ) ) { |
1567 | 1570 | $height = $other_args['height']; |
1568 | 1571 | } else { |
— | — | @@ -1575,7 +1578,7 @@ |
1576 | 1579 | |
1577 | 1580 | global $wgCategoryTreeMaxDepth; |
1578 | 1581 | $wgCategoryTreeMaxDepth = 10; |
1579 | | - $tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10 ) ); |
| 1582 | + $tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10, 'hideroot' => $hideroot ) ); |
1580 | 1583 | // Some string that will hopefully never show up in a category, |
1581 | 1584 | // template or field name. |
1582 | 1585 | $dummy_str = 'REPLACE THIS STRING!'; |
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php |
— | — | @@ -74,8 +74,9 @@ |
75 | 75 | 'sf_forminputs_listboxsize' => 'The height of this listbox, in rows', |
76 | 76 | 'sf_forminputs_includetimezone' => 'Include an input for the time zone', |
77 | 77 | 'sf_forminputs_topcategory' => 'The parent category of this set of categories (required)', |
| 78 | + 'sf_forminputs_hideroot' => 'Hide the parent category', |
78 | 79 | 'sf_forminputs_height' => 'The height of this input, in pixels', |
79 | | - 'sf_forminputs_width' => 'The width of this input, in pixels', |
| 80 | + 'sf_forminputs_width' => 'The width of this input, in pixels', |
80 | 81 | 'createform' => 'Create a form', |
81 | 82 | 'sf_createform_nameinput' => 'Form name', |
82 | 83 | 'sf_createform_nameinputdesc' => '(the form is usually given the same name as its main template):', |