AmiWiki:Coordination/MediaWiki skin and other changes
From AMI@Work Communities Wiki
Please update the status (latest installed) when installing on the server or modifying a component.
This page contains some patches and a skin for MediaWiki. These help integrating MediaWiki in the AMI@Work server environment. See also: MediaWiki auth.
Contents |
[edit] Skin
Skin location: http://gmuf.com/mosaic/AmiTheme.tar.gz
[edit] Installation
- Extract into mediawiki-dir/skins
- in LocalSettings.php:
$wgLogo = "$wgStylePath/amitheme/amilogo.gif"; # (change line) $wgDefaultSkin = 'amitheme'; # (add line)
[edit] Special:Preferences extra links and other stuff
| Patch location: | http://gmuf.com/mosaic/SpecialPreferences.diff |
| Changes: | includes/SpecialPreferences.php |
This patch
- hides the fields used to change the password and displays just a link to
$wgChangePasswordUrl - technically disables changing of user name and password
- disables the Real Name and Email fields (makes them gray) and displays links to
$wgChangeEmailUrland$wgChangeRealNameUrlto the right of these fields. - adds an additional fieldset containing a list of links as defined via
$wgPrefLinks; see Installation for an example
[edit] Installation
- Patch with
cd mediawiki-dir; patch -p1 </path/to/SpecialPreferences.diff
- Add to LocalSettings.php:
$wgChangePasswordUrl = 'something'; $wgChangeEmailUrl = 'something'; $wgChangeRealNameUrl = 'something'; $wgPrefLinks['joincommunities'] = "http://$wgBscwHost$wgBscwPath?op=regami&mode=get_user_details&target=communities"; $wgPrefLinks['enrollevents'] = "http://$wgBscwHost$wgBscwPath?op=regami&mode=get_user_details&target=events"; $wgPrefLinks['changeprofile'] = "http://$wgBscwHost$wgBscwPath?op=regami&mode=get_user_details&target=profile"; $wgPrefLinks['setresearchtopics'] = "http://$wgBscwHost$wgBscwPath?op=regami&mode=get_user_details&target=topics";
- For every key in
$wgPrefLinks, add a system message MediaWiki:Keyname containing the name to display
[edit] Parameter returntotxt
| Patch location: | http://gmuf.com/mosaic/returntotxt.diff |
| Changes: | includes/OutputPage.php includes/SpecialUserlogin.php |
Adds an optional returntotxt=something parameter. Example usage:
http://......&returnto=Main+Page&returntotxt=ABC
[edit] Installation
- Patch with
cd mediawiki-dir; patch -p1 </path/to/returntotxt.diff
[edit] Userlogin template
| Patch location: | http://gmuf.com/mosaic/template-Userlogin.diff |
| Changes: | includes/templates/Userlogin.php |
Permanently disables the "create user account" part and the "mail me a new password" button in the login form.
[edit] Installation
- Patch with
cd mediawiki-dir; patch -p1 </path/to/template-Userlogin.diff
[edit] Interwiki prefix patch
| Patch location: | http://gmuf.com/mosaic/Title.diff |
| Changes: | includes/Title.php |
This patch is a hack to make MediaWiki treat the bscw and pub interwiki prefixes differently.
Upon encountering a link of the form
[[bscw:something/something else/and so on&op=something&etc=blabla]]
MediaWiki will make it a link to
InterWikiBaseUrl . '/' . rawurlencode('something')
. '/' . rawurlencode('something else')
. '/' . rawurlencode('and so on')
. '&op=something&etc=blabla'
where . is concatenation and rawurlencode is URL encoding acc/to RFC 1738 (BSCW doesn't understand '+' as space).
An initial colon will not be URL encoded because it begins mnemonic paths in BSCW. You can use this feature like this:
[[bscw::something mnemonic/something else/and so on&op=something&etc=blabla]]
The pub: prefix works in the same way.
[edit] Note on base URLs
The base URL (iw_url in the interwiki table) of the interwiki entry must be in the following form
http://host/bscw/bscw.cgi$1
[edit] Installation
- Patch with
cd mediawiki-dir; patch -p1 </path/to/Title.diff
[edit] Action purge, special page tab, other changes
| Patch location: | http://gmuf.com/mosaic/purge.diff |
| Changes: | includes/SkinTemplate.php includes/Article.php' |
This patch
- adds content action </code>wfMsg('purge')</code> which clears the cache of the current page
- renames the "special page" tab to "bscw page" if there is a "titletxt" argument in the URL (this is for AmiSpecial)
- adds
wfMsg('myspace')in personal toolbar - makes the myspace link bold if there is a
myspace=1in the GET request. - moves preferences after mycontris in personal toolbar
[edit] Installation
- Patch with
cd mediawiki-dir; patch -p1 </path/to/purge.diff
[edit] AmiSpecial
Extension location: http://gmuf.com/mosaic/AmiSpecial.php
This extension adds two special pages:
- Special:Bscwform and
- Special:Updateuser
Both are intended only for requests from the BSCW server which should send in all available user cookies. Additionally, Special:Updateuser can be requested only via the localhost interface.
Special:Bscwform is used by BSCW as a template. BSCW should pull it like this:
/w/index.php?title=Special:Bscwform&titletxt=TitleOfThePage /w/index.php?title=Special:Bscwform&titletxt=TitleOfThePage&mword=poll
The first example will return a page containing the default magic word #form#. The magic word can be changed with the mword parameter. The page will be in a "bscw page" tab when called in this way (titletxt must be supplied or the pages will display an explanatory message).
Special:Updateuser should be called upon profile changes (esp. longname and/or primary email changes). It syncs the MediaWiki user with BSCW via XML-RPC and returns a page containing: UPDATE_RESULT_OK if everything went fine. GET it like this:
/wiki/Special:Updateuser
and look for UPDATE_RESULT_OK in the response. Display an error message (perhaps the response body itself--it will be an HTML fragment) if there's no UPDATE_RESULT_OK.
[edit] Installation
- copy AmiSpecial.php to mediawiki-dir/extensions/ami
- add the following to LocalSettings.php:
require_once( "extensions/ami/AmiSpecial.php" );
[edit] BSCW Image extension
Extension location: http://gmuf.com/mosaic/bscwimg.php
This extension adds the bscwimage tag which can be used like this:
<bscwimage>name|desc</bscwimage>
This produces the following HTML:
<img src="$wgBscwImagePath/$name" alt="$desc" title="$desc" />
[edit] Installation
- copy bscwimg.php to mediawiki-dir/extensions/ami
- add the following to LocalSettings.php:
require_once( "extensions/ami/bscwimg.php" ); $wgBscwImagePath = "/some/path" // or "http://some/path"

