https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114545

Revision: 114545
Author:   ning
Date:     2012-03-28 00:09:49 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
apply caption to WOM nest property

Modified Paths:
--------------
    trunk/extensions/WikiObjectModel/includes/models/WOM_OM_NestProperty.php

Modified: 
trunk/extensions/WikiObjectModel/includes/models/WOM_OM_NestProperty.php
===================================================================
--- trunk/extensions/WikiObjectModel/includes/models/WOM_OM_NestProperty.php    
2012-03-27 23:16:05 UTC (rev 114544)
+++ trunk/extensions/WikiObjectModel/includes/models/WOM_OM_NestProperty.php    
2012-03-28 00:09:49 UTC (rev 114545)
@@ -48,9 +48,33 @@
        }
 
        public function getValueText() {
-               return parent::getWikiText();
+               $text = array();
+               foreach ( $this->m_objects as $obj ) {
+                       $text[] = $obj->getWikiText();
+               }
+               return implode( '|', $text );
        }
+       
+       public function getPropertyValue() {
+               if ( count ( $this->m_objects ) > 0 )
+                       return $this->m_objects[0]->getWikiText();
 
+               return '';
+       }
+       
+       public function getCaption() {
+               $text = array();
+               $first = true;
+               foreach ( $this->m_objects as $obj ) {
+                       if ( $first ) {
+                               $first = false;
+                               continue;
+                       }
+                       $text[] = $obj->getWikiText();
+               }
+               return implode( '|', $text );
+       }
+       
        public function setXMLAttribute( $key, $value ) {
                if ( $value == '' ) throw new MWException( __METHOD__ . ": 
value cannot be empty" );
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to