Commit graph

72 commits

Author SHA1 Message Date
Victor Vasiliev
cd6b69e5b4 As Raymond points out, there is a mw-submit class 2008-08-29 20:27:25 +00:00
Victor Vasiliev
f7df81b59f * Add class='mw-input' to the input row
* Move submit button to the table
2008-08-29 20:16:29 +00:00
Andrew Garrett
e75a08f1bc PHP Sucks. Having a value of 0 was making $value appear as false, so you couldn't set a value when adding an option. Fixed this up with a strict check. 2008-08-20 12:30:31 +00:00
Aryeh Gregor
2658e07fb9 Cleanup some of my old code a bit. These should still be replaced with nicer functions altogether, though, as Brion would have it. 2008-08-13 14:52:40 +00:00
Aryeh Gregor
81d611bcac Re-commit turning makeKnownLinkObj(), makeBrokenLinkObj(), makeLinkObj() into link() wrappers. This should mean that all link processing now goes through link(). Per Brion's advice, remove the BrokenLink hook and replace it with LinkBegin and LinkEnd hooks. All parser tests pass except the usual suspects. 2008-08-05 17:05:59 +00:00
Brion Vibber
bd600419c4 Revert r38591 -- "Make good-faith effort to run BrokenLink hook in Linker::link(). No parser-test regressions, and it shouldn't change behavior unless Xml::expandAttributes() and Sanitizer::decodeTagAttributes() aren't inverses up to normalization."
IMHO this is an excellent opportunity to kill a horrible interface and replace it with a sane one. Note the only use of the BrokenLink hook currently in our SVN is in SemanticForms:

/**
 * Sets the URL for form-based adding of a nonexistent (broken-linked, AKA
 * red-linked) page
 */
function sffSetBrokenLink(&$linker, $title, $query, &$u, &$style, &$prefix, &$text, &$inside, &$trail) {
	$link = sffAddDataLink($title);
	if ($link != '')
		$u = $link;
	return true;
}

In the unlikely event that anybody else is really needing the exact hook details, I'm sure there's a much nicer, more future-friendly way to do it. Make a new hook and let these hypothetical extensions fix themselves up. :)
2008-08-05 04:56:29 +00:00
Aryeh Gregor
47a1e38e78 Make good-faith effort to run BrokenLink hook in Linker::link(). No parser-test regressions, and it shouldn't change behavior unless Xml::expandAttributes() and Sanitizer::decodeTagAttributes() aren't inverses up to normalization. 2008-08-04 19:36:20 +00:00
Aryeh Gregor
280afa8af2 Last commit contained errors. Revert most of it, keep only the tweaks to link() itself (and relevant parser test changes). 2008-08-03 17:05:17 +00:00
Aryeh Gregor
b83553af8b * Output title before class in Linker::link() to match behavior of makeLink() and friends, so as not to have to change old parser tests.
* Do not add action=edit to nonexistent special pages.
* Add profiling point for the bit where we add classes in linkAttribs().
* Turn makeLinkObj(), makeKnownLinkObj(), makeBrokenLinkObj() into wrappers for link().  This requires the creation of two new functions to turn query strings/attribute strings into arrays, but still results in fewer LOC (-11 lines) due to less code duplication.  This should be well-tested by the parser tests, because pretty much all link creation now goes through link(), but the only changes are encoding single quotes in attributes, which is a good change.  I find no additional database queries, so since this isn't a CPU bottleneck, there should be no performance issues.
2008-08-03 16:52:55 +00:00
Alexandre Emsenhuber
5cfdfc467b Don't allow contentless tags for <textarea> 2008-06-27 11:01:04 +00:00
Andrew Garrett
553d942726 Don't let textareas be done in short form 2008-06-27 10:46:04 +00:00
Andrew Garrett
ff32fc15cf Use class=mw_label instead of valign and align 2008-06-27 07:22:21 +00:00
Andrew Garrett
171c47e0a2 Core changes for AbuseFilter extension.
In particular:
Xml.php
* Add textarea method to Xml class.
* Make submit button optional for Xml::buildForm
* Right-align labels in buildForm.

Article.php:
* Make ArticleDelete hook display a real error

EditPage.php:
* Split off getBaseRevision()

Title.php:
* Allow errors to be ignored to be sent to getUserPermissionsErrors.
* Allow AbortMove hook to display a real error.

Block.php:
* Add 'mAngryAutoblock' option, for blocks by software, which does retroactive autoblocks on the last 5 IPs used in the last 7 days.
2008-06-27 06:24:42 +00:00
Niklas Laxström
53db0f0a35 * Fix comments 2008-06-17 08:10:50 +00:00
Chad Horohoe
9ba8e6fbf1 Document Xml::hidden(). 2008-06-10 23:18:15 +00:00
Alexandre Emsenhuber
8097d1cb20 Fixed Doxygen warnings when generating documentation for this file and document a bit. 2008-05-16 16:31:37 +00:00
Niklas Laxström
9df08aabb8 * Code cleanup 2008-05-11 21:43:16 +00:00
Niklas Laxström
ef44c50636 * Consistent case and autoloader 2008-05-10 13:46:05 +00:00
Niklas Laxström
6934849a0a * Added code two commonly needed use cases: separate label and input, and select 2008-05-10 13:44:25 +00:00
Niklas Laxström
8774063fa5 * Typo in comment 2008-05-10 09:48:03 +00:00
Alexandre Emsenhuber
5cf24493fa bug fixes:
* Be sure that article name is escaped when outputing a redirect page
* Mark Xml::buildForm() as static
2008-04-28 18:00:58 +00:00
Andrew Garrett
3e1d5464d1 Typo 2008-04-24 12:01:26 +00:00
Andrew Garrett
14b8af061d Fix loss of in moving buildForm to Xml.php, generalise it (this isn't just for global blocking anymore :-)) 2008-04-24 11:53:05 +00:00
Andrew Garrett
34ee5d8675 By suggestion of NikeRabbit, move wfBuildForm into Xml.php 2008-04-24 11:46:20 +00:00
Niklas Laxström
cab3560abc * Shortcut for common use case 2008-04-19 13:51:01 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Aryeh Gregor
d168c31923 Use the standard we've agreed upon for class names: prefixed with "mw-", words separated by hyphens. 2008-04-13 14:18:22 +00:00
Aaron Schulz
2bd9444a30 Add class 2008-04-12 05:17:07 +00:00
Brion Vibber
1b72addea7 Cleanup for r30216:
* Don't triple-escape HTML in drop-down lists :)
* Don't include empty attributes for missing optional parameters
* Use content language, not UI language, for loading predefined reasons
2008-01-28 20:27:15 +00:00
Huji
da4897cf6d * Renaming Xml::reasonDropDown to Xml::listDropDown to make sure it doesn't imply a special usage.
* Adding support for custom name and id, custom class, and custom tabindex to Xml::listDropDown
* Changing the order of parameters Xml::listDropDown accepts.
* Updating ipblock, file deletion and page deletion forms so they all use this new Xml element rather than holding three copies of similar code.
* Removing variables which are no more used in the three above forms.
* Renaming a few variables to follow the coding style of MediaWiki.
2008-01-28 12:57:02 +00:00
Huji
433bb02da8 Introducing Xml::reasonDropDown
* Generates a drop-down box given the required information
* Supports marking the approrpiate option as pre-selected
* Shall be used on deletion and protection pages, where a dropdown is used to select the appropriate reason for the action
2008-01-25 11:28:45 +00:00
Brion Vibber
83ece527d7 * (bug 12588) Fix selection in namespace selector on Special:Newpages
Godawful hack... we'll be frequently passed selected namespaces as strings since PHP is such a shithole.
But we also don't want blanks and nulls and "all"s matching 0, so let's convert *just* string ints to clean ints.
2008-01-11 21:10:51 +00:00
Andrew Garrett
9b0e230fcd Allow an element name to be specified in Xml::namespaceSelector. 2007-09-01 12:38:54 +00:00
Brion Vibber
07aeee4da8 aaand restore behavior from prior to r24882 on expected input 2007-08-20 13:46:08 +00:00
Brion Vibber
f5ee414cad Throw an exception for invalid data in expandAttributes() so we get a backtrace and can beat the shit out of whoever did us wrong instead of just seeing a useless PHP warning message or worse yet silently going through without even knowing we probably lost the data we wanted somewhere else in our output 2007-08-20 13:43:14 +00:00
Rob Church
818756ede2 Make Xml::expandAttributes() a bit more robust against non-array arguments; people keep passing it things it doesn't like :( 2007-08-17 17:06:33 +00:00
Rob Church
82b0e618bd Revert r24574 and r24667 per Brion on bug 10798 2007-08-08 17:46:43 +00:00
Rob Church
2552ae0528 Rewrite Xml::namespaceSelector() before it drives me to totemize somebody. 2007-08-04 12:50:43 +00:00
Rob Church
05ea81fa00 * (bug 10798) Exclude MediaWiki namespace from filtering options on Special:Protectedpages (implicit protection, doesn't make sense to have it)
* Introduce a fourth evil parameter to Xml::namespaceSelector() to exclude namespaces. Pure coincidence, not at all related to the above...
2007-08-04 12:20:41 +00:00
Brion Vibber
c17e2e91db case change for aesthetic purposes 2007-07-07 06:52:59 +00:00
Brion Vibber
676409012b * (bug 10477) Fix AJAX watch for Farsi on Firefox: JavaScript encoding tweak 2007-07-07 06:47:07 +00:00
Aaron Schulz
f7f2b225d1 *Re-add contribs year/month filter. Now it simply jumps to a certain offset. 2007-07-06 22:05:29 +00:00
Tim Starling
e1a8b177c1 gen=js has the wrong cache properties for language-dependent text. Moved wgAjaxWatch initialisation to makeGlobalVariablesScript(). Added associative array capability to Xml::encodeJsVar(). 2007-07-05 13:57:54 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Brion Vibber
1a9f23e73c Stripping out the year/month filter on contribs for the moment, since there's disagreement over how it should work.
Rather than annoy everyone by having it one way and changing it, we'll put it back when it's changed.
2007-06-27 20:36:03 +00:00
Rob Church
b48153b986 Xml::monthSelector() -> Allow callers to override the "id" attribute 2007-06-25 20:53:40 +00:00
Rob Church
510add5a5c Clean up the mess that is Xml::monthSelector()...
* Use accessors instead of direct access to static members
* Use existing XML functions to make life easier and guarantee clean XHTML
* Drop the useless class (use the ID in CSS)
2007-06-25 11:09:51 +00:00
Rotem Liss
3b5fa6f103 Fixing the month names - e.g. use 'january', not 'january-gen', in the months list. 2007-06-25 10:07:36 +00:00
Aaron Schulz
742f648d3b *Add year/month selector to user contribs (bug 516) 2007-06-23 17:27:39 +00:00
Rob Church
8ec0a2350e * (bug 9898) Allow viewing all namespaces in Special:Newpages
* Removed some bizarre behaviour in Xml::namespaceSelector() that stopped non-numeric indexes working for the "all namespace" option
2007-06-05 00:50:46 +00:00