Wikisphere extensions: Difference between revisions

From Wikisphere
Jump to navigation Jump to search
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
Through the following set of Wikisphere extensions you can:
Through the following set of Wikisphere extensions you can:


* enforce an "indirect moderation" on your wiki. You don't moderate pages (or even page's versions) one by one as in [[mediawikiwiki:Extension:FlaggedRevs|FlaggedRevs]] or [[mediawikiwiki:Extension:Approved_Revs|Approved_Revs]], instead, you assign a page and its sub-pages to an owner who can edit its draft state. The owner will be a moderator before the page is approved, and the page creator(s) when ready for publishing
* mark pages as published: as long as a page is in draft state, only authorized users can access it. (In WIKIs with existing pages you can restrict this feature to specific set of pages)
* easily set an empty title for pages, without having to resort in solutions [https://www.hostknox.com/knowledgebase/703/How-to-hide-page-titles-in-MediaWiki.html#hide-page-titles-with-magic-word-DISPLAYTITLE like the following]
*assign pages and sub-pages to specific users, specific groups or any combination of the two, with specific roles and permissions, through a user-friendly control panel
* easily assign display title, language, content model, and SEO metadata to each page and its sub-pages
*enforce an '''implicit moderation''' on your wiki. You don't directly moderate pages (or page versions) as in [[mediawikiwiki:Extension:FlaggedRevs|FlaggedRevs]] or [[mediawikiwiki:Extension:Approved_Revs|Approved Revs]], instead, you assign a page and its sub-pages to authorized user(s) or group(s) which can edit their properties. When the page is ready for publishing, either you publish it as moderator, or you provide the page creator with the relevant permission (i.e., you assign the page to that user or to a group to which the user belongs)
* assign one or more user as editor, moderator, admin, or reader to a page and its sub-pages (this is generally referenced as "page ownership")
* easily set an empty title for pages, without having to resort in solutions [https://www.hostknox.com/knowledgebase/703/How-to-hide-page-titles-in-MediaWiki.html#hide-page-titles-with-magic-word-DISPLAYTITLE like this one]
* easily assign display title, language, content model, published status (as semantic property), and SEO metadata to each page and its sub-pages
*easily create pages with pre-loaded content through regular expressions
*assign an user to a page for a given period, e.g. until your team members are affiliated to your organization
*assign an user to a page for a given period, e.g. until your team members are affiliated to your organization
*'''upload pictures under the current page''', letting you to don't worry about the picture's title and even duplicates ! (inasmuch as the picture is thus characterized by its path)
* ... (to be completed)
* ... (to be completed)


Line 23: Line 26:
|-
|-
|Wikisphere PageProperties
|Wikisphere PageProperties
|Allows to easily edit display title, language and content model of a page. Provides support for SEO and published/draft state of pages
|Allows to easily edit display title, language, content model of a page and its published state. Provides support for SEO metadata
|Wikisphere common
|Wikisphere common
|-
|-
Line 31: Line 34:
|-
|-
|Wikisphere Subpages
|Wikisphere Subpages
|Provides the list of subpages on the navigation panel, a magic word to display subpages of a given page, and a special page to navigate through suppages
|Provides a list of sub-pages on the navigation panel, a magic word to display sub-pages of a given page, and a special page to navigate through sub-pages
|none
|none
|-
|-
Line 37: Line 40:
|A simple extension to display the content of authorized files within pages
|A simple extension to display the content of authorized files within pages
|SyntaxHighlight (optionally)
|SyntaxHighlight (optionally)
|-
|Wikisphere PreloadContent
|(not yet developed) Automatically creates pages upon form submission based on the regular expressions
|
|}
|}




==Configuration==
 
Wikisphere is also featuring a [[Source code & patches|set of patches]] specifically allowing the upload of files at a specific path, an enhanced management of sub-pages and many improvements to popular extensions (primarily PageForms).
 
==Configuration variables==
{| class="wikitable"
{| class="wikitable"
|+
|+
Line 50: Line 52:
!possible values
!possible values
!description
!description
|-
|$wgWikisphereHandleDraftState
|none, new, all, owned
|requires the extension Wikisphere PageProperties. If set to "none" the pages don't need to be explicitly published through the page Properties (reachable from the dropdown of page actions, see picture ...) in order to be accessible by everybody. If set to "new" only new pages need to be explicitly published to be accessible to everybody. If set to "owned" only owned pages and sub-pages need to be published in order to be accessible to everybody or to be posted on the global wikisphere.org database (front-end)
|-
|$wgWikisphereOnBoardCreateOwnedPages
|object
|if the extension Wikisphere PageOwnership is installed, automatically creates "on board" (as the user signs up or signs in the first time after the extension has been installed) owned pages with given roles and permissions as defined in an object like
<pre>
$wgWikisphereOnBoardCreateOwnedPages = [
[
'page_name' => '{{realname_or_username}}',
'role' => 'editor',
'permissions' => 'edit,create,subpages',
'template' => "Personal_page_name"
],
...
];
</pre>
|-
|-
|$wgWikisphereUploadDisableWarnings
|$wgWikisphereUploadDisableWarnings
|true/false
|true/false
|disables "was-deleted", "duplicate" and "duplicate-archive" warnings on file upload (requires the patches in the file [[Source code & patches/includes/upload/UploadBase.php|includes/upload/UploadBase.php]])
|disables "was-deleted", "duplicate", "duplicate-archive" and "bad-prefix" warnings on file upload (requires the patches in the file [[Source code & patches/includes/upload/UploadBase.php|includes/upload/UploadBase.php]])
|-
|-
|$wgWikisphereUploadUnderCurrentPage
|$wgWikisphereUploadUnderCurrentPage
|true/false
|true/false
|uploads images under the current page. E.g. A picture named "cover.png" will be uploaded in the path Book name/cover.png rather than without any path (as in standard WIKIs). It allows the use of generic name for pictures, which are by contrast characterized by their path. (requires the patches [[Source code & patches#Files.2FUpload|described here]]). This feature is currently used with a [[Source code & patches#MsUpload|patched version of MsUpload]] and PageForms, input with "uploadable" parameter and $wgPageFormsSimpleUpload set to true, and it works also with the "one-step process" using [[mediawikiwiki:Extension:Page_Forms/Linking_to_forms#The_one-step_process|page name formulas]].
|currently used in PageForms, input with "uploadable" parameter: if set to true the picture will be uploaded under the current page, so that the filename of the picture will be "[title of current page]/[picture filename]"
This allows the use of generic names, which are by contrast characterized by their path.
 
This feature requires the patches [[Source code & patches#Files.2FUpload|described here]] and it also works with the "one-step process" using [[mediawikiwiki:Extension:Page_Forms/Linking_to_forms#The_one-step_process|page name formulas]] (the picture is uploaded in a temporary path and then moved to the page just created)
 
It does also exist a patch for [[Source code & patches#MsUpload|MsUpload]] (currently not used, in favor of VisualEditor enabled by default also for wikitext)
|-
|$wgWikispherePreloadContent
|object
|On page creation, automatically creates one or more pages associated to the matched regular expression:
<pre>
$wgWikispherePreloadContent = [
 
[
 
// can be a regular expression
// 1638769189/News_articles/2021/12/article_test
'match' => '#^([^/]+)/(News articles|News digests)/([^/]+)/([^/]+)/([^/]+)$#',
'pages' => [
[
'page' => '$1/$2',
'template' => "Subpages list"
],
[
'page' => '$1/$2/$3',
'template' => "Subpages list"
],
]
 
],
 
...
 
 
];
</pre>
|-
|-
|$wgWikisphereAllowEditRegularPages
|$wgWikispherePostOnWikisphere
|true/false
|true/false
|if set to true or the Wikisphere PageOwnership extension is not installed, logged in users can edit/create whatever page on the wiki as long as they are not owned by somebody else.
|posts the semantic data on the global wikisphere.org database (front-end)
|}
 
Once installed, the extension '''Wikisphere PageOwnership''' prevents standard users to edit pages to which they have not been assigned (individually, or as a group).    
 
 
{| class="wikitable"
|+new groups
!name
!description
|-
|-
|$wgWikisphereAutoAssignNewRegularPages
|Unassigned pages editor (wikisphere-regularpageseditors)
|moderator, editor,  none
|members of this group can edit unassigned pages (pages without owners)
|if different than "none" every newly created page is assigned to the logged-in user as moderator or editor. A moderator can access the Page Properties (therefore setting the page publishing state) while an editor cannot.
|-
|-
|$wgWikisphereCreateOwnedPageRealName
|Moderator (wikisphere-moderator)
|true/false
|members of this group can insert other users in the group  "Unassigned pages editor"
|if the extension Wikisphere PageOwnership is installed, automatically creates an owned page corresponding to the user's real name as soon as an user signs in
|}
 
 
 
{| class="wikitable"
|+new rights
!right
!description
|-
|-
|$wgWikisphereCreateOwnedPageTimestamp
|wikisphere-editregularpages
|true/false
|allows to edit unassigned pages (pages without an owner)
|if the extension Wikisphere PageOwnership is installed, automatically creates an owned page corresponding to the timestamp of the user's account creation as soon as an user signs in
|}
|-
 
|$wgWikispherePostOnWikisphere
 
|true/false
To further restrict editing of system namespaces you can use [[mediawikiwiki:Manual:$wgNamespaceProtection|$wgNamespaceProtection]]
|posts the semantic content on the global wikisphere.org database (front-end)
 
<pre>
// restrict editing
$wgNamespaceProtection[NS_PROJECT]  =
$wgNamespaceProtection[NS_TEMPLATE] =
$wgNamespaceProtection[NS_CATEGORY] =
$wgNamespaceProtection[NS_MODULE]  =
$wgNamespaceProtection[PF_NS_FORM]  =
$wgNamespaceProtection[NS_MEDIAWIKI]  =
// if restricted new users cannot create an account
//$wgNamespaceProtection[NS_SPECIAL]  =
 
['editinterface'];
</pre>
 
 
 
To allow users or groups to edit regular pages you can use the right "wikisphere-editregularpages" mentioned above, for instance using<pre>
$wgGroupPermissions['*']['wikisphere-editregularpages'] = false:
$wgGroupPermissions['user']['wikisphere-editregularpages'] = false;
</pre>
 
 
 
{| class="wikitable"
|+custom semantic properties
!property
!description
|-
|-
|$wgWikisphereHandleDraftState
|wikisphere published (__wikisphere_published)
|none, new, all, owned
|marks a page as published (through the Page properties control panel)
|requires the extension Wikisphere PageProperties. If set to "none" the pages don't need to be explicitly published through the page Properties (reachable from the dropdown of page actions, see picture ...) to be accessible to everybody. If set to "new" only new pages need to be explicitly published to be accessible to everybody. If set to "owned" only owned pages and sub-pages need to be published in order to be accessible to everybody or to be posted on the global  wikisphere.org database (front-end)
|}
|}


Line 94: Line 193:
|-
|-
|wikisphere_userpages
|wikisphere_userpages
|<nowiki>{{#wikisphere_userpages: }}</nowiki>
|<nowiki>{{wikisphere_userpages}}</nowiki>
|prints the list of pages owned by the logged-in user (to be used in forms, in order to create new pages under pages owned by the creator)
|prints the list of pages owned by the logged-in user (to be used in forms, in order to create new pages under pages owned by the creator)
|Wikisphere PageOwnership
|Wikisphere PageOwnership
Line 100: Line 199:
|wikisphere_subpages
|wikisphere_subpages
|<nowiki>{{#wikisphere_subpages: }}</nowiki>
|<nowiki>{{#wikisphere_subpages: }}</nowiki>
|prints the list of subpages of a given page
|prints the list of subpages of a given page, it accept a prefix as unnamed parameter, and "template" and "limit" as names parameters
|Wikisphere Subpages
|Wikisphere Subpages
|-
|-
Line 109: Line 208:
|-
|-
|hostname
|hostname
|<nowiki>{{#hostname:}}</nowiki>
|<nowiki>{{hostname}}</nowiki>
|prints the host name, currently used by [[Template:Pdf thumbnail|Pdf thumbnail]] to open display the pdf file from the pdf viewer of the browser
|prints the host name, currently used by [[Template:Pdf thumbnail|Pdf thumbnail]] to open display the pdf file from the pdf viewer of the browser
|Wikisphere common
|-
|registration_timestamp
|<nowiki>{{registration_timestamp}}</nowiki>
|print the Unix timestamp of user's registration date
|Wikisphere common
|-
|realname_or_username
|<nowiki>{{realname_or_username}}</nowiki>
|prints logged-in real name, or the username if the real name is empty
|Wikisphere common
|-
|realname
|<nowiki>{{realname}}</nowiki>
|prints logged-in real name
|Wikisphere common
|-
|username
|<nowiki>{{username}}</nowiki>
|prints logged-in username
|Wikisphere common
|-
|random_code
|<nowiki>{{#random_code: 8}}</nowiki>
|prints a random code of n digits
|Wikisphere common
|Wikisphere common
|}
|}
Line 128: Line 252:
*implements basic functions required by other Wikisphere extensions
*implements basic functions required by other Wikisphere extensions
*implements the hooks necessary to move the files uploaded using the "[[mediawikiwiki:Extension:Page_Forms/Linking_to_forms#The_one-step_process|one-step process]]" of PageForms under the target page (if the configuration variable  $wgWikisphereUploadUnderCurrentPage is set to true)
*implements the hooks necessary to move the files uploaded using the "[[mediawikiwiki:Extension:Page_Forms/Linking_to_forms#The_one-step_process|one-step process]]" of PageForms under the target page (if the configuration variable  $wgWikisphereUploadUnderCurrentPage is set to true)
*implements $wgWikispherePreloadContent to automatically create pages when the title of a created page matches a defined regular expression




Line 141: Line 266:
===PageOwnership===
===PageOwnership===


*creates default owned pages (real name and account creation timestamp)
*displays the action "Ownership" in the page's dropdown menu
*displays the action "Ownership" in the page's dropdown menu
*displays the list of personal pages on the left navigation panel
*displays the list of personal pages on the left navigation panel
*implements the parser function "wikisphere_userpages" to print the list of pages owned by the logged-in user
*implements the parser function "wikisphere_userpages" to print the list of pages owned by the logged-in user
*implements the special page PageOwnership in order to assign editors, moderators, admins or readers to specific pages and their sub-pages
*implements the special page PageOwnership in order to assign specific users and/or specific groups with specific roles and permissions




Line 153: Line 277:
*displays the list of subpages of the current page on the left navigation panel
*displays the list of subpages of the current page on the left navigation panel
*implements the special page WikisphereSubpages in order to display and navigate through subpages of a given page
*implements the special page WikisphereSubpages in order to display and navigate through subpages of a given page
 
*allows to format the list of sub-pages using a template
 
===Preload content===
 
 
== Use-cases ==
 
* A page with the user's real name and one with timestamp of account creation as titles, are automatically created and the user is assigned to them as "editor" (an editor can edit a page but cannot edit its properties, including its publishing state)
* Regular users cannot create new pages, except sub-pages of personal/owned pages, and pages created through forms
* All the pages without an owner are visible to other users, and the published state of pages with an owner has to be set to true in order to let other users to access them
 
 
 
Installed extensions: Wikisphere common, Wikisphere PageProperties, Wikisphere PageOwenrship
{| class="wikitable"
|+'''Configuration'''
!variable
!value
|-
|$wgWikisphereAllowEditRegularPages
|false
|-
|$wgWikisphereAutoAssignNewRegularPages
|none
|-
|$wgWikisphereHandleDraftState
|owned
|-
|$wgWikisphereCreateOwnedPageRealName
|true
|-
|$wgWikisphereCreateOwnedPageTimestamp
|true
|}

Latest revision as of 20:15, 19 December 2021

Through the following set of Wikisphere extensions you can:

  • mark pages as published: as long as a page is in draft state, only authorized users can access it. (In WIKIs with existing pages you can restrict this feature to specific set of pages)
  • assign pages and sub-pages to specific users, specific groups or any combination of the two, with specific roles and permissions, through a user-friendly control panel
  • enforce an implicit moderation on your wiki. You don't directly moderate pages (or page versions) as in FlaggedRevs or Approved Revs, instead, you assign a page and its sub-pages to authorized user(s) or group(s) which can edit their properties. When the page is ready for publishing, either you publish it as moderator, or you provide the page creator with the relevant permission (i.e., you assign the page to that user or to a group to which the user belongs)
  • easily set an empty title for pages, without having to resort in solutions like this one
  • easily assign display title, language, content model, published status (as semantic property), and SEO metadata to each page and its sub-pages
  • easily create pages with pre-loaded content through regular expressions
  • assign an user to a page for a given period, e.g. until your team members are affiliated to your organization
  • upload pictures under the current page, letting you to don't worry about the picture's title and even duplicates ! (inasmuch as the picture is thus characterized by its path)
  • ... (to be completed)


Modules

(each module is technically an autonomous extension)

name description required extensions
Wikisphere common Common methods required from the various Wikisphere extensions Semantic Mediawiki/PageForms
Wikisphere PageProperties Allows to easily edit display title, language, content model of a page and its published state. Provides support for SEO metadata Wikisphere common
Wikisphere PageOwnership Provides support for page ownership and attribution Wikisphere common
Wikisphere Subpages Provides a list of sub-pages on the navigation panel, a magic word to display sub-pages of a given page, and a special page to navigate through sub-pages none
Wikisphere FileInclusion A simple extension to display the content of authorized files within pages SyntaxHighlight (optionally)


Wikisphere is also featuring a set of patches specifically allowing the upload of files at a specific path, an enhanced management of sub-pages and many improvements to popular extensions (primarily PageForms).

Configuration variables

variable possible values description
$wgWikisphereHandleDraftState none, new, all, owned requires the extension Wikisphere PageProperties. If set to "none" the pages don't need to be explicitly published through the page Properties (reachable from the dropdown of page actions, see picture ...) in order to be accessible by everybody. If set to "new" only new pages need to be explicitly published to be accessible to everybody. If set to "owned" only owned pages and sub-pages need to be published in order to be accessible to everybody or to be posted on the global wikisphere.org database (front-end)
$wgWikisphereOnBoardCreateOwnedPages object if the extension Wikisphere PageOwnership is installed, automatically creates "on board" (as the user signs up or signs in the first time after the extension has been installed) owned pages with given roles and permissions as defined in an object like
$wgWikisphereOnBoardCreateOwnedPages = [
	[
		'page_name' => '{{realname_or_username}}',
		'role' => 'editor',
		'permissions' => 'edit,create,subpages',
		'template' => "Personal_page_name"
	],

	...

];
$wgWikisphereUploadDisableWarnings true/false disables "was-deleted", "duplicate", "duplicate-archive" and "bad-prefix" warnings on file upload (requires the patches in the file includes/upload/UploadBase.php)
$wgWikisphereUploadUnderCurrentPage true/false currently used in PageForms, input with "uploadable" parameter: if set to true the picture will be uploaded under the current page, so that the filename of the picture will be "[title of current page]/[picture filename]"

This allows the use of generic names, which are by contrast characterized by their path.

This feature requires the patches described here and it also works with the "one-step process" using page name formulas (the picture is uploaded in a temporary path and then moved to the page just created)

It does also exist a patch for MsUpload (currently not used, in favor of VisualEditor enabled by default also for wikitext)

$wgWikispherePreloadContent object On page creation, automatically creates one or more pages associated to the matched regular expression:
$wgWikispherePreloadContent = [

		[

		// can be a regular expression
		// 1638769189/News_articles/2021/12/article_test
		'match' => '#^([^/]+)/(News articles|News digests)/([^/]+)/([^/]+)/([^/]+)$#',
		'pages' => [			
			[
				'page' => '$1/$2',
				'template' => "Subpages list"
			],
			[
				'page' => '$1/$2/$3',
				'template' => "Subpages list"
			],
		]

	],

	...


];
$wgWikispherePostOnWikisphere true/false posts the semantic data on the global wikisphere.org database (front-end)

Once installed, the extension Wikisphere PageOwnership prevents standard users to edit pages to which they have not been assigned (individually, or as a group).


new groups
name description
Unassigned pages editor (wikisphere-regularpageseditors) members of this group can edit unassigned pages (pages without owners)
Moderator (wikisphere-moderator) members of this group can insert other users in the group "Unassigned pages editor"


new rights
right description
wikisphere-editregularpages allows to edit unassigned pages (pages without an owner)


To further restrict editing of system namespaces you can use $wgNamespaceProtection

// restrict editing
$wgNamespaceProtection[NS_PROJECT]  = 
$wgNamespaceProtection[NS_TEMPLATE] = 
$wgNamespaceProtection[NS_CATEGORY] = 
$wgNamespaceProtection[NS_MODULE]  =
$wgNamespaceProtection[PF_NS_FORM]  =
$wgNamespaceProtection[NS_MEDIAWIKI]  =
// if restricted new users cannot create an account
//$wgNamespaceProtection[NS_SPECIAL]  = 

['editinterface'];


To allow users or groups to edit regular pages you can use the right "wikisphere-editregularpages" mentioned above, for instance using

$wgGroupPermissions['*']['wikisphere-editregularpages'] = false:
$wgGroupPermissions['user']['wikisphere-editregularpages'] = false;


custom semantic properties
property description
wikisphere published (__wikisphere_published) marks a page as published (through the Page properties control panel)


Magic Words / Parser functions

name use case description extension
wikisphere_userpages {{wikisphere_userpages}} prints the list of pages owned by the logged-in user (to be used in forms, in order to create new pages under pages owned by the creator) Wikisphere PageOwnership
wikisphere_subpages {{#wikisphere_subpages: }} prints the list of subpages of a given page, it accept a prefix as unnamed parameter, and "template" and "limit" as names parameters Wikisphere Subpages
noparse {{#noparse: <a href="">my link</a>}} can be used to print raw html within the page when $wgRawHtml is disabled Wikisphere common
hostname {{hostname}} prints the host name, currently used by Pdf thumbnail to open display the pdf file from the pdf viewer of the browser Wikisphere common
registration_timestamp {{registration_timestamp}} print the Unix timestamp of user's registration date Wikisphere common
realname_or_username {{realname_or_username}} prints logged-in real name, or the username if the real name is empty Wikisphere common
realname {{realname}} prints logged-in real name Wikisphere common
username {{username}} prints logged-in username Wikisphere common
random_code {{#random_code: 8}} prints a random code of n digits Wikisphere common


Features

Wikisphere Common

  • Displays the list of forms on the left navigation panel
  • outputs script global variables on page head
  • implements "userCan" on behalf of other Wikisphere extensions
  • displays "Powered by WikiSphere" icon
  • implements magic words "noparse" and "hostname"
  • implements basic functions required by other Wikisphere extensions
  • implements the hooks necessary to move the files uploaded using the "one-step process" of PageForms under the target page (if the configuration variable $wgWikisphereUploadUnderCurrentPage is set to true)
  • implements $wgWikispherePreloadContent to automatically create pages when the title of a created page matches a defined regular expression


PageProperties

  • implements the special page PageProperties in order to assign properties like display_title, language, published state, meta (Html metadata), and more, to any page
  • displays the action "Properties" in the page's dropdown menu
  • prints HTML metadata in the head of the page
  • handles the link rendered in each page according to the saved display_title
  • retrieves and saves the page's semantic data on the global Wikisphere database (if the variable $wgWikispherePostOnWikisphere is enabled)


PageOwnership

  • displays the action "Ownership" in the page's dropdown menu
  • displays the list of personal pages on the left navigation panel
  • implements the parser function "wikisphere_userpages" to print the list of pages owned by the logged-in user
  • implements the special page PageOwnership in order to assign specific users and/or specific groups with specific roles and permissions


Subpages

  • implements the parser function "wikisphere_subpages"
  • displays the list of subpages of the current page on the left navigation panel
  • implements the special page WikisphereSubpages in order to display and navigate through subpages of a given page
  • allows to format the list of sub-pages using a template