r23881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23880‎ | r23881 | r23882 >
Date:04:08, 9 July 2007
Author:yaron
Status:old
Tags:
Comment:
New version, 0.3.7 - more initialization of variables, 'AddPage' form handles redirects
Modified paths:
  • /trunk/extensions/SemanticForms/INSTALL (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormEditTab.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_AddData.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_AddPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_AddData.php
@@ -69,7 +69,7 @@
7070 if (! $title) {$title = $target_name;}
7171 $text = SFFormPrinter::redirectText($title, $data_text);
7272 } else {
73 - $text .=<<<END
 73+ $text =<<<END
7474 <form name="createbox" action="" method="post" class="createbox">
7575
7676 END;
Index: trunk/extensions/SemanticForms/specials/SF_AddPage.php
@@ -32,9 +32,17 @@
3333 $page_name = $wgRequest->getVal('page_name');
3434 if ('' != $page_name) {
3535 // find out whether this page already exists,
36 - // and redirect appropriately
 36+ // and send user to the appropriate form
3737 $page_title = Title::newFromText($page_name);
3838 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+ }
3947 $ed = SpecialPage::getPage('EditData');
4048 $redirect_url = $ed->getTitle()->getFullURL() . "/" . $form_name . "/" . sffTitleURLString($page_title);
4149 } else {
Index: trunk/extensions/SemanticForms/INSTALL
@@ -1,4 +1,4 @@
2 -[[Semantic Forms 0.3.6]]
 2+[[Semantic Forms 0.3.7]]
33
44 Contents:
55 * Disclaimer
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -3,7 +3,7 @@
44 * Global functions and constants for Semantic Forms.
55 */
66
7 -define('SF_VERSION','0.3.6');
 7+define('SF_VERSION','0.3.7');
88
99 $wgExtensionFunctions[] = 'sfgSetupExtension';
1010
Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php
@@ -35,6 +35,7 @@
3636 // make sure that this is not itself a category page, and that the user
3737 // is allowed to edit it
3838 if (($obj->mTitle != null) && ($obj->mTitle->getNamespace() != NS_CATEGORY)) {
 39+ $form_name = null;
3940 $categories = getCategoriesForArticle($obj);
4041 $default_form_relation = str_replace(' ', '_', wfMsgForContent('sf_form_relation'));
4142 foreach ($categories as $category) {

Status & tagging log