Changeset 3457


Ignore:
Timestamp:
04/16/09 10:30:34 (3 years ago)
Author:
CrawfordCurrie
Message:

Item1383: removed support for settings in the plugin topic

Location:
trunk/TablePlugin
Files:
3 edited

Legend:

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

    r3416 r3457  
    4141---++ <nop>%TOPIC% Global Settings 
    4242 
    43 Plugin settings are stored as [[%SYSTEMWEB%.PreferenceSettings][preference settings]]. To reference 
    44 a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>INTERWIKIPLUGIN_SHORTDESCRIPTION%== 
     43You can override the default settings for the plugin by defining the following [[%SYSTEMWEB%.PreferenceSettings][preferences]]. 
    4544 
    46    * One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic: 
     45<!-- 
    4746      * Set SHORTDESCRIPTION = Control attributes of tables and sorting of table columns 
    48  
    49    * Set DEBUG to 1 to get debug messages in =data/debug.txt=.  Default: =0= 
    50       * Set DEBUG = 0 
    51  
    52    * Make all tables in a topic sortable. If this is set to =all=, all tables that have a header row (including those that do not have %TABLE before them) will be made sortable. If set to =none=, only tables with %TABLE will be sortable. Topic rendering is faster if this is set to =none=. 
    53       * #Set SORT = none 
    54       * Set SORT = all 
    55  
    56    * Default table attributes: 
    57       * Set TABLEATTRIBUTES = tableborder="1" cellpadding="0" cellspacing="0" valign="top" headercolor="#ffffff" headerbg="#687684" headerbgsorted="#334455" databg="#ffffff,#edf4f9" databgsorted="#f1f7fc,#ddebf6" tablerules="rows" 
     47--> 
     48| *Preference* | *Meaning* | *Default* | 
     49| TABLEPLUGIN_SORT | Make all tables in a topic sortable. If this is set to =all=, all tables that have a header row (including those that do not have %TABLE before them) will be made sortable. If set to =none=, only tables with %TABLE will be sortable. Topic rendering is faster if this is set to =none=. | all | 
     50| TABLEPLUGIN_TABLEATTRIBUTES | Default table attributes | tableborder="1" cellpadding="0" cellspacing="0" valign="top" headercolor="#ffffff" headerbg="#687684" headerbgsorted="#334455" databg="#ffffff,#edf4f9" databgsorted="#f1f7fc,#ddebf6" tablerules="rows" | 
    5851 
    5952---++ Table Attributes 
    6053 
    61 Attributes are defined as a =TABLEATTRIBUTES= Plugin setting in this topic, a =TABLEATTRIBUTES= preferences setting, or on line before the table using =%<nop>TABLE{...}%=: 
     54Attributes are defined as a =TABLEATTRIBUTES= [[%SYSTEMWEB%.PreferenceSettings][preference]], or on the line before the table using =%<nop>TABLE{...}%=: 
    6255%INCLUDE{"%SYSTEMWEB%.VarTABLE" section="table_attributes"}% 
    6356 
     
    112105 
    113106---++ Plugin Installation Instructions 
    114 This plugin is pre-installed with your Foswiki release. You should not have to install it other than to do an upgrade. 
    115  
    116    * Download the ZIP file from the Plugin web (see below) 
    117    * Unzip ==%TOPIC%.zip== in your Foswiki installation directory. Content: 
    118      | *File:* | *Description:* | 
    119      | ==data/System/%TOPIC%.txt== | Plugin topic | 
    120      | ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module | 
    121      | ==lib/Foswiki/Plugins/%TOPIC%/Core.pm== | Plugin Perl module | 
    122    * Visit =configure= in your Foswiki installation, and enable the plugin in the {Plugins} section. 
     107%$INSTALL_INSTRUCTIONS% 
    123108   * Test if the plugin is correctly installed: 
    124109      * Check above example if the table renders as expected 
     
    168153|  16 Nov 2001 | PTh: Added table border, cell spacing, cell padding, gif files | 
    169154|  07 Oct 2001 | JT: Initial version | 
    170 |  CPAN Dependencies: | none | 
    171 |  Other Dependencies: | none | 
    172 |  Perl Version: | 5.008 | 
    173155|  Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 
    174156|  Support: | http://foswiki.org/Support/%TOPIC% | 
  • trunk/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm

    r2910 r3457  
    2727package Foswiki::Plugins::TablePlugin; 
    2828 
    29 require Foswiki::Func;    # The plugins API 
    30 require Foswiki::Plugins; # For the API version 
     29use Foswiki::Func ();    # The plugins API 
     30use Foswiki::Plugins (); # For the API version 
    3131 
    32 use vars qw( $topic $installWeb $VERSION $RELEASE $initialised ); 
     32use vars qw( $topic $installWeb $initialised ); 
    3333 
    34 # This should always be $Rev$ so that Foswiki can determine the checked-in 
    35 # status of the plugin. It is used by the build automation tools, so 
    36 # you should leave it alone. 
    37 $VERSION = '$Rev$'; 
    38  
    39 # This is a free-form string you can use to "name" your own plugin version. 
    40 # It is *not* used by the build automation tools, but is reported as part 
    41 # of the version number in PLUGINDESCRIPTIONS. 
    42 $RELEASE = '1.038'; 
     34our $VERSION = '$Rev$'; 
     35our $RELEASE = '1.038'; 
     36our $SHORTDESCRIPTION = 'Control attributes of tables and sorting of table columns'; 
     37our $NO_PREFS_IN_TOPIC = 1; 
    4338 
    4439sub initPlugin { 
     
    6358    ### my ( $text, $removed ) = @_; 
    6459 
    65     my $sort = Foswiki::Func::getPreferencesValue( 'TABLEPLUGIN_SORT' ); 
     60    my $sort = Foswiki::Func::getPreferencesValue( 'TABLEPLUGIN_SORT' ) 
     61      || 'all'; 
    6662    return unless ($sort && $sort =~ /^(all|attachments)$/) || 
    6763      $_[0] =~ /%TABLE{.*?}%/; 
  • trunk/TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm

    r2910 r3457  
    17141714        $sortTablesInText = 0; 
    17151715        $sortAttachments  = 0; 
    1716         my $tmp = Foswiki::Func::getPreferencesValue('TABLEPLUGIN_SORT'); 
     1716        my $tmp = Foswiki::Func::getPreferencesValue('TABLEPLUGIN_SORT') 
     1717          || 'all'; 
    17171718        if ( !$tmp || $tmp =~ /^all$/oi ) { 
    17181719            $sortTablesInText = 1; 
     
    17241725 
    17251726        $pluginAttrs = 
    1726           Foswiki::Func::getPreferencesValue('TABLEPLUGIN_TABLEATTRIBUTES'); 
     1727          Foswiki::Func::getPreferencesValue('TABLEPLUGIN_TABLEATTRIBUTES') 
     1728              || 'tableborder="1" cellpadding="0" cellspacing="0" valign="top" headercolor="#ffffff" headerbg="#687684" headerbgsorted="#334455" databg="#ffffff,#edf4f9" databgsorted="#f1f7fc,#ddebf6" tablerules="rows"'; 
    17271729        $prefsAttrs = Foswiki::Func::getPreferencesValue('TABLEATTRIBUTES'); 
    17281730        _setDefaults(); 
Note: See TracChangeset for help on using the changeset viewer.