Page MenuHomePhabricator

New Talk Page Option
Closed, ResolvedPublic

Description

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.


Version: unspecified
Severity: enhancement

Details

Reference
bz13262

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:02 PM
bzimport set Reference to bz13262.

soxred93 wrote:

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.

attachment inputbox.php ignored as obsolete

Created attachment 4699
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.

attachment Inputbox - preloadtitle.diff ignored as obsolete

ayg wrote:

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
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?

Attached:

soxred93 wrote:

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.

soxred93 wrote:

Right now, just some better names.