r109840 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109839‎ | r109840 | r109841 >
Date:18:47, 23 January 2012
Author:yaron
Status:deferred
Tags:
Comment:
Added 'depth' parameter for 'category' and 'categories' input types
Modified paths:
  • /trunk/extensions/SemanticForms/includes/forminputs/SF_CategoriesInput.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/forminputs/SF_CategoryInput.php (modified) (history)
  • /trunk/extensions/SemanticForms/languages/SF_Messages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoriesInput.php
@@ -43,6 +43,11 @@
4444 return null;
4545 }
4646 $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+ }
4752 if ( array_key_exists( 'height', $other_args ) ) {
4853 $height = $other_args['height'];
4954 } else {
@@ -60,7 +65,7 @@
6166 $top_category, array(
6267 'mode' => 'categories',
6368 'namespaces' => array( NS_CATEGORY ),
64 - 'depth' => 10,
 69+ 'depth' => $depth,
6570 'hideroot' => $hideroot,
6671 )
6772 );
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoryInput.php
@@ -35,6 +35,11 @@
3636 return null;
3737 }
3838 $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+ }
3944 if ( array_key_exists( 'height', $other_args ) ) {
4045 $height = $other_args['height'];
4146 } else {
@@ -67,7 +72,7 @@
6873 array(
6974 'mode' => 'categories',
7075 'namespaces' => array( NS_CATEGORY ),
71 - 'depth' => 10,
 76+ 'depth' => $depth,
7277 'hideroot' => $hideroot,
7378 )
7479 );
@@ -124,6 +129,11 @@
125130 'description' => wfMsg( 'sf_forminputs_hideroot' )
126131 );
127132 $params[] = array(
 133+ 'name' => 'depth',
 134+ 'type' => 'int',
 135+ 'description' => wfMsg( 'sf_forminputs_depth' )
 136+ );
 137+ $params[] = array(
128138 'name' => 'height',
129139 'type' => 'int',
130140 'description' => wfMsg( 'sf_forminputs_height' )
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php
@@ -73,6 +73,7 @@
7474 'sf_forminputs_includetimezone' => 'Include an input for the time zone',
7575 'sf_forminputs_topcategory' => 'The parent category of this set of categories (required)',
7676 'sf_forminputs_hideroot' => 'Hide the parent category',
 77+ 'sf_forminputs_depth' => 'The number of levels of categories to show initially',
7778 'sf_forminputs_height' => 'The height of this input, in pixels',
7879 'sf_forminputs_width' => 'The width of this input, in pixels',
7980 'createform' => 'Create a form',