Extension:SimpleCalendar/pl

This page is a translated version of the page Extension:SimpleCalendar and the translation is 12% complete.
Other languages:
MediaWiki Stakeholders' Group Logo.svg This extension is maintained by a member of the MediaWiki Stakeholders' Group .
Podręcznik rozszerzeń MediaWiki
OOjs UI icon advanced-invert.svg
Simple Calendar
Status wydania: stabilne
SimpleCalendar.png
Realizacja Funkcja parsera
Opis Provides a very simple calendar extension which renders a table of all the months in the year with each day being a wiki article
Autor(zy) Aran Dunkley (Naddyskusja)
Opiekun(owie) User:Osnarddyskusja
Ostatnia wersja 1.4.0 (2021-06-14)
Polityka zgodności Follows the MediaWiki version lifecycle. Master is not backward compatible.
MediaWiki 1.25+
Composer mediawiki/simple-calendar
Licencja GNU General Public License 2.0 or later
Pobieranie
Przetłumacz rozszerzenie SimpleCalendar jeżeli jest dostępne na translatewiki.net

Sprawdź wykorzystywanie i matrycę wersji.

The SimpleCalendar extension is a very simple Calendar extension which renders a table of all the months in the year with each day being a wiki article. Days which have nothing in them show up as a red link, clicking on it will create a new article as usual. It installs as a parser function, so the following syntax is used:

{{#calendar:}}

When used like this with no parameters, a calendar of all twelve months will be rendered with each day pointing to an article using the date as its title.

Instalacja

  • Pobierz i umieść plik(i) w katalogu o nazwie SimpleCalendar w folderze extensions/.
  • Dodaj poniższy kod na dole swojego pliku LocalSettings.php:
    wfLoadExtension( 'SimpleCalendar' );
    
  •   Zrobione – Przejdź do Special:Version na swojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.

Do użytkowników mających wersję MediaWiki 1.24 lub wcześniejszą:

Powyższe instrukcje opisują nowy sposób instalowania tego rozszerzenia, poprzez wfLoadExtension(). Jeżeli chcesz zainstalować to rozszerzenie we wcześniejszych wersjach (MediaWiki 1.24 i wcześniejsze), zamiast wfLoadExtension( 'SimpleCalendar' ); użyj:

require_once "$IP/extensions/SimpleCalendar/SimpleCalendar.php";

Użycie

Parametry

There are a number of parameters which allow calendars for different specific purposes.

  • titleThe name of the article which each day in a calendar table links to is by default the date, e.g. 27 Jan 2008. If you want to have different calendars for different purposes, then the title parameter will precede the names with a separating slash character, for example, setting title to "Harry" will cause the dates to format as Harry/27 Jan 2008.
  • yearThis changes the year of the calendar table, the default if no year is specified is the current year.
  • monthIf a month is supplied, then only a single month will be rendered instead of a table containing all twelve months.
  • queryThis allows extra query-string information to be appended to the links for days which don't exist. The main use for this would be to allow some preloaded content in the newly created calendar articles. See examples below. The syntax looks a little strange because it has two equals characters in it.
  • formatThe default date format for date-articles linked to from the days in the calendar tables is, e.g. 2 February 1972, but can be adjusted by supplying a PHP date format in the format parameter. See PHP Manual - strftime for details about how to specify a date format.
  • dayformatThis sets the format of the titles of each day of the week at the top of the month tables. The default setting is M T W T F S S, but can be set to %a for abbreviated names in the current language such as Mon Tue..., or %A for full names in the current language.

CSS

The extension installs its own CSS which formats the tables as shown in the example images. You can add new rules to adjust the tables to your own needs. The default CSS that it installs is as follows.

table.calendar       { margin: 0; padding: 10px; }
table.calendar td    { margin: 0; padding: 2px; vertical-align: top; }
table.calendar th    { padding: 2px; background-color: #ddd; color: #666; text-align: center; font-size: 120%; font-weight: bold; border: none; }
table.month          { border: 2px solid #ccc; }
table.month .dow th  { color: #aaa; text-align: center; font-size: 110%; }
table.month td.today { background-color:#ddd; }
table.month td {
	border: none;
	margin: 0;
	padding: 1pt 1.5pt;
	font-weight: bold;
	font-size: 8pt;
	text-align: right;
	background-color: #eee;
	}
table.month td.day-active a { color: #217A28; }
table.month td.day-empty  a { color: #cc0000; }

Examples

 
Example calendar for the month of January 2007
The examples above use the CURRENTUSER variable which is not installed by default. See Extension:MyVariables if you're interested in adding variables.
{{#calendar: title={{CURRENTUSER}} }}
{{#calendar: title={{CURRENTUSER}} | year=2001 }}
{{#calendar: year=2007 | month=jan | title={{CURRENTUSER}} }}


this example renders the May table for the current year

{{#calendar: month=05 }}


this example uses the new query parameter to pre-load the NewDay template article into newly created dates. It looks a little confusing, but what it's saying is: add "preload=template" to the link

{{#calendar: query=preload=Template:NewDay }}

Changelogs

  • Version 1.4.0 (2021-06-14): Code refactoring; Compatility to modern MW versions.
  • Version 1.3.0 (2015-06-22): Uses the new Extension registration system for loading.
  • Version 1.2.11 (2015-06-19): Includes the default CSS in the extension now
  • Version 1.2.10 (2015-05-10): Fixed up lazy HTML and fixed default date format to work on Windows servers
  • Version 1.2.4 (2007-10-18): Don't die if generated title is invalid
  • Version 1.2.3 (2007-10-13): Use language settings for day and month names and add dayformat parameter
  • Version 1.2 (2007-05-03): Added format parameter.
  • Version 1.1 (2007-05-02): Changed to named parameters and added the query parameter. The style of the day-links are now handled by two new CSS classes, day-active and day-empty.