r90713 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90712‎ | r90713 | r90714 >
Date:14:32, 24 June 2011
Author:ankitgarg833
Status:deferred
Tags:
Comment:
support for allowed values. @TODO need modification to support comma values
Modified paths:
  • /trunk/extensions/PageSchemas/PageSchemas.classes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/PageSchemas.classes.php
@@ -108,7 +108,7 @@
109109 $this->categoryName = $category_name;
110110 $title = Title::newFromText( $category_name, NS_CATEGORY );
111111 $pageId = $title->getArticleID();
112 - $pageXmlstr =<<<END
 112+ /*$pageXmlstr =<<<END
113113 <ClassSchema name="City">
114114 <FormName>City</FormName>
115115 <Template name="City">
@@ -128,7 +128,8 @@
129129 </ClassSchema>
130130 END;
131131
132 - /*
 132+ */
 133+
133134 $dbr = wfGetDB( DB_SLAVE );
134135 //get the result set, query : slect page_props
135136 $res = $dbr->select( 'page_props',
@@ -147,8 +148,8 @@
148149 $row = $dbr->fetchRow( $res );
149150
150151 //retrievimg the third attribute which is pp_value
151 - $pageXml = $row[2];
152 - */
 152+ $pageXmlstr = $row[2];
 153+
153154 $pageXml = simplexml_load_string ( $pageXmlstr );
154155 $pageName = $pageXml->attributes()->name;
155156 /* index for template objects */
@@ -170,8 +171,8 @@
171172 foreach ( $template_all as $template ) {
172173 $field_all = $template->getFields();
173174 foreach( $field_all as $field ) { //for each Field, retrieve smw properties and fill $prop_name , $prop_type
174 - $prop_array = $field->getObject('Property'); //this returns an array with property values filled
175 - wfRunHooks( 'PageSchemasGeneratePages', array( $prop_array['name'], $prop_array['Type'] ) );
 175+ $prop_array = $field->getObject('Property'); //this returns an array with property values filled
 176+ wfRunHooks( 'PageSchemasGeneratePages', array( $prop_array['name'], $prop_array['Type'], $prop_array['allowed_value_str'] ) );
176177 }
177178 }
178179 }

Status & tagging log