Index: trunk/extensions/SemanticForms/specials/SF_AddData.php |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | if (! $title) {$title = $target_name;} |
71 | 71 | $text = SFFormPrinter::redirectText($title, $data_text); |
72 | 72 | } else { |
73 | | - $text .=<<<END |
| 73 | + $text =<<<END |
74 | 74 | <form name="createbox" action="" method="post" class="createbox"> |
75 | 75 | |
76 | 76 | END; |
Index: trunk/extensions/SemanticForms/specials/SF_AddPage.php |
— | — | @@ -32,9 +32,17 @@ |
33 | 33 | $page_name = $wgRequest->getVal('page_name'); |
34 | 34 | if ('' != $page_name) { |
35 | 35 | // find out whether this page already exists, |
36 | | - // and redirect appropriately |
| 36 | + // and send user to the appropriate form |
37 | 37 | $page_title = Title::newFromText($page_name); |
38 | 38 | if ($page_title && $page_title->exists()) { |
| 39 | + // it exists - see if page is a redirect; if |
| 40 | + // it is, edit the target page instead |
| 41 | + $article = new Article($page_title); |
| 42 | + $article->loadContent(); |
| 43 | + $redirect_title = Title::newFromRedirect($article->fetchContent()); |
| 44 | + if ($redirect_title != NULL) { |
| 45 | + $page_title = $redirect_title; |
| 46 | + } |
39 | 47 | $ed = SpecialPage::getPage('EditData'); |
40 | 48 | $redirect_url = $ed->getTitle()->getFullURL() . "/" . $form_name . "/" . sffTitleURLString($page_title); |
41 | 49 | } else { |
Index: trunk/extensions/SemanticForms/INSTALL |
— | — | @@ -1,4 +1,4 @@ |
2 | | -[[Semantic Forms 0.3.6]] |
| 2 | +[[Semantic Forms 0.3.7]] |
3 | 3 | |
4 | 4 | Contents: |
5 | 5 | * Disclaimer |
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Global functions and constants for Semantic Forms. |
5 | 5 | */ |
6 | 6 | |
7 | | -define('SF_VERSION','0.3.6'); |
| 7 | +define('SF_VERSION','0.3.7'); |
8 | 8 | |
9 | 9 | $wgExtensionFunctions[] = 'sfgSetupExtension'; |
10 | 10 | |
Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | // make sure that this is not itself a category page, and that the user |
37 | 37 | // is allowed to edit it |
38 | 38 | if (($obj->mTitle != null) && ($obj->mTitle->getNamespace() != NS_CATEGORY)) { |
| 39 | + $form_name = null; |
39 | 40 | $categories = getCategoriesForArticle($obj); |
40 | 41 | $default_form_relation = str_replace(' ', '_', wfMsgForContent('sf_form_relation')); |
41 | 42 | foreach ($categories as $category) { |