Skip to content

Commit

Permalink
Item13750: repackage using new data form
Browse files Browse the repository at this point in the history
- added unicode support
  • Loading branch information
MichaelDaum committed Sep 25, 2015
1 parent 8d70af1 commit 599733a
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 24 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
*.swp
*,v
CopyContrib.md5
CopyContrib.sha1
CopyContrib.tgz
CopyContrib.txt
CopyContrib.zip
CopyContrib_installer
CopyContrib_installer.pl
2 changes: 1 addition & 1 deletion bin/copy
@@ -1,7 +1,7 @@
#! /usr/bin/env perl
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2011-2013 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2011-2015 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
33 changes: 20 additions & 13 deletions data/System/CopyContrib.txt
Expand Up @@ -158,20 +158,27 @@ All parameters of the [[##Mode:_61topic_61][topic mode]] apply to each topic in
---++ Installation Instructions
%$INSTALL_INSTRUCTIONS%

---++ Info
<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->
---++ Dependencies
%$DEPENDENCIES%

| Author(s): | Michael Daum|
| Copyright: | &copy; 2013-2014, Michael Daum http://michaeldaumconsulting.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | &nbsp; |
---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 25 Sep 2015: | added support for unicode foswiki |
| 10 Jun 2014: | improved error handling; make messages translatable |
| 30 May 2014: | added forcenewrevision, minor and dontlog |
| 22 Oct 2013: | initial release |
| Dependencies: | %$DEPENDENCIES% |
| Contrib Home: | http://foswiki.org/Extensions/%TOPIC% |
| Feedback: | http://foswiki.org/Extensions/%TOPIC%Dev |

<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
%META:FIELD{name="Copyright" title="Copyright" value="&copy; 2013-2015, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/CopyContrib"}%
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/CopyContrib"}%
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/CopyContrib"}%
%META:FIELD{name="Version" title="Version" value="%$VERSION%"}%
8 changes: 5 additions & 3 deletions lib/Foswiki/Contrib/CopyContrib.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2015 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -18,10 +18,11 @@ use warnings;

use Foswiki::Func();
use Error qw( :try );
use Encode();
use Foswiki::OopsException ();

our $VERSION = '2.00';
our $RELEASE = '2.00';
our $VERSION = '2.01';
our $RELEASE = '25 Sep 2015';
our $SHORTDESCRIPTION = 'Copies webs, topics, attachments, or part of them';

our %agentImpls = (
Expand Down Expand Up @@ -147,6 +148,7 @@ sub renderTemplate {
sub urlEncode {
my $text = shift;

$text = Encode::encode_utf8($text) if $Foswiki::UNICODE;
$text =~ s/([^0-9a-zA-Z-_.:~!*'\/])/'%'.sprintf('%02x',ord($1))/ge;

return $text;
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/CopyContrib/CopyAgent.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2015 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/CopyContrib/TopicAgent.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2015 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/CopyContrib/TopicListAgent.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2015 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/CopyContrib/WebAgent.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2015 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion locale/CopyContrib/Foswiki.pot
@@ -1,6 +1,6 @@
# Copyright (C) 2014 Michael Daum http://michaeldaumconsulting.com
# This file is distributed under the same license as CopyContrib.
# Michael Daum <daum@michaeldaumconsulting.com>, 2014.
# Michael Daum <daum@michaeldaumconsulting.com>, 2015.
#
msgid ""
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion locale/CopyContrib/de.po
@@ -1,6 +1,6 @@
# Copyright (C) 2014 Michael Daum http://michaeldaumconsulting.com
# This file is distributed under the same license as CopyContrib.
# Michael Daum <daum@michaeldaumconsulting.com>, 2014.
# Michael Daum <daum@michaeldaumconsulting.com>, 2015.
#
msgid ""
msgstr ""
Expand Down
8 changes: 7 additions & 1 deletion templates/oopscopy.tmpl
Expand Up @@ -22,7 +22,13 @@

%TMPL:DEF{"topiclist_success"}%%MAKETEXT{"Successfully copied [_1] topic(s) to [[[_2]]]." args="%PARAM2%, %PARAM3%"}%%TMPL:END%

%TMPL:DEF{"topic_success"}%%MAKETEXT{"Successfully copied [[[_1]]] to [[[_2]]]." args="%PARAM2%, %PARAM3%"}%%TMPL:END%
%TMPL:DEF{"topic_success"}%%MAKETEXT{"Successfully copied [[[_1]]] to [[[_2]]]." args="%PARAM2%, %PARAM3%"}%
<literal>
<script>
window.location.href = '%SCRIPTURL{"view"}%/%PARAM3%';
</script>
</literal>
%TMPL:END%

%TMPL:DEF{"overwrite_error"}%%MAKETEXT{"Cannot overwrite existing destination topic [[[_1]]]." args="%PARAM2%"}% %TMPL:P{"goback" target="%BASEWEB%.%BASETOPIC%"}%%TMPL:END%

Expand Down

0 comments on commit 599733a

Please sign in to comment.