Emanspeaks has uploaded a new change for review.
https://gerrit.wikimedia.org/r/228419
Change subject: Added capability to assign levels for counters
......................................................................
Added capability to assign levels for counters
Change-Id: If8f16fa961b0ec730d7dc38c6b885f7ec290bd47
---
M NumerAlpha.class.php
M i18n/en.json
2 files changed, 14 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NumerAlpha
refs/changes/19/228419/1
diff --git a/NumerAlpha.class.php b/NumerAlpha.class.php
index e994297..5b4ff2d 100644
--- a/NumerAlpha.class.php
+++ b/NumerAlpha.class.php
@@ -24,6 +24,7 @@
);
static $frame = null; // set with each use of parser function...
static $prevName = 'default'; // default counter name
+ static $prevLevel = 0; //default level 0
static $lists = array();
static $listTypes = null;
@@ -86,7 +87,7 @@
}
break;
case wfMessage(
'ext-numeralpha-list-set-label' )->text():
- $newCountValue = intVal( $value
);
+ if ($value != '')
$newCountValue = intVal( $value );
break;
case wfMessage(
'ext-numeralpha-list-pad-length' )->text():
self::$lists[ $name ][
'padlength' ] = intVal( $value );
@@ -100,12 +101,21 @@
case wfMessage(
'ext-numeralpha-list-suffix' )->text():
self::$lists[ $name ][ 'suffix'
] = $value;
break;
+ case wfMessage(
'ext-numeralpha-list-level-label' )->text():
+ self::$lists[ $name ][ 'level'
] = intVal($value);
+ break;
}
}
}
-
+
+ if (isset(self::$lists[$name]['level']))
+ {
+ if (self::$lists[$name]['level'] > self::$prevLevel)
$newCountValue = 1;
+ self::$prevLevel = self::$lists[$name]['level'];
+ }
+
// either set count value or increment existing value
if ( isset( $newCountValue ) ) {
self::$lists[ $name ][ 'count' ] = $newCountValue;
diff --git a/i18n/en.json b/i18n/en.json
index a014b7a..bbe2cfe 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,5 +13,6 @@
"ext-numeralpha-list-pad-length": "pad length",
"ext-numeralpha-list-pad-char": "pad character",
"ext-numeralpha-list-prefix": "prefix",
- "ext-numeralpha-list-suffix": "suffix"
+ "ext-numeralpha-list-suffix": "suffix",
+ "ext-numeralpha-list-level-label": "level"
}
--
To view, visit https://gerrit.wikimedia.org/r/228419
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If8f16fa961b0ec730d7dc38c6b885f7ec290bd47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NumerAlpha
Gerrit-Branch: master
Gerrit-Owner: Emanspeaks <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits