http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97791

Revision: 97791
Author:   yaron
Date:     2011-09-22 04:19:47 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
Added check of Page Schemas form declaration to getDefaultFormsForPage()

Modified Paths:
--------------
    trunk/extensions/SemanticForms/includes/SF_FormLinker.php

Modified: trunk/extensions/SemanticForms/includes/SF_FormLinker.php
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_FormLinker.php   2011-09-22 
04:17:45 UTC (rev 97790)
+++ trunk/extensions/SemanticForms/includes/SF_FormLinker.php   2011-09-22 
04:19:47 UTC (rev 97791)
@@ -311,6 +311,14 @@
                        $default_forms = array();
                        $categories = SFUtils::getCategoriesForPage( $title );
                        foreach ( $categories as $category ) {
+                               // Check the Page Schema, if one exists.
+                               $psSchema = new PSSchema( $category );
+                               if ( $psSchema->isPSDefined() ) {
+                                       $formName = SFPageSchemas::getFormName( 
$psSchema );
+                                       if ( !is_null( $formName ) ) {
+                                               $default_forms[] = $formName;
+                                       }
+                               }
                                $default_forms = array_merge( $default_forms, 
self::getFormsThatPagePointsTo( $category, NS_CATEGORY, self::DEFAULT_FORM ) );
                        }
                        if ( count( $default_forms ) > 0 ) {


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

Reply via email to