Last modified: 2008-10-28 00:09:04 UTC
Currently, the inputbox extension has an option where if you type a page in the box, it makes a new section on the page and brings up the edit box. However, it would be useful if instead, a user enters a topic title into the box, and a new section with that title is created on the page the box is on. For instance, if this: <inputbox> type=newsection </inputbox> was placed on [[Talk:Main Page]] and a user typed "Hello World" in the box and pressed the button, the edit page for a new section on Talk:Main Page would come up, with "Hello World" as the preloaded title. I suggest this idea as a spin-off of the new "preloadtitle" parameter implemented in the index.php file, allowing the title of a section to be preloaded.
Created attachment 4698 [details] A patch for the Inputbox extension, to allow the new preload title option This is my first patch, so please tell me if there are any errors. It works on my computer.
Created attachment 4699 [details] Patch against trunk I have created a unified diff against trunk. Please check it. I was a bit complicated because your editor changed every tab into spaces. But we use tab indention in all source codes.
Soxred, I don't think I'm reviewing this anytime soon. I've never looked at or even really used Inputbox and don't have it installed, plus I have too many others commits I'm supposed to be reviewing.
Created attachment 4794 [details] Updated version that parses correctly Version of previous patch fixing a PHP parse error (HEREDOC string end needs to be at line start, not after whitespace) and a patching error (a changed line that's already in trunk). I'm not really sure what's going on here; the example usage in the initial comment does not appear to work. Can you clarify what this patch is supposed to do? Code in general looks ok for inputbox... Not too fond of the naming for 'getCreateForm2()', can this be renamed or merged with the other function?
Example: <inputbox> type=preloadtitle page=User talk:Soxred93 default=Post a comment here! buttonlabel=Post a comment, with the section title in the box! </inputbox>
Ok, I think I've got some vague idea what this means then. :) I strongly recommend not using 'preloadtitle' as the type name here, as it's not very understandable. The originally-suggested 'newsection' would probably be cleaner; or perhaps simply 'section'. However, there's already a 'comment' type, which confuses matters; this still requests a page title as the input, though. Another problem is that the new parameters are not properly initialized; some general cleanup is needed.
Has there been any further progress with this request? I came to request something similar.
The current patch looks good. Not sure exactly how up-to-date it is, but I'm sure a little improvement and possibly bug-fixing could make it good. Not sure exactly what to do next though.
Right now, just some better names.
Fixed in r42703