Changeset 3448


Ignore:
Timestamp:
04/15/09 16:48:29 (3 years ago)
Author:
CrawfordCurrie
Message:

Item1383: make plugin get its preferences from global preferences, instead of from the plugin topic

Location:
trunk/SpreadSheetPlugin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SpreadSheetPlugin/data/System/SpreadSheetPlugin.txt

    r3328 r3448  
    737737---++ Plugin Settings 
    738738 
    739 Plugin settings are stored as [[%SYSTEMWEB%.PreferenceSettings][preference settings]]. To reference 
    740 a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, i.e. ==%<nop>SPREADSHEETPLUGIN_SHORTDESCRIPTION%== 
    741  
    742    * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: 
    743       * Set SHORTDESCRIPTION = Add spreadsheet calculation like ="$SUM( $ABOVE() )"= to Foswiki tables and other topic text 
    744  
    745    * Debug plugin: (See output in =data/debug.txt=) 
    746       * Set DEBUG = 0 
    747  
    748    * Do not handle =%<nop>CALC{}%= variable in included topic while including topic: (default: 1) 
    749       * Set SKIPINCLUDE = 1 
    750  
    751 <noautolink> 
    752    * [[%SYSTEMWEB%.WikiWord][WikiWords]] to exclude from being spaced out by the ==$PROPERSPACE(text)== function. This comma delimited list can be overloaded by a DONTSPACE [[%SYSTEMWEB%.PreferenceSettings][preference setting]]: 
    753       * Set DONTSPACE = CodeWarrior, MacDonald, McIntosh, RedHat, SuSE 
    754 </noautolink> 
    755  
     739You can override some default settings in the plugin by setting the following [[%SYSTEMWEB%.PreferenceSettings][preferences]]. 
     740 
     741<!-- 
     742   * Set SHORTDESCRIPTION = Add spreadsheet calculation like ="$SUM( $ABOVE() )"= to Foswiki tables and other topic text 
     743--> 
     744| *Preference* | *Meaning* | *Default* | 
     745| =SPREADSHEETPLUGIN_DEBUG= | \ 
     746Debug plugin: (See output in =data/debug.txt=) | 0 | 
     747| =SPREADSHEETPLUGIN_SKIPINCLUDE= | \ 
     748Do not handle =%<nop>CALC{}%= variable in included \ 
     749topic while including topic | 1 | 
     750| =SPREADSHEETPLUGIN_DONTSPACE= | Comma-delimited list of \ 
     751[[%SYSTEMWEB%.WikiWord][WikiWords]] to exclude from being spaced out by \ 
     752the ==$PROPERSPACE(text)== function. | \ 
     753<noautolink>CodeWarrior, MacDonald, McIntosh, RedHat, SuSE</noautolink> | 
     754 
     755Note that the =DONTSPACE= global preference overrides the =SPREADSHEETPLUGIN_DONTSPACE= preference for historical reasons. 
    756756 
    757757---++ Plugin Installation Instructions 
    758  
    759 *Note:* You do not need to install anything on the browser to use this plugin. Below installation instructions are for the administrator who needs to install this plugin on the Foswiki server.  
    760  
    761    * Download the ZIP file from the <nop>%TOPIC% home 
    762    * Unzip ==SpreadSheetPlugin.zip== in your Foswiki installation directory. Content: 
    763      | *File:* | *Description:* | 
    764      | ==data/System/%TOPIC%.txt== | Plugin topic | 
    765      | ==data/System/%TOPIC%.txt,v== | Plugin topic repository | 
    766      | ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module | 
    767    * Visit =configure= in your Foswiki installation, and enable the Plugin in the {Plugins} section. 
     758%$INSTALL_INSTRUCTIONS% 
    768759   * Test if the "Total" in the first table in this topic is correct. 
    769760 
     
    817808|  16 Apr 2001: | Fixed div by 0 bug in $AVERAGE() | 
    818809|  17 Mar 2001: | Initial version with $ABOVE(), $AVERAGE(), $COLUMN(), $COUNTITEMS(), $EVAL(), $INT(), $LEFT(), $LOWER(), $MAX(), $MIN(), $ROW(), $SUM(), $T(), $UPPER() | 
    819 |  CPAN Dependencies: | none | 
    820 |  Other Dependencies: | none | 
    821 |  Perl Version: | 5.008 | 
    822810|  Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 
    823811|  Support: | http://foswiki.org/Support/%TOPIC% | 
  • trunk/SpreadSheetPlugin/lib/Foswiki/Plugins/SpreadSheetPlugin.pm

    r3328 r3448  
    2828# ========================= 
    2929use vars qw( 
    30         $web $topic $user $installWeb $VERSION $RELEASE $debug $skipInclude $doInit 
     30        $web $topic $user $installWeb $debug $skipInclude $doInit 
    3131    ); 
    3232 
    33 # This should always be $Rev: 13748 $ so that Foswiki can determine the checked-in 
    34 # status of the plugin. It is used by the build automation tools, so 
    35 # you should leave it alone. 
    36 $VERSION = '$Rev: 13748 $'; 
    37  
    38 # This is a free-form string you can use to "name" your own plugin version. 
    39 # It is *not* used by the build automation tools, but is reported as part 
    40 # of the version number in PLUGINDESCRIPTIONS. 
    41 $RELEASE = '29 Mar 2009'; 
     33our $VERSION = '$Rev: 13748 $'; 
     34our $RELEASE = '29 Mar 2009'; 
     35our $NO_PREFS_IN_TOPIC = 1; 
    4236 
    4337$doInit = 0; 
     
    5549 
    5650    # Get plugin debug flag 
    57     $debug = Foswiki::Func::getPreferencesFlag( "SPREADSHEETPLUGIN_DEBUG" ); 
     51    $debug = Foswiki::Func::getPreferencesFlag( "SPREADSHEETPLUGIN_DEBUG" ) || 0; 
    5852 
    5953    # Flag to skip calc if in include 
    60     $skipInclude = Foswiki::Func::getPreferencesFlag( "SPREADSHEETPLUGIN_SKIPINCLUDE" ); 
     54    $skipInclude = Foswiki::Func::getPreferencesFlag( "SPREADSHEETPLUGIN_SKIPINCLUDE" ) || 1; 
    6155 
    6256    # Plugin correctly initialized 
  • trunk/SpreadSheetPlugin/lib/Foswiki/Plugins/SpreadSheetPlugin/Calc.pm

    r3328 r3448  
    12931293    unless( $dontSpaceRE ) { 
    12941294        $dontSpaceRE = &Foswiki::Func::getPreferencesValue( "DONTSPACE" ) || 
    1295                        &Foswiki::Func::getPreferencesValue( "SPREADSHEETPLUGIN_DONTSPACE" ) || 
    1296                        "UnlikelyGibberishWikiWord"; 
     1295                       &Foswiki::Func::getPreferencesValue( "SPREADSHEETPLUGIN_DONTSPACE" ) || "CodeWarrior, MacDonald, McIntosh, RedHat, SuSE"; 
    12971296        $dontSpaceRE =~ s/[^a-zA-Z0-9\,\s]//go; 
    12981297        $dontSpaceRE = "(" . join( "|", split( /[\,\s]+/, $dontSpaceRE ) ) . ")"; 
Note: See TracChangeset for help on using the changeset viewer.