Skip to content

Commit

Permalink
Item12881: Add HISTORYPLUGIN_NREV to override revs
Browse files Browse the repository at this point in the history
If setting HISTORYPLUGIN_NREV is set, it overrides the default number of
revisions shown per page from the topic history link.
  • Loading branch information
gac410 committed Mar 15, 2015
1 parent 9cd6152 commit 9b9f021
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
17 changes: 14 additions & 3 deletions HistoryPlugin/data/System/HistoryPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1426280979" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1426445555" format="1.1" version="1"}%
%META:TOPICPARENT{name="Plugins"}%
---+ History Plugin

Expand All @@ -20,6 +20,16 @@ This plugins is designed to work together with !CompareRevisionsAddOn and !RevCo
Syntax: =%<nop>HISTORY{ _attributes_ }%=

%INCLUDE{"%SYSTEMWEB%.VarHISTORY" section="history_attributes"}%

---++ Custom settings:

If the preference variable =HISTORYPLUGIN_NREV= is set, it overrides the default number of revisions shown in history when the topic =History= link is
selected. For example, the following setting changes the revisions shown to 5. Copy this setting into a topic to enable it for a pariticular topic,
user, Web, or site wide. See [[%SYSTEMWEB%.PreferenceSettings]].

<verbatim>
* Set HISTORYPLUGIN_NREV = 5
</verbatim>

---++ Examples

Expand Down Expand Up @@ -57,6 +67,7 @@ __Note:__ You do not need to install anything on the browser to use this plugin.
-->

| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 15 Mar 2015: | 1.12 Version released with Foswiki 1.2.0. Foswikitask:Item12881: Add HISTORYPLUGIN_NREV setting. |
| 28 Nov 2012: | 1.11 Version released with Foswiki 1.1.6. Change to perl version strings |
| 11 Apr 2011: | 1.10 Version released with Foswiki 1.1.3. Only a minor change related to how the plugin is being upgraded |
| 13 Mar 2011: | 1.9 Arthur Clemens: added parameter =versions= as a more versatile alternative to =rev1=, =rev2=, =nrev= and =reverse=. |
Expand All @@ -81,9 +92,9 @@ __Note:__ You do not need to install anything on the browser to use this plugin.

__Related Topics:__ %SYSTEMWEB%.%WIKIPREFSTOPIC%, %LOCALSITEPREFS%, [[%SYSTEMWEB%.Plugins][Plugins]]

%META:FILEATTACHMENT{name="screenshot.png" attachment="screenshot.png" attr="" comment="" date="1426280456" path="screenshot.png" size="72043" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot.png" attachment="screenshot.png" attr="" comment="" date="1426445555" path="screenshot.png" size="72043" user="ProjectContributor" version="1"}%
%META:FORM{name="PackageForm"}%
%META:FIELD{name="Copyright" title="Copyright" value=" 2006, !JChristophFuchs; 2008-2012 Kenneth Lavrsen and Foswiki Contributors"}%
%META:FIELD{name="Copyright" title="Copyright" value=" 2006, !JChristophFuchs; 2008-2015 Kenneth Lavrsen and Foswiki Contributors"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/HistoryPlugin"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
Expand Down
6 changes: 3 additions & 3 deletions HistoryPlugin/lib/Foswiki/Plugins/HistoryPlugin.pm
Expand Up @@ -10,8 +10,8 @@ use Foswiki::AccessControlException ();

# =========================
# Simple decimal version, no leading "v"
our $VERSION = "1.11";
our $RELEASE = '1.11';
our $VERSION = "1.12";
our $RELEASE = '1.12';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Shows a complete history of a topic';

Expand Down Expand Up @@ -248,7 +248,7 @@ sub _handleHeadFoot {
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2008-2012 Foswiki Contributors. Foswiki Contributors
Copyright (C) 2008-2015 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
Expand Down
3 changes: 2 additions & 1 deletion core/templates/viewtopicactionbuttons.tmpl
Expand Up @@ -34,7 +34,8 @@

%TMPL:DEF{"history_rdiff_link"}%<a class='foswikiRequiresChangePermission' href='%SCRIPTURLPATH{"rdiff"}%/%BASEWEB%/%BASETOPIC%?type=history' rel='nofollow' %MAKETEXT{"title='View complete topic history' accesskey='h'>&History"}%</a>%TMPL:END%

%TMPL:DEF{"history_history_link"}%<a class='foswikiRequiresChangePermission' href='%SCRIPTURLPATH{"oops"}%/%BASEWEB%/%BASETOPIC%?template=oopshistory' rel='nofollow' %MAKETEXT{"title='View complete topic history' accesskey='h'>&History"}%</a>%TMPL:END%
%TMPL:DEF{"history_history_link"}%<a class='foswikiRequiresChangePermission' href='%SCRIPTURLPATH{"oops"}%/%BASEWEB%/%BASETOPIC%?template=oopshistory%IF{"defined HISTORYPLUGIN_NREV" then="&nrev=%HISTORYPLUGIN_NREV%" else=""}%' rel='nofollow' %MAKETEXT{"title='View complete topic history' accesskey='h'>&History"}%</a>%TMPL:END%



%TMPL:DEF{"raw_link"}%<span><a href='%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?raw=on%REVARG%' rel='nofollow' %MAKETEXT{"title='View without formatting' accesskey='v'>&View wiki text"}%</a></span>%TMPL:END%
Expand Down

0 comments on commit 9b9f021

Please sign in to comment.