Changeset 3457
- Timestamp:
- 04/16/09 10:30:34 (3 years ago)
- Location:
- trunk/TablePlugin
- Files:
-
- 3 edited
-
data/System/TablePlugin.txt (modified) (3 diffs)
-
lib/Foswiki/Plugins/TablePlugin.pm (modified) (2 diffs)
-
lib/Foswiki/Plugins/TablePlugin/Core.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/TablePlugin/data/System/TablePlugin.txt
r3416 r3457 41 41 ---++ <nop>%TOPIC% Global Settings 42 42 43 Plugin settings are stored as [[%SYSTEMWEB%.PreferenceSettings][preference settings]]. To reference 44 a plugin setting write ==%<nop><plugin>_<setting>%==, for example, ==%<nop>INTERWIKIPLUGIN_SHORTDESCRIPTION%== 43 You can override the default settings for the plugin by defining the following [[%SYSTEMWEB%.PreferenceSettings][preferences]]. 45 44 46 * One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic: 45 <!-- 47 46 * 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" | 58 51 59 52 ---++ Table Attributes 60 53 61 Attributes are defined as a =TABLEATTRIBUTES= Plugin setting in this topic, a =TABLEATTRIBUTES= preferences setting, or online before the table using =%<nop>TABLE{...}%=:54 Attributes are defined as a =TABLEATTRIBUTES= [[%SYSTEMWEB%.PreferenceSettings][preference]], or on the line before the table using =%<nop>TABLE{...}%=: 62 55 %INCLUDE{"%SYSTEMWEB%.VarTABLE" section="table_attributes"}% 63 56 … … 112 105 113 106 ---++ 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% 123 108 * Test if the plugin is correctly installed: 124 109 * Check above example if the table renders as expected … … 168 153 | 16 Nov 2001 | PTh: Added table border, cell spacing, cell padding, gif files | 169 154 | 07 Oct 2001 | JT: Initial version | 170 | CPAN Dependencies: | none |171 | Other Dependencies: | none |172 | Perl Version: | 5.008 |173 155 | Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 174 156 | Support: | http://foswiki.org/Support/%TOPIC% | -
trunk/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm
r2910 r3457 27 27 package Foswiki::Plugins::TablePlugin; 28 28 29 require Foswiki::Func; # The plugins API30 require Foswiki::Plugins; # For the API version29 use Foswiki::Func (); # The plugins API 30 use Foswiki::Plugins (); # For the API version 31 31 32 use vars qw( $topic $installWeb $ VERSION $RELEASE $initialised );32 use vars qw( $topic $installWeb $initialised ); 33 33 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'; 34 our $VERSION = '$Rev$'; 35 our $RELEASE = '1.038'; 36 our $SHORTDESCRIPTION = 'Control attributes of tables and sorting of table columns'; 37 our $NO_PREFS_IN_TOPIC = 1; 43 38 44 39 sub initPlugin { … … 63 58 ### my ( $text, $removed ) = @_; 64 59 65 my $sort = Foswiki::Func::getPreferencesValue( 'TABLEPLUGIN_SORT' ); 60 my $sort = Foswiki::Func::getPreferencesValue( 'TABLEPLUGIN_SORT' ) 61 || 'all'; 66 62 return unless ($sort && $sort =~ /^(all|attachments)$/) || 67 63 $_[0] =~ /%TABLE{.*?}%/; -
trunk/TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm
r2910 r3457 1714 1714 $sortTablesInText = 0; 1715 1715 $sortAttachments = 0; 1716 my $tmp = Foswiki::Func::getPreferencesValue('TABLEPLUGIN_SORT'); 1716 my $tmp = Foswiki::Func::getPreferencesValue('TABLEPLUGIN_SORT') 1717 || 'all'; 1717 1718 if ( !$tmp || $tmp =~ /^all$/oi ) { 1718 1719 $sortTablesInText = 1; … … 1724 1725 1725 1726 $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"'; 1727 1729 $prefsAttrs = Foswiki::Func::getPreferencesValue('TABLEATTRIBUTES'); 1728 1730 _setDefaults();
Note: See TracChangeset
for help on using the changeset viewer.
