User:Woytecr/area/Manual:Parameters to index.php/pl
From MediaWiki.org
Ta strona zawiera parametry dotyczące pliku index.php - strony głównej oprogramwoania MediaWiki. Most of these arguments are usually given as GET parameters in the URL, but can also be passed as POST data. POST is actually required in some cases, such as the purge action for anonymous users.
Uwaga:Informacje na tej stronie, zarówno Polskiej jak i Angielskiej nie są pełne! Co jakiś czas warto sprawdzić czy nie powstały zmiany na wersji angielskiej i ewentualnie wprowadzić nowsze tłumaczenie.
Clients submitting forms should submit all form parameters present in the HTML -- relying on any kind of static list may lead to future breakage.
The maxlag parameter applies to all actions, essentially telling that the request is not to be served in case of high traffic. Its value is numeric; the lower (but non-zero) this value, the lower the traffic that causes the request not to be served. Only applies if the software is running on a replicated database cluster.
For information on registering new actions with an installation of MediaWiki, see Manual:Hooks/UnknownAction.
Contents |
[edit] Akcje
The following is a list of allowed values for the action parameter.
Podane akcje mozna włączyć/wyłączyć w pliku LocalSettings.php. Additionally, any action except 'view' may be disabled by adding to the $wgDisabledActions array, which by default is empty. Disabling an action using the array takes precedence over per-action settings. For example, if 'info' is in the disabled actions array then you will never be able to view the info page, even if $wgAllowPageInfo is set to true.
Additionally, if searches are enabled and the search parameter is supplied (and non-blank) then all actions are ignored and the search is performed.
- view
- this is the default action; it is the one that is used when no action is explicitly given
- watch
- adds the page to the user's watchlist
- unwatch
- removes the page from the user's watchlist;
- delete
- deletes a page:
-
- by default, returns a form for the user to confirm deletion and specify a reason;
- deletion is performed upon a POST request, if a valid edit token is passed as the value of
wpEditToken; this is what happens when the user confirms deletion; - the delete reason is passed as the value of argument
wpReason; this string is recorded in the deletion log (thelog_commentfield of the logging table) - deletion is also performed when deleting a single version of an image; this requires the version id to be passed in the parameter
oldimageand a valid edit token inwpEditToken; in this case, the request can also be passed via GET;
- revert
- reverts to a previous version of an image; the following two other parameters are required:
-
oldimage, the id of the version to revert to;wpEditToken, a valid edit token;
- rollback
- rollbacks the last edits made by the last editor of the page; in other words, it restores the last version of the article whose editor is not the last one; the edit is marked as minor and a default edit summary is used
-
fromis the username whose edits are to be revertedtokenis a rollback token; used to prevent users from being tricked into performing an unwanted rollback by following a link or clicking a button in an external website- if the optional
summaryargument is passed, its value is used as the edit summary in place of the default one - if the optional
botargument is passed, the edit will be marked as a bot one (the edit is markedrc_bot=1in the recentchanges table)
- protect
- shows or changes the protection levels of a page:
-
- by default, returns a form showing the current protection levels of the page, allowing the user to change the protection levels of the page;
- these levels are changed to the values of
mwProtect-level-editandmwProtect-level-moveif the request is a POST one and a valid edit token is passed aswpEditToken; parametermwProtect-reasongives the reason for protection or unprotection which will be recorded in the page log; ifmwProtect-cascadeis also passed, cascading protection is applied (all transcluded pages are set to the same protection levels) - more generally, the actions that can be limited are those listed in the $wgRestrictionTypes array; this array is initialized to
array('edit','move')and can be changed in LocalSettings.php; the protection action then accept a parametermwProtect-level-$actionfor each action in that array
- unprotect
- alias for protect (they perform exactly the same function);
- info
-
- shows some information related to the page, such as the number of users having it in their watchlist, the number of edits, the number of authors;
- this action is disabled by default via the variable
$wgAllowPageInfoinDefaultSettings.php);
- markpatrolled
- marks an edit as patrolled; see meta:Help:Patrolled edit;
-
rcidis the id of an edit in the recentchanges table
- render
- shows an HTML rendering of the page; similar to the
viewaction, but only the article text is shown, not the additional toolboxes, etc. - deletetrackback
- ...
-
- related to TrackBack;
- this action is disabled by default in
DefaultSettings.php
- purge
- clear the cache of the page, forcing it to be rebuilt from its source;
-
- this action is directly performed for logged-in users
- for non logged-in users, the action is actually performed only if requested via a POST request; otherwise, a form to confirm purging is shown (pressing the OK button posts the purge request, which is then executed)
- same as 'view';
- dublincore
- ...
-
- disabled by default via $wgEnableDublinCoreRdf
- creativecommons
-
- disabled by default via $wgEnableCreativeCommonsRdf
- credits
- ...
- submit
- performs various actions related to changing the page (see below for more details):
-
- by default, shows an edit form;
- various other arguments can be passed to change a page, preview a new version of it, or show the difference with a new version (see edit/submit section below for details);
- edit
- generally used to return an edit form for the page, it actually performs almost the same function as submit;
- history
- shows the history of the page (see below)
- raw
- shows the raw content of the page (see below)
- ajax
- if enabled, calls a php function registered via $wgAjaxExportList; see Manual:Ajax.
-
- requires $wgUseAjax to be true; the only callable functions are those in the array $wgAjaxExportList (implicite if $wgAjaxSearch or $wgAjaxWatch is set)
- additional parameters:
rsis the function name (e.g.,rs=wfSajaxSearch); thersargs[]array is the list of arguments of this function (e.g.,rsargs[]=abcdpasses theabcdstring to the function). - the JavaScript function sajax_do_call for calling Ajax functions is defined in ajax.js
[edit] Preference overriding
The following parameters override some of the user's preferences. Other parameters explained in other sections are "diffonly", "internaledit", and "externaledit".
- useskin
- specify a skin
- uselang
- specify a language for the UI elements (such as the "my talk" link, etc.); this is especially useful for creating an account, because at that stage no preference settings apply, use e.g. http://meta.wikimedia.org/w/index.php?title=Special:Userlogin&type=signup&uselang=de ; uselang is also used as general parameter, not related to language, to select from a range of versions of a MediaWiki page, and for a combination of language code and some other parameter, see commons:Commons:Upload and [1];
- variant
- specify a language variant for the UI elements (this is used for example in the Chinese Wikipedia, as the Chinese language has variants);
- printable
- when passed with value
yes, the page is shown in a form that is suitable for printing;
The above four parameters affect all actions but "render" and "raw".
[edit] Identifying a page or revision
The page (or a version of it) can be specified by passing one or more of the following parameters:
- title
- the title of the page
- curid
- the id of the page; overrides the value of title (although the title parameter is still required, or you end up on the main page)
Some actions (such as view and edit) also work on a particular revision of a page. Such a revision is identified by the two following parameters, allowing the omission of the title and the id of the page.
- oldid
- the id of a revision;
- direction
- instead of the revision given by oldid, use:
direction=prev: the one preceding itdirection=next: the one following it
[edit] View and render
View is the default action. If no other action is passed, action=view is implicitly assumed. This action shows a page, a revision, or the difference between two revisions of the same or two different pages. The following is a (partial) list of arguments that affect this action.
- diff
- the value of this parameter identifies a revision; the difference between another revision and this one is returned:
-
- if
oldidis not passed, the difference between this revision and the previous one on the same article is shown; - otherwise, the difference between the revision given by
oldid/directionand this one is shown; the value of this parameter can be a revision id, the valuesprevornextto identify a revision relative to the one given byoldid/direction, and the valuecurto identify the latest revision of the page;
- if
- Note that
oldidanddiffneeds not to be two revisions of the same article, allowing two revisions of two different pages to be compared - redirect
- if the value of this parameter is 'no' and the page is a redirect, the page itself is shown and not the target of the redirect; this parameter has effect only on
action=viewandaction=renderand only if neitheroldidnordiffis given, as this is the only case where the target article is shown instead of the redirect; - rdfrom
- when the page is the result of following a redirect from an external wiki, this parameter tells which wiki that was, so that the "Redirected from ..." line can be shown
- diffonly
- override the user's preference on whether to render the page when a diff is requested
- search
- if non-blank (and if searches are enabled), override all other parameters and perform a search
The following parameters apply only to categories.
- from
- if the page is a category, only list entries whose sortkey are equal or follows the value of this parameter;
- until
- if the page is a category, only list entries whose sortkey precedes the value of this parameter; only used if
fromis not passed;
The following parameter apply only to images.
- page
- a page number in a multi-page media; it currently only applies to DjVu files; first page is numbered 1;
[edit] History
- limit
- number of page revisions to list
- dir
- the relative order of history pages:
dir=prevmeans that the earliest page of the history is shown as the first page; any other value means that the latest page of history is shown first; within each page, entries are sorted in decreasing timestamp in both cases - offset
- a timestamp used for specifying which part of the history is to be shown; the latest returned entry is the latest revision preceding this timestamp in the default case; if
dir=previs given, it works in the other way around; the value of this field is not actually an offset (the index of the first entry to show) for performance reasons - feed
- if specified, a feed for the changes in the history is returned; allowed values are
atomandrss - go
- (deprecated) if the value
go=firstis passed, the first (earliest) page of history is shown
[edit] Raw
Passing action=raw returns the source code of a page or revision.
- templates
- if passed with value
expand, templates within the page are expanded; - ctype
- the content-type value to be used in the HTTP header when returning the raw content, instead of the default
text/x-wiki; this can only be one of the allowed types, which currently aretext/x-wiki,text/javascript,text/css, andapplication/x-zope-edit - maxage
- the value of max-age in the Cache-Control HTTP header field to be used when returning the raw page
- usemsgcache
- only applies to pages in the MediaWiki namespace; if this argument is present, the content of the message is returned from the message cache and not from the database
- oldid
- the id of a specific revision to return
- direction
- either
next,prev, orcur; instead of the revision specified by oldid, returns the one following it, the one preceding it, or the current (last) one; - gen
- this argument can take value
cssorjs; the return value is a generated user CSS stylesheet or JavaScript
[edit] Edit and submit
The edit and submit actions perform almost the same action. By default, they return an "edit page" form for the page. Different results can be obtained by passing other arguments; some results (such as saving the new version of a page) can only be obtained using POST. This action takes the standard arguments for specifying a page or a page revision.
[edit] Options affecting the edit form
The following three options produce an effect on the edit form (the first one also affects how the page is saved.)
- section
- specifies the index of a section within a document to preload and edit; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value
newis used to append a new section to the document; - preload
- specifies a page, of which the wikitext is used as the initial value of the textarea in the edit form if the page or section to be edited does not exist; if it exists the preload command is ignored. (Bug 5210 since 2006-03-09: this will preload almost the full wikitext of the source page, including the noinclude parts and tags, but not the includeonly tags.)
- editintro
- title of an existing article or template to be rendered above the edit form;
- internaledit/externaledit
- overrides the default user preference on external editors.
- mode
- this parameter affects the result page if passed with value file and using an external editor;
- undo
- attempts to undo an edit or a sequence of edits; technically, this is done by trying to merge the inverse of these edits with the sequence of all subsequent edits; the value of this parameter is an id of an old revision of a page; if merge is not possible, a regular edit form for that revision is returned
-
- by default, undone is attempted on the edit preceeding the given revision id;
- if undoafter is also given, the changes between the revisions
undoafterandundoare attempted to be undone;
[edit] What to do
The following options tells the software what to do when submitting: saving, showing a preview, or showing the difference with the current version.
- wpSave
- this argument is generated when saving the content of an edit form returned by the server, but is not actually used nor required when submitting (see below for required arguments to save);
- wpPreview
- set in a POST request to request a preview of the page or section as if the value of wpTextbox1 were saved;
-
- by default, returns an edit form with a preview of the value of wpTextbox1;
- if the additional
liveargument is passed, only the rendering of the value of wpTextbox1 is shown, not the form and the other GUI element; this is similar to the result of saving and then viewing withaction=render(for some details of live preview and an application, see en:User:Pilaf/Live Preview); - the argument
wpLivePreviewis identical to wpPreview; therefore, a regular preview is returned ifliveis not passed;
- wpDiff
- set in a POST request to request a table showing the changes between the current version of the page or section and the version as if value of wpTextbox1 were saved;
[edit] Parameters that are needed to save
The following parameters are required when a user saves a page. The edit summary field may also be required if so configured (see below).
- wpTextbox1
- the new page/section content;
- wpStarttime
- the timestamp of when the user started editing the page; used to check whether the page has been deleted between this moment and the submission time (in this case, the user is asked to confirm saving);
- wpRecreate
- in case the page was deleted after wpStarttime, this field confirms that the page is to be saved;
- wpEdittime
- for new pages, it is equal to wpStarttime; otherwise, it is the timestamp of the last revision of the page; used to check edit conflicts;
- wpEditToken
- an edit token; this is used to avoid users from being tricked into saving a page by following a link or pressing a button in an external site. For non-logged-in users, wpEditToken is required since revision 18112; it currently contains only the characters
+\, rather than a random string (see edit token suffix).
For the page to be saved, wpStarttime, wpEdittime, wpTextbox1 and wpEditToken are required in a POST request, and neither wpPreview nor wpDiff are passed. If the page was deleted after wpStarttime, the boolean option wpRecreate is also required.
[edit] Optional additional data
The edit summary or the "ignore blank" parameter may be mandatory if "warn on blank summaries" is configured.
- wpSummary
- the edit summary;
- wpMinoredit
- if set in a save request, the edit is marked as minor; for preview and diff, it is the initial value of "this is a minor edit" checkbox in the edit form;
- wpWatchthis
- if passed on a save request, the page is added to the user's watchlist; if it is not passed in a save request, the page is removed from the user's watchlist; for preview or diff, this is the initial value of the "watch this page" checkbox of the edit form;
- wpSection
- specify the index of a section within a document to submit to; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value
newis used to append a new section to the document; - wpAutoSummary
- contains the MD5-hashing of the edit summary field as initially presented to the user in the edit form; this field is used to check if the user has modified that field before submitting: if the MD5 hashing of the value of
wpEditSummaryis the same as this field, the edit summary has not been modified; - wpIgnoreBlankSummary
- save page even if user has not modified the edit summary, while they were supposed to;
- wpTextbox2
- in case of an edit conflict, it contains the value of wpTextbox1 of the save request that generated the conflict;
- safemode
- some browsers are known to have problems with editing text containing Unicode characters; when a request for an edit form come from one such browser, the non-ascii characters in the initial content of the textarea are converted into the form
&#xxxx;and the valuesafemode=1is hidden in the form; when submitting, thesafemodefield indicate that the the inverse translation is to be performed; a browser is considered non-Unicode-compliant if the User-Agent HTTP header matches a regular expressions in the variable $wgBrowserBlackList; - wpScrolltop
- used to preserve the scrollbar position in the edit textbox when loading a preview.
[edit] Specialne strony
Most special pages have additional parameters, specific to the function they perform. As an example, the parameters for Special:Export are outlined in Manual:Parameters to Special:Export
Userspace JavaScript scripts may take additional parameters passed via GET or POST. If the user's or global JavaScript script include Lupin's Autoedit Script, the following parameters are used for automated editing: autoedit, autosummary, autoclick, and autominor. Some more details are given in Extension:Autoedit.