mirror of
https://github.com/silverstripe/silverstripe-versionfeed
synced 2024-10-22 11:05:31 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c0b557f282 | ||
|
d24f2fa031 | ||
|
dd625a8683 | ||
|
a51c30fb0f | ||
|
f00a204f6d | ||
|
eb3283662c | ||
|
002fbf766c | ||
|
a753712806 | ||
|
a1eac8de23 | ||
|
4e0d5ec409 | ||
|
9b92ba8d6c |
12
.upgrade.yml
12
.upgrade.yml
@ -1,12 +0,0 @@
|
||||
mappings:
|
||||
VersionFeed: SilverStripe\VersionFeed\VersionFeed
|
||||
VersionFeed_Controller: SilverStripe\VersionFeed\VersionFeedController
|
||||
VersionFeedSiteConfig: SilverStripe\VersionFeed\VersionFeedSiteConfig
|
||||
CachedContentFilter: SilverStripe\VersionFeed\Filters\CachedContentFilter
|
||||
ContentFilter: SilverStripe\VersionFeed\Filters\ContentFilter
|
||||
RateLimitFilter: SilverStripe\VersionFeed\Filters\RateLimitFilter
|
||||
\VersionFeed\Filters\CachedContentFilter: SilverStripe\VersionFeed\Filters\CachedContentFilter
|
||||
\VersionFeed\Filters\ContentFilter: SilverStripe\VersionFeed\Filters\ContentFilter
|
||||
\VersionFeed\Filters\RateLimitFilter: SilverStripe\VersionFeed\Filters\RateLimitFilter
|
||||
VersionFeedFunctionalTest: SilverStripe\VersionFeed\Tests\VersionFeedFunctionalTest
|
||||
VersionFeedTest: SilverStripe\VersionFeed\Tests\VersionFeedTest
|
10
README.md
10
README.md
@ -7,15 +7,11 @@
|
||||
|
||||
The module creates an RSS feed on each page with their change history, as well as one for the entire site.
|
||||
|
||||
## Requirements
|
||||
|
||||
* Silverstripe ^4
|
||||
|
||||
**Note:** For a Silverstripe 3.x compatible version, please use [the 1.x release line](https://github.com/silverstripe/silverstripe-versionfeed/tree/1.2).
|
||||
|
||||
## Installation
|
||||
|
||||
Install with composer by running `composer require silverstripe/versionfeed` in the root of your Silverstripe project.
|
||||
```sh
|
||||
composer require silverstripe/versionfeed
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -16,15 +16,14 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"silverstripe/cms": "^4",
|
||||
"silverstripe/versioned": "^1",
|
||||
"silverstripe/siteconfig": "^4"
|
||||
"php": "^8.1",
|
||||
"silverstripe/cms": "^5",
|
||||
"silverstripe/versioned": "^2",
|
||||
"silverstripe/siteconfig": "^5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"silverstripe/framework": "^4.10",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
"squizlabs/php_codesniffer": "^3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -6,8 +6,6 @@ eo:
|
||||
TITLECHANGED: 'Titolo estas ŝanĝita:'
|
||||
Warning: 'Publikigi la historion ankaŭ malkaŝos la ŝanĝojn ĝis tiam protektitajn kontraŭ publika vido.'
|
||||
Warning2: 'Ŝanĝi la alirajn agordojn tiel ke ĉi tiu paĝo, aŭ paĝoj sub ĝi, fariĝas publike alireblaj <br>eble rezultigos ke publikiĝos ĉiuj historiaj ŝanĝoj en tiuj paĝoj. Bonvole rekonsideru <br> la sekcion "Publika historio" de ĉi tiu sekcio, por certigi ke nur intencita informo publikiĝu.'
|
||||
db_PublicHistory: 'Publika historio'
|
||||
SilverStripe\VersionFeed\VersionFeedSiteConfig:
|
||||
ALLCHANGES: 'Ĉiuj paĝaj ŝanĝoj'
|
||||
ALLCHANGESLABEL: 'Ĉieaj ŝanĝoj fluu en publikan'
|
||||
db_AllChangesEnabled: 'Ĉiuj ŝanĝoj enŝaltitaj'
|
||||
|
13
lang/sk.yml
13
lang/sk.yml
@ -1,13 +0,0 @@
|
||||
sk:
|
||||
SilverStripe\VersionFeed\VersionFeed:
|
||||
LABEL: 'Zverejniť históriu'
|
||||
SINGLEPAGEFEEDTITLE: 'Aktualizácie stránky {title}'
|
||||
SITEFEEDTITLE: 'Aktualizácie {title}'
|
||||
TITLECHANGED: 'Názov sa zmenil:'
|
||||
Warning: 'Zverejnením histórie sa zverejnia aj zmeny, ktoré boli v tom čase chránené pred zrakom verejnosti.'
|
||||
Warning2: 'Zmena nastavení prístupu tak, aby sa táto stránka alebo stránky pod ňou stali verejne prístupné,<br>môže viesť k zverejneniu všetkých historických zmien aj na týchto stránkach.<br> Skontrolujte nastavenia v časti "Verejná história", aby ste sa uistili, že sú zverejnené iba zamýšľané informácie.'
|
||||
db_PublicHistory: 'Verejná história'
|
||||
SilverStripe\VersionFeed\VersionFeedSiteConfig:
|
||||
ALLCHANGES: 'Všetky zmeny stránky'
|
||||
ALLCHANGESLABEL: 'Zverejnite informačný kanál globálnych zmien'
|
||||
db_AllChangesEnabled: 'Všetky zmeny povolené'
|
@ -6,7 +6,6 @@ sl:
|
||||
TITLECHANGED: 'Spremenjen naslov:'
|
||||
Warning: 'Objava zgodovine bo razkrila tudi spremembe, ki do sedaj niso bile javno objavljene.'
|
||||
Warning2: 'Sprememba nastavitev dostopa tako, da so so ta stran ali njene podstrani dostopne javnosti, <br> lahko povzroči objavo tudi vseh sprememb na omenjenih straneh. Podrobno preverite <br> seznam sprememb in se prepričajte, da boste razkrili samo tiste informacije, ki jih želite.'
|
||||
db_PublicHistory: 'Javna zgodovina'
|
||||
SilverStripe\VersionFeed\VersionFeedSiteConfig:
|
||||
ALLCHANGES: 'Vse spremembe'
|
||||
ALLCHANGESLABEL: 'Javno objavi seznam s krovnimi spremembami'
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace SilverStripe\VersionFeed;
|
||||
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\CMS\Model\SiteTreeExtension;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Forms\CheckboxField;
|
||||
@ -12,7 +11,7 @@ use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\FieldType\DBField;
|
||||
use SilverStripe\SiteConfig\SiteConfig;
|
||||
use SilverStripe\View\Parsers\Diff;
|
||||
use SilverStripe\View\Parsers\HtmlDiff;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
|
||||
class VersionFeed extends SiteTreeExtension
|
||||
@ -80,7 +79,7 @@ class VersionFeed extends SiteTreeExtension
|
||||
$qLimit = (int)$limit + 1;
|
||||
$versions = $this->owner->Versions(
|
||||
"\"WasPublished\"='1' AND \"CanViewType\" IN ('Anyone', 'Inherit') $offset",
|
||||
"\"SiteTree\".\"LastEdited\" DESC, \"SiteTree\".\"ID\" DESC",
|
||||
"\"LastEdited\" DESC, \"ID\" DESC",
|
||||
$qLimit
|
||||
);
|
||||
|
||||
@ -95,7 +94,7 @@ class VersionFeed extends SiteTreeExtension
|
||||
if (isset($previous)) {
|
||||
// Produce the diff fields for use in the template.
|
||||
if ($version->Title != $previous->Title) {
|
||||
$diffTitle = Diff::compareHTML($version->Title, $previous->Title);
|
||||
$diffTitle = HtmlDiff::compareHTML($version->Title, $previous->Title);
|
||||
|
||||
$version->DiffTitle = DBField::create_field('HTMLText', null);
|
||||
$version->DiffTitle->setValue(
|
||||
@ -108,7 +107,7 @@ class VersionFeed extends SiteTreeExtension
|
||||
}
|
||||
|
||||
if ($version->Content != $previous->Content) {
|
||||
$diffContent = Diff::compareHTML($version->Content, $previous->Content);
|
||||
$diffContent = HtmlDiff::compareHTML($version->Content, $previous->Content);
|
||||
|
||||
$version->DiffContent = DBField::create_field('HTMLText', null);
|
||||
$version->DiffContent->setValue('<div>'.$diffContent.'</div>');
|
||||
@ -169,26 +168,6 @@ class VersionFeed extends SiteTreeExtension
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a list of changes to the current page, excluding non-published and explicitly secured versions.
|
||||
*
|
||||
* @deprecated 2.0.0 Use VersionFeed::getDiffList() instead
|
||||
*
|
||||
* @param int $highestVersion Top version number to consider.
|
||||
* @param boolean $fullHistory Set to true to get the full change history, set to false for a single diff.
|
||||
* @param int $limit Limit to the amount of items returned.
|
||||
*
|
||||
* @returns ArrayList List of cleaned records.
|
||||
*/
|
||||
public function getDiffedChanges($highestVersion = null, $fullHistory = true, $limit = 100)
|
||||
{
|
||||
Deprecation::notice('2.0.0', 'Use VersionFeed::getDiffList() instead');
|
||||
return $this->getDiffList(
|
||||
$highestVersion,
|
||||
$fullHistory ? $limit : 1
|
||||
);
|
||||
}
|
||||
|
||||
public function updateSettingsFields(FieldList $fields)
|
||||
{
|
||||
if (!$this->owner->config()->get('changes_enabled')) {
|
||||
|
@ -114,7 +114,6 @@ class VersionFeedController extends Extension
|
||||
AND ("PublicHistory" IS NULL OR "PublicHistory" = \'1\')
|
||||
ORDER BY "LastEdited" DESC LIMIT ' . $limit);
|
||||
$lastChange = $latestChanges->record();
|
||||
$latestChanges->rewind();
|
||||
|
||||
if ($lastChange) {
|
||||
// Cache the diffs to remove DOS possibility.
|
||||
@ -191,7 +190,6 @@ class VersionFeedController extends Extension
|
||||
{
|
||||
if (!Config::inst()->get(VersionFeed::class, 'allchanges_enabled')
|
||||
|| !SiteConfig::current_site_config()->AllChangesEnabled
|
||||
|| !method_exists($this->owner, 'getSiteRSSLink')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user