Index: trunk/extensions/PageSchemas/PageSchemas.classes.php |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | $this->categoryName = $category_name; |
110 | 110 | $title = Title::newFromText( $category_name, NS_CATEGORY ); |
111 | 111 | $pageId = $title->getArticleID(); |
112 | | - $pageXmlstr =<<<END |
| 112 | + /*$pageXmlstr =<<<END |
113 | 113 | <ClassSchema name="City"> |
114 | 114 | <FormName>City</FormName> |
115 | 115 | <Template name="City"> |
— | — | @@ -128,7 +128,8 @@ |
129 | 129 | </ClassSchema> |
130 | 130 | END; |
131 | 131 | |
132 | | - /* |
| 132 | + */ |
| 133 | + |
133 | 134 | $dbr = wfGetDB( DB_SLAVE ); |
134 | 135 | //get the result set, query : slect page_props |
135 | 136 | $res = $dbr->select( 'page_props', |
— | — | @@ -147,8 +148,8 @@ |
148 | 149 | $row = $dbr->fetchRow( $res ); |
149 | 150 | |
150 | 151 | //retrievimg the third attribute which is pp_value |
151 | | - $pageXml = $row[2]; |
152 | | - */ |
| 152 | + $pageXmlstr = $row[2]; |
| 153 | + |
153 | 154 | $pageXml = simplexml_load_string ( $pageXmlstr ); |
154 | 155 | $pageName = $pageXml->attributes()->name; |
155 | 156 | /* index for template objects */ |
— | — | @@ -170,8 +171,8 @@ |
171 | 172 | foreach ( $template_all as $template ) { |
172 | 173 | $field_all = $template->getFields(); |
173 | 174 | 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'] ) ); |
176 | 177 | } |
177 | 178 | } |
178 | 179 | } |