امتداد:مراجعات معتمدة

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:Approved Revs and the translation is 26% complete.
Other languages:
الدليل المرجعي لامتدادات ميدياويكي
OOjs UI icon advanced-invert.svg
Approved Revs
حالة الإصدار مستقر
تنفيذ وصلة
بيان يسمح للإداريين وسم مراجعة محددة لصفحة ما بوسم «معتمد - approved».
المؤلف/المؤلفون Yaron Koren <yaron57@gmail.com> and others
آخر إصدار 1.7.2 (ديسمبر 2021)
سياسة التوافق النسخة الرئيسية تحافظ على التوافق مع الإصدارات السابقة.
MediaWiki 1.32+
تغييرات قاعدة البيانات نعم
جداول approved_revs
approved_revs_files
ترخيص رخصة جنو العمومية 2.0 أو ما بعدها
التنزيل
  • $egApprovedRevsBlankIfUnapproved
  • $egApprovedRevsEnabledNamespaces
  • $egApprovedRevsAutomaticApprovals
  • $egApprovedRevsFileAutomaticApprovals
  • $egApprovedRevsShowNotApprovedMessage
  • $egApprovedRevsBlankFileIfUnapproved
  • $egApprovedRevsSelfOwnedNamespaces
  • $egApprovedRevsShowApproveLatest
viewlinktolatest, approverevisions, viewapprover
ترجم الامتداد Approved Revs لو كان متوفرا على translatewiki.net

طالع مصفوفة الاستخدام والإصدارات.

المسائل المهام المفتوحة · الإبلاغ عن عطل تقني

إن امتداد Approved Revs هو امتداد يسمح للإداريين بوسم مراجعة معينة في صفحة بوسم «معتمدة - approved». المراجعة المعتمدة هي تلك التي تعرض حينما يستعرض المستخدمين الصفحة مستخدمين معرف مواردها الموحد الرئيسي.

صمم هذا الامتداد كي يكون بديل سهل الاستخدام خفيف المطالب عن الامتداد FlaggedRevs . إن امتداد FlaggedRevs هو امتداد غني بالسمات مخصص للخدمة الشاقة يقدم ليس فقط اعتماد المراجعات بل أنه يحتوي على سمات مراجعة وأخرى ذات صلة؛ حيث يحدد 4 حقوق مستخدمين و3 مجموعات مستخدمين و15 متغير عمومي و أنواع من السجلات و11 صفحة خاصة و9 جداول قواعد بيانات (على عكسه، يحدد امتداد المراجعات المعتمدة 3 حقوق مستخدمين ولا يحدد مجموعات مستخدمين ويحدد 7 متغيرات عمومية ونوع سجلات واحد وصفحة خاصة واحدة وجدولي قواعد بيانات). لو كنت تشغّل موقع ويكي كبير الحجم مثل ويكيبيديا، حيث يجب أن يتخذ قرار ما هي المراجعة التي يجب عرضها بصفة المراجعة «الرسمية» على يد أكثر من شخص أو يقبله على الأقل أكثر من شخص واحد، سيكون امتداد FlaggedRevs هو الأداة المناسبة لك. إلا أنك لو كنت تشغّل موقع ويكي صغير أو متوسط، يتولى تشغيله عدد محدود من الإداريين، ربما يكون امتداد المراجعات المعتمدة هو الحل الأنسب.

حتى لو كانت مراجعة ما معتمدة، لا يزال بإمكان أغلب الامتدادات التي تجلب محتوى الصفحات الحصول على آخر مراجعة، لا المراجعة المعتمدة (لو كانتا مختلفتين). إلا أن الامتدادات التي تحصل على بيانات محددة من صفحات مثل Cargo أو Semantic MediaWiki أو DynamicPageList ، سوف تعرض، لحسن الحظ، البيانات الصحيحة (أي المعتمدة).

التنزيل

يمكنك تنزيل الكود البرمجي لامتداد المراجعات المعتمدة، في صيغة ‎.zip‎، من هنا.

يمكنك أيضا تنزيل الكود البرمجي مباشرة مستخدما غت من مستودع الكود المصدري لميدياويكي. ومن سطر الأوامر، يمكنك استدعاء ما يلي:

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ApprovedRevs.git

كي ترى النص البرمجي على الإنترنت، شاملا تاريخ الإصدار لكل ملف، اذهب إلى phab:diffusion/EARE/browse/master/.

التنصيب

To install this extension, create an 'ApprovedRevs' directory (either by extracting a compressed file or downloading via Git), and place this directory within the main MediaWiki 'extensions' directory. Then, in the file 'LocalSettings.php', add the following line:

wfLoadExtension( 'ApprovedRevs' );

You will also need to install two database tables for this extension: "approved_revs" and "approved_revs_files". You can do this in one of two ways: either run the script "update.php " in MediaWiki's /maintenance directory, or call the SQL directly in your database - you can find it in the files ApprovedRevs.sql and ApprovedFiles.sql, both located in the extension's /sql directory.

If you were running a version of Approved Revs older than 1.4, and are upgrading to version 1.4 or higher, you will need to call update.php again, in order to have the latest DB table structure.

Finally, there are the following user rights defined for Approved Revs:

  • 'approverevisions' - The permission to approve and unapprove revisions of pages. By default it is given to all members of the 'sysop' group.
  • 'viewlinktolatest' - The permission to see a note at the top of pages that have an approved revision, explaining that what the user is seeing is not necessarily the latest revision. By default it is given to everyone (i.e, '*').
  • 'viewapprover' - The permission to see another note at the top of pages that have an approved revision, stating who last approved it. By default it is given to all members of the 'sysop' group.

You can modify the set of users who have any of these permissions. For example, to have the "view most recent revision" link show up only for administrators, you could add the following, below the inclusion of Approved Revs:

$wgGroupPermissions['*']['viewlinktolatest'] = false;
$wgGroupPermissions['sysop']['viewlinktolatest'] = true;

المؤلفون

Approved Revs was written by Yaron Koren. Important code contributions were also made by Raimond Spekking, Siebrand Mazeland, Jeroen De Dauw, Eli Handel, Andrew Engelbrecht, hashar, Anomie, Mark Hershberger, Flo, Addshore, James Montalvo, Fodagus, Kris Field and others.

الاستخدام

A history page, with "approve" links, plus a star and an "unapprove" link for the approved revision

Once the extension is installed, anyone with the 'approverevisions' permission will see a link that reads "(approve)" on each row of a page history page. Clicking on that link will set that revision as the approved one. If you then go back to the history page, you will see an "approve" link next to every other revision, along with an "unapprove" link for the approved revision; the approved revision's row will also have a star next to it. Clicking "approve" for any other revision will re-set the approval to that revision; while clicking "unapprove" will mean that there will no longer be an approved revision for this page.

Users without 'approverevisions' permission will see nothing special in the history page, other than a star icon on the approved revision's row.

By default, if a user with 'approverevisions' permission makes an edit to a page that already has an approved revision, that edit, i.e. the latest revision of the page, gets automatically marked as approved. By contrast, if a page has no approved revision (this of course includes new pages), automatic approvals will not be applied.

You can eliminate automatic approvals, thus requiring that every approval has to be done manually, by adding the following to LocalSettings.php below the inclusion of Approved Revs:

$egApprovedRevsAutomaticApprovals = false;

A similar logic applies for new versions of files; these automatic approvals, too, can be turned off automatically with the following line:

$egApprovedRevsFileAutomaticApprovals = false;

Conversely, if you set "$egApprovedRevsBlankIfUnapproved" or "$egApprovedRevsBlankFileIfUnapproved" to true in LocalSettings.php (see below), every edit to pages and/or files made by a user with 'approverevisions' permission becomes approved - even edits to pages/files that don't have an approved revision.

Manual revision approvals and unapprovals get stored in the 'approval' log; though approvals that happen automatically, as a result of someone with approval power editing a page, do not.

Special:ApprovedRevs page

Approved Revs defines a special page, "Special:ApprovedRevs" which shows four separate lists:

  • pages whose approved revision is not their latest
  • all pages with an approved revision
  • "unapproved pages" (all pages without an approved revision)
  • pages with invalid approvals (such as pages in a namespace that was previously approvable but no longer is).

For the third list, of pages with no approved revision, you can optionally include a link for each page to mark that page's latest revision as approved. To include such links, add the following to LocalSettings.php:

$egApprovedRevsShowApproveLatest = true;

حفظ معلومات الاعتماد

Information about approvals - who made them, and when they were made - is stored in the "Revision approval" log, which can be viewed at the page Special:Log. Recent approvals are also shown in Special:RecentChanges.

عرض الصفحات غير المعتمدة خالية

If you want to, you can have pages that have no approved revision show up as blank - users will still be able to see all the revisions if they click on the "history" tab, but the main display will be a blank page. To do that, just add the following line to LocalSettings.php, anywhere after the inclusion of Approved Revs:

$egApprovedRevsBlankIfUnapproved = true;

Similarly, you can set files with no approved version to not show up when embedded in other pages, by adding the following line:

$egApprovedRevsBlankFileIfUnapproved = true;

الإشارة إلى صفحات غير معتمدة

By default, pages with no approved revision simply show up normally, with no indication of their status. You can have such pages display a message at the top saying, "This is the latest revision of this page; it has no approved revision." To do that, add the following line to LocalSettings.php:

$egApprovedRevsShowNotApprovedMessage = true;

ضبط الصفحات كي يمكن اعتمادها

Some wiki pages can have their revisions approved, while others cannot; this is determined in one of three ways.

ضبط كافة الصفحات في نطاق اسم محدد لتكون قابلة للاعتماد

A global variable, $egApprovedRevsEnabledNamespaces, exists, which determines which namespaces are handled by the extension. This variable is an array, and by default it holds six namespaces: NS_MAIN (the main namespace), NS_USER (user pages), NS_FILE (files), NS_TEMPLATE (templates), NS_HELP (help pages) and NS_PROJECT (the project namespace, which usually has the same name as the wiki). You can add additional namespaces to this set - after the inclusion of Approved Revs in LocalSettings.php, add something like:

$egApprovedRevsEnabledNamespaces[NS_USER_TALK] = true;

It is not recommended to add the Category or MediaWiki namespaces to this array, because, due to their special implementation in MediaWiki, approvals will not work correctly on those pages.

To remove default namespaces as approvable, set their value to false. For example, to make files unapprovable, add the following:

$egApprovedRevsEnabledNamespaces[NS_FILE] = false;

جعل الصفحات يمكن اعتمادها باستخدام ‎#approvable_by

Approved Revs defines the #approvable_by parser function, which lets you define certain pages as being approvable by certain individual users and groups. For example, the following call would allow user Alice Jones, as well as users in the Bureaucrat and Sysop groups, to approve the page on which it was called:

{{#approvable_by: users = Alice Jones | groups = bureaucrat,sysop }}

Note that, if a user who is allowed to edit a page because of this parser function approves a revision before this function was added, then they will lose the ability to make any other approvals (since the approved revision does not contain this call), until an administrator comes in and undoes their action.

ضبط صفحات يمكن اعتمادها باستخدام كلمة سحرية

Individual pages not within one of the specified namespaces can also be made approvable, by adding the __APPROVEDREVS__ magic word anywhere within the page. It is recommended to add in this magic word to pages via a template. If __APPROVEDREVS__ is added directly to a page, just be careful not to approve a revision of the page from before that string was added; this could lead to unexpected behavior.

إفساح المجال لغير الإداريين «لتملك» صفحات

Sometimes it's helpful to allow those without the general 'approverevisions' permission to be able to approve revisions of certain pages - in other words, to have ownership of certain pages. An obvious example is user pages - it makes sense to allow each user to be able to approve revisions on their own user pages. For namespaces other than "User", you can choose to have the user who originally created any page in that namespace be designated as the page owner, who then has revision-approval permission for that page.

To have this kind of "ownership" for a specific namespace, you need to add the namespace to the variable $egApprovedRevsSelfOwnedNamespaces. To allow users to "own", i.e. be able to approve, pages in the main and user namespaces, for instance, you should add the following to LocalSettings.php:

$egApprovedRevsSelfOwnedNamespaces = array( NS_MAIN, NS_USER );

A namespace needs to belong to $egApprovedRevsEnabledNamespaces before it can be added to $egApprovedRevsSelfOwnedNamespaces.

Displaying approval information

Approved Revs defines five "magic words" that can be used to display approval information about a specific page (or file). They are:

  • APPROVALYEAR - the year in which the page was last approved
  • APPROVALMONTH - the month in which the page was last approved
  • APPROVALDAY - the day of the month in which the page was last approved
  • APPROVALTIMESTAMP - the full timestamp of the date/time in which the page was last approved
  • APPROVALUSER - the user who last approved the page.

All five can be simply called by themselves (which will return that information for the page on which the call is located), or called with a page name passed in (which will return that information for the specified page). So, for example, in the page "Main Page", the call {{APPROVALYEAR}} will display the year in which the page "Main Page" was last approved, while the call {{APPROVALYEAR:Employees list}} will display the year in which the page "Employees list" was last approved.

If any of these magic words are called for a page that has no approved revision, or for a page that does not exist, they will simply not display anything.

The first four of these magic words can also be called for files; the last one, APPROVALUSER, unfortunately will not work.

Note that, if you began using Approved Revs before version 1.4, the first four magic words, which all have to do with the time in which the revision was made, will most likely display a blank for any page whose revision was approved while Approved Revs was still on an older version.

واجهة برمجة التطبيقات

Approved Revs defines an API action, "approve", which lets you either approve or (if the extra parameter "unapprove" is added) unapprove any revision via the MediaWiki API. See here for an explanation of the syntax for this API.

وسم كافة الصفحات بوسم معتمدة

For pages that do not yet have an approved revision, you may want to automatically approve their latest revision, as a way to quickly initialize their content. For that, you can use the command line script 'ApprovedRevs/maintenance/approveAllPages.php'. This script approves the latest revision of all pages that can be approved but do not have an approved revision. (The script has various optional flags, including one that lets you also handle pages that already do have an approved revision.)

اعتماد الملفات

Selecting version of a file to be approved

You can also approve file revisions with Approved Revs. It should be noted that only revisions to the actual file are approvable; revisions to the wikitext of the file pages are not. As such, approval of files is not done by clicking the "view history" link in the top-right of the file's page. Instead, scroll to the "File history" section near the bottom of the file page, and click "approve" on the right of the file history table.

When a version of an image is approved, that version is displayed when the image is included on other pages. For non-image uploads (e.g. PDFs), any links directly to the file will go to the approved version, not the latest.

Just like the approveAllPages.php script, there is another script, approveAllFiles.php, that exists specifically for file approvals.

تاريخ النسخة

Approved Revs is currently at version 1.7.2. See the entire version history.

المشكلات المعروفة

  • Approved Revs does not seem to work with the AccessControl extension - approving a revision leads to a "Deny_action" error.

المساهمة في المشروع

الأعطال البرمجية وطلبات السمات

Send any bug reports and requests to Yaron Koren (yaron57@gmail.com).

المساهمة برقع برمجية في المشروع

If you found some bug and fixed it, or if you wrote code for a new feature, please either do a Git commit for it, or create a patch by going to the "ApprovedRevs" directory, and typing:

git diff > descriptivename.patch

If you create a patch, please send it, with a description, to Yaron Koren.

الترجمة

Translation of Approved Revs is done through translatewiki.net. The translation for this extension can be found here: https://translatewiki.net/w/?title=Special:Translate&group=ext-approvedrevs. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.

انظر أيضا