Skip to content

Commit e0ebfd4

Browse files
WillNorrisWillNorris
authored andcommitted
Item479: rebrand BarcodePlugin
git-svn-id: http://svn.foswiki.org/trunk/BarcodePlugin@1378 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
1 parent 6411813 commit e0ebfd4

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

data/Foswiki/BarcodePlugin.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
%META:TOPICINFO{author="StevenSprouse" date="1100553250" format="1.0" version="1.5"}%
23
%META:TOPICPARENT{name="SearchResult"}%
34
---+ <nop>%TOPIC%
@@ -59,34 +60,35 @@ headercolor="#FFFFCC" databg="#CCCCCC, #EFEFEF" headerrows="1" footerrows="1" }%
5960
</verbatim>
6061
---+++ Plugin Installation Instructions
6162

62-
__Note:__ You do not need to install anything on your browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
63+
__Note:__ You do not need to install anything on your browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where Foswiki is running.
6364

6465
* Make sure your Perl administrator has installed the Barcode::Code128 module. (perl -MCPAN -e "install Barcode::Code128")
6566
* Make sure you have GD 1.20 or later installed.
6667
* Download the ZIP file from the Plugin web (see below)
67-
* Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
68+
* Unzip ==%TOPIC%.zip== in your Foswiki installation directory. Content:
6869
| *File:* | *Description:* |
6970
| ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
7071
| ==data/System/%TOPIC%.txt== | Plugin topic |
7172
| ==data/System/%TOPIC%.txt,v== | Plugin topic repository |
72-
| ==pub/TWiki/BarcodePlugin/example_0.png== | Sample =barcode= image |
73-
| ==pub/TWiki/BarcodePlugin/example_1.png== | Sample =barcode= image|
74-
| ==pub/TWiki/BarcodePlugin/example_0.png,v== | Sample =barcode= repository |
75-
| ==pub/TWiki/BarcodePlugin/example_1.png,v== | Sample =barcode= repository |
76-
* (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
73+
| ==pub/Foswiki/BarcodePlugin/example_0.png== | Sample =barcode= image |
74+
| ==pub/Foswiki/BarcodePlugin/example_1.png== | Sample =barcode= image|
75+
| ==pub/Foswiki/BarcodePlugin/example_0.png,v== | Sample =barcode= repository |
76+
| ==pub/Foswiki/BarcodePlugin/example_1.png,v== | Sample =barcode= repository |
77+
* (Dakar) Visit =configure= in your Foswiki installation, and enable the plugin in the {Plugins} section.
7778
* Test if the plugin is correctly installed:
7879
* Check above examples if the "if installed" column shows images instead of variables.
7980

8081

8182
---+++ Plugin Info
8283

8384
| Plugin Author: | TWiki:Main/StevenSprouse |
84-
| Plugin Version: | 8 Sep 2004 |
85+
| Plugin Version: | 15 Dec 2008 |
8586
| Change History: | |
87+
| 15 Dec 2008| v1.003 - Rebranded to Foswiki |
8688
| 11 Nov 2004| v1.002 - Improved benchmarks by changing Perl module load timing. |
8789
| 5 Nov 2004| v1.001 - Added cue_cat flag |
8890
| 4 Nov 2004| v1.000 - Initial release |
89-
| TWiki Dependency: | $TWiki::Plugins::VERSION 1.024 |
91+
| Foswiki Dependency: | $Foswiki::Plugins::VERSION 1.024 |
9092
| CPAN Dependencies: | Barcode::Code128 |
9193
| | GD v1.20 or later |
9294
| Other Dependencies: | none |

lib/Foswiki/Plugins/BarcodePlugin.pm

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
# =========================
26-
package TWiki::Plugins::BarcodePlugin; # change the package name and $pluginName!!!
26+
package Foswiki::Plugins::BarcodePlugin; # change the package name and $pluginName!!!
2727
# =========================
2828

2929
use vars qw(
@@ -43,7 +43,7 @@ use vars qw(
4343
$pluginInitialized;
4444
);
4545

46-
# This should always be $Rev$ so that TWiki can determine the checked-in
46+
# This should always be $Rev$ so that Foswiki can determine the checked-in
4747
# status of the plugin. It is used by the build automation tools, so
4848
# you should leave it alone.
4949
$VERSION = '$Rev$';
@@ -61,21 +61,21 @@ sub initPlugin
6161
( $topic, $web, $user, $installWeb ) = @_;
6262

6363
# check for Plugins.pm versions
64-
if( $TWiki::Plugins::VERSION < 1 ) {
65-
TWiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" );
64+
if( $Foswiki::Plugins::VERSION < 1 ) {
65+
Foswiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" );
6666
return 0;
6767
}
6868

6969
# Get plugin debug flag
70-
$debug = TWiki::Func::getPreferencesFlag( "\U$pluginName\E_DEBUG" );
70+
$debug = Foswiki::Func::getPreferencesFlag( "\U$pluginName\E_DEBUG" );
7171

7272
# Get plugin preferences, the variable defined by: * Set EXAMPLE = ...
7373
# $barcodeCount is used to assign a unique filename to each barcode in a topic.
7474
$barcodeCount=0;
7575
$pluginInitialized = 0;
7676

7777
# Plugin correctly initialized
78-
TWiki::Func::writeDebug( "- TWiki::Plugins::${pluginName}::initPlugin( $web.$topic ) is OK" ) if $debug;
78+
Foswiki::Func::writeDebug( "- Foswiki::Plugins::${pluginName}::initPlugin( $web.$topic ) is OK" ) if $debug;
7979
return 1;
8080
}
8181

@@ -139,7 +139,7 @@ sub _parse_parameters
139139
return %args;
140140
}
141141

142-
# Return the value for the specified TWiki plugin parameter. If the
142+
# Return the value for the specified Foswiki plugin parameter. If the
143143
# parameter does not exist, then return the specified default value. The
144144
# parameter is deleted from the list of specified parameters allowing the
145145
# code to determine what parameters remain and were not requested.
@@ -172,7 +172,7 @@ sub _make_filename
172172

173173
# before save, create directories if they don't exist.
174174
# If the top level "pub/$web" directory doesn't exist, create it.
175-
my $dir = TWiki::Func::getPubDir() . "/$web";
175+
my $dir = Foswiki::Func::getPubDir() . "/$web";
176176
if( ! -e "$dir" ) {
177177
umask( 002 );
178178
mkdir( $dir, 0775 );
@@ -193,7 +193,7 @@ sub commonTagsHandler
193193
{
194194
### my ( $text, $topic, $web ) = @_; # do not uncomment, use $_[0], $_[1]... instead
195195

196-
TWiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug;
196+
Foswiki::Func::writeDebug( "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )" ) if $debug;
197197

198198
# This is the place to define customized tags and variables
199199
# Called by sub handleCommonTags, after %INCLUDE:"..."%
@@ -204,7 +204,7 @@ sub commonTagsHandler
204204

205205
# =========================
206206
sub _makeBarcode {
207-
TWiki::Func::writeDebug( "- ::makeBarcode " ) if $debug;
207+
Foswiki::Func::writeDebug( "- ::makeBarcode " ) if $debug;
208208
my ($args, $topic, $web) = @_;
209209
if (!$pluginInitialized) {
210210
$pluginInitialized = 1;
@@ -217,14 +217,14 @@ sub _makeBarcode {
217217
#Parse the args
218218
my %parameters = _parse_parameters($args);
219219

220-
TWiki::Func::writeDebug( "- ${pluginName}::handleBarcode( arg=$args )" ) if $debug;
220+
Foswiki::Func::writeDebug( "- ${pluginName}::handleBarcode( arg=$args )" ) if $debug;
221221

222222
#Create the PNG
223223
my $bc = new Barcode::Code128;
224224

225225
# Get text
226226
my ($text) = _get_parameter("text",$defaultText, \%parameters);
227-
TWiki::Func::writeDebug( "- ${pluginName}::handleBarcode text=$text" ) if $debug;
227+
Foswiki::Func::writeDebug( "- ${pluginName}::handleBarcode text=$text" ) if $debug;
228228
# Get Default Paramters
229229
my ($padding) = _get_parameter("padding",$defaultPadding, \%parameters);
230230
my ($height) = _get_parameter("height",$defaultHeight, \%parameters);
@@ -249,7 +249,7 @@ sub _makeBarcode {
249249
$text =~ tr|A-Za-z\-|a-zA-Z/|;
250250
}
251251
my ($dir, $filename) = _make_filename("barcode",$barcodeCount++, $topic, $web);
252-
TWiki::Func::writeDebug( "- ${pluginName}::handleBarcode file=$dir $filename" ) if $debug;
252+
Foswiki::Func::writeDebug( "- ${pluginName}::handleBarcode file=$dir $filename" ) if $debug;
253253

254254
my $bc_png;
255255
eval {$bc_png=$bc->png($text)} || return _make_error $@;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
data/TWiki/BarcodePlugin.txt NEW
2-
lib/TWiki/Plugins/BarcodePlugin.pm NEW
3-
pub/TWiki/BarcodePlugin/example_0.png NEW
4-
pub/TWiki/BarcodePlugin/example_1.png NEW
1+
data/Foswiki/BarcodePlugin.txt NEW
2+
lib/Foswiki/Plugins/BarcodePlugin.pm NEW
3+
pub/Foswiki/BarcodePlugin/example_0.png NEW
4+
pub/Foswiki/BarcodePlugin/example_1.png NEW

lib/Foswiki/Plugins/BarcodePlugin/build.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ BEGIN
88
}
99
}
1010

11-
use TWiki::Contrib::Build;
11+
use Foswiki::Contrib::Build;
1212

1313
# Create the build object
14-
$build = new TWiki::Contrib::Build( 'BarcodePlugin' );
14+
$build = new Foswiki::Contrib::Build( 'BarcodePlugin' );
1515

1616
# Build the target on the command line, or the default target
1717
$build->build($build->{target});

0 commit comments

Comments
 (0)