Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMParserFunctionParser.php |
— | — | @@ -20,11 +20,22 @@ |
21 | 21 | if ( $r ) { |
22 | 22 | $len = strlen( $m[0] ); |
23 | 23 | $func_key = trim( $m[1] ); |
| 24 | + |
24 | 25 | return array( 'len' => $len, 'obj' => new WOMParserFunctionModel( $func_key ) ); |
25 | 26 | } |
26 | 27 | return null; |
27 | 28 | } |
28 | 29 | |
| 30 | + public function getSubParserID( $obj ) { |
| 31 | +// if ( ( $obj instanceof WOMParserFunctionModel ) |
| 32 | +// && ( strtolower( $obj->getFunctionKey() ) == 'ask' ) |
| 33 | +// && ( count ( $obj->getObjects() ) == 0 ) ) { |
| 34 | +// |
| 35 | +// return WOM_PARSER_ID_QUERYSTRING; |
| 36 | +// } |
| 37 | + return WOM_PARSER_ID_PARAMETER; |
| 38 | + } |
| 39 | + |
29 | 40 | public function isObjectClosed( $obj, $text, $offset ) { |
30 | 41 | if ( !$obj instanceof WOMParserFunctionModel ) return false; |
31 | 42 | |
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMTemplateParser.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | return null; |
27 | 27 | } |
28 | 28 | |
29 | | - public function getSubParserID() { |
| 29 | + public function getSubParserID( $obj ) { |
30 | 30 | return WOM_PARSER_ID_PARAMETER; |
31 | 31 | } |
32 | 32 | |
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMTemplateFieldHolderParser.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | return null; |
27 | 27 | } |
28 | 28 | |
29 | | - public function getSubParserID() { |
| 29 | + public function getSubParserID( $obj ) { |
30 | 30 | return WOM_PARSER_ID_PARAM_VALUE; |
31 | 31 | } |
32 | 32 | |
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMParameterParser.php |
— | — | @@ -13,12 +13,40 @@ |
14 | 14 | $this->m_parserId = WOM_PARSER_ID_PARAMETER; |
15 | 15 | } |
16 | 16 | |
| 17 | + private function parseAsk ( $text, WikiObjectModelCollection $parentObj ) { |
| 18 | + if ( !defined( 'SMW_VERSION' ) ) return null; |
| 19 | + |
| 20 | + if ( trim( strtolower( $parentObj->getFunctionKey() ) ) != 'ask' ) return null; |
| 21 | + |
| 22 | + if ( count ( $parentObj->getObjects() ) == 0 ) { |
| 23 | + return array( 'len' => 0, 'obj' => new WOMQuerystringModel() ); |
| 24 | + } |
| 25 | + |
| 26 | + if ( defined( 'SMW_AGGREGATION_VERSION' ) ) { |
| 27 | + $r = preg_match( '/^(\s*\?([^>=|}]+)(?:\>([^=|}]*))?(?:=([^|}]*))?)(\||\}|$)/', $text, $m ); |
| 28 | + if ( !$r ) return null; |
| 29 | + return array( |
| 30 | + 'len' => strlen( $m[5] == '|' ? $m[0] : $m[1] ), |
| 31 | + 'obj' => new WOMQueryPrintoutModel( trim( $m[2] ), trim( $m[4] ), trim( $m[3] ) ) ); |
| 32 | + } else { |
| 33 | + $r = preg_match( '/^(\s*\?([^=|}]+)(?:=([^|}]*))?)(\||\}|$)/', $text, $m ); |
| 34 | + if ( !$r ) return null; |
| 35 | + return array( |
| 36 | + 'len' => strlen( $m[4] == '|' ? $m[0] : $m[1] ), |
| 37 | + 'obj' => new WOMQueryPrintoutModel( trim( $m[2] ), trim( $m[3] ) ) ); |
| 38 | + } |
| 39 | + } |
| 40 | + |
17 | 41 | public function parseNext( $text, WikiObjectModelCollection $parentObj, $offset = 0 ) { |
18 | 42 | if ( !( ( $parentObj instanceof WOMTemplateModel ) |
19 | 43 | || ( $parentObj instanceof WOMParserFunctionModel ) ) ) |
20 | 44 | return null; |
21 | 45 | |
22 | 46 | $text = substr( $text, $offset ); |
| 47 | + |
| 48 | + $ret = $this->parseAsk ( $text, $parentObj ); |
| 49 | + if ( $ret != null ) return $ret; |
| 50 | + |
23 | 51 | $r = preg_match( '/^([^=|}]*)(\||=|\}|$)/', $text, $m ); |
24 | 52 | if ( !$r ) return null; |
25 | 53 | |
— | — | @@ -38,13 +66,19 @@ |
39 | 67 | } |
40 | 68 | } |
41 | 69 | |
42 | | - public function getSubParserID() { |
| 70 | + public function getSubParserID( $obj ) { |
| 71 | + if ( ( $obj instanceof WOMQuerystringModel ) |
| 72 | + || ( $obj instanceof WOMQueryPrintoutModel ) ) |
| 73 | + return ''; |
| 74 | + |
43 | 75 | return WOM_PARSER_ID_PARAM_VALUE; |
44 | 76 | } |
45 | 77 | |
46 | 78 | public function isObjectClosed( $obj, $text, $offset ) { |
47 | 79 | if ( !( ( $obj instanceof WOMTemplateFieldModel ) |
48 | | - || ( $obj instanceof WOMParameterModel ) ) ) |
| 80 | + || ( $obj instanceof WOMParameterModel ) |
| 81 | + || ( $obj instanceof WOMQuerystringModel ) |
| 82 | + || ( $obj instanceof WOMQueryPrintoutModel ) ) ) |
49 | 83 | return false; |
50 | 84 | |
51 | 85 | if ( ( strlen( $text ) >= $offset + 1 ) && $text { $offset } == '|' ) { |
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMPropertyValueParser.php |
— | — | @@ -0,0 +1,36 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * @author Ning
|
| 5 | + *
|
| 6 | + * @file
|
| 7 | + * @ingroup WikiObjectModels
|
| 8 | + */
|
| 9 | +
|
| 10 | +class WOMPropertyValueParser extends WikiObjectModelParser {
|
| 11 | +
|
| 12 | + public function __construct() {
|
| 13 | + parent::__construct();
|
| 14 | + $this->m_parserId = WOM_PARSER_ID_PROPERTY_VALUE;
|
| 15 | + }
|
| 16 | +
|
| 17 | + public function parseNext( $text, WikiObjectModelCollection $parentObj, $offset = 0 ) {
|
| 18 | + if ( !( $parentObj instanceof WOMNestPropertyModel ) )
|
| 19 | + return null;
|
| 20 | +
|
| 21 | + return array( 'len' => 0, 'obj' => new WOMNestPropertyValueModel() );
|
| 22 | + }
|
| 23 | +
|
| 24 | + public function isObjectClosed( $obj, $text, $offset ) {
|
| 25 | + if ( !( $obj instanceof WOMNestPropertyValueModel ) )
|
| 26 | + return false;
|
| 27 | +
|
| 28 | + if ( ( strlen( $text ) >= $offset + 1 ) && $text { $offset } == '|' ) {
|
| 29 | + return 1;
|
| 30 | + }
|
| 31 | + $parentClose = WOMProcessor::getObjectParser( $obj->getParent() )
|
| 32 | + ->isObjectClosed( $obj->getParent(), $text, $offset );
|
| 33 | + if ( $parentClose !== false ) return 0;
|
| 34 | +
|
| 35 | + return false;
|
| 36 | + }
|
| 37 | +}
|
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMPropertyParser.php |
— | — | @@ -45,8 +45,42 @@ |
46 | 46 | // } |
47 | 47 | $r = preg_match( $semanticLinkPattern, $text, $m ); |
48 | 48 | if ( $r ) { |
| 49 | + $inQuerystring = false; |
| 50 | + $o = $parentObj; |
| 51 | + do { |
| 52 | + if ( $o instanceof WOMQuerystringModel ) { |
| 53 | + $inQuerystring = true; |
| 54 | + break; |
| 55 | + } |
| 56 | + $o = $o->getParent(); |
| 57 | + } while ( $o != null ); |
| 58 | + |
| 59 | + if ( $inQuerystring ) { |
| 60 | + $semanticPropPattern = '/\[\[ # Beginning of the link |
| 61 | + (?:([^:][^][]*):[=:])+ # Property name (or a list of those) |
| 62 | + /xu'; |
| 63 | + preg_match( $semanticPropPattern, $text, $m ); |
| 64 | + return array( 'len' => strlen( $m[0] ), 'obj' => new WOMNestPropertyModel( $m[1] ) ); |
| 65 | + } |
| 66 | + |
49 | 67 | return array( 'len' => strlen( $m[0] ), 'obj' => new WOMPropertyModel( $m[1], $m[2], isset( $m[3] ) ? $m[3] : '' ) ); |
50 | 68 | } |
51 | 69 | return null; |
52 | 70 | } |
| 71 | + |
| 72 | + public function getSubParserID( $obj ) { |
| 73 | + return WOM_PARSER_ID_PROPERTY_VALUE; |
| 74 | + } |
| 75 | + |
| 76 | + public function isObjectClosed( $obj, $text, $offset ) { |
| 77 | + if ( !$obj instanceof WOMNestPropertyModel ) return false; |
| 78 | + |
| 79 | + if ( ( strlen( $text ) >= $offset + 2 ) |
| 80 | + && $text { $offset } == ']' |
| 81 | + && $text { $offset + 1 } == ']' ) { |
| 82 | + return 2; |
| 83 | + } |
| 84 | + |
| 85 | + return false; |
| 86 | + } |
53 | 87 | } |
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMTableParser.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | return array( 'len' => strlen( $m[1] ), 'obj' => new WOMTableModel( trim( $m[2] ) ) ); |
28 | 28 | } |
29 | 29 | |
30 | | - public function getSubParserID() { |
| 30 | + public function getSubParserID( $obj ) { |
31 | 31 | return WOM_PARSER_ID_TABLECELL; |
32 | 32 | } |
33 | 33 | |
Index: trunk/extensions/WikiObjectModel/includes/parsers/WikiObjectModelParser.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | } |
72 | 72 | |
73 | 73 | // specified next parser. e.g., template parser -> parameter parser |
74 | | - public function getSubParserID() { return ''; } |
| 74 | + public function getSubParserID( $obj ) { return ''; } |
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Return a string that displays all error messages as a tooltip, or |
Index: trunk/extensions/WikiObjectModel/includes/models/WOM_OM_NestProperty.php |
— | — | @@ -0,0 +1,66 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * This model implements Property models.
|
| 5 | + *
|
| 6 | + * @author Ning
|
| 7 | + * @file
|
| 8 | + * @ingroup WikiObjectModels
|
| 9 | + *
|
| 10 | + */
|
| 11 | +
|
| 12 | +class WOMNestPropertyModel extends WikiObjectModelCollection {
|
| 13 | + protected $m_property; // name
|
| 14 | + protected $m_user_property; // name
|
| 15 | +
|
| 16 | + public function __construct( $property ) {
|
| 17 | + parent::__construct( WOM_TYPE_NESTPROPERTY );
|
| 18 | +
|
| 19 | + if ( !defined( 'SMW_VERSION' ) ) {
|
| 20 | + // MW hook will catch this exception
|
| 21 | + throw new MWException( __METHOD__ . ": Property model is invalid. Please install 'SemanticMediaWiki extension' first." );
|
| 22 | + }
|
| 23 | +
|
| 24 | + $user_property = SMWPropertyValue::makeUserProperty( $property );
|
| 25 | + if ( count ( $user_property->getErrors() ) > 0 ) {
|
| 26 | + $user_property = SMWPropertyValue::makeUserProperty( '///NA///' );
|
| 27 | + } else {
|
| 28 | + $property = '';
|
| 29 | + }
|
| 30 | +
|
| 31 | + $this->m_user_property = $user_property;
|
| 32 | + $this->m_property = $property;
|
| 33 | + }
|
| 34 | +
|
| 35 | + public function getProperty() {
|
| 36 | + return $this->m_user_property;
|
| 37 | + }
|
| 38 | +
|
| 39 | + public function setProperty( $property ) {
|
| 40 | + $this->m_user_property = $property;
|
| 41 | + }
|
| 42 | +
|
| 43 | + public function getPropertyName() {
|
| 44 | + return ( $this->m_property ) ? $this->m_property : $this->m_user_property->getWikiValue();
|
| 45 | + }
|
| 46 | +
|
| 47 | + public function getWikiText() {
|
| 48 | + return "[[{$this->getPropertyName()}::{$this->getValueText()}]]";
|
| 49 | + }
|
| 50 | +
|
| 51 | + public function getValueText() {
|
| 52 | + return parent::getWikiText();
|
| 53 | + }
|
| 54 | +
|
| 55 | + public function setXMLAttribute( $key, $value ) {
|
| 56 | + if ( $value == '' ) throw new MWException( __METHOD__ . ": value cannot be empty" );
|
| 57 | +
|
| 58 | + if ( $key == 'name' ) {
|
| 59 | + $property = SMWPropertyValue::makeUserProperty( $value );
|
| 60 | + } else {
|
| 61 | + throw new MWException( __METHOD__ . ": invalid key/value pair: name=property_name" );
|
| 62 | + }
|
| 63 | + }
|
| 64 | + protected function getXMLAttributes() {
|
| 65 | + return 'name="' . self::xml_entities( $this->getPropertyName() ) . '"';
|
| 66 | + }
|
| 67 | +}
|
Index: trunk/extensions/WikiObjectModel/includes/models/WOM_OM_Querystring.php |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * This model implements key value models.
|
| 5 | + *
|
| 6 | + * @author Ning
|
| 7 | + * @file
|
| 8 | + * @ingroup WikiObjectModels
|
| 9 | + *
|
| 10 | + */
|
| 11 | +
|
| 12 | +class WOMQuerystringModel extends WikiObjectModelCollection {
|
| 13 | +
|
| 14 | + public function __construct() {
|
| 15 | + parent::__construct( WOM_TYPE_QUERYSTRING );
|
| 16 | + }
|
| 17 | +
|
| 18 | + public function setXMLAttribute( $key, $value ) {
|
| 19 | + throw new MWException( __METHOD__ . ": no key/value pair required" );
|
| 20 | + }
|
| 21 | +
|
| 22 | + public function getWikiText() {
|
| 23 | + return $this->getValueText() .
|
| 24 | + '|';
|
| 25 | + }
|
| 26 | +
|
| 27 | + public function getValueText() {
|
| 28 | + return parent::getWikiText();
|
| 29 | + }
|
| 30 | +}
|
Index: trunk/extensions/WikiObjectModel/includes/models/WOM_OM_QueryPrintout.php |
— | — | @@ -0,0 +1,62 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * This model implements query printout models.
|
| 5 | + *
|
| 6 | + * @author Ning
|
| 7 | + * @file
|
| 8 | + * @ingroup WikiObjectModels
|
| 9 | + *
|
| 10 | + */
|
| 11 | +
|
| 12 | +class WOMQueryPrintoutModel extends WikiObjectModel {
|
| 13 | + protected $m_property;
|
| 14 | + protected $m_label;
|
| 15 | + protected $m_aggregation;
|
| 16 | +
|
| 17 | + public function __construct( $property, $label = '', $aggregation = '' ) {
|
| 18 | + parent::__construct( WOM_TYPE_QUERYPRINTOUT );
|
| 19 | + $this->m_property = $property;
|
| 20 | + $this->m_label = $label;
|
| 21 | +
|
| 22 | + $this->m_aggregation = ( defined( 'SMW_AGGREGATION_VERSION' ) ? $aggregation : '' );
|
| 23 | + }
|
| 24 | +
|
| 25 | + public function getProperty() {
|
| 26 | + return $this->m_property;
|
| 27 | + }
|
| 28 | +
|
| 29 | + public function getLabel() {
|
| 30 | + return $this->m_label;
|
| 31 | + }
|
| 32 | +
|
| 33 | + public function getAggregation() {
|
| 34 | + return $this->m_aggregation;
|
| 35 | + }
|
| 36 | +
|
| 37 | + public function getWikiText() {
|
| 38 | + return '?' . $this->m_property .
|
| 39 | + ( $this->m_aggregation == '' ? "" : ( '>' . $this->m_aggregation ) ) .
|
| 40 | + ( $this->m_label == '' ? "" : ( '=' . $this->m_label ) ) . '|';
|
| 41 | + }
|
| 42 | +
|
| 43 | + public function setXMLAttribute( $key, $value ) {
|
| 44 | + if ( $value == '' ) throw new MWException( __METHOD__ . ": value cannot be empty" );
|
| 45 | +
|
| 46 | + if ( $key == 'property' ) {
|
| 47 | + $this->m_property = $value;
|
| 48 | + } elseif ( $key == 'label' ) {
|
| 49 | + $this->m_label = $value;
|
| 50 | + } elseif ( defined( 'SMW_AGGREGATION_VERSION' ) && $key == 'aggregation' ) {
|
| 51 | + $this->m_aggregation = $value;
|
| 52 | + } else {
|
| 53 | + throw new MWException( __METHOD__ . ": invalid key/value pair: property=property name, label=query label" .
|
| 54 | + ( defined( 'SMW_AGGREGATION_VERSION' ) ? ", aggregation=agg_type" : "" ) );
|
| 55 | + }
|
| 56 | + }
|
| 57 | +
|
| 58 | + protected function getXMLAttributes() {
|
| 59 | + return 'property="' . self::xml_entities( $this->m_property ) . '"' .
|
| 60 | + ( $this->m_aggregation == '' ? "" : ( ' aggregation="' . self::xml_entities( $this->m_aggregation ) . '"' ) ) .
|
| 61 | + ( $this->m_label == '' ? "" : ( ' label="' . self::xml_entities( $this->m_label ) . '"' ) );
|
| 62 | + }
|
| 63 | +}
|
Index: trunk/extensions/WikiObjectModel/includes/models/WOM_OM_NestPropertyValue.php |
— | — | @@ -0,0 +1,20 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * This model implements Parameter / Template_field value models.
|
| 5 | + *
|
| 6 | + * @author Ning
|
| 7 | + * @file
|
| 8 | + * @ingroup WikiObjectModels
|
| 9 | + *
|
| 10 | + */
|
| 11 | +
|
| 12 | +class WOMNestPropertyValueModel extends WikiObjectModelCollection {
|
| 13 | +
|
| 14 | + public function __construct() {
|
| 15 | + parent::__construct( WOM_TYPE_NESTPROPERTYVAL );
|
| 16 | + }
|
| 17 | +
|
| 18 | + public function setXMLAttribute( $key, $value ) {
|
| 19 | + throw new MWException( __METHOD__ . ": no key/value pair required" );
|
| 20 | + }
|
| 21 | +}
|
Index: trunk/extensions/WikiObjectModel/includes/WOM_Processor.php |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | | - private static function parseNext( $text, WikiObjectModelCollection $parentObj, WOMPageModel $rootObj, &$offset = 0, $parserInstance = null ) { |
| 210 | + private static function parseNext( $text, WikiObjectModelCollection $parentObj, WOMPageModel $rootObj, &$offset = 0 ) { |
211 | 211 | // $fname = 'WikiObjectModel::parseNext (WOM)'; |
212 | 212 | // wfProfileIn( $fname ); |
213 | 213 | |
— | — | @@ -224,22 +224,23 @@ |
225 | 225 | } |
226 | 226 | |
227 | 227 | $result = null; |
228 | | - if ( $parserInstance == null ) { |
229 | | - $parserInstance2 = null; |
| 228 | + $parserId = self::getObjectParser( $parentObj )->getSubParserID( $parentObj ); |
| 229 | + if ( $parserId == '' ) { |
| 230 | + $parserInstance = null; |
230 | 231 | foreach ( self::$parsers as $parser ) { |
231 | 232 | $parser_res = $parser->parseNext( $text, $parentObj, $offset ); |
232 | 233 | if ( $parser_res == null ) continue; |
233 | | - if ( $parserInstance2 == null || $parser->subclassOf( $parserInstance2 ) ) { |
234 | | - $parserInstance2 = $parser; |
| 234 | + if ( $parserInstance == null || $parser->subclassOf( $parserInstance ) ) { |
| 235 | + $parserInstance = $parser; |
235 | 236 | $result = $parser_res; |
236 | 237 | } |
237 | 238 | } |
238 | | - if ( $parserInstance2 == null ) { |
239 | | - $parserInstance2 = self::$base_parser; |
240 | | - $result = $parserInstance2->parseNext( $text, $parentObj, $offset ); |
| 239 | + if ( $parserInstance == null ) { |
| 240 | + $parserInstance = self::$base_parser; |
| 241 | + $result = $parserInstance->parseNext( $text, $parentObj, $offset ); |
241 | 242 | } |
242 | 243 | } else { |
243 | | - $parserInstance2 = $parserInstance; |
| 244 | + $parserInstance = self::$parsers[$parserId]; |
244 | 245 | $result = $parserInstance->parseNext( $text, $parentObj, $offset ); |
245 | 246 | if ( $result == null ) { |
246 | 247 | // FIXME: just omit current char, this will not fit for Wiki parser |
— | — | @@ -265,15 +266,14 @@ |
266 | 267 | |
267 | 268 | if ( $next_obj->isCollection() && !( isset( $result['closed'] ) && $result['closed'] ) ) { |
268 | 269 | $collection_start = $offset; |
269 | | - $d = self::parseNext( $text, $next_obj, $rootObj, $offset, |
270 | | - ( ( $parserInstance2 != null && isset( self::$parsers[$parserInstance2->getSubParserID()] ) ) ? |
271 | | - self::$parsers[$parserInstance2->getSubParserID()] : |
272 | | - null ) ); |
273 | | - if ( $d == 100 && $parserInstance2->isObjectClosed( $next_obj, $text, $offset ) === false ) { |
| 270 | + $d = self::parseNext( $text, $next_obj, $rootObj, $offset ); |
| 271 | + if ( $d == 100 && $parserInstance->isObjectClosed( $next_obj, $text, $offset ) === false ) { |
274 | 272 | // rollback |
275 | | - $p = self::getObjectParser( $parentObj ); |
276 | | - if ( $p != null && $p->isObjectClosed( $parentObj, $text, $offset ) === false ) { |
277 | | - return $d; |
| 273 | + if ( ! ( $parentObj instanceof WOMPageModel ) ) { |
| 274 | + $p = self::getObjectParser( $parentObj ); |
| 275 | + if ( $p != null && $p->isObjectClosed( $parentObj, $text, $offset ) === false ) { |
| 276 | + return $d; |
| 277 | + } |
278 | 278 | } |
279 | 279 | $parentObj->rollback(); |
280 | 280 | $offset = $collection_start - $result['len']; |
— | — | @@ -738,13 +738,12 @@ |
739 | 739 | |
740 | 740 | public static function getValidText( $text, $parent, $wom ) { |
741 | 741 | if ( $parent != null ) { |
742 | | - $parserId = self::getObjectParser( $parent )->getSubParserID(); |
| 742 | + $parserId = self::getObjectParser( $parent )->getSubParserID( $parent ); |
743 | 743 | if ( $parserId != '' ) { |
744 | | - $parser = self::$parsers[$parserId]; |
745 | 744 | $offset = 0; |
746 | 745 | $p2 = clone ( $parent ); |
747 | 746 | $p2->reset(); |
748 | | - self::parseNext( $text, $p2, $wom, $offset, $parser ); |
| 747 | + self::parseNext( $text, $p2, $wom, $offset ); |
749 | 748 | $text = ''; |
750 | 749 | foreach ( $p2->getObjects() as $obj ) { |
751 | 750 | $text .= $obj->getWikiText(); |
Index: trunk/extensions/WikiObjectModel/includes/WOM_Setup.php |
— | — | @@ -14,9 +14,13 @@ |
15 | 15 | $wgAutoloadClasses['WOMTemplateModel'] = $wgOMIP . '/includes/models/WOM_OM_Template.php'; |
16 | 16 | $wgAutoloadClasses['WOMParserFunctionModel'] = $wgOMIP . '/includes/models/WOM_OM_ParserFunction.php'; |
17 | 17 | $wgAutoloadClasses['WOMParameterModel'] = $wgOMIP . '/includes/models/WOM_OM_Parameter.php'; |
| 18 | +$wgAutoloadClasses['WOMQuerystringModel'] = $wgOMIP . '/includes/models/WOM_OM_Querystring.php'; |
| 19 | +$wgAutoloadClasses['WOMQueryPrintoutModel'] = $wgOMIP . '/includes/models/WOM_OM_QueryPrintout.php'; |
18 | 20 | $wgAutoloadClasses['WOMParamValueModel'] = $wgOMIP . '/includes/models/WOM_OM_ParamValue.php'; |
19 | 21 | $wgAutoloadClasses['WOMTemplateFieldModel'] = $wgOMIP . '/includes/models/WOM_OM_TmplField.php'; |
20 | 22 | $wgAutoloadClasses['WOMPropertyModel'] = $wgOMIP . '/includes/models/WOM_OM_Property.php'; |
| 23 | +$wgAutoloadClasses['WOMNestPropertyModel'] = $wgOMIP . '/includes/models/WOM_OM_NestProperty.php'; |
| 24 | +$wgAutoloadClasses['WOMNestPropertyValueModel'] = $wgOMIP . '/includes/models/WOM_OM_NestPropertyValue.php'; |
21 | 25 | $wgAutoloadClasses['WOMTextModel'] = $wgOMIP . '/includes/models/WOM_OM_Text.php'; |
22 | 26 | $wgAutoloadClasses['WOMLinkModel'] = $wgOMIP . '/includes/models/WOM_OM_Link.php'; |
23 | 27 | $wgAutoloadClasses['WOMSectionModel'] = $wgOMIP . '/includes/models/WOM_OM_Section.php'; |
— | — | @@ -34,11 +38,15 @@ |
35 | 39 | define( 'WOM_TYPE_CATEGORY' , 'category' ); |
36 | 40 | define( 'WOM_TYPE_SECTION' , 'section' ); |
37 | 41 | define( 'WOM_TYPE_PROPERTY' , 'property' ); |
| 42 | +define( 'WOM_TYPE_NESTPROPERTY' , 'nest_property' ); |
| 43 | +define( 'WOM_TYPE_NESTPROPERTYVAL', 'nest_property_value' ); |
38 | 44 | define( 'WOM_TYPE_LINK' , 'link' ); |
39 | 45 | define( 'WOM_TYPE_TEXT' , 'text' ); |
40 | 46 | define( 'WOM_TYPE_TEMPLATE' , 'template' ); |
41 | 47 | define( 'WOM_TYPE_PARSERFUNCTION' , 'parser_function' ); |
42 | 48 | define( 'WOM_TYPE_PARAMETER' , 'parameter' ); |
| 49 | +define( 'WOM_TYPE_QUERYSTRING' , 'querystring' ); |
| 50 | +define( 'WOM_TYPE_QUERYPRINTOUT' , 'printout' ); |
43 | 51 | define( 'WOM_TYPE_PARAM_VALUE' , 'value' ); |
44 | 52 | define( 'WOM_TYPE_TMPL_FIELD' , 'template_field' ); |
45 | 53 | define( 'WOM_TYPE_SENTENCE' , 'sentence' ); |
— | — | @@ -56,6 +64,7 @@ |
57 | 65 | $wgAutoloadClasses['WOMCategoryParser'] = $wgOMIP . '/includes/parsers/WOMCategoryParser.php'; |
58 | 66 | $wgAutoloadClasses['WOMLinkParser'] = $wgOMIP . '/includes/parsers/WOMLinkParser.php'; |
59 | 67 | $wgAutoloadClasses['WOMPropertyParser'] = $wgOMIP . '/includes/parsers/WOMPropertyParser.php'; |
| 68 | +$wgAutoloadClasses['WOMPropertyValueParser'] = $wgOMIP . '/includes/parsers/WOMPropertyValueParser.php'; |
60 | 69 | $wgAutoloadClasses['WOMSectionParser'] = $wgOMIP . '/includes/parsers/WOMSectionParser.php'; |
61 | 70 | $wgAutoloadClasses['WOMTemplateParser'] = $wgOMIP . '/includes/parsers/WOMTemplateParser.php'; |
62 | 71 | $wgAutoloadClasses['WOMParserFunctionParser'] = $wgOMIP . '/includes/parsers/WOMParserFunctionParser.php'; |
— | — | @@ -72,6 +81,7 @@ |
73 | 82 | define( 'WOM_PARSER_ID_CATEGORY' , 'category' ); |
74 | 83 | define( 'WOM_PARSER_ID_SECTION' , 'section' ); |
75 | 84 | define( 'WOM_PARSER_ID_PROPERTY' , 'property' ); |
| 85 | +define( 'WOM_PARSER_ID_PROPERTY_VALUE' , 'property_val' ); |
76 | 86 | define( 'WOM_PARSER_ID_LINK' , 'link' ); |
77 | 87 | define( 'WOM_PARSER_ID_TEXT' , 'text' ); |
78 | 88 | define( 'WOM_PARSER_ID_TEMPLATE' , 'template' ); |
— | — | @@ -91,6 +101,7 @@ |
92 | 102 | 'WOMCategoryParser', |
93 | 103 | 'WOMLinkParser', |
94 | 104 | 'WOMPropertyParser', |
| 105 | + 'WOMPropertyValueParser', |
95 | 106 | 'WOMSectionParser', |
96 | 107 | 'WOMTemplateParser', |
97 | 108 | 'WOMParserFunctionParser', |
— | — | @@ -109,11 +120,15 @@ |
110 | 121 | WOM_TYPE_CATEGORY => WOM_PARSER_ID_CATEGORY, |
111 | 122 | WOM_TYPE_SECTION => WOM_PARSER_ID_SECTION, |
112 | 123 | WOM_TYPE_PROPERTY => WOM_PARSER_ID_PROPERTY, |
| 124 | + WOM_TYPE_NESTPROPERTY => WOM_PARSER_ID_PROPERTY, |
| 125 | + WOM_TYPE_NESTPROPERTYVAL => WOM_PARSER_ID_PROPERTY_VALUE, |
113 | 126 | WOM_TYPE_LINK => WOM_PARSER_ID_LINK, |
114 | 127 | WOM_TYPE_TEMPLATE => WOM_PARSER_ID_TEMPLATE, |
115 | 128 | WOM_TYPE_PARSERFUNCTION => WOM_PARSER_ID_PARSERFUNCTION, |
116 | 129 | WOM_TYPE_PARAMETER => WOM_PARSER_ID_PARAMETER, |
117 | 130 | WOM_TYPE_TMPL_FIELD => WOM_PARSER_ID_PARAMETER, |
| 131 | + WOM_TYPE_QUERYSTRING => WOM_PARSER_ID_PARAMETER, |
| 132 | + WOM_TYPE_QUERYPRINTOUT => WOM_PARSER_ID_PARAMETER, |
118 | 133 | WOM_TYPE_PARAM_VALUE => WOM_PARSER_ID_PARAM_VALUE, |
119 | 134 | WOM_TYPE_LISTITEM => WOM_PARSER_ID_LISTITEM, |
120 | 135 | WOM_TYPE_TABLE => WOM_PARSER_ID_TABLE, |
Index: trunk/extensions/WikiObjectModel/includes/WOM_Initialize.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * Deprecated entry point, use WikiObjectModel/WikiObjectModel.php instead. |
| 5 | + * Deprecated entry point, use WikiObjectModel/WikiObjectModel.php instead. |
6 | 6 | */ |
7 | 7 | |
8 | 8 | include_once '../WikiObjectModel.php'; |
\ No newline at end of file |